mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 18:21:59 +00:00
Shape builder can now created triangulated face sets
This commit is contained in:
@@ -1305,6 +1305,22 @@ class ShapeBuilder:
|
|||||||
]
|
]
|
||||||
return self.file.createIfcFacetedBrep(self.file.createIfcClosedShell(faces))
|
return self.file.createIfcFacetedBrep(self.file.createIfcClosedShell(faces))
|
||||||
|
|
||||||
|
def triangulated_face_set(
|
||||||
|
self, points: SequenceOfVectors, faces: Sequence[Sequence[int]]
|
||||||
|
) -> ifcopenshell.entity_instance:
|
||||||
|
"""
|
||||||
|
Generate an IfcTriangulatedFaceSet
|
||||||
|
|
||||||
|
Note that this is not available in IFC2X3.
|
||||||
|
|
||||||
|
:param points: list of 3d coordinates
|
||||||
|
:param faces: list of triangles consisted of point indices (points indices starting from 0)
|
||||||
|
:return: IfcTriangulatedFaceSet
|
||||||
|
"""
|
||||||
|
ifc_points = self.file.createIfcCartesianPointList3D(ifc_safe_vector_type(points))
|
||||||
|
ifc_faces = [[i + 1 for i in face][:3] for face in faces]
|
||||||
|
return self.file.createIfcTriangulatedFaceSet(Coordinates=ifc_points, CoordIndex=ifc_faces)
|
||||||
|
|
||||||
def polygonal_face_set(
|
def polygonal_face_set(
|
||||||
self, points: SequenceOfVectors, faces: Sequence[Sequence[int]]
|
self, points: SequenceOfVectors, faces: Sequence[Sequence[int]]
|
||||||
) -> ifcopenshell.entity_instance:
|
) -> ifcopenshell.entity_instance:
|
||||||
|
|||||||
Reference in New Issue
Block a user