]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java
Allow multiple radii for turns.
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / controlpoint / PipingRules.java
index 6c121d80857da7b7c920c37f73d774b14d191b62..727cf1a882e8d513fa1ab583ef2584a692054954 100644 (file)
@@ -1083,7 +1083,7 @@ public class PipingRules {
                // TODO : this returns now space for 90 deg turn.
                // The challenge: position of tcp affects the turn angle, which then affects the required space. Perhaps we need to iterate...
                // Additionally, if the path legs contain offset, using just positions of opposite path leg ends is not enough,    
-               return tcp.getPipeRun().getTurnRadius();
+               return ((TurnComponent)tcp.getPipelineComponent()).getTurnRadius();
        }
 
        private static void insertElbowUpdate(UpdateStruct2 u, PipeControlPoint dcp, PipeControlPoint next, boolean dcpStart, Vector3d position, Vector3d directedDirection) throws Exception{
@@ -1579,7 +1579,7 @@ public class PipingRules {
                        Vector3d turnAxis = new Vector3d();
                        turnAxis.cross(prev, next);
                        if (turnAxis.lengthSquared() > MathTools.NEAR_ZERO) {
-                               double elbowRadius = tcp.getPipelineComponent().getPipeRun().getTurnRadius();
+                               double elbowRadius = ((TurnComponent)tcp.getPipelineComponent()).getTurnRadius();
                                double R = elbowRadius / Math.tan(angle * 0.5);
                                
                                turnAxis.normalize();