From: Bill Kuker Date: Mon, 20 Apr 2009 20:44:23 +0000 (+0000) Subject: Fixed web thickness bug X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=ef77534831dd2d87b8829fb105047a4935c27eb3;p=sw%2Fmotorsim Fixed web thickness bug --- diff --git a/src/com/billkuker/rocketry/motorsim/grain/RotatedShapeGrain.java b/src/com/billkuker/rocketry/motorsim/grain/RotatedShapeGrain.java index 3aab5d5..6b7ef0d 100644 --- a/src/com/billkuker/rocketry/motorsim/grain/RotatedShapeGrain.java +++ b/src/com/billkuker/rocketry/motorsim/grain/RotatedShapeGrain.java @@ -124,7 +124,7 @@ public class RotatedShapeGrain implements Grain { if (web != null) return web; - java.awt.geom.Area a = getCrossSection(Amount.valueOf(0, SI.MILLIMETER)); + java.awt.geom.Area a = shape.getShape(Amount.valueOf(0, SI.MILLIMETER)); Rectangle r = a.getBounds(); double max = r.getWidth() < r.getHeight() ? r.getHeight() : r .getWidth(); // The max size @@ -133,7 +133,7 @@ public class RotatedShapeGrain implements Grain { while (true) { guess = min + (max - min) / 2; // Guess halfway through log.debug("Min: " + min + " Guess: " + guess + " Max: " + max); - a = getCrossSection(Amount.valueOf(guess, SI.MILLIMETER)); + a = shape.getShape(Amount.valueOf(guess, SI.MILLIMETER)); if (a.isEmpty()) { // guess is too big max = guess;