Merge pull request #1915 from SiboVG/issue-1907

[#1907] Fix RockSim fin tab offset
This commit is contained in:
Sibo Van Gool 2022-12-21 23:51:21 +01:00 committed by GitHub
commit fd670e6eeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import net.sf.openrocket.rocketcomponent.EllipticalFinSet;
import net.sf.openrocket.rocketcomponent.FinSet;
import net.sf.openrocket.rocketcomponent.FreeformFinSet;
import net.sf.openrocket.rocketcomponent.TrapezoidFinSet;
import net.sf.openrocket.rocketcomponent.position.AxialMethod;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@ -64,7 +65,7 @@ public class FinSetDTO extends BasePartDTO {
setCantAngle(theORFinSet.getCantAngle());
setTabDepth(theORFinSet.getTabHeight() * RockSimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
setTabLength(theORFinSet.getTabLength() * RockSimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
setTabOffset(theORFinSet.getTabOffset() * RockSimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
setTabOffset(theORFinSet.getTabOffset(AxialMethod.TOP) * RockSimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
setThickness(theORFinSet.getThickness() * RockSimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
setRadialAngle(theORFinSet.getBaseRotation());

View File

@ -396,8 +396,12 @@ public abstract class FinSet extends ExternalComponent implements AxialPositiona
return tabPosition;
}
public double getTabOffset(AxialMethod method){
return method.getAsOffset(tabPosition, tabLength, length);
}
public double getTabOffset(){
return this.tabOffsetMethod.getAsOffset(tabPosition, tabLength, length);
return getTabOffset(this.tabOffsetMethod);
}
/**