Introduction to CSG Java Applet



  This project is basically a demonstration and learning tool, which makes it easy to understand the Graphics concept of Constructive Solid Geometry by actually performing the various operations and being able to see the results in 3-D Wireframe.

  Creating complex object using Boolean set operations on simple primitives is very useful in solid modeling. This project involved creating a Java Applet which creates a mesh defining the boundary of the resulting objects. CSG operations are very interesting in that it is very easy to create the desired object by specifying simple boolean operations on the solids. In fact, this methos is highly suited to the modeling of assembly parts, which tend to be composed of regular solid shapes.

  Several alternative methods exist for modeling solid objects but were not chosen for this implementation because of certain drawbacks they incur. One such method is Spatial-Occupancy Enumeration. In this implementation, solids are approximated by their voxel images and Boolean set operations are computed point by point. Although easy to implement, this method is undesirable because both processing time and memory requirements grow order N^3 (where N is # of cells along each side of the voxel image). To overcome the space problems, modifications such as octrees and ray-reps have been devised to reduce the size of the data-structures involved. Still, these methods are subject to alias problems inherent in the rasterization of an object. A third more involved method involves representing solids as Binary-Space Partition trees. Here, a solid is defined by a set of planes with one side of each plane being defined as inside and the other outside the solid. Even though this method is efficient, users have difficulty visualizing how to construct a desired object using simple planes. The CSG representation was chosen for this implementation because of its compact representation as well as its ease in use.

  The applet allows the user to place four different basic solids - Cube, Sphere, Cylinder and Cone on the screen. The user can then manipulate each of these objects by applying the basic operations of scaling, rotation and scaling.

  Once the solids have been appropriately placed, the CSG operations of Union, intersection and Difference can be applied. Each solid that comes up on the screen is given a name and these can be used in specifying the CSG operation string.

  Currently, the solids are brought up as Wireframes, as this implementation is faster and thus it is more efficient to manipulate simple as well as composite objects. It also makes it possible to view the solids from different directions.