From a835c64805a6082e60939dde2fc2d8780c46baad Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Tue, 18 Jun 2024 21:59:12 +0200 Subject: [PATCH] BIM: Fix base edge direction for Arch_Stairs Fixes #14377 If the base edge of a stairs has a delta Z, the start point must have lowest Z. The `makeStraightStairsWithLanding` code fails otherwise. Using `edge = Part.LineSegment().toShape()` is not the most efficient, but matches the pattern used elsewhere in the code. --- src/Mod/BIM/ArchStairs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/BIM/ArchStairs.py b/src/Mod/BIM/ArchStairs.py index 7bbf69a36c..60c980f234 100644 --- a/src/Mod/BIM/ArchStairs.py +++ b/src/Mod/BIM/ArchStairs.py @@ -304,6 +304,9 @@ class _Stairs(ArchComponent.Component): if isinstance(edge.Curve,(Part.LineSegment,Part.Line)): # preparing for multi-edges landing / segment staircase if obj.NumberOfSteps > 1: + # if the edge has a delta Z the start point must have lowest Z: + if edge.Vertexes[0].Point.z > edge.Vertexes[1].Point.z: + edge = Part.LineSegment(edge.Vertexes[1].Point,edge.Vertexes[0].Point).toShape() self.makeStraightStairsWithLanding(obj,edge) # all cases use makeStraightStairsWithLanding() # preparing for multi-edges landing / segment staircase