+ public static void setZeroOffset(Vector3d startPoint, Vector3d endPoint, Vector3d dir, Vector3d offset) {
+ dir.set(endPoint);
+ dir.sub(startPoint);
+ double l = dir.lengthSquared();
+ if (l > MathTools.NEAR_ZERO)
+ dir.scale(1.0/Math.sqrt(l));
+ offset.set(0.0, 0.0, 0.0);
+ }
+
+ public static List<PipeControlPoint> getOffsetPoints(PipeControlPoint start, ArrayList<PipeControlPoint> list) {
+ List<PipeControlPoint> offsets = new ArrayList<PipeControlPoint>(list.size());
+ // Only start offset affects the calculation
+ if (start.isOffset())
+ offsets.add(start);
+ for (PipeControlPoint icp : list) {
+ if (icp.isOffset()) {
+ offsets.add(icp);
+ } else if (icp.isDualSub())
+ ErrorLogger.defaultLogError("Updating pipe run, found offset controlpoint " + icp, new Exception("ASSERT!"));
+ }
+ return offsets;
+ }
+