if (isDualSub())
throw new RuntimeException("Dual sub points cannot be inserted.");
// size change control point cannot be inserted this way, because it ends PipeRun
- if (isSizeChange())
- throw new RuntimeException("Size change points cannot be inserted.");
+// if (isSizeChange())
+// throw new RuntimeException("Size change points cannot be inserted.");
PipeRun piperun = previous.getPipeRun();
// and just to make sure that control point structure is not corrupted
if (getPipeRun() != null) {
Vector3d pos = getWorldPosition();
switch (type) {
case NEXT: {
- Vector3d dir = getInlineDir();
double length = getInlineLength();
+ Vector3d dir;
+ if (isInline()) {
+ dir = getInlineDir();
+ } else {
+ dir = getPathLegDirection(Direction.NEXT);
+ }
dir.scale(length);
pos.add(dir);
break;
}
case PREVIOUS: {
- Vector3d dir = getInlineDir();
double length = getInlineLength();
- dir.scale(-length);
+ Vector3d dir;
+ if (isInline()) {
+ dir = getInlineDir();
+ dir.negate();
+ } else {
+ dir = getPathLegDirection(Direction.PREVIOUS);
+ }
+ dir.scale(length);
pos.add(dir);
break;
}