]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Use path leg end point check for offset legs 31/3031/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Thu, 18 Jul 2019 14:47:22 +0000 (17:47 +0300)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Thu, 18 Jul 2019 14:47:22 +0000 (17:47 +0300)
gitlab #14

Change-Id: Ibd35af89a21e2c6bf188b740f68c685e12f6c39e

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

index e1d9ae2d3971a57548a8821f9c118acb4c4934ff..ea8a512bcd8d0aac247d0df0881286e5dfdb6b75 100644 (file)
@@ -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<PipeControlPoint> pathLegPoints = new ArrayList<PipeControlPoint>();