+ @Test
+ public void simpleTransitionWithShouldersHollow2() {
+ Transition nc = new Transition();
+
+ final double epsilonPercent = 0.001;
+ final double density = 2.0;
+
+ nc.setLength(1.0);
+ nc.setType( Transition.Shape.CONICAL );
+ nc.setForeRadius(0.5);
+ nc.setAftRadius(1.0);
+ nc.setThickness(0.25);
+ nc.setAftShoulderLength(1.0);
+ nc.setAftShoulderRadius(1.0);
+ nc.setAftShoulderThickness(0.25);
+ nc.setForeShoulderLength(1.0);
+ nc.setForeShoulderRadius(0.5);
+ nc.setForeShoulderThickness(0.25);
+
+ nc.setMaterial( new Material.Bulk("test",density,true));
+
+ System.out.println( nc.getComponentVolume() );
+
+ // Volume of filled transition =
+ double filledVolume = Math.PI /3.0 * ( 1.0*1.0 + 1.0 * 0.5 + 0.5 * 0.5 ) * 1.0;
+
+ // magic 2D cad drawing...
+ //
+ // Since the thickness < fore radius, the
+ // hollowed out portion of the transition
+ // forms a transition.
+ // the dimensions of this transition were determined
+ // using a 2d cad tool.
+
+ double innerTransitionAftRadius = 0.7205;
+ double innerTransitionForeRadius = 0.2205;
+ double innerVolume = Math.PI /3.0 * ( innerTransitionAftRadius * innerTransitionAftRadius + innerTransitionAftRadius * innerTransitionForeRadius + innerTransitionForeRadius * innerTransitionForeRadius);
+
+ double volume = filledVolume - innerVolume;
+
+ // now add aft shoulder
+ volume += Math.PI * 1.0 * 1.0 * 1.0 - Math.PI * 1.0 * 0.75 * 0.75;
+ // now add fore shoulder
+ volume += Math.PI * 1.0 * 0.5 * 0.5 - Math.PI * 1.0 * 0.25 * 0.25;
+
+
+ double mass = density * volume;
+
+ System.out.println( volume );
+
+ assertEquals( volume, nc.getComponentVolume(), epsilonPercent * volume);
+ assertEquals( mass, nc.getMass(), epsilonPercent * mass );
+ }
+