Bounding Iterated Function Systems Orion Sky Lawlor olawloruiuc
Bounding Iterated Function Systems Orion Sky Lawlor olawlor@uiuc. edu CS 497 jch November 14, 2002 1
Roadmap Introduction to IFS n Rice’s Bounding Spheres n Lawlor’s Polyhedral Bounds n 2
Iterated Function Systems 3
Iterated Function Systems--IFS A finite set of “maps”— distortions of some space n Apply the maps in random order n Converges to unique “attractor” n n Equivalent to L-systems, others n E. g. , Mandelbrot set is just convergence diagram for a onemap 2 D IFS: complex squaring 4
Example IFS—Sierpinski Gasket Shape is 3 copies of itself, so we use 3 maps: 5
Example IFS—Sierpinski Gasket Shape is 3 copies of itself, so we use 3 maps: n Map to top 6
Example IFS—Sierpinski Gasket Shape is 3 copies of itself, so we use 3 maps: n Map to top n Map down right 7
Example IFS—Sierpinski Gasket Shape is 3 copies of itself, so we use 3 maps: n Map to top n Map down right n Map down left 8
Example IFS—Sierpinski Gasket Many other, equivalent options 9
IFS Gallery: Menger’s Sponge 10
IFS Gallery: Spirals 11
IFS Gallery: Five Non-Platonic Non-Solids Reproduced from Hart and De. Fanti, SIGGRAPH 1991 12
IFS Gallery: Fractal Forest Reproduced from Hart and De. Fanti, SIGGRAPH 1991 13
IFS Conclusions n An IFS is just a set of maps of space n n Pastes shape onto copies of itself IFS are useful tool for representing fractal shapes Wide variation in results n Arbitrary number of dimensions n Beautiful, natural look n Easy to produce/manipulate n 14
Sphere Bounds for IFS 15
Why bother bounding an IFS? For display, processing, etc. n Raytracing [Hart, De. Fanti ‘ 91] n Intersect rays with bounds n Replace nearest intersecting bound with a set of smaller bounds n Repeat until miss or ‘close enough’ n 16
Why Bound IFS with Spheres? n Spheres are a commonly used bounding volume for raytracing n n Invariant under rotation n n Rotate a sphere, nothing happens Closed under scaling n n Very fast intersection test—a few multiplies and adds Scale a sphere, get a sphere Easy to represent and work with 17
Recursive Bounds for IFS n Each map of the bound must lie completely within the bound n n B contains map(B) Now we just recurse to the attractor n B contains map(B)) contains map(map(B))). . . 18
Sphere Bound for IFS n Each map of the sphere must lie completely within the sphere n This is our “recursive bound” Knowns wi Map number i si Scaling factor of wi Unknowns r Radius of big sphere x Center of big sphere 19
Sphere Bound for IFS [Rice, 1996] n We require dist(x, wi (x)) + si r < r dist(x, wi (x)) si r x r Equivalently r > dist(x, wi (x))/(1 - si ) n We must pick x to minimize r n n Nonlinear optimization problem (!) 20
Sphere Bound Conclusions n Spheres are nice bounding volumes n Especially for raytracing Hart gives a heuristic for sphere bounds n Rice shows how to find optimal (recursive) sphere bound n Requires nonlinear optimization n Complex, slow (? ) n 21
Polyhedral Bounds for IFS 22
Why Bound IFS with Polyhedra? n Includes many common shapes n n Bounding boxes are the other commonly used bounding volume for raytracing n n Box, tetrahedron, octahedron, . . . A better fit for elongated objects Computers don’t like curves (nonlinear optimization); a polyhedron has no curves 23
Why not Bound IFS with Polyhedra? n Polyhedra have corners, which might stick out under rotation Can always fix by adding sides n Not so bad in practice n ! 24
Polyhedral Bound for IFS n Each map of the polyhedron should lie completely within the original polyhedron n Again, a “recursive bound” Knowns wm (x) Map number m ns Normal of side s Unknowns ds Displacement of side s 25
Polyhedron Bounding, in Words n We will require Each corner of the polyhedron n Under each map n To satisfy all polyhedron halfspaces n 26
Point-in-Polyhedron Test n Points inside polyhedron must lie inside all halfspaces n. Point lies in a halfspace if 27
Polyhedron corners (2 D Version) n The corner of sides i and j is where both halfspaces meet or, if we define 28
Polyhedron Bounding, in Equations n n We require: n Each corner of the polyhedron (linear) n Under each map (linear) n To satisfy all the halfspaces (linear) These are linear constraints (I M S of them) 29
Linear Optimization [Lawlor 2002] n We’ve reduced IFS bounding to a problem in linear optimization Constraints: Just shown n Unknowns: Displacements ds n Objective: Minimize sum of displacements? (Probably want to minimize area or length instead) n n Guaranteed to find the optimal bound if it exists (for some definition of “optimal”) 30
2 D Implementation Used open-source linear solver package lp_solve 3. 2 n Written in C++ n Generating constraints take about 40 lines (with comments) n n n Would be even shorter with a better matrix class Welded to a GUI 31
Time vs. Number of Sides O(s 4. 6) time; all in solver 32
Area vs. Number of Sides Little benefit to using more than 12 sides 33
IFS Gallery: Spirals, with Bounds 34
Convex IFS Bounds: Conclusions n Optimal polyhedron bounding using linear optimization Off-the-shelf solvers n Piles of nice theory (optimality!) n Fast enough for interactive use n n Future directions RIFS Bounding (solve for attractorlet bounds) n Implement in 3 D n 35
- Slides: 35