PointCarrier
- class PointCarrier(location: ndarray[3], attributes_set: Set[ElementAttributes] | None = None)
A
PointCarrieris functionally the same as aPointand is purely to separate the concept ofShapeElementandCarrierfor points.- Parameters:
location – Where the point is located.
attributes_set – The set of
ElementAttributespresent in elements on this carrier.
Attributes
Where the point is located.
Methods
Return
Trueifpointis coincident to this carrier.Return
Trueif this carrier is equivalent to another.Find all intersection points between this carrier and another.
Group elements by
ElementAttributes.Group elements by coequality.
Maximize a group of elements.
- contains_point(point: ndarray[3]) bool
Return
Trueifpointis coincident to this carrier. Fuzzy with tolerance.
- equivalent_to(other: PointCarrier) bool
Return
Trueif this carrier is equivalent to another. Fuzzy with tolerance.
- find_intersections(other: Carrier) ndarray
Find all intersection points between this carrier and another. The output should be a numpy array of shape
(n, 3)where each row is an intersection point. If there are no intersections, returnnp.zeros((0, 3)).
- classmethod group_elements_by_attribute(elements: Iterable[E_co]) Dict[ElementAttributes, List[E_co]]
Group elements by
ElementAttributes.- Parameters:
elements – Elements to group.
- Returns:
A mapping of
ElementAttributesto lists ofShapeElementinstances that have the attributes used as the key in the map.
- classmethod group_elements_by_coequality(elements: Iterable[E_co]) List[List[E_co]]
Group elements by coequality. Two
ShapeElementinstances are considered coequal if they have spatially equivalent carriers ( checked withequivalent_to()withmatch_attributes=False).- Parameters:
elements – Elements to group.
- Returns:
A list of elements grouped by coequality. Each entry in this list is a list of coequal elements.
- classmethod maximize(elements: Sequence[Point]) List[Point]
Maximize a group of elements. Elements are considered maximal if there are no two elements such that
coincident_with()returnsTrue.Specifically, if two elements visually appear to be one, replace the two with the one element they appear to be.
Maximization also performs calibration, which involves finding the “average” carrier of each set of coequal elements and projecting the resulting maximal elements onto this average carrier. This helps account for floating point error in the long run.
- location
Where the point is located.