raygeo.sketch.constraints.point_on_line
PointOnLineConstraint
Enforces a point lies on a line or circle/arc circumference.
point
point: int
The constrained point.
target
target: PointOnTarget
Resolved target geometry.
constrains_radius()
constrains_radius(registry: registry.EntityRegistry, entity_id: int) -> bool
Whether this constraint determines the target's radius: true when the target is a circle/arc circumference and the constrained point is itself solver-constrained.
| Parameter | Type | Description |
|---|---|---|
registry | registry.EntityRegistry | |
entity_id | int | |
| Returns | bool |
error()
error(registry: registry.EntityRegistry) -> list[float]
Returns the constraint error at the registry's point positions.
| Parameter | Type | Description |
|---|---|---|
registry | registry.EntityRegistry | |
| Returns | list[float] |
is_hit()
is_hit(
mx: float,
my: float,
threshold: float,
registry: registry.EntityRegistry,
to_screen: Optional[Any] = None,
) -> bool
Whether the constraint's rendered symbol is hit at (mx, my).
| Parameter | Type | Description |
|---|---|---|
mx | float | |
my | float | |
threshold | float | |
registry | registry.EntityRegistry | |
to_screen | Optional[Any] = None | |
| Returns | bool |
set_user_visible()
set_user_visible(value: bool) -> None
Sets the reference user-visibility flag.
| Parameter | Type | Description |
|---|---|---|
value | bool | |
| Returns | None |
to_dict()
to_dict() -> dict
Serializes to the reference constraint dictionary shape.
| Parameter | Type | Description |
|---|---|---|
| Returns | dict |
user_visible()
user_visible() -> bool
Reference user-visibility flag.
| Parameter | Type | Description |
|---|---|---|
| Returns | bool |
PointOnTarget
The resolved target geometry: an infinite line, or a circle/arc circumference.
Line
The infinite line through two points.
RadiusCurve
The circle/arc through center and radius-bearing point.