From 789307025abcef45f162dd2b626d51e5fddbb07e Mon Sep 17 00:00:00 2001 From: Pawel Baran Date: Sun, 15 Dec 2024 14:46:13 +0100 Subject: [PATCH] flipping of bars fixed to take release into account --- Structure_Engine/Modify/Flip.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Structure_Engine/Modify/Flip.cs b/Structure_Engine/Modify/Flip.cs index 7f1e249fb..d0b5d5f15 100644 --- a/Structure_Engine/Modify/Flip.cs +++ b/Structure_Engine/Modify/Flip.cs @@ -27,6 +27,7 @@ using BH.oM.Quantities.Attributes; using System.ComponentModel; using BH.Engine.Base; +using BH.oM.Structure.Constraints; namespace BH.Engine.Structure @@ -51,6 +52,15 @@ public static Bar Flip(this Bar bar) flipped.Start = flipped.End; flipped.End = tempNode; + BarRelease flippedRelease = bar.Release?.ShallowClone(); + if (flippedRelease != null) + { + Constraint6DOF tempRelease = flippedRelease.StartRelease; + flippedRelease.StartRelease = flippedRelease.EndRelease; + flippedRelease.EndRelease = tempRelease; + flipped.Release = flippedRelease; + } + return flipped; }