mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
fix - recalculate normals for wall-mounted handrail railings
Fixes inverted normals on SweptDiskSolid end caps by recalculating face normals after IFC geometry is loaded into Blender. Fixes #6483
This commit is contained in:
@@ -106,6 +106,13 @@ def update_railing_modifier_ifc_data(context: bpy.types.Context) -> None:
|
||||
model_representation = ifcopenshell.api.geometry.add_railing_representation(ifc_file, **representation_data)
|
||||
tool.Model.replace_object_ifc_representation(body, obj, model_representation)
|
||||
|
||||
# recalculate normals to ensure correct shading
|
||||
mesh = obj.data
|
||||
if isinstance(mesh, bpy.types.Mesh):
|
||||
bm = tool.Blender.get_bmesh_for_mesh(mesh, clean=False)
|
||||
bmesh.ops.recalc_face_normals(bm, faces=bm.faces[:])
|
||||
tool.Blender.apply_bmesh(mesh, bm)
|
||||
|
||||
elif props.railing_type == "FRAMELESS_PANEL":
|
||||
tool.Model.add_body_representation(obj)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user