}
public Vector3d getSizeChangeOffsetVector(Vector3d dir) {
+ Quat4d q;
if (rotationAngle == null)
- rotationAngle = 0.0;
- Quat4d q = getControlPointOrientationQuat(dir, rotationAngle);
+ q = getControlPointOrientationQuat(dir, 0.0);
+ else
+ q = getControlPointOrientationQuat(dir, rotationAngle);
Vector3d v = new Vector3d(0.0,offset,0.0);
Vector3d offset = new Vector3d();
MathTools.rotate(q, v, offset);
}
public Vector3d getSizeChangeOffsetVector() {
+ Quat4d q;
if (rotationAngle == null)
- rotationAngle = 0.0;
- Quat4d q = getControlPointOrientationQuat(rotationAngle);
+ q = getControlPointOrientationQuat(0.0);
+ else
+ q = getControlPointOrientationQuat(rotationAngle);
Vector3d v = new Vector3d(0.0,offset,0.0);
Vector3d offset = new Vector3d();
MathTools.rotate(q, v, offset);
ErrorLogger.defaultLogError("Updating pipe run, found offset controlpoint " + icp, new Exception("ASSERT!"));
}
if (offsets.size() == 0) {
- dir.set(startPoint);
- dir.sub(endPoint);
+ dir.set(endPoint);
+ dir.sub(startPoint);
double l = dir.lengthSquared();
if (l > MathTools.NEAR_ZERO)
dir.scale(1.0/Math.sqrt(l));
} else {
Vector3d sp = new Vector3d(startPoint);
Point3d ep = new Point3d(endPoint);
- dir.set(sp);
- dir.sub(ep);
+ dir.set(ep);
+ dir.sub(sp);
double l = dir.lengthSquared();
if (l > MathTools.NEAR_ZERO)
dir.scale(1.0/Math.sqrt(l));
break;
}
ep = nep;
- dir.set(sp);
- dir.sub(ep);
+ dir.set(ep);
+ dir.sub(sp);
l = dir.lengthSquared();
if (l > MathTools.NEAR_ZERO)
dir.scale(1.0/Math.sqrt(l));