From 0c171a457b3a23be4948cbf48a7ccae9eb1d5e4f Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 6 Nov 2025 18:06:48 +0500 Subject: [PATCH] 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 --- src/bonsai/bonsai/tool/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/tool/model.py b/src/bonsai/bonsai/tool/model.py index 405244eba4..e2713db1af 100644 --- a/src/bonsai/bonsai/tool/model.py +++ b/src/bonsai/bonsai/tool/model.py @@ -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