upxo.geoEntities.ring2d module
2D ring (closed loop of edges) geometric entity for UPXO.
Usage
from upxo.geoEntities.ring2d import ring2d
Classes
ring2d : Closed 2D polygon represented as a multi-edge loop with a closing edge.
Notes
A ring2d is formed from an ordered, continuous, non-self-intersecting
muledge2d object by adding a closing edge between the last pntb and the
first pnta of the multi-edge chain.
- class upxo.geoEntities.ring2d.ring2d(me=None, dim=2, lean='ignore')[source]
Bases:
objectClosed 2D polygon represented as a multi-edge loop with a closing edge.
A
ring2dwraps a continuous, non-self-intersectingmuledge2dand adds a synthetic closing edge from the last endpoint back to the first.Entry points:
Bottom-up: from a
muledge2dobject.Top-down: from a Crystal or Poly-crystal object.
Cross-library: from a Shapely ring object.
Usage
from upxo.geoEntities.ring2d import ring2d
Notes
The source
muledge2dis expected to be ordered, continuous, and free from self-intersections before the closing edge is added.Unused elsewhere in UPXO – not currently imported by any other module. The actively-used ring implementation is
upxo.geoEntities.mulsline2d.ring2d(a same-named but unrelated class built onMSline2dsegments rather thanmuledge2d); mind the name collision when importing.- EPS = 1e-12
- me
- dim
- ce
- ce_pindices
- property centroid
Centroid of the ring.
- Returns:
Centroid point delegated to the underlying
muledge2dobject.- Return type:
- property centroids
Centroids of all ring edges.
- Returns:
Edge centroids from the source multi-edge with the closing-edge centroid appended.
- Return type:
- property lengths
Lengths of all ring edges.
- property slopes
Slopes of all ring edges.
- property length
Total perimeter length of the ring.
- Returns:
Sum of all source-edge lengths and the closing-edge length.
- Return type:
- property length_mean
Mean edge length of the ring.
- Returns:
Arithmetic mean of all ring-edge lengths.
- Return type:
- property slope_mean
Mean slope, ignoring NaN and infinite values.
- Returns:
Mean of masked-valid edge slopes.
- Return type:
- property slope_max_hiv
Maximum slope with vertical-edge handling.
- Returns:
infif any edge has infinite slope; otherwise the maximum slope value.- Return type:
- property slope_max_hi
Masked finite slope statistic.
- Returns:
Mean of slope values after masking invalid values.
- Return type:
- property slope_max_i
Mean of valid slopes.
- Returns:
Mean of slope values after masking invalid values.
- Return type:
- property roughness
Roughness measure delegated to the underlying multi-edge.
- Returns:
Roughness value returned by
self.me.roughness.- Return type:
- property angles
Orientation angles of all edges in the ring, including the closing edge.
- lean