Fixes computation of fallback position for linear placement. PlacementRelTo was improperly ignored

This commit is contained in:
Richard Brice
2026-07-07 11:59:47 -07:00
parent 7322263a5e
commit 61642d2ba3
@@ -16,8 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import numpy as np
import ifcopenshell
import ifcopenshell.util.placement
from ifcopenshell import entity_instance
@@ -36,7 +34,7 @@ def update_fallback_position(file: ifcopenshell.file, lp: entity_instance):
if not lp.CartesianPosition:
lp.CartesianPosition = file.createIfcAxis2Placement3D(Location=file.createIfcCartesianPoint((0.0, 0.0, 0.0)))
p = np.array(ifcopenshell.util.placement.get_axis2placement(lp.RelativePlacement))
p = ifcopenshell.util.placement.get_local_placement(lp)
x = float(p[0, 3])
y = float(p[1, 3])