diff --git a/core/src/net/sf/openrocket/file/rasaero/importt/RASAeroCommonConstants.java b/core/src/net/sf/openrocket/file/rasaero/importt/RASAeroCommonConstants.java index 63bdce030..7cdc12372 100644 --- a/core/src/net/sf/openrocket/file/rasaero/importt/RASAeroCommonConstants.java +++ b/core/src/net/sf/openrocket/file/rasaero/importt/RASAeroCommonConstants.java @@ -193,8 +193,8 @@ public class RASAeroCommonConstants { } else if (CROSS_SECTION_SUBSONIC_NACA.equals(crossSection)) { return FinSet.CrossSection.AIRFOIL; } else { - warnings.add("Unknown fin cross section: " + crossSection + ", defaulting to square."); - return FinSet.CrossSection.SQUARE; + warnings.add("Unknown fin cross section: " + crossSection + ", defaulting to Airfoil."); + return FinSet.CrossSection.AIRFOIL; } } @@ -218,7 +218,7 @@ public class RASAeroCommonConstants { } else if (FINISH_CAST_IRON.equals(surfaceFinish)) { return ExternalComponent.Finish.ROUGHUNFINISHED; } else { - warnings.add("Unknown surface finish: " + surfaceFinish + ", defaulting to regular paint."); + warnings.add("Unknown surface finish: " + surfaceFinish + ", defaulting to Regular Paint."); return ExternalComponent.Finish.NORMAL; } } diff --git a/core/src/net/sf/openrocket/file/rasaero/importt/RailGuideHandler.java b/core/src/net/sf/openrocket/file/rasaero/importt/RailGuideHandler.java index aae088369..707ef506a 100644 --- a/core/src/net/sf/openrocket/file/rasaero/importt/RailGuideHandler.java +++ b/core/src/net/sf/openrocket/file/rasaero/importt/RailGuideHandler.java @@ -37,12 +37,16 @@ public abstract class RailGuideHandler { buttonFore.setAxialOffset(0.0254); // 1 inch separation buttonAft.setAxialOffset(-0.0254 + buttonAft.getOuterDiameter()/2); // 1 inch separation - // Calculate the angle offset of the launch lugs + // Calculate the angle offset of the rail guides // Don't ask me how I got this formula... I don't know what the hell RASAero is doing here. // Just experimentally measured the right offsets, it seems to work okay. - double r = diameter / 2; + double H = buttonFore.getTotalHeight(); + double D = buttonFore.getOuterDiameter(); double R = parent.getOuterRadius(); - double rot = -Math.acos((0.6616*R - r) / (R+r)); + double rot = -Math.acos((D - 1.3232*R)/(D - 2*H - 2*R)); // This is not an exact solution for all cases, but it is for the most common case + if (Double.isNaN(rot)) { // Just to be safe :) + rot = 0; + } buttonFore.setAngleOffset(rot); buttonAft.setAngleOffset(rot);