Only check if radius is automatic
This commit is contained in:
parent
9183bde51e
commit
35a91b4654
@ -849,12 +849,20 @@ public abstract class SymmetricComponent extends BodyComponent implements BoxBou
|
|||||||
// have a radial offset of 0 from their centerline, we are in line.
|
// have a radial offset of 0 from their centerline, we are in line.
|
||||||
|
|
||||||
if ((this.parent instanceof RingInstanceable) &&
|
if ((this.parent instanceof RingInstanceable) &&
|
||||||
(!MathUtil.equals(this.parent.getRadiusMethod().getRadius(this.parent.parent, this, this.parent.getRadiusOffset()), 0)))
|
(!MathUtil.equals(this.parent.getRadiusMethod().getRadius(
|
||||||
|
this.parent.parent, this, this.parent.getRadiusOffset()), 0)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ((candidate.parent instanceof RingInstanceable) && ((candidate.parent.parent == this) ||
|
if (candidate.parent instanceof RingInstanceable) {
|
||||||
(!MathUtil.equals(candidate.parent.getRadiusMethod().getRadius(candidate.parent.parent, candidate, candidate.parent.getRadiusOffset()), 0))))
|
// We need to check if the grandparent of the candidate is a body tube and if the outer radius is automatic.
|
||||||
|
// If so, then this would cause an infinite loop when checking the radius of the radiusMethod.
|
||||||
|
if (candidate.parent.parent == this && (this.isAftRadiusAutomatic() || this.isForeRadiusAutomatic())) {
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
|
return MathUtil.equals(candidate.parent.getRadiusMethod().getRadius(
|
||||||
|
candidate.parent.parent, candidate, candidate.parent.getRadiusOffset()), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user