]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Fix update of inline components with offsets 71/3871/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Fri, 14 Feb 2020 12:20:42 +0000 (14:20 +0200)
committerReino Ruusu <reino.ruusu@semantum.fi>
Fri, 14 Feb 2020 12:21:06 +0000 (14:21 +0200)
gitlab #82

Change-Id: I735a8756886f16c7a7d6b877fc240039ff8322c8

org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java

index d00e4018de1407887cb1982e578bb2b3d967a4a5..33c832f1b8c4bec41cc22d5c0d1dec791f6f8968 100644 (file)
@@ -216,6 +216,17 @@ public class PipingRules {
                        System.out.println("PipingRules.updateInlineControlPoint() " + pcp);
                PipeControlPoint start = pcp.findPreviousEnd();
                updatePathLegNext(start, pcp, PathLegUpdateType.NONE);
+               
+               if (pcp.isOffset()) {
+                       // Adjusting the rotation angle of an offset component may change variable angle turns
+                       PipeControlPoint end = pcp.findNextEnd();
+                       if (end.isVariableAngle()) {
+                               updatePathLegNext(end, end, PathLegUpdateType.NONE);
+                       }
+                       if (start.isVariableAngle()) {
+                               updatePathLegPrev(start, start, PathLegUpdateType.NONE);
+                       }
+               }
        }
 
        private static PipeControlPoint insertElbow(PipeControlPoint pcp1, PipeControlPoint pcp2, Vector3d pos) throws Exception{