Fix RD2 position for small body tubes and rule 1

This commit is contained in:
SiboVG 2023-03-28 19:17:44 +02:00
parent 9e8163e3e1
commit 020ea2cf3f

View File

@ -367,6 +367,10 @@ public class RecoveryHandler extends AbstractElementHandler {
offset += parentBodyTube.getOuterRadius() * 2.25; // 1.125 calibers
recoveryDevice.setAxialMethod(AxialMethod.TOP);
if (offset + recoveryDevice.getLength() > parentBodyTube.getLength()) {
// For rule 1, device 2 should be below device 1, so just in case, put this at the bottom instead of at the top
if (bodyTubes.size() == 1) {
recoveryDevice.setAxialMethod(AxialMethod.BOTTOM);
}
offset = 0;
}
recoveryDevice.setAxialOffset(offset);