raygeo.sketch.entities.point
SketchPoint
A sketch point: coordinates and solver flags.
When obtained from a registry it is a live view: coordinate writes are written back to the registry.
It also behaves like an (x, y) pair for indexing and iteration.
constrained
constrained: bool
Whether the point is fully constrained, as computed by the solver.
fixed
fixed: bool
Whether the point is pinned and never moves.
id
id: types.EntityID
Unique point id, stable across solves.
waypoint_type
waypoint_type: str
Waypoint type string ("sharp"/"smooth"/"symmetric").
x
x: float
X coordinate.
y
y: float
Y coordinate.
apply_constraint()
apply_constraint(
registry: protocols.Registry,
bezier: Any,
cp_index: int,
sketch: Optional[Any] = None,
) -> None
Applies the bezier-waypoint constraint after a control point edit on one of the point's connected beziers.
| Parameter | Type | Description |
|---|---|---|
registry | protocols.Registry | |
bezier | Any | |
cp_index | int | |
sketch | Optional[Any] = None | |
| Returns | None |
enforce_constraint()
enforce_constraint(
registry: protocols.Registry,
sketch: Optional[Any] = None,
) -> None
Re-enforces the bezier-waypoint constraint across every connected bezier at this point.
| Parameter | Type | Description |
|---|---|---|
registry | protocols.Registry | |
sketch | Optional[Any] = None | |
| Returns | None |
from_dict()
from_dict(dict: dict) -> SketchPoint
Builds a point from the reference point dictionary shape.
| Parameter | Type | Description |
|---|---|---|
dict | dict | |
| Returns | SketchPoint |
get_connected_beziers()
get_connected_beziers(
registry: protocols.Registry,
sketch: Optional[Any] = None,
) -> list[Any]
The bezier entities connected to this point, as the registry's own Python objects.
| Parameter | Type | Description |
|---|---|---|
registry | protocols.Registry | |
sketch | Optional[Any] = None | |
| Returns | list[Any] |
get_paired_beziers()
get_paired_beziers(
registry: protocols.Registry,
sketch: Optional[Any] = None,
) -> tuple[Any, Any]
The two bezier entities joined at this point, if any.
| Parameter | Type | Description |
|---|---|---|
registry | protocols.Registry | |
sketch | Optional[Any] = None | |
| Returns | tuple[Any, Any] |
is_in_rect()
is_in_rect(rect: tuple[float, float, float, float]) -> bool
Whether the point lies inside the given rect.
| Parameter | Type | Description |
|---|---|---|
rect | tuple[float, float, float, float] | |
| Returns | bool |
is_sharp()
is_sharp() -> bool
Whether the waypoint role is sharp.
| Parameter | Type | Description |
|---|---|---|
| Returns | bool |
is_smooth()
is_smooth() -> bool
Whether the waypoint role is smooth.
| Parameter | Type | Description |
|---|---|---|
| Returns | bool |
is_symmetric()
is_symmetric() -> bool
Whether the waypoint role is symmetric.
| Parameter | Type | Description |
|---|---|---|
| Returns | bool |
pos()
pos() -> tuple[float, float]
The point position as a (x, y) tuple.
| Parameter | Type | Description |
|---|---|---|
| Returns | tuple[float, float] |
to_dict()
to_dict() -> dict
Serializes to the reference point dictionary shape.
| Parameter | Type | Description |
|---|---|---|
| Returns | dict |