Aller au contenu principal

raygeo.sketch.constraints.rotational

RotationalConstraint​

Enforces p2 is p1 rotated by angle_rad about center.

angle_rad​

angle_rad: float

Resolved rotation angle in radians.

center​

center: int

Rotation center.

p1​

p1: int

Source point.

p2​

p2: int

Rotated point.

error()​

error(registry: registry.EntityRegistry) -> list[float]

Returns the constraint error at the registry's point positions.

ParameterTypeDescription
registryregistry.EntityRegistry
Returnslist[float]

expression()​

expression() -> Optional[str]

The stored expression string, if any (evaluated caller-side).

ParameterTypeDescription
ReturnsOptional[str]

set_expression()​

set_expression(expression: Optional[str]) -> None

Sets the expression string (evaluated caller-side).

ParameterTypeDescription
expressionOptional[str]
ReturnsNone

set_user_visible()​

set_user_visible(value: bool) -> None

Sets the reference user-visibility flag.

ParameterTypeDescription
valuebool
ReturnsNone

to_dict()​

to_dict() -> dict

Serializes to the reference constraint dictionary shape.

ParameterTypeDescription
Returnsdict

user_visible()​

user_visible() -> bool

Reference user-visibility flag.

ParameterTypeDescription
Returnsbool