raygeo.sketch.constraints.aspect_ratio
AspectRatioConstraint
Enforces dist(p1, p2) == ratio * dist(p3, p4).
p1
p1: int
First point of the reference segment.
p2
p2: int
Second point of the reference segment.
p3
p3: int
First point of the scaled segment.
p4
p4: int
Second point of the scaled segment.
ratio
ratio: float
Resolved ratio value.
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] |
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 |