X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fscenegraph%2Fcontrolpoint%2FPipeControlPoint.java;h=b67562459016b3dddcb1ba730a99a1a5bb016beb;hb=refs%2Fheads%2Frelease%2F1.35.2;hp=493f3b894702d8f86606c08e744f75afdffedf9c;hpb=5c3aac4fe749c3a12b66823116dc43472bab869d;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java index 493f3b89..b6756245 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java @@ -616,8 +616,8 @@ public class PipeControlPoint extends G3DNode implements IP3DNode { if (isDualSub()) throw new RuntimeException("Dual sub points cannot be inserted."); // size change control point cannot be inserted this way, because it ends PipeRun - if (isSizeChange()) - throw new RuntimeException("Size change points cannot be inserted."); +// if (isSizeChange()) +// throw new RuntimeException("Size change points cannot be inserted."); PipeRun piperun = previous.getPipeRun(); // and just to make sure that control point structure is not corrupted if (getPipeRun() != null) { @@ -1038,16 +1038,27 @@ public class PipeControlPoint extends G3DNode implements IP3DNode { Vector3d pos = getWorldPosition(); switch (type) { case NEXT: { - Vector3d dir = getInlineDir(); double length = getInlineLength(); + Vector3d dir; + if (isInline()) { + dir = getInlineDir(); + } else { + dir = getPathLegDirection(Direction.NEXT); + } dir.scale(length); pos.add(dir); break; } case PREVIOUS: { - Vector3d dir = getInlineDir(); double length = getInlineLength(); - dir.scale(-length); + Vector3d dir; + if (isInline()) { + dir = getInlineDir(); + dir.negate(); + } else { + dir = getPathLegDirection(Direction.PREVIOUS); + } + dir.scale(length); pos.add(dir); break; }