This commit is contained in:
Andrej730
2025-11-05 19:18:11 +05:00
parent b46136e9f8
commit 6f04eb12d0
2 changed files with 42 additions and 39 deletions
+11 -8
View File
@@ -345,6 +345,8 @@ class BIMArrayProperties(PropertyGroup):
method: Literal["OFFSET", "DISTRIBUTE"] method: Literal["OFFSET", "DISTRIBUTE"]
sync_children: bool sync_children: bool
relating_array_object: Union[bpy.types.Object, None] relating_array_object: Union[bpy.types.Object, None]
def update_total_length_target(self: "BIMStairProperties", context: bpy.types.Context) -> None: def update_total_length_target(self: "BIMStairProperties", context: bpy.types.Context) -> None:
"""Update tread_run when total_length_target changes""" """Update tread_run when total_length_target changes"""
# Calculate available length for default treads # Calculate available length for default treads
@@ -477,6 +479,7 @@ def update_custom_first_last_tread_run(self: "BIMStairProperties", context: bpy.
total_length += n_default_treads * self.tread_run total_length += n_default_treads * self.tread_run
self["total_length_target"] = total_length self["total_length_target"] = total_length
StairType = Literal["CONCRETE", "WOOD/STEEL", "GENERIC"] StairType = Literal["CONCRETE", "WOOD/STEEL", "GENERIC"]
@@ -531,14 +534,14 @@ class BIMStairProperties(PropertyGroup):
update=update_custom_tread_lock, update=update_custom_tread_lock,
) )
custom_first_last_tread_run: bpy.props.FloatVectorProperty( custom_first_last_tread_run: bpy.props.FloatVectorProperty(
name="Custom First / Last Treads Widths", name="Custom First / Last Treads Widths",
description='Specify custom first / last treads widths, different from the general "Tread Run". Leave 0 to disable.', description='Specify custom first / last treads widths, different from the general "Tread Run". Leave 0 to disable.',
default=(0, 0), default=(0, 0),
min=0, min=0,
unit="LENGTH", unit="LENGTH",
size=2, size=2,
update=update_custom_first_last_tread_run, # Added update callback update=update_custom_first_last_tread_run, # Added update callback
) )
nosing_length: bpy.props.FloatProperty( nosing_length: bpy.props.FloatProperty(
name="Nosing Length", name="Nosing Length",
description=( description=(
+6 -6
View File
@@ -1415,9 +1415,9 @@ class Model(bonsai.core.tool.Model):
nosing_overlap_offset = -V_(nosing_overlap, 0) nosing_overlap_offset = -V_(nosing_overlap, 0)
# ============ DEBUG LOGGING START ============ # ============ DEBUG LOGGING START ============
print("\n" + "="*80) print("\n" + "=" * 80)
print("STAIR GENERATION DEBUG - WOOD/STEEL TYPE") print("STAIR GENERATION DEBUG - WOOD/STEEL TYPE")
print("="*80) print("=" * 80)
print(f"Input Parameters:") print(f"Input Parameters:")
print(f" stair_type: {stair_type}") print(f" stair_type: {stair_type}")
print(f" number_of_treads: {number_of_treads}") print(f" number_of_treads: {number_of_treads}")
@@ -1433,7 +1433,7 @@ class Model(bonsai.core.tool.Model):
print(f" nosing_overlap: {nosing_overlap}") print(f" nosing_overlap: {nosing_overlap}")
print(f" nosing_tread_gap: {nosing_tread_gap}") print(f" nosing_tread_gap: {nosing_tread_gap}")
print(f" nosing_overlap_offset: {nosing_overlap_offset}") print(f" nosing_overlap_offset: {nosing_overlap_offset}")
print("="*80 + "\n") print("=" * 80 + "\n")
# ============ DEBUG LOGGING END ============ # ============ DEBUG LOGGING END ============
def define_generic_stair_treads(): def define_generic_stair_treads():
@@ -1499,9 +1499,9 @@ class Model(bonsai.core.tool.Model):
current_offset += tread_offset current_offset += tread_offset
if stair_type == "WOOD/STEEL": if stair_type == "WOOD/STEEL":
print("\n" + "-"*80) print("\n" + "-" * 80)
print("WOOD/STEEL STAIR GENERATION PROCESS") print("WOOD/STEEL STAIR GENERATION PROCESS")
print("-"*80) print("-" * 80)
builder = ShapeBuilder(None) builder = ShapeBuilder(None)
@@ -1590,7 +1590,7 @@ class Model(bonsai.core.tool.Model):
print(f" Total vertices: {len(vertices)}") print(f" Total vertices: {len(vertices)}")
print(f" Total edges: {len(edges)}") print(f" Total edges: {len(edges)}")
print(f" Total treads generated: {tread_index}") print(f" Total treads generated: {tread_index}")
print("-"*80 + "\n") print("-" * 80 + "\n")
elif stair_type == "GENERIC": elif stair_type == "GENERIC":
define_generic_stair_treads() define_generic_stair_treads()