From 2c1238705b1402da4494d5a750e3b131d11e8ea3 Mon Sep 17 00:00:00 2001 From: Sibo Van Gool Date: Sun, 12 Sep 2021 15:48:19 +0200 Subject: [PATCH 1/3] [fixes #1003] Remove clipping of FinSet points beyond parent body --- core/src/net/sf/openrocket/rocketcomponent/FinSet.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/FinSet.java b/core/src/net/sf/openrocket/rocketcomponent/FinSet.java index b298608bc..f132bb28b 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FinSet.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FinSet.java @@ -1161,12 +1161,6 @@ 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( body.getLength()-0.000001 < points[lastIndex].x) { - points[lastIndex] = points[lastIndex].setX(body.getLength()).setY(body.getAftRadius()); - } - if( 0.0000001 < (Math.abs(xOffset) + Math.abs(yOffset))){ points = translatePoints(points, xOffset, yOffset); } From 4edba14595833fc4ac88d9be56f89aeae9c4d79b Mon Sep 17 00:00:00 2001 From: Sibo Van Gool Date: Sun, 12 Sep 2021 15:49:06 +0200 Subject: [PATCH 2/3] Fix C-style array declaration --- .../net/sf/openrocket/gui/rocketfigure/FinSetShapes.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/FinSetShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/FinSetShapes.java index 29d98a266..b4ae59935 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/FinSetShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/FinSetShapes.java @@ -32,9 +32,9 @@ public class FinSetShapes extends RocketComponentShape { final Transformation compositeTransform = transformation.applyTransformation(cantRotation); - Coordinate finPoints[] = finset.getFinPoints(); - Coordinate tabPoints[] = finset.getTabPoints(); - Coordinate rootPoints[] = finset.getRootPoints(); + Coordinate[] finPoints = finset.getFinPoints(); + Coordinate[] tabPoints = finset.getTabPoints(); + Coordinate[] rootPoints = finset.getRootPoints(); // Translate & rotate points into place finPoints = compositeTransform.transform( finPoints ); From 9382a3b832cd7138f1b68336028fba0d6d57abe3 Mon Sep 17 00:00:00 2001 From: Sibo Van Gool Date: Thu, 16 Sep 2021 01:53:53 +0200 Subject: [PATCH 3/3] [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); }