Use MathUtil.EPSILON for FinSet point correction

This commit is contained in:
SiboVG 2022-08-27 12:42:55 +02:00
parent 406b18be64
commit 9aa83c1698

View File

@ -1096,12 +1096,12 @@ public abstract class FinSet extends ExternalComponent implements AxialPositiona
// correct last point, if beyond a rounding error from body's end.
final int lastIndex = points.length - 1;
if (Math.abs(points[lastIndex].x - body.getLength()) < 0.000001) {
if (Math.abs(points[lastIndex].x - body.getLength()) < MathUtil.EPSILON) {
points[lastIndex] = points[lastIndex].setX(body.getLength()).setY(body.getAftRadius());
}
// translate the points if needed
if ((Math.abs(xOffset) + Math.abs(yOffset)) > 0.0000001) {
if ((Math.abs(xOffset) + Math.abs(yOffset)) > MathUtil.EPSILON) {
points = translatePoints(points, xOffset, yOffset);
}