]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java
Added support for eccentric reducers
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / actions / AddComponentAction.java
index bf220dd8776dc03959acc6a1410e78771a4adac1..4c116c1f26efb73d9453e850e299a43cb89992f9 100644 (file)
@@ -159,11 +159,7 @@ public class AddComponentAction extends vtkAction {
                        PipeControlPoint newPcp = newComponent.getControlPoint();
                        
                        PipeControlPoint toPcp = component.getControlPoint();
-                       Vector3d start = new Vector3d();
-                       Vector3d end = new Vector3d();
-                       Vector3d dir = new Vector3d();
-                       toPcp.getInlineControlPointEnds(start, end, dir);
-                       dir.normalize();
+                       
                        
                        switch (position) {
                        case NEXT: 
@@ -175,6 +171,13 @@ public class AddComponentAction extends vtkAction {
                                if (toPcp.isDualSub())
                                        toPcp = toPcp.parent;
                        }
+                       
+                       Vector3d start = new Vector3d();
+                       Vector3d end = new Vector3d();
+                       Vector3d dir = new Vector3d();
+                       toPcp.getInlineControlPointEnds(start, end, dir);
+                       dir.normalize();
+                       
                        PipeRun pipeRun = toPcp.getPipeRun();
                        
                        if (!toAdd.isSizeChange()) {