From 294f1dcbec34369945b1631efa195b783cbed89d Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Thu, 18 Jul 2019 17:47:22 +0300 Subject: [PATCH] Use path leg end point check for offset legs gitlab #14 Change-Id: Ibd35af89a21e2c6bf188b740f68c685e12f6c39e --- .../scenegraph/controlpoint/PipingRules.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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(); -- 2.47.1