]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Fix division by zero in ComponentUtls.addComponent() 07/4107/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Tue, 7 Apr 2020 09:46:30 +0000 (12:46 +0300)
committerReino Ruusu <reino.ruusu@semantum.fi>
Tue, 7 Apr 2020 09:46:30 +0000 (12:46 +0300)
gitlab #116

Change-Id: Ia0be7bf31ec74f04262a3cc2cdf86cea119ee02f

org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java

index 913fceb9178276045828d04d9546000e39b62dd2..ea9f492f6b96e8144215cff483399e6ee7d9af32 100644 (file)
@@ -427,9 +427,8 @@ public class ComponentUtils {
                        }
                        Vector3d start = new Vector3d();
                        Vector3d end = new Vector3d();
-                       dir = new Vector3d();
-                       toPcp.getInlineControlPointEnds(start, end, dir);
-                       dir.normalize();
+                       dir = toPcp.getInlineDir();
+                       toPcp.getControlPointEnds(start, end);
                        switch (position) {
                        case NEXT:
                                pos = new Vector3d(end);