Facet#
- class planestress.pre.geometry.Facet(pt1: Point, pt2: Point)[source]#
Bases:
object
Class describing a facet of a 2D geometry, i.e. an edge.
- Parameters:
- Variables:
idx (int) – Facet index.
Methods
Converts the line to a
shapely
Line
object.Converts the facet to a tuple.
If the facet contains the point
old
, replace withnew
.Tests whether or not a facet is zero length.
Attributes
pt1
pt2
idx
- to_tuple() tuple[float, float] [source]#
Converts the facet to a tuple.
- Raises:
RuntimeError – If a point in the facet hasn’t been assigned an index.
- Returns:
Facet
in tuple format (pt1_idx
,pt2_idx
).- Return type:
- to_shapely_line() LineString [source]#
Converts the line to a
shapely
Line
object.- Returns:
Facet
as ashapely.LineString
.- Return type: