MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get_x

Function get_x

src/ifcopenshell-python/ifcopenshell/util/shape.py:101–108  ·  view source on GitHub ↗

Calculates the X length of the geometry :param geometry: Geometry output calculated by IfcOpenShell :return: The X dimension

(geometry: W.Triangulation)

Source from the content-addressed store, hash-verified

99
100
101def get_x(geometry: W.Triangulation) -> float:
102 """Calculates the X length of the geometry
103
104 :param geometry: Geometry output calculated by IfcOpenShell
105 :return: The X dimension
106 """
107 verts_flat = get_vertices(geometry).ravel()
108 return (np.max(verts_flat[0::3]) - np.min(verts_flat[0::3])).item()
109
110
111def get_y(geometry: W.Triangulation) -> float:

Callers 3

get_max_xyFunction · 0.70
get_max_xyzFunction · 0.70
get_min_xyzFunction · 0.70

Calls 2

get_verticesFunction · 0.85
itemMethod · 0.80

Tested by

no test coverage detected