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

raygeo.sketch.entity_group

EntityGroup​

An ephemeral view over (registry, entity_ids): the surviving entities plus their unique defining points, manipulable as one piece of geometry.

entity_ids​

entity_ids: list[types.EntityID]

The group's entity ids, in group order.

apply_placement()​

apply_placement(placement: Any) -> None

Rigidly moves the group's defining points and internal offsets by the placement transform.

ParameterTypeDescription
placementAny
ReturnsNone

apply_rigid_motion()​

apply_rigid_motion(motion: Any) -> None

Applies a shape-preserving placement transform.

ParameterTypeDescription
motionAny
ReturnsNone

center()​

center() -> tuple[float, float]

Returns the logical center of the group's entities.

ParameterTypeDescription
Returnstuple[float, float]

entities()​

entities() -> list

Returns the group's surviving entities, in group order.

ParameterTypeDescription
Returnslist

helper_ids()​

helper_ids() -> list[types.EntityID]

Returns helper geometry belonging to the group's entities.

ParameterTypeDescription
Returnslist[types.EntityID]

point_ids()​

point_ids() -> list[types.EntityID]

Returns the group's unique point ids in stable order.

ParameterTypeDescription
Returnslist[types.EntityID]

points()​

points() -> list

Returns the group's unique defining points.

ParameterTypeDescription
Returnslist

polylines()​

polylines() -> list[list[tuple[float, float]]]

Samples every entity of the group into polylines.

ParameterTypeDescription
Returnslist[list[tuple[float, float]]]

radial_project()​

radial_project(
center: tuple[float, float],
radius: float,
pin: Optional[tuple[float, float]] = None,
) -> None

Translates the group radially so its center sits on a circle.

ParameterTypeDescription
centertuple[float, float]
radiusfloat
pinOptional[tuple[float, float]] = None
ReturnsNone

remap_point_refs()​

remap_point_refs(pid_map: Mapping[int, int]) -> None

Rewrites the group's entities' point ID references.

ParameterTypeDescription
pid_mapMapping[int, int]
ReturnsNone

restore_positions()​

restore_positions(snapshot: Any) -> None

Restores point positions captured by snapshot_positions.

ParameterTypeDescription
snapshotAny
ReturnsNone

rewrite_copy_from()​

rewrite_copy_from(
copy: EntityGroup,
placement: Any,
extra_point_pairs: Optional[Sequence[tuple[types.EntityID, types.EntityID]]] = None,
) -> list

Rewrites an existing copy group from this template group.

ParameterTypeDescription
copyEntityGroup
placementAny
extra_point_pairsOptional[Sequence[tuple[types.EntityID, types.EntityID]]] = None
Returnslist

snapshot_positions()​

snapshot_positions() -> list

Captures the current position of every point of the group.

ParameterTypeDescription
Returnslist

translate()​

translate(dx: float, dy: float) -> None

Moves every point of the group by the given delta.

ParameterTypeDescription
dxfloat
dyfloat
ReturnsNone

with_helpers()​

with_helpers() -> EntityGroup

Returns a view extended with this group's helper entities.

ParameterTypeDescription
ReturnsEntityGroup

Functions​

points_bbox_center()​

points_bbox_center(points: Any) -> tuple[float, float]

Returns the bbox center of a list of points.

ParameterTypeDescription
pointsAny
Returnstuple[float, float]

remap_point_refs()​

remap_point_refs(obj: Any, pid_map: Mapping[int, int]) -> None

Rewrites point ID references on an entity or constraint.

ParameterTypeDescription
objAny
pid_mapMapping[int, int]
ReturnsNone