Commit in GeomConverter/test/org/lcsim/detector/solids on MAIN
TrdTest.java+30-21.1 -> 1.2
JM: Test trapezoids with simple phi placement algorithm.

GeomConverter/test/org/lcsim/detector/solids
TrdTest.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- TrdTest.java	24 Jul 2007 19:58:18 -0000	1.1
+++ TrdTest.java	27 Jul 2007 22:38:59 -0000	1.2
@@ -9,6 +9,8 @@
 import hep.graphics.heprep.HepRepType;
 import hep.graphics.heprep.HepRepTypeTree;
 import hep.graphics.heprep.HepRepWriter;
+import hep.physics.vec.BasicHep3Vector;
+import hep.physics.vec.Hep3Vector;
 
 import java.awt.Color;
 import java.io.FileOutputStream;
@@ -23,6 +25,7 @@
 import org.lcsim.detector.LogicalVolume;
 import org.lcsim.detector.PhysicalVolume;
 import org.lcsim.detector.PhysicalVolumeNavigatorStore;
+import org.lcsim.detector.Rotation3D;
 import org.lcsim.detector.Transform3D;
 import org.lcsim.detector.converter.heprep.DetectorElementToHepRepConverter;
 import org.lcsim.detector.material.IMaterial;
@@ -32,7 +35,7 @@
  * Test that writes out the HepRep for a {@link org.lcsim.detector.solids.Trd}.
  *
  * @author Jeremy McCormick
- * @version $Id: TrdTest.java,v 1.1 2007/07/24 19:58:18 jeremy Exp $
+ * @version $Id: TrdTest.java,v 1.2 2007/07/27 22:38:59 jeremy Exp $
  */
 
 public class TrdTest 
@@ -72,8 +75,33 @@
 				lvTest,
 				mom.getLogicalVolume(),
 				0);	
+			
+		double r=1500;
+		int n = 8;
 		
-		new DetectorElement("dummy",null,nav.getPath("/pvtrd"));
+		for (int i=0; i<n; i++)
+		{
+			double phi=2*Math.PI*((double)i)/n;
+			double zc=-phi-Math.PI/2;
+			 
+			double x=r*Math.cos(phi);
+			double y=r*Math.sin(phi);
+			Hep3Vector trans = new BasicHep3Vector(x,y,0);
+			Rotation3D rotate = new Rotation3D();
+			
+			rotate.setPassiveXYZ(Math.PI/2, 0, zc);
+			Transform3D transform = new Transform3D(trans,rotate); 			
+						
+			String name="pvtrd_rot_"+i;
+			new PhysicalVolume(
+					transform,
+					name,
+					lvTest,
+					mom.getLogicalVolume(),
+					i
+					);
+			new DetectorElement("dummy_"+i,null,nav.getPath("/"+name));
+		}
 	}
 	
 	public final IPhysicalVolume createWorld()
CVSspam 0.2.8