Aller au contenu principal

raygeo.sketch.constraints.angle

AngleConstraint​

Enforces a clockwise angle in degrees between two lines. The angle is measured at the lines' intersection between the rays selected by e1_far/e2_far (endpoint ids; None picks the endpoint farther from the intersection).

e1_far​

e1_far: Optional[int]

Far point of the anchor line.

e2_far​

e2_far: Optional[int]

Far point of the other line.

p1​

p1: int

First point of the anchor line.

p2​

p2: int

Second point of the anchor line.

p3​

p3: int

First point of the other line.

p4​

p4: int

Second point of the other line.

value_deg​

value_deg: float

Resolved angle value in degrees.

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]

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).

ParameterTypeDescription
mxfloat
myfloat
thresholdfloat
registryregistry.EntityRegistry
to_screenOptional[Any] = None
Returnsbool

is_mirror_compatible()​

is_mirror_compatible() -> bool

Whether the constraint survives mirroring of all referenced geometry. An expression-based angle encodes user intent that does not auto-flip under reflection.

ParameterTypeDescription
Returnsbool

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