In this lab you will investigate implicit surface generation. Implicit surfaces are generated by finding "level surfaces" in a 3D field. That is, by placing polygons in all of the voxels which have scalar data of a certain value. The surface descriptions often take forms familar from analytical geometry. For instance, a unit sphere at the origin is described by
x^2 + y^2 + z^2 - 1.0
when a surface is fit to the points in 3D which have a value of zero.
Procedure
Download:
~yourID/.DXmacros so than when DX
starts up it will find these macros. Note the programs in this exercise
will not run without these macros.
(2*x^2 + y^2 + z^2 -1)^3 - 0.2*x^2*z^3 - y^2*z^3
creates a heart-shaped object.
Different functions of x,y,z will produce different shapes. (Note that for different functions, you may have to modify the range limits of the space defined by the Construct module.) As an example, the following image was made by defining an implicit sphere in a separate module from the heart, then morphing between them by linearly intropolating between the two 3D fields. In this case, mixing .9 of the heart 3D field with 0.1 of the sphere 3D field. The sphere used was:
x^2 + y^2 +(z+.25)^2 -.5

min(a,b) function so that the voxels which are in the
interior of either cylinder are interior to the result. (Remember that
an implicit function changes sign as the surface is crossed and that for
the surfaces used here, that points inside have a negative value.) The
image below is the result of the union of two cylinders.
Execute the programs to understand their behavior, then modify them as follows:
To get a feel for the number of polygons on this surface, add a SimplifySurface module between the isosurface module and following modules. Also add a Describe module ot the output of the SimplifySurface module. Change the the parameter in the SimplifySurface module which controls surface accuracy, while reading the object description in the Message window. The number of "data values" is also the number of vertices in the object. What is the minimum number of vertices you can use to get a reasonable approximation of a heart? You can use the Shade module with the "how" parameter set to "faceted" to see the individual polygons. Optimization of polygon count will be essential later in the semester when you deal with lots of objects.
The image below is formed as
((superquadric minus torus) union cylinder),
but with about 1% white noise added to the 3D field.
You should be able to explain your programs. You should use transmitters/receivers, macros, and comments in the "Notation" field of each module so that you and the grader can understand the program. Control panels, if any, should be well organized, labeled, and with the appropriate numeric ranges.
The Lab 11 grading guide will be filled out by a consultant during section to evaluate your work.