From: Marko Luukkainen Date: Thu, 18 Jul 2019 14:47:22 +0000 (+0300) Subject: Use path leg end point check for offset legs X-Git-Tag: v1.43.0~242 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=294f1dcbec34369945b1631efa195b783cbed89d;p=simantics%2F3d.git Use path leg end point check for offset legs gitlab #14 Change-Id: Ibd35af89a21e2c6bf188b740f68c685e12f6c39e --- 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 e1d9ae2d..ea8a512b 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 @@ -475,14 +475,19 @@ public class PipingRules { if (DEBUG) System.out.println("PipingRules.updateInlineControlPoints() " + u); + Vector3d start = new Vector3d(u.startPoint); + Vector3d end = new Vector3d(u.endPoint); + + if (checkSizes) { + // create offsets for leg ends. + MathTools.mad(start, u.dir, u.start.getInlineLength()); + MathTools.mad(end, u.dir, -u.end.getInlineLength()); + } + boolean recalcline = false; if (!u.hasOffsets) { - Vector3d start = new Vector3d(u.startPoint); - Vector3d end = new Vector3d(u.endPoint); - // create offsets. - MathTools.mad(start, u.dir, u.start.getInlineLength()); - MathTools.mad(end, u.dir, -u.end.getInlineLength()); + for (PipeControlPoint icp : u.list) { updateInlineControlPoint(icp, start, end, u.dir); @@ -537,8 +542,8 @@ public class PipingRules { } } } else { // with offset - Vector3d sp = new Vector3d(u.startPoint); - Vector3d ep = new Vector3d(u.endPoint); + Vector3d sp = new Vector3d(start); + Vector3d ep = new Vector3d(end); ep.sub(u.offset); ArrayList pathLegPoints = new ArrayList();