From 71c9066dc7c9ae33e23aa4ad45bfe3aec3e180ba Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 21 Apr 2024 11:27:22 +0200 Subject: [PATCH] Fallback to C++ impl of IfcAxis2PlacementLinear #4565 --- .../ifcopenshell/util/placement.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/placement.py b/src/ifcopenshell-python/ifcopenshell/util/placement.py index 1bf35ed07b..fc3f572f39 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/placement.py +++ b/src/ifcopenshell-python/ifcopenshell/util/placement.py @@ -69,12 +69,11 @@ def get_axis2placement(placement: ifcopenshell.entity_instance) -> MatrixType: if coordinates := getattr(location, "Coordinates", None): o = coordinates else: - ifc_class = location.is_a("IfcPointByDistanceExpression") - print( - f'WARNING. Placement location of type "{ifc_class}" ' - f'is not yet supported and placement {placement} may be placed incorrectly.' - ) - o = (0.0, 0.0, 0.0) + import ifcopenshell.geom + st = ifcopenshell.geom.settings() + st.set('convert-back-units', True) + shp = ifcopenshell.geom.create_shape(st, placement) + return np.array(shp.matrix).reshape((4,4)) elif ifc_class == "IfcAxis2Placement2D": z = np.array((0, 0, 1))