Add opt-in toggle to join coplanar surface boundaries in drawings

Introduces a "Join Coplanar Surfaces" boolean property (default off)
nested under the "Generate Material Layers" option in BIM_PT_camera.
When enabled, remove_coplanar_boundary_lines runs after linework
generation to suppress shared boundary lines between adjacent coplanar
elements of the same material.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Ryan Schultz
2026-04-12 08:09:12 -05:00
parent 6c993ba919
commit 2b7bcb1b40
3 changed files with 13 additions and 2 deletions
@@ -1005,14 +1005,16 @@ class CreateDrawing(bpy.types.Operator):
if self.cprops.generate_material_layers:
self.generate_material_layers(context, root)
self.merge_linework_and_add_metadata(root)
self.remove_coplanar_boundary_lines(root)
if self.cprops.generate_material_layers and self.cprops.join_coplanar_surfaces:
self.remove_coplanar_boundary_lines(root)
self.move_elements_to_top(root)
elif self.cprops.cut_mode == "OPENCASCADE":
self.move_projection_to_bottom(root)
if self.cprops.generate_material_layers:
self.generate_material_layers(context, root)
self.merge_linework_and_add_metadata(root)
self.remove_coplanar_boundary_lines(root)
if self.cprops.generate_material_layers and self.cprops.join_coplanar_surfaces:
self.remove_coplanar_boundary_lines(root)
self.move_elements_to_top(root)
if self.cprops.fill_mode == "SHAPELY":
@@ -500,6 +500,11 @@ class BIMCameraProperties(PropertyGroup):
generate_material_layers: bpy.props.BoolProperty(
name="Generate Material Layers", description="Generate material layer linework in drawings", default=True
)
join_coplanar_surfaces: bpy.props.BoolProperty(
name="Join Coplanar Surfaces",
description="Remove shared boundary lines between adjacent coplanar elements of the same material",
default=False,
)
fill_mode: EnumProperty(
items=[
("NONE", "None", "Disable filling areas seen in projection"),
@@ -104,6 +104,10 @@ class BIM_PT_camera(Panel):
row.prop(props, "linework_mode")
row = self.layout.row()
row.prop(props, "generate_material_layers")
if props.generate_material_layers:
row = self.layout.row()
row.separator(factor=1.0)
row.prop(props, "join_coplanar_surfaces")
if props.linework_mode == "OPENCASCADE":
row = self.layout.row()
row.prop(props, "fill_mode")