import com.medcosm.primitives.physics.*; /** * A simple example of a class that works with MedCosm Computer Generated Hologram Maker to * programmatically define the point sources which compose an object. Place this class in the * same directory as the startup JAR file and select it to * demonstrate how this works. * * Note that this class does *not* need to be compiled. The CGH program will * directly load and execute the .java file. *
Title: Computer Generated Hologram Maker
*Description: Hologram Simulator
*Copyright: Copyright (c) 2003
*Company: MedCosm
* @author Alan Stein * @version 1.0 */ public class testObject { public PointSourceArray createObject() { PointSourceArray object=new PointSourceArray(); PointSource p; //let's create a square as the hologram object int numPts=10; //num samples in each line // double spacing=443.0e-7; //sample at 600 DPI (in meters) double spacing=0.001; //space each dot 1 mm apart, cube is (numPts*spacing = 1cm on each side) double depth=2; //depth of cube from plate (in meters); for (int i = 0; i < numPts; i++) { p=new PointSource(0, i*spacing, depth, 1, 670e-9, 0, 0); object.addPointSource(p); } for (int i = 0; i < numPts; i++) { p=new PointSource(i*spacing, 0, depth, 1, 670e-9, 0, 0); object.addPointSource(p); } for (int i = 0; i < numPts; i++) { p=new PointSource(numPts*spacing, i*spacing, depth, 1, 670e-9, 0, 0); object.addPointSource(p); } for (int i = 0; i < numPts; i++) { p=new PointSource(i*spacing, numPts*spacing, depth, 1, 670e-9, 0, 0); object.addPointSource(p); } return object; } }