raygeo.sketch.constraints.equal_distance
EqualDistanceConstraint
Enforces dist(p1, p2) == dist(p3, p4).
p1
p1: int
First point of the first pair.
p2
p2: int
Second point of the first pair.
p3
p3: int
First point of the second pair.
p4
p4: int
Second point of the second pair.
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 |
targets_segment()
targets_segment(
p1: int,
p2: int,
entity_id: Optional[int],
registry: registry.EntityRegistry,
) -> bool
Whether this constraint defines the length/distance of the segment (p1, p2), for either pair (order independent).
| Parameter | Type | Description |
|---|---|---|
p1 | int | |
p2 | int | |
entity_id | Optional[int] | |
registry | registry.EntityRegistry | |
| Returns | bool |
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 |