Pular para o conteúdo principal

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.

ParameterTypeDescription
registryprotocols.Registry
bezierAny
cp_indexint
sketchOptional[Any] = None
ReturnsNone

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.

ParameterTypeDescription
registryprotocols.Registry
sketchOptional[Any] = None
ReturnsNone

from_dict()​

from_dict(dict: dict) -> SketchPoint

Builds a point from the reference point dictionary shape.

ParameterTypeDescription
dictdict
ReturnsSketchPoint

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.

ParameterTypeDescription
registryprotocols.Registry
sketchOptional[Any] = None
Returnslist[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.

ParameterTypeDescription
registryprotocols.Registry
sketchOptional[Any] = None
Returnstuple[Any, Any]

is_in_rect()​

is_in_rect(rect: tuple[float, float, float, float]) -> bool

Whether the point lies inside the given rect.

ParameterTypeDescription
recttuple[float, float, float, float]
Returnsbool

is_sharp()​

is_sharp() -> bool

Whether the waypoint role is sharp.

ParameterTypeDescription
Returnsbool

is_smooth()​

is_smooth() -> bool

Whether the waypoint role is smooth.

ParameterTypeDescription
Returnsbool

is_symmetric()​

is_symmetric() -> bool

Whether the waypoint role is symmetric.

ParameterTypeDescription
Returnsbool

pos()​

pos() -> tuple[float, float]

The point position as a (x, y) tuple.

ParameterTypeDescription
Returnstuple[float, float]

to_dict()​

to_dict() -> dict

Serializes to the reference point dictionary shape.

ParameterTypeDescription
Returnsdict