मुख्य सामग्री पर जाएँ

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.

ParameterTypeDescription
registryregistry.EntityRegistry
Returnslist[float]

set_user_visible()​

set_user_visible(value: bool) -> None

Sets the reference user-visibility flag.

ParameterTypeDescription
valuebool
ReturnsNone

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

ParameterTypeDescription
p1int
p2int
entity_idOptional[int]
registryregistry.EntityRegistry
Returnsbool

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