Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 17a: ACTIVE ZONES of CSG primitives Jarek Rossignac CS1050:

Similar presentations


Presentation on theme: "1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 17a: ACTIVE ZONES of CSG primitives Jarek Rossignac CS1050:"— Presentation transcript:

1 1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Lecture 17a: ACTIVE ZONES of CSG primitives Jarek Rossignac CS1050: Understanding and Constructing Proofs Spring 2006

2 2 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Lecture Objectives Learn how to Compute the positive form of a CSG tree Define the active zone Z of a primitive Compute a CSG expression of Z Use the CSG expression for classifying surfels

3 3 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is a CSG tree Consider a CSG expression: S=(A–B)+(C–D)–(EF) It may be parsed into a binary tree –Leaves correspond to primitive shapes –Nodes represent Boolean operations –Root represents solid defined by S     AB C D E F root primitives

4 4 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac A 2D example

5 5 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac A shape has many CSG reps

6 6 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac When is a primitive redundant A primitive A is redundant in S if S can be expressed using the other primitves, without A.

7 7 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Is A redundant if  A adds nothing to  S?

8 8 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac How to convert a CSG to its positive form? Apply de Morgan laws and push the complement down to the primitives Primitives complemented an odd number of times are negative (and hence unbounded)

9 9 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is the positive form of S? S=(A+B)–(C–D)–(EF)      A B C D E F  A B CC D  E FF     S = (A+B) (  C–D) (  E+  F)

10 10 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Now assume CSG is in positive form Rename the negative primitives with new names so that they become positive (although infinite) primitives A CSG tree in positive form has only union and intersection operators Hence, in what follows we need not discuss what to do with difference operators We assume that the CSG tree has been converted into its positive form and that all primitives are positive (even though some may be unbounded)

11 11 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is the path of a primitive A? The parent and ancestors of A in the CSG tree. root Nodes in the path of A primitives   AB C D E F   

12 12 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac How to compute the path? Path will be represented as a string of L or R symbols p=emptyString; path(root,p); path(n,p) { if (n.isPrimitive) { n.myPath=p; else { path(n.left, p+’L’); path(n.right, p+’R’); };   AB C D E F    LLL LR LRL LRR RL RR LL LR LLR

13 13 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What are the branching nodes? Siblings of path nodes root Branching nodes of A primitives   AB C D E F   

14 14 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What are the path and branching nodes of D? Path nodes Branching nodes   AB C D E F   

15 15 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What are i-nodes and u-nodes of A? i-nodes = branching nodes that are children of an intersection u-nodes = branching nodes that are children of a union   AB C D E F    Circle the i-nodes of A? Circle the u-nodes of A?

16 16 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Practice i-nodes and u-nodes   AB C D E F    Circle the i-nodes of C? Circle the u-nodes of C?

17 17 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is the active zone of A in S? The active zone Z of primitive A in a given CSG expression of S is the region in which changes to A affect S.

18 18 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Simple active zones

19 19 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac How are I, U, and Z of A defined? I-zone: I = intersection of the i-nodes (or the universe w if none) U-zone: U = union of the u-nodes Active zone: Z = I – U Compute I, U, and Z for A   AB C D E F    I = EF U = B+CD Z = EF – (B+CD) = EF– B –(CD)

20 20 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Practice: Shade S and Z IDENTIFY S AND Z Verify that changing A out of Z does not change S   AB C D E F    I = EF U = B+CD Z = EF – (B+CD) = EF– B –(CD) A B F E CD

21 21 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Point-in-solid test on CSG Classify(point P, node N) IF N is primitive, THEN RETURN(PMC(P,N)) ELSE RETURN(Combine(N.op, PMC(P,N.left),PMC(P,N.right)));      AB C D E F A B F E C D

22 22 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Surfel = point E on the boundary of a primitive A. Does it contribute to the boundary of S? Or can A be changed around E without affecting S? How to test a surfel

23 23 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Strategy for CSG rendering Generate a sufficiently dense set of surfels on the boundary of each primitive A –For a cylinder, place surfels on a circle and slide the circle … Classify surfels against Z Render those in Z

24 24 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Definition of S 0 and S 1 S 0 is the solid obtained by replacing A by the empty set in S S 1 is the solid obtained by replacing A by the universe in S

25 25 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Show that S 0  S  S 1 Remember that A is positive –“  ” means inclusion or equality Adding material to A can only grow S Subtracting material from A can only shrink S

26 26 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Reordering the tree to put A on the left

27 27 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Prove that S = AI+S 0 Distributing intersection over union in the reordered tree yields S=AI+X. Setting A to 0 shows that X=S 0. Similarly, we can show that S = (A+U)S 1 since (A+B 2 +B 3 )(B 1 +B 2 +B 3 )B 4S = (A+B 2 +B 3 )(B 1 +B 2 +B 3 )B 4 S= (AB 1 +B 2 +B 3 )B 4 = AB 1 B 4 +(B 2 +B 3 )B 4 = AI+S 0

28 28 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Show that AI  S  A+U S=AI+S 0 henceS=AI+S 0 hence AI  S S=(A+U)S 1 henceS=(A+U)S 1 hence S  (A+U)

29 29 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Show that S 1 =I+S 0 and S 0 =US 1 Replace A by the univese (1) in S=AI+S 0Replace A by the univese (1) in S=AI+S 0 Replace A by the empty set (0) in S=(A+U)S 1Replace A by the empty set (0) in S=(A+U)S 1

30 30 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Show that S 1 –S 0 = I–S 0 = S 1 –U Since S 1 =I+S 0, S 1 –S 0 = (I+S 0 )–S 0 = I–S 0 Since S 0 =US 1 S 1 –S 0 = S 1 – US 1 = S 1 – U

31 31 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Prove that Z = S 1 –S 0 S 1 –S 0 = (S 1 –S 0 )(S 1 –S 0 ), since X=XX = (I–S 0 )(S 1 –U), proven above = I  S 0 S 1  U, de Morgan = (IS 1 )(  S 0  U), by reordering = (IS 1 )–(S 0 +U), de Morgan = I–U, since I  S 1 and U  S 0 = Z, by definition of Z

32 32 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Show that S=AZ+S 0 S = AS 1 +  AS 0, Shanon’s expansion = AS 1 +S 0 = AS 1 +(A  S 0 +AS 0 )+S 0 = (AS 1 +A  S 0 ) + (AS 0 +S 0 ) = A(S 1 –S 0 )+S 0 = AZ+S 0A S0S0S0S0 S1S1S1S1

33 33 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Show that AZ and S 0 are disjoint A Z S 0 = A(S 1  S 0 )S 0 = AS 1 (  S 0 S 0 ) = 0

34 34 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Assigned Reading Two papers: Active Zones in CSG for Accelerating Boundary Evaluation, Redundancy Elimination, Interference Detection and Shading Algorithms –Jarek Rossignac and Herbert Voelcker –ACM Transactions on Graphics, Vol. 8, pp. 51-87, 1989. Blister: GPU-based rendering of Boolean combinations of free-form triangulated shapes –John Hable and Jarek Rossignac –ACM Transactions on Graphics, SIGGRAPH 2005.

35 35 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Assigned Project P8 Due April 4 before class Teams of 1 and 2 Create a joint web page and put a link to it from the PPPs of each team member Include in the project: –Project title: 1050 project P8: Active Zones for CSG –Names of the team members –Short description of the assignment –Definition of the active zone and explanation of how it is computed –A short description of how/why it is used in the applet –An example of a CSG expression and of the active zone expression for a primmitive –Reference to the Active Zone paper –Window with a running applet (described in the next slide) –Explanations of the User Interface commands for dragging/chaning primitives –Link to the course code

36 36 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac P8 implementation Start with your P3 assignment with a CSG editor –You will not need it tree editing (but it is nice if you have it) –You need to be able to render a CSG defined region –and to circulate which one is the current primitive –and to move the primitive Implement a recursive procedure that compute the path to each primitive and stores it with the primitive (you can represent the path as a string of characters or bits). Let A be the current primitive, Z its active zone, and S 0 the region defined by the expression S whith A replaced by the empty set Render the background in white, S 0 in blue, AZ in red, Z–A in green. Remember that S 0 and AZ are disjoint and that their union is S.

37 37 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Showing off the results for P8 Hardwire your code with an interesting CSG tree and select the default current primitive so that it has at at least 3 branching nodes, two of which being Boolean expression with two or more primtives, with at least one i-node and one u-node. In the project web page, print the CSG expression, say which primtive is the defailt active primitive, provide the CSG expressions for its I-zone, U-zone, active zone, and S 0.


Download ppt "1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 17a: ACTIVE ZONES of CSG primitives Jarek Rossignac CS1050:"

Similar presentations


Ads by Google