mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +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
|
||||
obj = bpy.data.objects[name]
|
||||
triangulated_mesh = self.triangulate_mesh(obj)
|
||||
mat = np.array(obj.matrix_world)
|
||||
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])
|
||||
cm.add_object(name, mesh, mat)
|
||||
cm.add_object(name, mesh)
|
||||
|
||||
def triangulate_mesh(self, obj):
|
||||
import bmesh
|
||||
|
||||
Reference in New Issue
Block a user