From: Reino Ruusu Date: Tue, 7 Apr 2020 09:46:30 +0000 (+0300) Subject: Fix division by zero in ComponentUtls.addComponent() X-Git-Tag: v1.43.0~25 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F16%2F4116%2F1;p=simantics%2F3d.git Fix division by zero in ComponentUtls.addComponent() gitlab #116 Change-Id: Ia0be7bf31ec74f04262a3cc2cdf86cea119ee02f (cherry picked from commit f6ac6d85a7207ba0c60ed17bfbd0c2dac8fc735c) --- diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java b/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java index 913fceb9..ea9f492f 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java @@ -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);