Skip to content

Commit

Permalink
See #4652. Fix bug where using create_mesh won't work if you pass it …
Browse files Browse the repository at this point in the history
…a triangulation.
  • Loading branch information
Moult committed May 10, 2024
1 parent 69e21da commit cd6eac3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/blenderbim/blenderbim/bim/import_ifc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1912,18 +1912,20 @@ def create_mesh(self, element: ifcopenshell.entity_instance, shape) -> bpy.types
and geometry.verts
and self.is_point_far_away((geometry.verts[0], geometry.verts[1], geometry.verts[2]))
):
m = shape.transformation.matrix.data
mat = np.array(
([m[0], m[3], m[6], m[9]], [m[1], m[4], m[7], m[10]], [m[2], m[5], m[8], m[11]], [0, 0, 0, 1])
)
offset_point = np.linalg.inv(mat) @ np.array(
offset_point = np.array(
(
float(props.blender_eastings),
float(props.blender_northings),
float(props.blender_orthogonal_height),
0.0,
)
)
if geometry != shape:
m = shape.transformation.matrix.data
mat = np.array(
([m[0], m[3], m[6], m[9]], [m[1], m[4], m[7], m[10]], [m[2], m[5], m[8], m[11]], [0, 0, 0, 1])
)
offset_point = np.linalg.inv(mat) @ offset_point
verts = [None] * len(geometry.verts)
for i in range(0, len(geometry.verts), 3):
verts[i], verts[i + 1], verts[i + 2] = ifcopenshell.util.geolocation.enh2xyz(
Expand Down

0 comments on commit cd6eac3

Please sign in to comment.