raygeo.sketch.constraints.point_on_curve
PointOnCurveConstraint
Enforces a point lies on a cubic Bezier curve. The control points are stored as offsets from their
owning endpoints; curves without control points use the straight-segment residual (is_line).
cp1_offset
cp1_offset: tuple[float, float]
First control point as offset from the start point.
cp2_offset
cp2_offset: tuple[float, float]
Second control point as offset from the end point.
end
end: int
Curve end point.
is_line
is_line: bool
Whether the curve degenerates to a straight segment.
point
point: int
The constrained point.
start
start: int
Curve start point.
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 |