mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
use column-major reshape for matrices #4565
This commit is contained in:
@@ -693,7 +693,7 @@ class IfcImporter:
|
|||||||
shape = self.create_generic_shape(element)
|
shape = self.create_generic_shape(element)
|
||||||
if not shape:
|
if not shape:
|
||||||
continue
|
continue
|
||||||
mat = np.array(shape.transformation.matrix).reshape((4,4))
|
mat = np.array(shape.transformation.matrix).reshape((4, 4), order="F")
|
||||||
point = np.array(
|
point = np.array(
|
||||||
(
|
(
|
||||||
shape.geometry.verts[0] / self.unit_scale,
|
shape.geometry.verts[0] / self.unit_scale,
|
||||||
@@ -1150,7 +1150,8 @@ class IfcImporter:
|
|||||||
self.link_element(element, obj)
|
self.link_element(element, obj)
|
||||||
|
|
||||||
if shape:
|
if shape:
|
||||||
mat = np.array(shape.transformation.matrix).reshape((4,4))
|
# We use numpy here because Blender mathutils.Matrix is not accurate enough
|
||||||
|
mat = np.array(shape.transformation.matrix).reshape((4, 4), order="F")
|
||||||
self.set_matrix_world(obj, self.apply_blender_offset_to_matrix_world(obj, mat))
|
self.set_matrix_world(obj, self.apply_blender_offset_to_matrix_world(obj, mat))
|
||||||
self.material_creator.create(element, obj, mesh)
|
self.material_creator.create(element, obj, mesh)
|
||||||
elif mesh:
|
elif mesh:
|
||||||
@@ -1886,7 +1887,7 @@ class IfcImporter:
|
|||||||
and geometry.verts
|
and geometry.verts
|
||||||
and self.is_point_far_away((geometry.verts[0], geometry.verts[1], geometry.verts[2]))
|
and self.is_point_far_away((geometry.verts[0], geometry.verts[1], geometry.verts[2]))
|
||||||
):
|
):
|
||||||
mat = np.array(shape.transformation.matrix).reshape((4,4))
|
mat = np.array(shape.transformation.matrix).reshape((4, 4), order="F")
|
||||||
offset_point = np.linalg.inv(mat) @ np.array(
|
offset_point = np.linalg.inv(mat) @ np.array(
|
||||||
(
|
(
|
||||||
float(props.blender_eastings),
|
float(props.blender_eastings),
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ def get_axis2placement(placement: ifcopenshell.entity_instance) -> MatrixType:
|
|||||||
st = ifcopenshell.geom.settings()
|
st = ifcopenshell.geom.settings()
|
||||||
st.set('convert-back-units', True)
|
st.set('convert-back-units', True)
|
||||||
shp = ifcopenshell.geom.create_shape(st, placement)
|
shp = ifcopenshell.geom.create_shape(st, placement)
|
||||||
return np.array(shp.matrix).reshape((4,4))
|
return np.array(shp.matrix).reshape((4, 4), order="F")
|
||||||
|
|
||||||
elif ifc_class == "IfcAxis2Placement2D":
|
elif ifc_class == "IfcAxis2Placement2D":
|
||||||
z = np.array((0, 0, 1))
|
z = np.array((0, 0, 1))
|
||||||
|
|||||||
Reference in New Issue
Block a user