From: Marko Luukkainen Date: Thu, 5 Dec 2019 10:23:11 +0000 (+0000) Subject: Merge "Fix removed nodes leaving visible graphical elements." X-Git-Tag: v1.43.0~99 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=ed680aaef733cf82ec30a132611937f24ca3644a;hp=09afb6fbe9c440b6768714373d95d581111b9993;p=simantics%2F3d.git Merge "Fix removed nodes leaving visible graphical elements." --- diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java index 58873b0f..57ee4ba8 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java @@ -864,7 +864,8 @@ public class PipingRules { double l2next = icp.getInlineLength(); double l2 = l2prev + l2next; double l2s = l2 * l2; - if (l > l2s) { + double diff = l - l2s; + if (diff >= MIN_INLINE_LENGTH) { if (allowInsertRemove) { dir.normalize(); double length = Math.sqrt(l) - l2; // true length of the variable length component @@ -988,16 +989,19 @@ public class PipingRules { other = u.end; position = u.startPoint; dcpStart = true; + if (!u.reversed) + canMoveOther = true; inlineEnd = u.end.isInline(); } else { dcp = u.end; other = u.start; position = u.endPoint; + if (u.reversed) + canMoveOther = true; inlineEnd = u.start.isInline(); } - canMoveOther = !(other == u.updated); - + Vector3d directedDirection = direction(dcp, dcpStart ? Direction.NEXT : Direction.PREVIOUS); if (directedDirection == null) { //updateTurnControlPointTurn(dcp, dcp.getPrevious(), dcp.getNext()); @@ -1286,7 +1290,7 @@ public class PipingRules { R = tr / t; if (R <= curr) break; - curr = R*1.01; + curr = R*1.001; iter--; } return curr;