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

Change-Id: Ia0be7bf31ec74f04262a3cc2cdf86cea119ee02f
(cherry picked from commit f6ac6d85a7207ba0c60ed17bfbd0c2dac8fc735c)

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);