From 1c22d60d859f73fe6320ff1ed1cc6f753752d97a Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Tue, 7 Apr 2020 12:46:30 +0300 Subject: [PATCH] Fix division by zero in ComponentUtls.addComponent() gitlab #116 Change-Id: Ia0be7bf31ec74f04262a3cc2cdf86cea119ee02f (cherry picked from commit f6ac6d85a7207ba0c60ed17bfbd0c2dac8fc735c) --- .../src/org/simantics/plant3d/utils/ComponentUtils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); -- 2.47.1