+ if (pcp.getNext() != null)
+ connectNext = false;
+ } else {
+ Vector3d dir = s.getControlPoint().getPathLegDirection(Direction.NEXT);
+ Vector3d currDir = getLast().getControlPoint().getPathLegDirection(Direction.NEXT);
+ dir.normalize();
+ currDir.normalize();
+ double dot = dir.dot(currDir);
+ System.out.println(dot + " " + currDir + " " + dir);
+ if (dot > 0.95 || dot < -0.95) {
+ // pipes are almost in the same direction, creating a branch is not feasible.
+ branch = false;
+ } else {
+ branch = true;
+ }