mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
385d4aa409
In slice_layerset_mesh (loader.py), detect when an AXIS3 slab's stored extrusion.Depth is inconsistent with the sum of its LayerThicknesses (i.e. depth_scale != 1.0). This was caused by old Bonsai code in change_thickness that incorrectly scaled extrusion.Depth by 1/cos(obj.rotation_euler.x) for ObjectPlacement-rotated slabs, making the mesh 1.414× too tall for 45°-rotated slabs. Two-part fix applied on first import of affected files: 1. Scale mesh vertices in Z (from the mesh bottom) by 1/depth_scale so the local Z span equals total_perp_thickness × unit_scale, giving the correct physical slab geometry immediately. 2. Write the corrected extrusion.Depth = total_perp_thickness / extrusion_vec.z back to the IFC data so future imports load the correct geometry without requiring this correction. Files saved after this fix will open correctly with depth_scale = 1.0 and no vertex adjustment needed.