mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
d79770003a
Three bugs fixed: 1. EditAssignedMaterial was sweeping all slabs that share a layer set when changing material properties, instead of updating only the selected element's assigned material. 2. slice_layerset_mesh (loader.py): layer bisect positions were scaled incorrectly due to a stale unit_scale and a reversed/missing DirectionSense guard. Now always recalculates unit_scale fresh and correctly applies sense_factor. 3. change_thickness (slab.py): extrusion depth was computed as `thickness / cos(obj.rotation_euler.x)`, which incorrectly scaled ObjectPlacement-rotated slabs (where the extrusion direction is local Z and no scaling is needed). The correct formula is `thickness / extrusion_vec.z`, which handles both ObjectPlacement rotation (extrusion_vec.z ≈ 1.0 → no scale) and ExtrudedDirection tilts (extrusion_vec.z < 1.0 → scale up) uniformly. The resulting slab was 1.414× too thick for 45°-rotated slabs, making both material layers appear fatter than specified. slice_layerset_mesh retains a depth_scale safety factor (extrusion_vec.z × ifc_depth / total_layer_thickness) as a robustness guard for IFC files from other authoring tools where extrusion depth may not match the sum of LayerThicknesses.