Gable Roof support for roof modifier

How it works:
1) You add Roof Modifier to some object that represents roof footprint.
2) Start editing path (Shift-E in BIM Tool).
3) Then you can select any edge and specify roof angles manually for each edge (Shift-R in BIM Tool)
to make side gabled you just need to set angle to 90 degrees. Preview will update automatically.  You can set it back to 0 for angle to be defined automatically.

Some other changes:
- refactored decorator.py, in decorator now it's possible to supply some custom bmesh function that will be called on redraw, decorator now also can draw faces;
- changed colors for selected verts / edges to less bright, now it in more contrast to selected verts / edges color and seems much more readable;
This commit is contained in:
Andrej730
2023-03-28 12:20:13 +05:00
parent 5943e7e62e
commit ab618be49f
9 changed files with 442 additions and 187 deletions
@@ -23,6 +23,7 @@ from blenderbim.bim.prop import ObjProperty
from blenderbim.bim.module.model.data import AuthoringData
from blenderbim.bim.module.model.root import ConstrTypeEntityNotFound
from bpy.types import PropertyGroup, NodeTree
from math import pi
def get_ifc_class(self, context):
@@ -569,7 +570,7 @@ class BIMRailingProperties(PropertyGroup):
class BIMRoofProperties(PropertyGroup):
roof_types = (("HIP_ROOF", "HIP_ROOF", ""),)
roof_types = (("HIP/GABLE ROOF", "HIP/GABLE ROOF", ""),)
roof_generation_methods = (
("HEIGHT", "HEIGHT", ""),
("ANGLE", "ANGLE", ""),
@@ -579,12 +580,14 @@ class BIMRoofProperties(PropertyGroup):
is_editing: bpy.props.IntProperty(default=-1)
is_editing_path: bpy.props.BoolProperty(default=False)
roof_type: bpy.props.EnumProperty(name="Roof Type", items=roof_types, default="HIP_ROOF")
roof_type: bpy.props.EnumProperty(name="Roof Type", items=roof_types, default="HIP/GABLE ROOF")
generation_method: bpy.props.EnumProperty(
name="Roof Generation Method", items=roof_generation_methods, default="HEIGHT"
name="Roof Generation Method", items=roof_generation_methods, default="ANGLE"
)
height: bpy.props.FloatProperty(name="Height", default=1.0)
angle: bpy.props.FloatProperty(name="Slope Angle", default=10, description="In degrees")
height: bpy.props.FloatProperty(
name="Height", default=1.0, description="Maximum height of the roof to be generated.", subtype="DISTANCE"
)
angle: bpy.props.FloatProperty(name="Slope Angle", default=pi / 18, subtype="ANGLE")
def get_general_kwargs(self):
kwargs = {