6. Distribute points within the volume

There are many methods of distributing points within a volume.  For simple geometries refer to the createpts command.  This example uses the regnpts command which, although more complicated, provides greate flexibility.  Points are distributed within regions using Cartesian, cylindrical or spherical coordinates by constructing rays that travel through regions and distributing points along these rays. For this example, points are distributed using Cartesian coordinates. The rays are specified by defining a set of points and a plane. For each point in the set, a ray is constructed normal to the plane passing through the point. In general rays are constructed in sets, each set is specified by a single plane and a set of points. The createpts command is used to create the points. Theregnpts command is used to specify the plane, to specify the region, and to specify the number of points to be distributed along the rays. The points and the plane should lie outside the enclosing volume and on opposite sides. The normal to the plane should point toward the point. As rays are created, if they do not pass through the specified region, no points are distributed. Points may be spaced evenly along the ray or they may be spaced according to a ratio. The following commands will place points in the unit cube.


createpts /xyz/5,5,1/0.,0.,1.1/1.,1.,1.1/1,1,0


“283” “208”


“342” “270”


“347” “308”

Other versions of the regnpts are appropriate for cylindrical and spherical geometries. For cylindrical geometries the createpts command specifies points in a cylindrical shell outside the volume. The regnpts command specifies a line (usually the cylinder axis), and the rays are constructed normal to this line and containing one of the createpts points. For spherical geometries the createpts command specifies points in a spherical shell outside the volume. The regnpts command specifies a point (usually the center of the sphere) from which rays are constructed to the createpts points.