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

Function get_faces

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

Get all the faces as a numpy array Faces are always triangulated. If the shape is a BRep and you want to get the original untriangulated output, refer to :func:`get_edges`. Results are a nested numpy array e.g. [[f1v1, f1v2, f1v3], [f2v1, f2v2, f2v3], ...] :param geometry: Geometr

(geometry: W.Triangulation)

Source from the content-addressed store, hash-verified

252
253
254def get_faces(geometry: W.Triangulation) -> npt.NDArray[np.int32]:
255 """Get all the faces as a numpy array
256
257 Faces are always triangulated. If the shape is a BRep and you want to get
258 the original untriangulated output, refer to :func:`get_edges`.
259
260 Results are a nested numpy array e.g. [[f1v1, f1v2, f1v3], [f2v1, f2v2, f2v3], ...]
261
262 :param geometry: Geometry output calculated by IfcOpenShell
263 :return: A numpy array listing all the faces.
264 Array shape: (n, 3), where n - number of faces.
265 """
266 return np.frombuffer(geometry.faces_buffer, dtype="i").reshape(-1, 3)
267
268
269def get_material_colors(geometry: W.Triangulation) -> npt.NDArray[np.float64]:

Callers 5

get_areaFunction · 0.85
get_side_areaFunction · 0.85
get_footprint_areaFunction · 0.85
get_outer_surface_areaFunction · 0.85
get_footprint_perimeterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected