]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Fix orientation of new straight components in insertStraight 62/3862/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Tue, 11 Feb 2020 11:55:37 +0000 (13:55 +0200)
committerReino Ruusu <reino.ruusu@semantum.fi>
Tue, 11 Feb 2020 11:56:27 +0000 (13:56 +0200)
gitlab #77

Change-Id: Ic04f7ac4e12297ee6cfa830b428dd4fe2dd70951

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

index 2c5f7427c7143430beb56edb57583ee31fbafbbb..100852bf5fe01aeeb59e1caec34323c43a48606b 100644 (file)
@@ -280,6 +280,9 @@ public class PipingRules {
                scp.insert(pcp1, pcp2);
 
                scp.setWorldPosition(pos);
+               Vector3d dir = new Vector3d();
+               dir.sub(pcp2.getWorldPosition(), pcp1.getWorldPosition());
+               updateControlPointOrientation(scp, dir);
                scp.setLength(length);
                validate(scp.getPipeRun());
                return scp;