From 9382a3b832cd7138f1b68336028fba0d6d57abe3 Mon Sep 17 00:00:00 2001 From: Sibo Van Gool Date: Thu, 16 Sep 2021 01:53:53 +0200 Subject: [PATCH] [fixes #1003] Use clipping of FinSet points only around edge of part, no further --- core/src/net/sf/openrocket/rocketcomponent/FinSet.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/net/sf/openrocket/rocketcomponent/FinSet.java b/core/src/net/sf/openrocket/rocketcomponent/FinSet.java index f132bb28b..970b0562b 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FinSet.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FinSet.java @@ -1161,6 +1161,12 @@ public abstract class FinSet extends ExternalComponent implements AxialPositiona xCur += increment; } + // 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) { + points[lastIndex] = points[lastIndex].setX(body.getLength()).setY(body.getAftRadius()); + } + if( 0.0000001 < (Math.abs(xOffset) + Math.abs(yOffset))){ points = translatePoints(points, xOffset, yOffset); }