stair generation - fix bug with extended top nib with zero first tread run

`s0 = V_(custom_first_last_tread_run[0] or tread_run, tread_rise) + td_vector` was assuming `0` means "no custom first tread run", not it means actually "zero first tread run", so could should be adjusted

before - https://files.catbox.moe/5ovqnh.mp4
after - https://files.catbox.moe/srorl2.mp4
This commit is contained in:
Andrej730
2025-11-06 18:06:48 +05:00
parent b5e8dfd863
commit 0c171a457b
+2 -1
View File
@@ -1423,6 +1423,7 @@ class Model(bonsai.core.tool.Model):
nosing_overlap = max(nosing_length, 0)
nosing_tread_gap = -min(nosing_length, 0)
nosing_overlap_offset = -V_(nosing_overlap, 0)
first_tread_run = custom_first_last_tread_run[0] if custom_first_last_tread_run[0] is not None else tread_run
# ============ DEBUG LOGGING START ============
print("\n" + "=" * 80)
@@ -1639,7 +1640,7 @@ class Model(bonsai.core.tool.Model):
# s0 is just a sampled point from the bottom line
# we stick to the third point as the first point
# is affected by customized tread run
s0 = V_(custom_first_last_tread_run[0] or tread_run, tread_rise) + td_vector
s0 = V_(first_tread_run, tread_rise) + td_vector
# comes from y = stair_tan * x + b
b = s0.y - stair_tan * s0.x