From 02c9aee70bdbe2d665bccdc3605abe5d02ddfa38 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 20 Jan 2024 21:53:34 +1100 Subject: [PATCH] Fix #3947. Do slight 2mm offset to account for Z-fighting on 2D plan views and RCPs. --- .../blenderbim/bim/module/drawing/operator.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/drawing/operator.py b/src/blenderbim/blenderbim/bim/module/drawing/operator.py index 10100f832c..1456d612e9 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/operator.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/operator.py @@ -494,6 +494,11 @@ class CreateDrawing(bpy.types.Operator): geom_settings = ifcopenshell.geom.settings( DISABLE_TRIANGULATION=True, STRICT_TOLERANCE=True, INCLUDE_CURVES=True ) + if ifc.by_id(body_context[0]).ContextType == "Plan" and "PLAN_VIEW" in target_view: + offset = ifcopenshell.ifcopenshell_wrapper.float_array_3() + # A 2mm Z offset to combat Z-fighting in plan or RCPs + offset[2] = 0.002 if target_view == "PLAN_VIEW" else -0.002 + geom_settings.offset = offset geom_settings.set_context_ids(body_context) it = ifcopenshell.geom.iterator( geom_settings, ifc, multiprocessing.cpu_count(), include=elements @@ -513,6 +518,11 @@ class CreateDrawing(bpy.types.Operator): geom_settings = ifcopenshell.geom.settings( DISABLE_TRIANGULATION=True, STRICT_TOLERANCE=True, INCLUDE_CURVES=True ) + if ifc.by_id(annotation_context[0]).ContextType == "Plan" and "PLAN_VIEW" in target_view: + offset = ifcopenshell.ifcopenshell_wrapper.float_array_3() + # A 2mm Z offset to combat Z-fighting in plan or RCPs + offset[2] = 0.002 if target_view == "PLAN_VIEW" else -0.002 + geom_settings.offset = offset geom_settings.set_context_ids(annotation_context) it = ifcopenshell.geom.iterator( geom_settings, ifc, multiprocessing.cpu_count(), include=elements