Clean up formatting

This commit is contained in:
Brady
2023-06-08 16:36:32 -05:00
parent 26574b4a9b
commit f232bbdb15
2 changed files with 14 additions and 5 deletions

View File

@@ -36,8 +36,12 @@ public final class CylinderSchematic extends CachedMaskSchematic {
public boolean partOfMask(int x, int y, int z) {
double da = Math.abs((this.getA(x, y) + 0.5) - this.centerA);
double db = Math.abs((this.getB(y, z) + 0.5) - this.centerB);
return !this.outside(da, db)
&& (filled || outside(da + 1, db) || outside(da, db + 1));
if (this.outside(da, db)) {
return false;
}
return filled
|| this.outside(da + 1, db)
|| this.outside(da, db + 1);
}
private boolean outside(double da, double db) {

View File

@@ -37,11 +37,16 @@ public final class SphereSchematic extends CachedMaskSchematic {
double dx = Math.abs((x + 0.5) - this.centerX);
double dy = Math.abs((y + 0.5) - this.centerY);
double dz = Math.abs((z + 0.5) - this.centerZ);
return !this.outside(dx, dy, dz)
&& (filled || outside(dx + 1, dy, dz) || outside(dx, dy + 1, dz) || outside(dx, dy, dz + 1));
if (this.outside(dx, dy, dz)) {
return false;
}
return filled
|| this.outside(dx + 1, dy, dz)
|| this.outside(dx, dy + 1, dz)
|| this.outside(dx, dy, dz + 1);
}
private boolean outside(double dx,double dy, double dz) {
private boolean outside(double dx, double dy, double dz) {
return dx * dx / this.radiusSqX + dy * dy / this.radiusSqY + dz * dz / this.radiusSqZ > 1;
}
});