To view this content, you need to install Java from java.com

CS1050, Spring 2006, Project 8
Active Zones for CSG
by Jacob Bolton   Email:
Submitted: April 3, 2006

n - prints out the CSG tree
p - prints our the list of Primitives
. - selects the next primitive in the list
, - selects the previous primitive in the list
> - increase radius of selected primitive
< - decrease radius of selected primitive
P - goes to the parent CSG node
L - goes to the left child CSG node
R - goes to the right child CSG node
; - changes to the next operation (operation nodes)
' - changes to the previous operation (operation nodes)
: - changes the node's primitive to the next in the list (primitive nodes)
" - changes the node's primitive to the next in the list (primitive nodes)
d - replaces this node with its left child
D - replaces this node with its right child
o - creates a new node with the current as its left child and a new primitive as its right child
O - creates a new node with the current as its right child and a new primitive as its left child
c - clears all unused primitives
t - toggle if the current primitive is unbounded
T - toggle display of active zones
i - saves an image of the current frame

The goal of this assignment is to extend our older CSG project to incorporate the calculation and displaying of the Active Zones for the currently selected primitive. The Active Zone of a particular primitive in a CSG tree is the region of space where changes to the primitive will affect the shape of the final CSG object.

The Active Zone is calculated by first taking the positive form of the CSG tree and finding the path to the target primitive. The branching nodes are then added to one of two groups, I and U, depending on whether the parent of the branch is an intersection operation or a union operation. The active zone can then be calculated by Z = I - U. A more in-depth explaination can be found in Jarek Rossignac's paper on CSG Active Zones

Active zone calculations are used in this applet to display the zones in a colorful manner. If the applet is toggled to display the active zones (default setting), the background is drawn in white, the active zone in red or green (depending on whether the target primitive is also in that location or not), and the rest of the CSG shape that is unaffected by the active zone is shown in blue.

The original CSG expression that is input into the applet is

S = (((P[0] + P[1]) + P[6]) + (P[7] + P[8])) - ((P[2] + P[5]) - (P[3] + P[4]))
The applet then converts the expression into the following positive form:
S = (((P[0] + P[1]) + P[6]) + (P[7] + P[8])) * ((P[2]' * P[5]') + (P[3] + P[4]))
The default target is set for P[6], so the applet does the following calculation to determine the active zone Z:
I = (P[2]' * P[5]') + (P[3] + P[4])
U = (P[0] + P[1]) + (P[7] + P[8])
Z = I - U = ((P[2]' * P[5]') + (P[3] + P[4])) - ((P[0] + P[1]) + (P[7] + P[8]))
S0 = S - Z

The following image shows the zones as described above and labels them:

Source code: P8

Built with Processing