mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 22:12:32 +00:00
apply matrix to object in BlenderClasher
Since scale is not supported in fcl upstream as found in https://github.com/IfcOpenShell/IfcOpenShell/issues/1129
This commit is contained in:
@@ -4778,11 +4778,10 @@ class BlenderClasher:
|
|||||||
name = object_name.name
|
name = object_name.name
|
||||||
obj = bpy.data.objects[name]
|
obj = bpy.data.objects[name]
|
||||||
triangulated_mesh = self.triangulate_mesh(obj)
|
triangulated_mesh = self.triangulate_mesh(obj)
|
||||||
mat = np.array(obj.matrix_world)
|
|
||||||
mesh = ifcclash.Mesh()
|
mesh = ifcclash.Mesh()
|
||||||
mesh.vertices = np.array([tuple(v.co) for v in triangulated_mesh.vertices])
|
mesh.vertices = np.array([tuple(obj.matrix_world @ v.co) for v in triangulated_mesh.vertices])
|
||||||
mesh.faces = np.array([tuple(p.vertices) for p in triangulated_mesh.polygons])
|
mesh.faces = np.array([tuple(p.vertices) for p in triangulated_mesh.polygons])
|
||||||
cm.add_object(name, mesh, mat)
|
cm.add_object(name, mesh)
|
||||||
|
|
||||||
def triangulate_mesh(self, obj):
|
def triangulate_mesh(self, obj):
|
||||||
import bmesh
|
import bmesh
|
||||||
|
|||||||
Reference in New Issue
Block a user