]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Directed path leg update handled offset wrong way. 70/3670/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Wed, 4 Dec 2019 14:29:48 +0000 (16:29 +0200)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Wed, 4 Dec 2019 14:34:04 +0000 (14:34 +0000)
Additionally, removed debug messages.

gitlab #12

Change-Id: I8abab7e87115a1ce9439fed4d70a9e0973ed5ca8
(cherry picked from commit a53efc63bed07331a3a2f9879f266e41cbe738cb)

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

index 4f95e7964c8194db3df5afc950e043748efba808..58873b0f1003d5f64156b3c16a42def1cb8cccd4 100644 (file)
@@ -447,7 +447,6 @@ public class PipingRules {
                Vector3d endPoint = end.getWorldPosition();
                Vector3d dir = new Vector3d();
                hasOffsets = calculateOffset(startPoint, endPoint, start, list, end, dir, offset);
-               System.out.println();
                return new UpdateStruct2(start, startPoint, list, end, endPoint, dir, offset, hasOffsets, iter, direction == Direction.PREVIOUS, toRemove, updated);
        }
        
@@ -1010,7 +1009,7 @@ public class PipingRules {
                }
                Point3d directedEndPoint = new Point3d(u.endPoint);
                if (u.hasOffsets)
-                       directedEndPoint.add(u.offset);
+                       directedEndPoint.sub(u.offset);
 
                double mu[] = new double[2];
 
@@ -1262,7 +1261,6 @@ public class PipingRules {
                return tr; // space for 90 deg
            Vector3d dir = dcp.getDirectedControlPointDirection();
            Vector3d dp = dcp.getWorldPosition();
-           //Vector3d tp = tcp.getWorldPosition();
            Vector3d op = other.getWorldPosition();
            double u[] = new double[1];
            Vector3d closest = MathTools.closestPointOnStraight(op, dp, dir,u);
@@ -1893,7 +1891,6 @@ public class PipingRules {
                                List<PipeControlPoint> list2 = pcps.get(i+1);
                                PipeControlPoint prev = list.get(list.size()-1);
                                PipeControlPoint next = list2.get(0);
-                               System.out.println();
                                if (prev == next) {
                                        // Reverse the component on the boundary.
                                        InlineComponent ic = (InlineComponent)prev.getPipelineComponent();