Rewrite coordinate offset to use np.array not Vector() for precision

This commit is contained in:
Dion Moult
2024-09-27 23:08:54 +10:00
parent 9f02737a2e
commit 4261fdbed6
5 changed files with 41 additions and 32 deletions
@@ -83,7 +83,7 @@ def add_representation(
"context": context,
"blender_object": blender_object,
"geometry": geometry,
"coordinate_offset": coordinate_offset,
"coordinate_offset": Vector(coordinate_offset) if coordinate_offset is not None else None,
"total_items": total_items,
"unit_scale": unit_scale,
"should_force_faceted_brep": should_force_faceted_brep,
@@ -1086,12 +1086,12 @@ class ShapeBuilder:
)
return points, segments, transition_arc
def mesh(self, points: list[Vector], faces: list[list[int]]) -> ifcopenshell.entity_instance:
def mesh(self, points: list[list[float]], faces: list[list[int]]) -> ifcopenshell.entity_instance:
if self.file.schema == "IFC2X3":
return self.faceted_brep(points, faces)
return self.polygonal_face_set(points, faces)
def faceted_brep(self, points: list[Vector], faces: list[list[int]]) -> ifcopenshell.entity_instance:
def faceted_brep(self, points: list[list[float]], faces: list[list[int]]) -> ifcopenshell.entity_instance:
"""Generate an IfcFacetedBrep with a closed shell
Note that :func:`polygonal_face_set` is recommended in IFC4.
@@ -1109,7 +1109,7 @@ class ShapeBuilder:
]
return self.file.createIfcFacetedBrep(self.file.createIfcClosedShell(faces))
def polygonal_face_set(self, points: list[Vector], faces: list[list[int]]) -> ifcopenshell.entity_instance:
def polygonal_face_set(self, points: list[list[float]], faces: list[list[int]]) -> ifcopenshell.entity_instance:
"""
Generate an IfcPolygonalFaceSet