From: Reino Ruusu Date: Tue, 11 Feb 2020 11:55:37 +0000 (+0200) Subject: Fix orientation of new straight components in insertStraight X-Git-Tag: v1.43.0~79 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=3eb220c649ab8125712af7fd2241acc731364545;p=simantics%2F3d.git Fix orientation of new straight components in insertStraight gitlab #77 Change-Id: Ic04f7ac4e12297ee6cfa830b428dd4fe2dd70951 --- diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java index 2c5f7427..100852bf 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java @@ -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;