﻿ <%BANNER%>

# Finding Intersection Curves Using Subdividable Linear Efficient Function Enclosures

PAGE 1

FINDING INTERSECTION CUR VES USING SUBDIVID ABLE LINEAR EFFICIENT FUNCTION ENCLOSURES By MINHO KIM A THESIS PRESENTED TO THE GRADUA TE SCHOOL OF THE UNIVERSITY OF FLORID A IN P AR TIAL FULFILLMENT OF THE REQUIREMENTS F OR THE DEGREE OF MASTER OF SCIENCE UNIVERSITY OF FLORID A 2004

PAGE 2

Cop yrigh t 2004 b y Minho Kim

PAGE 3

T o m y paren ts and m y sister

PAGE 4

A CKNO WLEDGMENTS I w ould lik e to thank m y advisor, Dr. J org P eters. He inspired me, guided me through all the researc h, and ga v e me in v aluable advice, suggestions, and commen ts. This thesis nev er could ha v e b een done without his help. I also w ould lik e to sho w m y gratitude to Dr. Anand Rangara jan and Dr. P aul A. Fish wic k for serving on m y committee. But most of all, mem b ers of m y family deserv e m y deep est gratitude. They ha v e alw a ys b een on m y side and c heered me up through m y en tire life. iv

PAGE 5

T ABLE OF CONTENTS page A CKNO WLEDGMENTS . . . . . . . . . . . . . . iv LIST OF FIGURES . . . . . . . . . . . . . . . . vii ABSTRA CT . . . . . . . . . . . . . . . . . . viii CHAPTER1 INTR ODUCTION . . . . . . . . . . . . . . . 1 2 PREVIOUS W ORK . . . . . . . . . . . . . . 3 2.1 Ov erview . . . . . . . . . . . . . . . . 3 2.2 Analytic Metho ds . . . . . . . . . . . . . 3 2.3 Lattice Ev aluation Metho ds . . . . . . . . . . 4 2.4 Marc hing Metho ds . . . . . . . . . . . . . 4 2.5 Sub division Metho ds . . . . . . . . . . . . 5 3 BA CK GR OUND KNO WLEDGE . . . . . . . . . . . 7 3.1 SLEFE (Sub dividable Linear Ecien t F unction Enclosure) . . 7 3.1.1 Ov erview . . . . . . . . . . . . . . 7 3.1.2 Theoretical Basis . . . . . . . . . . . 7 3.1.3 Width of the SLEFE . . . . . . . . . . 11 3.1.4 Example . . . . . . . . . . . . . . 11 3.1.5 T ensoring SLEFEs . . . . . . . . . . . 15 3.1.6 Mid-structure . . . . . . . . . . . . 16 3.1.7 Extension to Curv es and Surfaces . . . . . . . 16 3.1.8 In v erse of Mid-structure . . . . . . . . . . 17 4 PR OCEDURE . . . . . . . . . . . . . . . . 18 4.1 Constructing Mid-structures of T ensor-pro duct B ezier Surfaces . 18 4.2 Finding the In tersection of Mid-structures . . . . . . 19 4.2.1 Finding the In tersection of Tw o T riangles . . . . . 19 4.2.2 Finding the T op ology of Piecewise Linear In tersection Curv es 22 4.2.3 In v erting Pircewise Linear Curv es to B-Spline Curv es . 25 5 ANAL YSIS . . . . . . . . . . . . . . . . . 26 5.1 Ev aluating an Exact In tersection . . . . . . . . . 26 v

PAGE 6

5.2 Measuring T olerance . . . . . . . . . . . . 27 6 CONCLUSION AND FUTURE W ORK . . . . . . . . . 34 REFERENCES . . . . . . . . . . . . . . . . . 35 BIOGRAPHICAL SKETCH . . . . . . . . . . . . . . 37 vi

PAGE 7

LIST OF FIGURES Figure page 3{1 Hat function. . . . . . . . . . . . . . . . 12 3{2 SLEFEs of a 1 with its con trol p oin ts. . . . . . . . . . 14 3{3 Example of mid-structure. . . . . . . . . . . . . 16 3{4 Bounding b o xes of SLEFEs at break p oin ts. . . . . . . . 17 4{1 In tersection of triangle and line segmen t. . . . . . . . . 19 4{2 Making triangle edges exclusiv e of eac h other. . . . . . . 22 4{3 Degenerate cases of triangle-triangle in tersection. . . . . . 23 4{4 Constructing the top ology of in tersection curv es. . . . . . . 24 5{1 Finding simple b oundaries for a line segmen t. . . . . . . 28 5{2 T olerance according to the in tersection angle. . . . . . . . 28 5{3 T olerance with resp ect to the in tersection angle. . . . . . . 30 5{4 Example 1. Tw o surfaces in tersecting eac h other. . . . . . 30 5{5 Exact in tersection curv e. . . . . . . . . . . . . 31 5{6 Mid-structures. . . . . . . . . . . . . . . . 31 5{7 In tersection of t w o mid-structures. . . . . . . . . . . 32 5{8 The B-Spline curv e in v erted. . . . . . . . . . . . 32 5{9 T olerance of the in tersection curv e. . . . . . . . . . 33 5{10 Example 2. Tw o surfaces with the tolerance of its in tersection curv e. 33 vii

PAGE 8

Abstract of Thesis Presen ted to the Graduate Sc ho ol of the Univ ersit y of Florida in P artial F ulllmen t of the Requiremen ts for the Degree of Master of Science FINDING INTERSECTION CUR VES USING SUBDIVID ABLE LINEAR EFFICIENT FUNCTION ENCLOSURES By Minho Kim August 2004 Chair: J org P eters Ma jor Departmen t: Computer and Information Science and Engineering Finding the in tersection of t w o surfaces, usually a collection of curv es, is an imp ortan t c hallenge in mo deling geometry This thesis presen ts a metho d to nd parametric (b-spline) in tersection curv es whic h appro ximate the actual in tersection curv es of t w o B ezier surfaces. W e rst appro ximate the original surfaces using SLEFEs (Sub dividable Linear Ecien t F unction Enclosures) and their mid-structures. The piecewise linear curv es, whic h are the in tersections of t w o mid-structures, are in v erted to the b-spline curv es whic h appro ximate the exact in tersection curv es. Our metho d is fast, has kno wn error b ounds, and generates b-spline curv es, whic h are v ery useful for man y applications. Moreo v er, our metho d can b e rened with the guaran tee of decreasing error b ound. viii

PAGE 9

CHAPTER 1 INTR ODUCTION Finding the in tersection of t w o surfaces, Surface/Surface In tersection (SSI), pla ys an imp ortan t role in the follo wing areas: CAD (Computer-Aided Design): trimming curv es [ 1 2 ], b oundary represen tation [ 1 3 ], CSG (Constructing Solid Geometry) [ 3 ] man ufacturing: to ol path generation [ 1 4 ] computer animation: in terference detection [ 4 ] feature recognition [ 4 5 ] computer graphics: hidden surface remo v al [ 4 ], visibilit y computations [ 4 ] engineering: grid generation [ 2 4 ] scien tic visualization [ 4 5 ]. Except for a few sp ecial cases, it is dicult to nd the exact in tersection. The dicult y arises from sev eral asp ects. First, ev en for surfaces of lo w p olynomial degree, the in tersection curv e is t ypically of high degree. F or example, the in tersection curv e of t w o tensor-pro duct bicubic B ezier surfaces can b e as high as 324 [ 4 ]. Moreo v er, some geometric complexities, whic h are, constrictions (near singular or singular cases) [ 5 ], small lo ops, singularities, and m ultiple branc hes at the singularities mak e it more dicult [ 4 ]. In addition, the imprecision in tro duced b y n umerical errors in nite precision computations mak es it more complicated [ 5 ]. This thesis presen ts a metho d for appro ximating the in tersection of t w o B ezier surfaces with tolerance guaran tees. Ev en though the in tersection of t w o surfaces usually consists of isolated p oin ts, a set of curv es, a set of o v erlapping surfaces, or an y com bination of these cases [ 3 6 7 8 ], w e can fo cus on curv es since the 1

PAGE 10

2 appro ximation excludes singular cases. Our metho d excels on sp eed and pro duces a useful output curv e. Moreo v er, it is renable with decreasing tolerance guaran teed.

PAGE 11

CHAPTER 2 PREVIOUS W ORK 2.1 Ov erview Due to the strong demand men tioned earlier, there is a ric h b o dy of literature in v estigating SSI. According to the approac hes they tak e, the metho ds can b e categorized [ 5 9 10 11 ] in to four classes: analytic metho ds [ 1 5 12 ], lattic e evaluation metho ds [ 8 ], mar ching metho ds [ 10 13 ], and sub division metho ds [ 2 3 6 9 7 14 15 ]. Some metho ds use the com binations of those metho ds. They are called hybrid metho ds [ 4 ]. 2.2 Analytic Metho ds A nalytic metho ds deriv e the equation whic h describ es the in tersection of t w o surfaces and tries to nd the solution of the equation [ 5 ]. But the p ossible high degree of the equation mak es this metho d limited to sev eral kinds of the surfaces. In Gradine [ 1 ] and Gradine and Klein IV[ 12 ], Grandine sees the SSI problem as a sp ecial case of the more general c ontouring pr oblem Rather than the usual system of n equations in n v ariables, the con touring problem has few er, sa y k equations than v ariables, and has ( n k )-dimensional manifold as its solutions in the nonsingular cases. The SSI problem is the case of k = n 1, and th us has curv es as the solutions [ 1 12 ]. Before solving the nonlinear system, he rst tries to nd the top ology of the in tersection curv es. Ev en though this pro cess requires the class of the surfaces to b e restricted, it reduces the initial v alue problem o v er an unkno wn parameter in terv al to a b oundary v alue problem o v er a xed, sp ecied in terv al, th us eliminating man y problems arising b efore. T o solv e the nonlinear system, he applies spline c ol lo c ation and gets the solution parameterized b y arclength [ 1 12 ]. 3

PAGE 12

4 P atrik alakis [ 5 ] rst transforms the problem of nding the in tersection of t w o surfaces to the in tersection of a surface and a plane and mak es it p ossible to use the sub division metho d. He tries to nd the signic ant p oints (b order p oin ts, turning p oin ts, and singular p oin ts) using adaptive sub division and minimization But this metho d is not general b ecause it dep ends on the a v ailabilit y of a Bernstein p olynomial represen tation of the in tersection curv e, whic h th us restricts the class of the surfaces. F or more general cases, he in tro duces the oriente d distanc e function and tries to nd the zero set of it. 2.3 Lattice Ev aluation Metho ds L attic e evaluation metho ds are based on the idea that if w e x one of the v ariables of the tensor-pro duct surface, the surface b ecomes a curv e. In other w ords, w e appro ximate one of the surfaces b y a set of curv es and calculate the in tersection of the surface and eac h of the curv es, whic h th us reduces the dimensionalit y of surface in tersections [ 5 ]. This metho d has a disadv an tage in that w e ma y miss some imp ortan t features dep ending on the resolution of the grid. This metho d is not only used as an indep enden t metho d to nd the in tersection of the surfaces [ 8 ], but it is used as a part of other metho ds. F or example, P atrik alakis uses this metho d to nd the initial appro ximation for the c ol line ar normal p oints whic h then are used to nd the critic al p oints [ 5 ]. In addition, man y of the marc hing metho ds use this metho d to nd the starting p oint [ 5 ]. 2.4 Marc hing Metho ds Mar ching metho ds also called curve tr acing schemes [ 12 ], curve fol lowing schemes [ 12 ], or c ontinuation metho ds [ 10 14 ], can b e used for the more general cases. The basic idea b ehind it is to trace the p oin ts on the in tersection curv e from the starting p oint whic h is already kno wn on the in tersection curv e. But dep ending on the step size, this metho d also ma y miss some imp ortan t features and jump to other segmen ts of the curv e when t w o curv es are v ery close to eac h other. T o nd

PAGE 13

5 the starting p oin ts for ev ery branc h is also a c hallenge and man y of the metho ds rely on the lattice ev aluation or sub division metho ds to nd them [ 5 ]. Ab del-Malek and Y eh rst try to nd the starting p oin ts using the Mo or ePenr ose pseudo-inverse of the subJacobian. T o trace the p oin ts on the curv e, they use the Pr e dictor-Corr e ctor metho d. In addition, the r ow-r ank deciency of the Jacobian is used to detect the singularities along the curv e [ 10 ]. 2.5 Sub division Metho ds Sub division metho ds can b e used for most general cases. They adopt the famous divide-and-c onquer sc heme to nd the in tersection. Ev en though they do not require the starting p oin ts, whic h is an imp ortan t adv an tage, they also ma y miss some imp ortan t features and the top ology of the in tersection curv es [ 5 ]. This is also the case of our metho d b ecause w e appro ximate original surfaces. Lanquetin et al. [ 9 ] presen t the metho d to nd the in tersection curv es of t w o sub division surfaces. A t the initial sub division step, they nd the piecewise linear in tersection curv e using the bruteforce triangle-triangle in tersection. But after the initial sub division step, they use one of t w o strategies to reduce the n um b er of triangles tested for the in tersection. In the neighb orho o d algorithm they consider only the 1-neigh b orho o d of the previous in tersecting curv es. The other algorithm uses the bip artite gr aph to reduce the n um b er of triangles in v olv ed [ 9 ]. Gleic her and Kass also use the b ounding v olumes, sp ecically AABB (AxisAligned Bounding Bo x), for the domain and interval arithmetic [ 15 ]. This metho d is impro v ed b y Henrique b y using ane arithmetic instead of the in terv al arithmetic [ 14 ]. Hub er uses the b ounding v olumes to nd the in tersection. If t w o b ounding v olumes are in tersecting, one of the domains is split in to t w o domains and calculated again un til the giv en tolerance is satised. He uses in terv al arithmetic to compute the b ounding v olumes [ 3 6 7 ].

PAGE 14

6 Jean and Hamann triangulate the surfaces using the adaptive triangulation metho d and nd the in tersection curv es of t w o triangle meshes, whic h are the linear spline curv es. They use the k-d tr e e structure to build the space-partitioning tree, th us reducing the n um b er of triangles in v olv ed. They also in tro duce an additional renemen t step [ 2 ].

PAGE 15

CHAPTER 3 BA CK GR OUND KNO WLEDGE 3.1 SLEFE (Sub dividable Linear Ecien t F unction Enclosure) 3.1.1 Ov erview The Sub dividable Linear Ecien t F unction Enclosure (SLEFE) is a tec hnique whic h constructs piecewise linear enclosure for a nonlinear function [ 16 17 18 19 ]. Instead of constructing the enclosures for the function directly whic h is slo w, SLEFE tries to construct the enclosure of its basis functions, whic h can b e done o-line fast. Because enclosures of basis functions do not c hange once the basis functions and the n um b er of linear pieces to enclose them are determined, they can b e tabulated, th us making it fast to construct SLEFEs. Ev en though this metho d migh t b e less optimal compared to constructing the enclosures of the giv en function directly SLEFEs are v ery go o d L 1 appro ximands, and, moreo v er, they can b e rened with the guaran tee of decreasing tolerance. 3.1.2 Theoretical Basis The SLEFE is based on t w o general lemmas. Let x = b T x b e the function of whic h w e are trying to nd the SLEFEs where b is the basis function v ector of the v ector space B to whic h x b elongs. Lemma 1 (c hange of basis) Given two nite-dimensional ve ctor sp ac es of functions, B 6 = H s := dim B dim ( B \ H ) ( b i ) i =1 ; ;dim B a b asis of B ( a i ) i =1 ; ;s functions in B and line ar maps L : B H ; : B R s ; 7

PAGE 16

8 such that (i) ( j a i ) i;j is the identity in R s s and (ii) k er = k er ( E L ) (wher e E is the emb e dding identity) then for any x := b x 2 B ( b L b ) x = ( a L a ) ( x ) : (3.1) Let d = dim B a = 266664 a T1 b ... a Ts b 377775 = 266664 a 1 ; 1 : : : a 1 ;d ... . ... a s; 1 : : : a s;d 377775 b = M a b : In addition, let matrices M L and M denote the linear maps L and eac h. In other w ords, L ( x ) = L ( b T x ) = b T M L x and ( x ) = ( b T x ) = M x : Then, w e can transform ( 3.1 ) using matrices as follo ws,: ( b L b ) x = ( a L a ) ( x ) b T x L ( b T x ) = ( M a b ) T ( M x ) L (( M a b ) T M x ) b T x b T M L x = ( M a b ) T ( M x ) L ( b T M Ta M x ) b T x b T M L x ) = b T M Ta ( M x ) b T M L M Ta M x b T ( x M L x ) = b T ( M Ta M x M L M Ta M x ) : (3.2)

PAGE 17

9 No w, from (i) w e kno w M M Ta = I therefore x = M x = ( M M Ta ) M x = M ( M Ta M ) x th us M x M ( M Ta M ) x = M ( I M Ta M ) x = 0 whic h means ( I M Ta M ) x is a k ernel of M ( ii ) means that the k ernel of M and E M L are the same. Therefore ( E M L )( I M Ta M ) x = 0. No w w e get ( E M L )( I M Ta M ) x = 0 ( E M L ) x = ( E M L ) M Ta M x ( E M L ) x = ( M Ta M L M Ta )( M x ) : x M L x = M Ta M x M L M Ta M x : By m ultiplying b T on b oth sides, w e get ( 3.2 ). Note this lemma from another view. Giv en t w o nite-dimensional v ector space B and H let L b e an ortho gonal pr oje ction map from B on to its subspace B \ H In other w ords, L ( x ) is the orthogonally pro jected image of x on B \ H where x is a function in B Then w e can easily c hange the basis functions of L ( x ) to those of H b ecause L ( x ) 2 H No w x L ( x ) is left. Because L is an orthogonal pro jection map, x L ( x ) is orthogonal to the subspace B \ H and lies in another subspace B H of whic h dimension is s = dim ( B H ) = dim B dim ( B \ H ). Therefore w e can express x L ( x ) using only s n um b er of v ectors, sa y a = [ a 1 a 2 a s ] T whic h are linearly indep enden t of eac h other in B H W e can no w imagine a v ector space A of whic h basis functions are a Let b e the linear map from B to A Then all the functions ( a i ) i =1 ; ;s in B should b e mapp ed to the unit v ectors in A The condition \ ( i )( j a i ) i;j is

PAGE 18

10 the identity in R s s is equiv alen t to this one. But when express L L ( x ) using a w e should remo v e all the comp onen ts lying in B \ H th us a L ( a ). Because the functions in the v ector space A are orthogonal to the subspace B \ H all the functions lying in B \ H will b e mapp ed to zero in A b y the linear map These functions also will b e mapp ed to zero b y the linear map E L b ecause for those lying in B \ H L ( x ) = x that is the pro jected image is the same with itself. This condition is equiv alen t to \ ( ii ) k er = k er ( E L ) (wher e E is the emb e dding identity)." Lemma 2 (b ounds) If, with the denitions of L emma 1 additional ly the maps x x : B s H s and x x : B s H satisfy a L a a L a a L a c omp onentwise on every p oint of a domain U and ( x ) + ( i ) := max f 0 ; x ( i ) g and ( x ) ( i ) := min f 0 ; x ( i ) g then x := Lx + a L a ( x ) + + a L a ( x ) ; x := Lx + a L a ( x ) + a L a ( x ) + sandwiches x on U : x x x F rom Lemma 1 w e no w get x = L ( x ) + ( a L a ) ( x ) : W e can easily c hange the basis of L ( x ) to the basis of H b ecause L ( x ) 2 H but w e cannot c hange the basis of ( a L a ) ( x ), whic h is a L a Instead, w e can enclose it with the functions in H whic h are a L a for the lo w er b ound and a L a for the upp er b ound. T o enclose the function x w e ha v e to c ho ose the basis function, dep ending on its co ecien ts. F or example, to nd the lo w er b ound of the function x w e ha v e to c ho ose the lo w er b ound of the basis for the p ositiv e co ecien ts, but w e ha v e to c ho ose the upp er b ound of the basis for the negativ e ones.

PAGE 19

11 Then all the basis functions of x and x are h and therefore w e can enclose the function x with the basis functions of H In other w ords, x = h T u x = h T l : Here, w e can notice that a L a and a L a do not c hange according to the co ecien ts x whic h mak es it fast to nd SLEFEs. 3.1.3 Width of the SLEFE The width of the SLEFE can b e dened as w sl ef e = max U ( x x ) = max U f ( a L a a L a )( x ) + ( a L a a L a )( x ) g = max U f ( a L a a L a )( x ) + + ( a L a a L a )( x ) g = max U d 1 X i =1 ( a i L a i a i L a i ) j i x j : If is a se c ond dier enc e map w sl ef e is anely invariant That is wh y w e c ho ose a second dierence map for in practice. 3.1.4 Example Here is a simple example. Let us consider a univ eriate cubic p olynomial function in B ezier form x ( u ) := b T x where x = [ x 0 x 1 x 2 x 3 ] T b = [ b 0 b 1 b 2 b 3 ] T b i = 3! (3 i )! i (1 u ) 3 i u i :

PAGE 20

12 6 h ( x 1 ) 4 h ( x 1 / 3 ) 2 h ( x ) 0 1 / 3 2 / 3 1 h ( x ) 1 3 h ( x 2 / 3 ) ( a ) ( b ) Figure 3{1: (a) Hat function and (b) piecewise linear function pro duced b y a linear com bination of hat functions. W e c ho ose the basis functions of H as the hat functions b ecause w e w an t to enclose x with a piecewise linear function. The linear com bination of hat functions h ( x i=n ) is a piecewise linear function with its break p oin ts at f i=n j i = 0 ; : : : ; n g (Figure 3{1 ). Let h b e the basis functions of H : h = [ h 0 h 1 h 2 h 3 ] T h i = h ( x i= 3) where h ( x ) is a hat function. F unctions in H are piecewise linear functions with their break p oin ts on 0, 1 = 3, 2 = 3 and 1. But using the basis b w e can express only the linear functions without an y break p oin ts. Therefore, orthogonally pro jecting x to its subspace B \ H is equiv alen t to selecting the linear parts from x whic h is (1 u ) x 0 + ux 3

PAGE 21

13 W e therefore get L ( x ) = (1 u ) x 0 + ux 3 = 1 u 0 0 u 266666664 x 0 x 1 x 2 x 3 377777775 = (1 u ) 3 3 u (1 u ) 2 3 u 2 (1 u ) u 3 1 3 266666664 3 0 0 0 2 0 0 1 1 0 0 2 0 0 0 3 377777775 266666664 x 0 x 1 x 2 x 3 377777775 = b T M L x %end of therefore M L = 1 3 266666664 3 0 0 0 2 0 0 1 1 0 0 2 0 0 0 3 377777775 : No w w e ha v e to c ho ose the linear map W e c ho ose a second dierence op erator to mak e the width s sl ef e anely in v arian t ( 3.1.3 ), and therefore M = 264 1 2 1 0 0 1 2 1 375 M a = 1 3 264 0 2 1 0 0 1 2 0 375 b ecause M M Ta = I No w a L a = M a b ( b T M L M Ta ) T

PAGE 22

14 Figure 3{2: SLEFEs of a 1 with its con trol p oin ts. = M a b M a M TL b = ( M a M a M TL ) b = 0BBBBBBB@ 1 3 264 0 2 1 0 0 1 2 0 375 1 3 264 0 2 1 0 0 1 2 0 375 1 3 266666664 3 2 1 0 0 0 0 0 0 0 0 0 0 1 2 3 377777775 1CCCCCCCA b = 1 3 264 0 2 1 0 0 1 2 0 375 b th us w e get a 1 = 1 3 [0 2 1 0] b and a 2 = 1 3 [0 1 2 0] b : a 1 is depicted in Figure 3{2 with its SLEFEs and con trol p oin ts [ 18 ]. Because the pro cess to construct the SLEFEs of a 1 and a 2 are oine, w e can use an y metho d, suc h as optimization, to construct them.

PAGE 23

15 3.1.5 T ensoring SLEFEs Let x ( s; t ) = d s X i =0 d t X j =0 x i;j b i ( s ) b j ( t ) = b ( s ) T Xb ( t ) b e a tensor-pro duct p olynomial x ( s; t ) in the v ector space B B where X is the co ecien t matrix with its comp onen ts x i;j and b ( s ) and b ( t ) are the basis functions in the Bernstein p olynomial form with their degrees d s and d t eac h. No w let x i = [ x i; 0 x i;d t ] T then x ( s; t ) = b ( s ) T Xb ( t ) = b ( s ) T 266664 x T0 ... x Td s 377775 b ( t ) = b ( s ) T 266664 b ( t ) T x 0 ... b ( t ) T x d s 377775 = b ( s ) T x ( t ) : F or eac h b ( t ) T x i w e can enclose them with x ( t ) = h ( t ) T u ti and x ( t ) = h ( t ) T l ti where h ( t ) is the m -piecewise linear hat function. Let us consider the upp er b ound rst.x ( s; t ) = b ( s ) T x ( t ) b ( s ) T 266664 h ( t ) T u t0 ... h ( t ) T u td s 377775 = b ( s ) T 266664 ( u t0 ) T ... ( u td s ) T 377775 h ( t ) = b ( s ) T 266664 u t0 ; 0 : : : u t0 ;m ... . ... u td s ; 0 : : : u td s ;m 377775 h ( t ) = 266664 b ( s ) T 266664 u t0 ; 0 ... u td s ; 0 377775 : : : b ( s ) T 266664 u t0 ;m ... u td s ;m 377775 377775 h ( t ) [ h ( s ) T u 0 h ( s ) T u n ] h ( t ) = h ( s ) T Uh ( t )

PAGE 24

16 Figure 3{3: Example of mid-structure. A bi-quadratic B ezier patc h ( left ) nely ev aluated, ( midd le ) appro ximated b y sampling, and ( right ) its mid-structure [ 18 ]. where h ( s ) is an n -piecewise linear function, u j = [ u 0 ;j u n;j ] T and U is an n m matrix with its elemen t of u j;i The lo w er b ound case is straigh tforw ard. 3.1.6 Mid-structure The mid-structure x = ( x + x ) = 2 can b e used as a go o d L 1 appro ximand of the function x and has the tolerance of w sl ef e = 2. F or surfaces in 3D, the mid-structure can b e used as a w a y of triangulation. Compared to other triangulation metho ds as adaptive triangulation it is m uc h faster but still has reasonable tolerance. Figure 3{3 sho ws the mid-structure of a bi-quadratic B ezier patc h [ 18 ]. W e are trying to nd the in tersection b y using the mid-structure to appro ximate the t w o surfaces. 3.1.7 Extension to Curv es and Surfaces When w e extend SLEFEs to curv es and surfaces in 2D or 3D space, w e get the SLEFE for eac h comp onen t separately ( x and y comp onen ts for 2D case and x y and z comp onen ts for 3D case). Because all the comp onen ts

PAGE 25

17 Figure 3{4: Bounding b o xes of SLEFEs at break p oin ts. are indep enden t of eac h other, w e get 2 D pairs of p oin ts, whic h construct a D dimensional axis aligned b ounding b o x at eac h break p oin t, as Figure 3{4 sho ws for the 2D case. Due to the linearit y the original curv e or surface is conned in the c onvex c ombinations of the b o xes (Figure 3{4 ). But w e need to simplify the enclosures to mak e them more useful. But when w e deal with mid-structures, w e do not ha v e to care ab out this issue b ecause the mid-p oin t for eac h b ounding b o x is unique.3.1.8 In v erse of Mid-structure W e can get the original co ecien ts x from its mid-structure x = ( x + x ) = 2 = L ( x ) + ( a + L a + a + L a )( x ) = 2 (3.3) b ecause a + L a and a + L a are tabulated, and the op erator is giv en (second dierence), therefore w e get the original function. This in v erted function can b e used as an appro ximand of the piecewise linear function x with kno wn tolerance. W e get the B-Spline form of the in tersection curv e b y in v erting the piecewise linear curv e, whic h is the in tersection of the mid-structures of t w o surfaces.

PAGE 26

CHAPTER 4 PR OCEDURE 4.1 Constructing Mid-structures of T ensor-pro duct B ezier Surfaces The SubLiME pac k age (h ttp://www.cise.ur.edu/researc h/SurfLab) pro vides utilit y functions whic h nd SLEFEs of sev eral kinds of p olynomial functions with v arious degrees and n um b er of break p oin ts. Here is the utilit y function whic h nds the SLEFEs for a tensor-pro duct B ezier surface int tpSlefe ( REAL *coeff, int strideu, int stridev, int degu, int degv, int segu, int segv, REAL* upper, REAL* lower, int stride slefeu, int stride slefev); where coeff : co ecien ts of B ezier surface strideu stridev : strides b et w een co ecien ts for eac h direction degu degv : degree of Bernstein p olynomial for eac h direction segu segv : n um b er of piecewise linear segmen ts for eac h direction (= # of break p oin ts 1) upper lower : arra ys where the upp er and lo w er b ounds at eac h break p oin t are stored. stride slefeu stride slefev : strides b et w een SLEFE b ounds for eac h direction. As men tioned in 3.1.7 w e ha v e to call this function for eac h x y and z comp onen t. 18

PAGE 27

19 v 1 v 2 v 3 p 1 p 1 p Figure 4{1: In tersection of triangle and line segmen t. 4.2 Finding the In tersection of Mid-structures T o nd the in tersection of t w o mid-structures, the collection of piecewise linear curv es, w e rst need to nd the in tersections of all the pairs of triangles in eac h triangle mesh. After that, w e construct the piecewise linear curv es b y connecting the line segmen ts prop erly 4.2.1 Finding the In tersection of Tw o T riangles T o nd the in tersection of t w o triangles, w e need to c hec k the in tersection of eac h edge of one triangle with the other triangle, th us six in tersection tests. In tersection of a line segmen t and a triangle. A p oin t p inside a triangle (including its v ertices and edges) can b e expressed as a con v ex com bination of the v ertices v 1 v 2 and v 3 as follo ws: p = t 1 v 1 + t 2 v 2 + t 3 v 3 (4.1) where t 1 + t 2 + t 3 = 1 t 1 0 t 2 0 t 3 0 :

PAGE 28

20 And a p oin t on a line segmen t (including its end p oin ts) can b e expressed as a con v ex com bination of t w o end v ertices p 1 and p 2 : p = s p 1 + (1 s ) p 2 (4.2) where 0 s 1. No w w e can express all the equations as follo ws: 266666664 p 2 ;x p 2 ;y p 2 ;z 1 377777775 = 266666664 v 1 ;x v 2 ;x v 3 ;x p 2 ;x p 1 ;x v 1 ;y v 2 ;y v 3 ;y p 2 ;y p 1 ;y v 1 ;z v 2 ;z v 3 ;z p 2 ;z p 1 ;z 1 1 1 0 377777775 266666664 t 1 t 2 t 3 s 377777775 : Let M b e the 4 4 matrix ab o v e. Then w e can nd t 1 t 2 t 3 and s b y m ultiplying the in v erse matrix of M on b oth sides. If all four are non-negativ e, w e can sa y the line segmen t in tersects with the triangle. In most cases, t w o triangles do not in tersect or they in tersect in a line segmen t. T o connect suc h line segmen ts correctly afterw ards, w e need to iden tify eac h in tersection p oin t uniquely F or the nonsingular and generate cases, a com bination of index of the edge whic h in tersects with the other triangle index of the triangle mesh where the ab o v e edge b elongs index of the triangle whic h in tersects with the edge ab o v e can b e used to iden tify an in tersection p oin t. (Because w e ha v e only t w o triangle meshes, it is enough to ha v e only the mesh index of the edge.) Singular cases. The singular cases are: when an y pair of the three v ertices of the triangle are same when all the v ertices of the triangle lie on the same line when the t w o end p oin ts of the line segmen t are the same when the line segmen t is parallel to the plane where the triangle lies.

PAGE 29

21 F or simplicit y w e deal only with nonsingular cases. W e can a v oid most of the singular cases b y additional renemen t of the SLEFEs. Once it is conrmed that they in tersect (nonsingular case), w e can easily nd the in tersection p oin t using ( 4.1 ) or ( 4.2 ). Degenerate cases. There are three kinds of degenerate in tersection p oin ts. 1. when t w o v ertices from eac h triangle meet (red p oin ts in Figure 4{3 ) 2. when one v ertex of one triangle and one edge of the other triangle meet but not at an y of the end p oin ts of the edge (blue p oin ts in Figure 4{3 ) 3. when t w o edges from eac h triangle meet but not at an y of the end p oin ts (green p oin ts in Figure 4{3 ) Degenerate cases cause the in tersection test to generate duplicated in tersection p oin ts, whic h are actually the same. So w e need an additional algorithm to prev en t suc h cases. 1. If v ertex v 1 1 of one triangle T 1 lies on the other triangle T 2 duplicated in tersection p oin ts ma y b e found b y the in tersection test of t w o edges e 12 and e 13 whic h share the v ertex v 1 1 T o prev en t it, w e mak e the edges exclusiv e of eac h other (Figure 4{2 ). In other w ords, an y p oin t on the edge e ji is dened as tv j i 1 + (1 t ) v j i +1 (4.3) where 0 < t 1, i + k = ( i + k + 3) mo d 3, and j 2 f 1 ; 2 g Notice the range of t do es not include 1, whic h mak es the edges exclusiv e of eac h other. 2. T o correctly iden tify the in tersection p oin ts, when an y of the v ertices is also an in tersection p oin t, instead of using the three prop erties as the iden tier, w e use index of the v ertex index of the mesh where the v ertex b elongs as the iden tier. This iden tier has a higher priorit y than the previous one when comparing t w o in tersection p oin ts.

PAGE 30

22 v 1 v 2 v 3 v 1 v 1 v 2 v 2 v 3 v 3 e 3 e 2 e 1 Figure 4{2: Making triangle edges exclusiv e of eac h other. 3. If t w o v ertices from eac h triangle in tersect, an y of the v ertices can b e used as the iden tier. T o mak e it unique, w e use the v ertex index of T 2 as the iden tier. 4. If t w o edges from eac h triangle in tersect, an y of the edges can b e used as the edge index of the iden tier. T o a v oid this, w e use the edge index of T 2 as the edge index of the iden tier. Figure 4{3 sho ws the v arious degenerate cases. W e can nd some singular cases in the gure. With some more tests for the singular cases, w e can use the same algorithm to uniquely iden tify the in tersection p oin ts. But w e do not deal with the singular cases in our implemen tation. 4.2.2 Finding the T op ology of Piecewise Linear In tersection Curv es After collecting all the in tersecting line segmen ts, w e need to connect them prop erly Eac h in tersection line segmen t is comp osed of one or t w o in tersection p oin ts. Because w e w an t to appro ximate the in tersection curv es with B-Spline curv es, w e ignore the case of one in tersection p oin t. In addition, w e assume all the v ertices can b e shared b y t w o edges at most, otherwise w e cannot apply the in v ersion pro cess. If an y v ertex if shared b y more than t w o edges, w e connect only pairs of them th us making them separate. Using the iden tier of eac h in tersection p oin t, as describ ed b efore, the in tersection curv e can b e constructed as follo ws. A t an y step, there is a collection of piecewise linear curv es constructed so far. Eac h piecewise linear curv e consists of a list of in tersection p oin ts. F or an incoming

PAGE 31

23 Figure 4{3: Degenerate cases of triangle-triangle in tersection. Red, blue, and green p oin ts denote eac h v ertex-v ertex, v ertex-edge, and edge-edge cases. in tersection line segmen t, its t w o end p oin ts are compared with the rst and last p oin ts of eac h piecewise linear curv e. The top ology of the curren t curv es c hange according to the new line segmen t as follo ws (Figure 4{4 ): 1. Eac h t w o end p oin ts are the same with the rst and last p oin ts of the same curv e: The curv e b ecomes closed b y the new in tersection line segmen t. No new p oin t is added. 2. Tw o end p oin ts are the same with the rst or last p oin ts of t w o dieren t curv es: The curv es are merged together. No new p oin t is added. 3. Only one of the end p oin ts is the same with the rst or last of a curv e: The other end p oin t is added to the curv e. 4. None of the t w o end p oin ts is the same with the rst or last of an y curv e. The new curv e is created with the t w o end p oin ts as its rst and last p oin ts.

PAGE 32

24 c a s e 1 c a s e 2 c a s e 3 c a s e 4Figure 4{4: Constructing the top ology of in tersection curv es.

PAGE 33

25 4.2.3 In v erting Pircewise Linear Curv es to B-Spline Curv es The SubLiME pac k age also pro vides the utilit y functions whic h can b e used to in v ert a piecewise linear curv e to a B-Spline curv e. It also pro vides a function for a closed curv e called bspInvClosed The function for an op en curv e is as follo ws: int bspInv(REAL* mid, int cpnum, int deg, int mid stride, REAL* coeff, int stride); where mid : co ordinates of mid-structure (piecewise linear curv e) to b e in v erted to a B-Spline curv e cpnum : n um b er of v ertices of mid-structure deg : degree of B-Spline curv e mid stride : stride of v ertices of mid-structure coeff : arra y where con trol p oin ts of resulting B-Spline curv e will b e stored stride : stride of con trol p oin ts Usage of the function for the closed curv e is the same.

PAGE 34

CHAPTER 5 ANAL YSIS 5.1 Ev aluating an Exact In tersection T o see ho w close our appro ximation is to the exact in tersection, w e need to nd the exact in tersection. But as describ ed earlier, the exact in tersection can b e found only for a few cases. One of the cases is to nd the pro jection of a curv e C lying in xy -plane on the B ezier surface S H where its con trol p oin ts are the height elds of xy -plane. If w e sw eep the curv e C along z -axis, w e can get a surface S C and the pro jection on the surface S H of C can b e considered as the in tersection of the t w o surfaces S H and S C (Figure 5{4 ). In this case, w e can ev aluate the exact in tersection using comp osition as follo ws. Let the domain D H of S H b e the unit square of u v plane where 0 u; v 1, and D C of C b e the unit length line segmen t of t axis where 0 t 1. W e need to ev aluate the p oin ts on the in tersection curv es corresp onding to 0 t 1. F or a giv en t v alue, w e can easily ev aluate the corresp onding p oin t ( x C ( t ) ; y C ( t )) on C W e no w need to map this p oin t to a ( u; v ) v alue of D H Let ( x H ( u; v ) ; y H ( u; v ) ; z H ( u; v )) b e the p oin t on S H Because the x and y co ordinate v alues of S H are regularly lo cated, w e can linearly map a p oin t ( x; y ) on the x y plane to D H In other w ords, u = ax H ( u; v ) + b = ax C ( t ) + b v = cy H ( u; v ) + d = cx C ( t ) + d where a and c are not zeros b ecause x and y co ordinate v alues of S H are same with those of C No w w e can ev aluate the z co ordinate v alue of the in tersection p oin t 26

PAGE 35

27 using ( u; v ). Therefore the p oins on the in tersection curv e is ( x C ( t ) ; y C ( t ) ; z H ( ax C ( t ) + b; by C ( t ) + d )) : Figure 5{5 sho ws an exact in tersection curv e ev aluated in this w a y 5.2 Measuring T olerance T o measure the tolerance of the appro ximated in tersection curv e, w e need to simplify its SLEFEs. Let us examine the 2D case. W e can easily extend it to the 3D case. As men tioned b efore, at eac h break p oin t, the enclosing b ounds built b y SLEFEs result in an axis-aligned b o x. T o mak e it simple to measure the tolerance of in tersection, w e need the upp er and lo w er b ounds to b e (i) p ar al lel with the mid-structur e and (ii) have the same distanc e fr om the mid-structur e T o do this, w e nd the planes eac h con taining the corners of the b ounding b o xes at the break p oin ts and select the one with maxim um distance from the mid-structure. W e need to nd and c hec k N 2 D n um b er of planes where N is the n um b er of break p oin ts for eac h mid-structure segmen t and D is the dimension. F or example, 2 2 2 = 8 n um b er of planes are found and c hec k ed in 2D case (Figure 3{2 ). In the 3D case, w e ma y ha v e 3 2 3 n um b er of planes b ecause w e need to nd suc h b ounds for eac h triangle. Then w e get a pair of SLEFEs whic h satisfy our conditions. A plane can b e expressed as d = n x = n T x where n is the normal v ector. If n is normalize d d is the distance of the plane from the origin. In other w ords, all the p oin ts on the plane ha v e the same distance from the origin if they are pro jected to the same normal v ector n Therefore, the distance of the plane where a p oin t p b elongs and has normal v ector n is n T p By comparing suc h distance of all the p oin ts, w e can nd the plane whic h

PAGE 36

28 1 x D 1 y D 2 x D 2 y D Figure 5{1: Finding simple b oundaries for a line segmen t. q q q q e 1 e 2 q q q q f s i n c o s 2 s i n ) 1 8 0 c o s ( 2 c o s 2 2 1 2 2 2 1 2 1 2 2 2 1 2 1 2 2 2 1 e e e e e e e e l l l l e + + = + = + = q s i n 1 1 e l = q s i n 2 2 e l = q f = 1 8 0 Figure 5{2: T olerance according to the in tersection angle.

PAGE 37

29 is the farthest from the plane of mid-structure. In other w ords, the tolerance of a mid-structure segmen t (triangle in 3D case) e is e = max i j n T p i d j where n is the normlized normal v ector of the plane where the triangle lies, p i is one of the corner p oin ts, and d is the distance of the mid-structure segmen t from origin. No w, let us consider the case when t w o SLEFEs in tersect (Figure 5{2 ). F rom the gure, w e can nd that the in tersection p oin t of t w o SLEFEs is enclosed in a parallelepip ed and the maxim um tolerance is half of its longer diagonal. If the SLEFEs in tersect with the angle < 90 the tolerance is e = p e 21 + e 22 + 2 e 1 e 2 cos sin where e 1 and e 2 are the tolerance of eac h SLEFE. Figure 5{3 sho ws the tolerance with v arious in tersection angles and ratio of t w o tolerances. As it sho ws, the tolerance increases rapidly as the in tersection angle gets close to zero. F or eac h pair of triangles, w e can nd a line segmen t with its tolerance. W e can imagine a cylinder for eac h line segmen t of whic h the radius is the tolerance. The exact in tersection curv e is guaran teed to b e inside of suc h cylinders for eac h corresp onding segmen t (Figure 5{9 ). By in v erting the piecewise linear curv es to B-Spline curv es, w e get additional error b ounds s sl ef e = 2 b et w een the line segmen t and its corresp onding B-Spline curv e segmen t. Therefore the o v erall tolerance is just e + s sl ef e = 2.

PAGE 38

30 0 10 20 30 40 50 60 70 80 90 0 1 2 3 4 5 6 7 8 9 10 intersection angletolerancee1=e2 e1=2e2 e1=3e2 Figure 5{3: T olerance with resp ect to in tersection angle and ratio of b ounding spheres. x -axis denotes the in tersection angle, e 1 is xed to 1 and from the b ottom curv e, e 2 = 1 ; 2 ; 3 ; : : : and so on. Figure 5{4: Example 1. Tw o surfaces in tersecting eac h other. The cylindrical surface is constructed using four B ezier patc hes.

PAGE 39

31 Figure 5{5: Example 1. Exact in tersection curv e computed as describ ed. Figure 5{6: Mid-structures of Figure 5{4

PAGE 40

32 Figure 5{7: In tersection of t w o mid-structures in Figure 5{6 Figure 5{8: The B-Spline curv e in v erted from Figure 5{7

PAGE 41

33 Figure 5{9: T olerance of the in tersection curv e in Figure 5{7 illustrated b y cylinder ab out the linear segmen ts. Figure 5{10: Example 2. Tw o surfaces with the tolerance of its in tersection curv e.

PAGE 42

CHAPTER 6 CONCLUSION AND FUTURE W ORK T o appro ximate the in tersection curv es of t w o surfaces, w e triangulate the original surfaces using mid-structures of SLEFEs. The piecewise linear in tersection curv es of these t w o triangle meshes are in v erted to B-Spline curv es to appro ximate the in tersection curv es. T o impro v e the result, w e can apply v arious metho ds to eac h pro cess. First, b ecause nding the enclosing b ounds in the basis space is oine, w e can apply v arious metho ds. F or example, w e can use some optimization metho ds to minimize the width of the SLEFEs. T o mak e the upp er and lo w er SLEFEs alw a ys parallel, w e ma y b e able to mak e the upp er and lo w er SLEFEs parallel in basis space. All suc h impro v emen ts do not aect the eciency b ecause they are once-and-all pro cesses. If w e w an t to use the mid-structure as a metho d of triangulation, rather than using the mid-p oin ts to get the mid-structure, w e can nd an indep enden t piecewise linear curv e whic h appro ximates the basis function and use this to get the mid-structures. Because the pro cess of triangulating the original surfaces is separated from the pro cess of appro ximating the piecewise linear curv e using B-Spline curv es, w e can use other metho ds to triangulate the surfaces only if the tolerance is kno wn. But other triangulation metho ds are probably slo w er than the SLEFE metho d. 34

PAGE 43

REFERENCES  Thomas A. Grandine, \Applications of Con touring," SIAM R eview v ol. 42, no. 2, pp. 297{316, Jun. 2000.  B. A. Jean and Bernd Hamann, \An ecien t surface-surface in tersection algorithm using adaptiv e surface triangulations and space partitioning trees," Mathematic al Engine ering in Industry v ol. 7, no. 1, pp. 25{40, Sep. 1998.  Ernst Hub er, \In tersecting general parametric surfaces using b ounding v olumes," in Pr o c e e dings of the 10th Canadian Confer enc e on Computational Ge ometry | CCCG'98 pp. 52{53, Mon treal, Qu eb ec, Canada, Aug. 1998.  Shank ar Krishnan and Dinesh Mano c ha, \An ecien t surface in tersection algorithm based on lo w er-dimensional form ulation," A CM T r ansactions on Gr aphics v ol. 16, no. 1, pp. 74{106, Jan. 1997.  Nic holas M. P atrik alakis, \Surface-to-surface in tersections," IEEE Computer Gr aphics and Applic ations v ol. 13, no. 1, pp. 89{95, Jan. 1993.  Ernst Hub er, \Surface-to-surface in tersection based on triangular parameter domain sub division," in Pr o c e e dings of the 11th Canadian Confer enc e on Computational Ge ometry | CCCG'99 pp. 100{102, V ancouv er, British Colum bia, Canada, Aug. 1999.  Wilhelm Barth and Ernst Hub er, \Computations with tigh t b ounding v olumes for general parametric surfaces," in Pr o c e e dings of 15th Eur op e an Workshop on Computational Ge ometry | CG'99 pp. 123{126, An tib es, F rance, Mar. 1999.  R. E. Barnhill, G. F arin, M. Jordan and B. R. Pip er, \Surface/surface in tersection," Computer A ide d Ge ometric Design v ol. 4, no. 1{2, pp. 3{16, Jul. 1987.  S. Lanquetin, S. F oufou, H. Kheddouci and M. Nev eu, \Computing sub division surface in tersection," in Pr o c e e dings of WSCG '2003 pp. 73{76, Campus Bory Plzen Bory Czec h Republic, F eb. 2003.  K. Ab del-Malek and H. J. Y eh, \Determining in tersection curv es b et w een surfaces of t w o solids," Computer-A ide d Design v ol. 28, no. 6{7, pp. 539{549, Jun.{Jul. 1996.  Edwin Bo ender, \A surv ey of in tersection algorithms for curv ed surfaces," Computers & Gr aphics v ol. 15, no. 1, pp. 109{115, 1991. 35

PAGE 44

36  Thomas A. Grandine and F rederic k W. Klein IV, \A new approac h to the surface in tersection problem," Computer A ide d Ge ometric Design v ol. 14, no. 2, pp. 111{134, F eb. 1997.  C. L. Ba ja j, C. M. Homann, R. E. Lync h and J. E. H. Hop croft, \T racing surface in tersections," Computer A ide d Ge ometric Design v ol. 5, no. 4, pp. 285{307, No v. 1988.  Luiz Henrique de Figueiredo, \Surface in tersection using ane arithmetic," in Pr o c e e dings of the Confer enc e on Gr aphics Interfac e '96 pp. 168{175, Ma y 1996.  M. Gleic her and M. Kass, \An in terv al renemen t tec hnique for surface in tersection," in Pr o c e e dings of the Confer enc e on Gr aphics Interfac e '92 pp. 242{249, V ancouv er, British Colum bia, Canada, Ma y 1992.  J org P eters and Xiaobin W u, \Optimized renable surface enclosure," T e chnic al r ep ort Univ ersit y of Florida, Oct. 2000.  J org P eters and Xiaobin W u, \On the optimalit y of piecewise linear maxnorm enclosures based on slefes," in Pr o c e e dings of Curve and Surfac e Design: Saint-Malo 2002 pp. 335{344, Sain t-Malo, F rance, Jul. 2002.  J org P eters, \Ecien t one-sided linearization of spline geometry ," in Pr o c e e dings of The Mathematics of Surfac es X pp. 297{319, Leeds, UK, Sep. 2003.  Da vid Lutterk ort and J org P eters, \Optimized renable enclosure of m ultiv ariate p olynomial pieces," Computer A ide d Ge ometric Design v ol. 18, no. 9, pp. 851{863, No v. 2001.  G. F arin, \An SSI bibliograph y ," in R. Barnhil l, e ditor, Ge ometry Pr o c essing for Design and Manufacturing pp. 205{207, SIAM, Philadelphia, Jan. 1992.

PAGE 45

BIOGRAPHICAL SKETCH Minho Kim w as b orn on Marc h 3, 1974, in Seoul, Republic of Korea. He receiv ed his Bac helor of Science degree in electrical engineering in 1997 from Seoul National Univ ersit y Seoul, Republic of Korea. In 2004, he receiv ed his Master of Science degree from the Departmen t of Computer and Information Science and Engineering at the Univ ersit y of Florida. His ma jor researc h area is computer graphics. 37

PAGE 46

I certify that I ha v e read this study and that in m y opinion it conforms to acceptable standards of sc holarly presen tation and is fully adequate, in scop e and qualit y as a thesis for the degree of Master of Science. J org P eters, J org P eters Asso ciate Professor of CISE I certify that I ha v e read this study and that in m y opinion it conforms to acceptable standards of sc holarly presen tation and is fully adequate, in scop e and qualit y as a thesis for the degree of Master of Science. Anand Rangara jan Asso ciate Professor of CISE I certify that I ha v e read this study and that in m y opinion it conforms to acceptable standards of sc holarly presen tation and is fully adequate, in scop e and qualit y as a thesis for the degree of Master of Science. P aul Fish wic k Professor of CISE

PAGE 47

This thesis w as submitted to the Graduate F acult y of the College of Engineering and to the Graduate Sc ho ol and w as accepted as partial fulllmen t of the requiremen ts for the degree of Master of Science. August 2004 Pramo d P Khargonek ar Dean, College of Engineering Winfred M. Phillips Dean, Graduate Sc ho ol

PAGE 48

TITLE OF THE DISSER T A TION Minho Kim (352) 377-3788 Departmen t of Computer and Information Science and Engineering Chair: J org P eters Degree: Master of Science Graduation Date: August 2004 En ter the text of y ou general audience abstract here.

 Permanent Link: http://ufdc.ufl.edu/UFE0005702/00001

## Material Information

Title: Finding Intersection Curves Using Subdividable Linear Efficient Function Enclosures
Physical Description: Mixed Material
Copyright Date: 2008

## Record Information

Source Institution: University of Florida
Holding Location: University of Florida
Rights Management: All rights reserved by the source institution and holding location.
System ID: UFE0005702:00001

 Permanent Link: http://ufdc.ufl.edu/UFE0005702/00001

## Material Information

Title: Finding Intersection Curves Using Subdividable Linear Efficient Function Enclosures
Physical Description: Mixed Material
Copyright Date: 2008

## Record Information

Source Institution: University of Florida
Holding Location: University of Florida
Rights Management: All rights reserved by the source institution and holding location.
System ID: UFE0005702:00001

## This item has the following downloads:

Full Text

FINDING INTERSECTION CURVES
USING
SUBDIVIDABLE LINEAR EFFICIENT FUNCTION ENCLOSURES

By

MINHO KIM

A THESIS PRESENTED TO THE GRADUATE SCHOOL
OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT
OF THE REQUIREMENTS FOR THE DEGREE OF
MASTER OF SCIENCE

UNIVERSITY OF FLORIDA

2004

Copyright 2004

by

Minho Kim

To my parents
and
my sister

ACKNOWLEDGMENTS

I would like to thank my advisor, Dr. Jorg Peters. He inspired me, guided

me through all the research, and gave me invaluable advice, -ii..-i- -lions, and

comments. This thesis never could have been done without his help. I also would

like to show my gratitude to Dr. Anand Rangarajan and Dr. Paul A. Fishwick for

serving on my committee.

But most of all, members of my family deserve my deepest gratitude. They

have always been on my side and cheered me up through my entire life.

TABLE OF CONTENTS

page

ACKNOWLEDGMENTS ............

LIST OF FIGURES ..............

ABSTRACT ...................

CHAPTER

1 INTRODUCTION ............

2 PREVIOUS WORK ............

2.1 Overview ...............
2.2 Analytic Methods ..........
2.3 Lattice Evaluation Methods ..
2.4 Marching Methods .........
2.5 Subdivision Methods ........

3 BACKGROUND KNOWLEDGE .....

3.1 SLEFE (Subdividable Linear Efficient Function Enclosure)
3.1.1 O verview . . . . . .
3.1.2 Theoretical Basis ...................
3.1.3 Width of the SLEFE ................
3.1.4 Exam ple . . . . . .
3.1.5 Tensoring SLEFEs .. ................
3.1.6 M id-structure . . . . . .

3.1.7
3.1.8

Extension to Curves and Surfaces
Inverse of Mid-structure .......

4 PROCEDURE .................. ............. .. 18

4.1 Constructing Mid-structures of Tensor-product B6zier Surfaces .18
4.2 Finding the Intersection of Mid-structures . . 19
4.2.1 Finding the Intersection of Two Triangles . ... 19
4.2.2 Finding the Topology of Piecewise Linear Intersection Curves 22
4.2.3 Inverting Pircewise Linear Curves to B-Spline Curves .. 25

5 ANALYSIS .............. ................. 26

5.1 Evaluating an Exact Intersection ................. .. 26

5.2 Measuring Tolerance ............... ... .. 27

6 CONCLUSION AND FUTURE WORK ..... .......... 34

REFERENCES .............. ... ......... .... 35

BIOGRAPHICAL SKETCH ................ ... ......... 37

LIST OF FIGURES
Figure page

3-1 Hat function. .............................. 12

3-2 SLEFEs of al with its control points. ................ 14

3-3 Example of mid-structure. .................. .... .. 16

3-4 Bounding boxes of SLEFEs at break points. . . ..... 17

4-1 Intersection of triangle and line segment. .. . . ...... 19

4-2 Making triangle edges exclusive of each other. . . 22

4-3 Degenerate cases of triangle-triangle intersection. . . ... 23

4-4 Constructing the topology of intersection curves . . .... 24

5-1 Finding simple boundaries for a line segment. . . 28

5-2 Tolerance according to the intersection angle. . . 28

5-3 Tolerance with respect to the intersection angle. . . .. 30

5-4 Example 1. Two surfaces intersecting each other. . . ... 30

5-5 Exact intersection curve. ............... ... .. 31

5-6 Mid-structures. ............... ......... .. 31

5-7 Intersection of two mid-structures ................ .. .. 32

5-8 The B-Spline curve inverted. ............. . .. 32

5-9 Tolerance of the intersection curve. .................. 33

5-10 Example 2. Two surfaces with the tolerance of its intersection curve. 33

Abstract of Thesis Presented to the Graduate School
of the University of Florida in Partial Fulfillment of the
Requirements for the Degree of Master of Science

FINDING INTERSECTION CURVES
USING
SUBDIVIDABLE LINEAR EFFICIENT FUNCTION ENCLOSURES

By

Minho Kim

August 2004

Chair: Jorg Peters
I. i r' Department: Computer and Information Science and Engineering

Finding the intersection of two surfaces, usually a collection of curves, is

an important challenge in modeling geometry. This thesis presents a method

to find parametric (b-spline) intersection curves which approximate the actual

intersection curves of two B6zier surfaces. We first approximate the original

surfaces using SLEFEs (Subdividable Linear Efficient Function Enclosures) and

their mid-structures. The piecewise linear curves, which are the intersections of two

mid-structures, are inverted to the b-spline curves which approximate the exact

intersection curves. Our method is fast, has known error bounds, and generates

b-spline curves, which are very useful for many applications. Moreover, our method

can be refined with the guarantee of decreasing error bound.

CHAPTER 1
INTRODUCTION

Finding the intersection of two surfaces, Surface/Surface Intersection (SSI),

plays an important role in the following areas:

CAD (Computer-Aided Design): trimming curves [ ], boundary representa-

tion [ ], CSG (Constructing Solid Geometry) []

manufacturing: tool path generation [ ]

computer animation: interference detection [

feature recognition[, ]

computer graphics: hidden surface removal [ ], visibility computations [ ]

engineering: grid generation ]

scientific visualization [ ].

Except for a few special cases, it is difficult to find the exact intersection. The

difficulty arises from several aspects. First, even for surfaces of low polynomial

degree, the intersection curve is typically of high degree. For example, the intersec-

tion curve of two tensor-product bicubic B6zier surfaces can be as high as 324 [ ].

Moreover, some geometric complexities, which are, constrictions (near singular or

singular cases) [ ], small loops, singularities, and multiple branches at the singulari-

ties make it more difficult [ ]. In addition, the imprecision introduced by numerical

errors in finite precision computations makes it more complicated [ ].

This thesis presents a method for approximating the intersection of two B6zier

surfaces with tolerance guarantees. Even though the intersection of two surfaces

usually consists of isolated points, a set of curves, a set of overlapping surfaces,

or any combination of these cases [ ], we can focus on curves since the

2

approximation excludes singular cases. Our method excels on speed and produces a

useful output curve. Moreover, it is refinable with decreasing tolerance guaranteed.

CHAPTER 2
PREVIOUS WORK

2.1 Overview

Due to the strong demand mentioned earlier, there is a rich body of literature

investigating SSI. According to the approaches they take, the methods can be

categorized [ ,] into four classes: .ii/;:'i methods [ ], lattice

evaluation methods [ marching methods [ and subdivision methods

[ , ]. Some methods use the combinations of those methods. They
are called .i1,.:1./ methods [ ].

2.2 Analytic Methods

1Anili,.:, methods derive the equation which describes the intersection of two

surfaces and tries to find the solution of the equation [ ]. But the possible high

degree of the equation makes this method limited to several kinds of the surfaces.

In Gradine [ ] and Gradine and Klein IV[ ], Grandine sees the SSI problem

as a special case of the more general control, ii, problem. Rather than the usual

-i,-1 ii of n equations in n variables, the contouring problem has fewer, say k,

equations than variables, and has (n k)-dimensional manifold as its solutions

in the nonsingular cases. The SSI problem is the case of k = n 1, and thus has

curves as the solutions [ ]. Before solving the nonlinear system, he first tries

to find the topology of the intersection curves. Even though this process requires

the class of the surfaces to be restricted, it reduces the initial value problem

over an unknown parameter interval to a boundary value problem over a fixed,

specified interval, thus eliminating many problems arising before. To solve the

nonlinear system, he applies spline collocation and gets the solution parameterized

by arclength [ ].

Patrikalakis [ ] first transforms the problem of finding the intersection of two

surfaces to the intersection of a surface and a plane and makes it possible to use

the subdivision method. He tries to find the ..:,iI'.:? n,/1 points (border points,

turning points, and singular points) using adaptive subdivision and minimization.

But this method is not general because it depends on the availability of a Bernstein

polynomial representation of the intersection curve, which thus restricts the class of

the surfaces. For more general cases, he introduces the oriented distance function

and tries to find the zero set of it.

2.3 Lattice Evaluation Methods

Lattice evaluation methods are based on the idea that if we fix one of the vari-

ables of the tensor-product surface, the surface becomes a curve. In other words,

we approximate one of the surfaces by a set of curves and calculate the intersection

of the surface and each of the curves, which thus reduces the dimensionality of

surface intersections [ ]. This method has a disadvantage in that we may miss some

important features depending on the resolution of the grid.

This method is not only used as an independent method to find the intersec-

tion of the surfaces [ ], but it is used as a part of other methods. For example,

Patrikalakis uses this method to find the initial approximation for the collinear

normal points, which then are used to find the critical points [ ]. In addition, many

of the marching methods use this method to find the starting point [ ].

2.4 Marching Methods

lii, .,:.i methods, also called curve tracing schemes [ ], curve following

schemes [ ], or continuation methods [ ], can be used for the more general

cases. The basic idea behind it is to trace the points on the intersection curve from

the -1. iil ,. point, which is already known on the intersection curve. But depending

on the step size, this method also may miss some important features and jump to

other segments of the curve when two curves are very close to each other. To find

the starting points for every branch is also a challenge and many of the methods

rely on the lattice evaluation or subdivision methods to find them [ ].

Abdel-Malek and Yeh first try to find the starting points using the Moore-

Penrose pseudo-inverse of the subJacobian. To trace the points on the curve, they

use the Predictor-Corrector method. In addition, the row-rank .1, .,7. ,:I of the

Jacobian is used to detect the singularities along the curve [ ].

2.5 Subdivision Methods

Subdivision methods can be used for most general cases. They adopt the

famous divide-and-conquer scheme to find the intersection. Even though they do

not require the starting points, which is an important advantage, they also may

miss some important features and the topology of the intersection curves [ ]. This

is also the case of our method because we approximate original surfaces.

Lanquetin et al. [ ] present the method to find the intersection curves of two

subdivision surfaces. At the initial subdivision step, they find the piecewise linear

intersection curve using the bruteforce triangle-triangle intersection. But after the

initial subdivision step, they use one of two strategies to reduce the number of

triangles tested for the intersection. In the neighborhood 1ii','il/ i, they consider

only the 1-neighborhood of the previous intersecting curves. The other algorithm

uses the bipartite qiratip to reduce the number of triangles involved [ ].

Gleicher and Kass also use the bounding volumes, specifically AABB (Axis-

Aligned Bounding Box), for the domain and interval arithmetic [ ]. This method

is improved by Henrique by using affine arithmetic instead of the interval arith-

metic [ ].

Huber uses the bounding volumes to find the intersection. If two bounding vol-

umes are intersecting, one of the domains is split into two domains and calculated

again until the given tolerance is satisfied. He uses interval arithmetic to compute

the bounding volumes [ ].

6

Jean and Hamann triangulate the surfaces using the adaptive t,.:,,,i,.1;.. :

method and find the intersection curves of two triangle meshes, which are the linear

spline curves. They use the k-d tree structure to build the space-partitioning tree,

thus reducing the number of triangles involved. They also introduce an additional

refinement step [ ].

CHAPTER 3
BACKGROUND KNOWLEDGE

3.1 SLEFE (Subdividable Linear Efficient Function Enclosure)

3.1.1 Overview

The Subdividable Linear Efficient Function Enclosure (SLEFE) is a technique

which constructs piecewise linear enclosure for a nonlinear function [ ].

Instead of constructing the enclosures for the function directly, which is slow,

SLEFE tries to construct the enclosure of its basis functions, which can be done

off-line fast. Because enclosures of basis functions do not change once the basis

functions and the number of linear pieces to enclose them are determined, they can

be tabulated, thus making it fast to construct SLEFEs. Even though this method

might be less optimal compared to constructing the enclosures of the given function

directly, SLEFEs are very good L" approximands, and, moreover, they can be

refined with the guarantee of decreasing tolerance.

3.1.2 Theoretical Basis

The SLEFE is based on two general lemmas.

Let x = b'x be the function of which we are trying to find the SLEFEs where

b is the basis function vector of the vector space B to which x belongs.

Lemma 1 (change of basis) Given two finite-dimensional vector spaces of

functions, B / s := dimB dim(B n -H ),(bi)i ,...,diam a basis of B, (a), 1,,...,s

functions in B, and linear maps

L : B- A :B--IR,

such that (i)(Aja)~j, is the *.7, ,l.li in RSX' and (ii)kerA = ker(E L) (where E is

the embedding .,. iil,,i) then for any x := b x E B,

(b- Lb) x (a- La) (Ax).

(3.1)

d =dim B

aTb a,,i

aTb a1,i
SMb.

In addition, let matrices ML and MA

other words,

L(x)

and

A(x)

... al,d

b

... a,,d_

denote the linear maps L and A each. In

SL(bx)

bTMLX

SA(bTx)

SMax.

Then, we can transform (3.1) using matrices as follows,:

(b Lb) x

bTx L(bTx)

bTx bTMLX

bTx bTMLx)

bT(x MLX)

(a La) (Ax)

(Mab)T(Mx) L((Mab)TMAx)

(Mab)T(MZx) -L(bTMMzAx)

bTM (Max) bTMLM MA

bT(MTMax MLM MAX).

(3.2)

Now, from (i) we know MAM' = I, therefore

Ax MAx (MAMT)MAX

SMa(MTMa)x

thus

Max- M (M MA)x = M (I- M M )x 0

which means (I MTMA)x is a kernel of MA. (ii) means that the kernel of MA

and E ML are the same. Therefore (E ML)(I MMA)x = 0. Now we get

(E- ML)(I- MTMA)x 0

(E ML)x (E ML)MM

(E M)x (M MLM (Max).

x-MLX MLMax- MCMT Max.

By multiplying bT on both sides, we get (3.2).

Note this lemma from another view.

Given two finite-dimensional vector space B and H7, let L be an orlt..,., !

projection map from B onto its subspace B n 'H. In other words, L(x) is the

orthogonally projected image of x on B n 7H where x is a function in B. Then we

can easily change the basis functions of L(x) to those of 'H because L(x) E 'H. Now

x L(x) is left. Because L is an orthogonal projection map, x L(x) is orthogonal

to the subspace B n 'H and lies in another subspace B 'H of which dimension is

s = dim(B H) = dimB dim(B n ). Therefore we can express x L(x) using

only s number of vectors, say a = [ai a2 a ]T, which are linearly independent of

each other in B H. We can now imagine a vector space A of which basis functions

are a. Let A be the linear map from B to A. Then all the functions (ai)i1,...,s

in B should be mapped to the unit vectors in A. The condition "(i)(jai)i,j is

the .i1. Ldli in RW 8" is equivalent to this one. But when express L L(x) using

a, we should remove all the components lying in B n 7 thus a L(a). Because

the functions in the vector space A are orthogonal to the subspace B n 7 all the

functions lying in B n will be mapped to zero in A by the linear map A. These

functions also will be mapped to zero by the linear map E L because for those

lying in B n 'H, L(x) = x, that is the projected image is the same with itself. This

condition is equivalent to "(ii)kerA = ker(E L) (where E is the embedding

., ;,I.:1,.i)."

Lemma 2 (bounds) If, with the .7. ,P1i:i. of Lemma 1, additionally the maps

x --- : sB --- and x : B --U -ii a La < a La < a La

componentwise on every point of a domain U, and (Ax) (i) := max{0, Ax(i)}, and

(Ax)_ (i) : min{0, Ax(i)} then

x : Lx + a La (Ax)+ + a La (Ax)_,

S:=Lx + a- La (Ax)_ + a- La (Ax)+

sandwiches x on U: x < x <-.

From Lemma 1, we now get

x = L(x) + (a La) (Ax).

We can easily change the basis of L(x) to the basis of -H because L(x) E 7H, but we

cannot change the basis of (a La) (Ax), which is a La. Instead, we can enclose

it with the functions in -H, which are a La for the lower bound and a La for

the upper bound. To enclose the function x, we have to choose the basis function,

depending on its coefficients. For example, to find the lower bound of the function

x, we have to choose the lower bound of the basis for the positive coefficients, but

we have to choose the upper bound of the basis for the negative ones.

Then all the basis functions of x and 7 are h, and therefore we can enclose the

function x with the basis functions of F. In other words,

x h T

7X = hT1.

Here, we can notice that a La and a La do not change according to the

coefficients x, which makes it fast to find SLEFEs.

3.1.3 Width of the SLEFE

The width of the SLEFE can be defined as

,,. e = max(T )
U
max{(a La- a La)(Ax) (a- La- a La)(Ax)_}
U
max{(a La- a La)(Ax) +(a- La- a La)(-Ax)_}
d-l
Smax (a,- La a, Lai)|Aix|.
i= 1

If A is a second difference map, Wslefe is affi',' 1, invariant. That is why we

choose a second difference map for A in practice.

3.1.4 Example

Here is a simple example.

Let us consider a univeriate cubic polynomial function in B6zier form

x(u) := bTX

where

x = [x0 X1 X2 X3]T

b [bo bl b2 b3]T

3 3-i
bi (3- i)!i!( )3- t"

1

h (x)

(a)

6h(x-)
4h(x-1/3) 3h(x-2/3)

0 1/3 2/3 1

(b)

Figure 3-1: (a) Hat function and (b) piecewise linear function produced by a linear
combination of hat functions.

We choose the basis functions of R- as the hat functions because we want to

enclose x with a piecewise linear function. The linear combination of hat functions

h(x i/n) is a piecewise linear function with its break points at {i/n0i = 0,..., n}

(Figure 3-1). Let h be the basis functions off T:

h = [ho hi h2 h3

h = h(x i/3)

where h(x) is a hat function.

Functions in R-1 are piecewise linear functions with their break points on 0,

1/3, 2/3 and 1. But using the basis b, we can express only the linear functions

without any break points. Therefore, orthogonally projecting x to its subspace

B n R-1 is equivalent to selecting the linear parts from x, which is (1 u)xo + ux3.

13

We therefore get

L(x) = (1 U)xo + ux

xo

\ 1
S -u 0 0 u
x2

X3

3 0 0 0 xo

1 0 0 2 x1

0 0 0 3 a3

SbTML

,,i of therefore
3000

12001
ML -
ML 3 1 0 0 2

0003

Now we have to choose the linear map A. We choose a second difference

operator to make the width Sslefe affinely invariant (3.1.3), and therefore

1 -2 1 0
MA =
0 1 -2 1

1 0 -2 -1 0
Ma -
S 30 -1 -2 0

because M aM, = I.

Now

Mab (bTMML )

a La

Figure 3-2: SLEFEs of al with its control points.

Mab MaM b

(Ma MaM)b

10
3 0

0
3 0
3 0 .

0 l 0

0 3 0

0
b
0

thus we get

1
a, [0
3

2 1 ]b

and
1
a2 -[0 1 2 ]b.
3
al is depicted in Figure 3-2 with its SLEFEs and control points [ ]. Because the

process to construct the SLEFEs of al and a2 are offline, we can use any method,

such as optimization, to construct them.

-1 0

2 0 3

3210

0000

0000

0123

b

3.1.5 Tensoring SLEFEs

Let
de dt
x(s,t) 0 xijbi(s)bj(t)
i=0 j=0
b(s)TXb(t)

be a tensor-product polynomial x(s, t) in the vector space B x B where X is

the coefficient matrix with its components xwj and b(s) and b(t) are the basis

functions in the Bernstein polynomial form with their degrees d, and dt each. Now

let x, = [xio xidt]T then

Sb(t)Txo

x(s, t) = b(s)TXb(t) = b(s)T 3 b(t) b(s)T

T b(t)Tx
Sb(s)x(t).

For each b(t)Tx,, we can enclose them with r(t) = h(t)Tu and x(t) h(t)T

where h(t) is the m-piecewise linear hat function. Let us consider the upper bound

first.

x(s, t) = b(S)T(t)

h(t)7u (ut)T Io ... u,
< b(s)T b(s)T h(t) =b(s)T h(t)

h(t)Tu (u )U T ,o ... Ui
t t
U0,0 U,,
b(s)T ... b(s)T h(t)
t t
Ud,o Ud,min
< [h(s)Tuo ... h(s)Tu,]h(t)

S h(s)TUh(t)

Figure 3-3: Example of mid-structure. A bi-quadratic B6zier patch (left) finely
evaluated, (middle) approximated by -.,iiliii-. and (right) its mid-structure[ ].

where h(s) is an n-piecewise linear function, uj = [uo,j ... u,j]T and U is an nx m

matrix with its element of uj,i. The lower bound case is straightforward.

3.1.6 Mid-structure

The mid-structure

= (X+ x)/2

can be used as a good L" approximand of the function x and has the tolerance of

w'lf6e/2. For surfaces in 3D, the mid-structure can be used as a way of triangu-

lation. Compared to other triangulation methods as adaptive ti .:,,, ;.uli ':. it is

much faster but still has reasonable tolerance. Figure 3-3 shows the mid-structure

of a bi-quadratic B6zier patch [ ].

We are trying to find the intersection by using the mid-structure to approxi-

mate the two surfaces.

3.1.7 Extension to Curves and Surfaces

When we extend SLEFEs to curves and surfaces in 2D or 3D space, we

get the SLEFE for each component separately (x- and y-components for 2D

case and x-, y- and z- components for 3D case). Because all the components

Figure 3-4: Bounding boxes of SLEFEs at break points.

are independent of each other, we get 2D pairs of points, which construct a D-

dimensional axis aligned bounding box at each break point, as Figure 3-4 shows

for the 2D case. Due to the linearity, the original curve or surface is confined in

the convex combinations of the boxes (Figure 3-4). But we need to simplify the

enclosures to make them more useful. But when we deal with mid-structures, we do

not have to care about this issue because the mid-point for each bounding box is

unique.

3.1.8 Inverse of Mid-structure

We can get the original coefficients x from its mid-structure

7 = (+Tx)/2

L(x) + (a + La+ a + La)(Ax)/2

(3.3)

because a + La and a + La are tabulated, and the operator A is given (second

difference), therefore we get the original function. This inverted function can be

used as an approximand of the piecewise linear function T with known tolerance.

We get the B-Spline form of the intersection curve by inverting the piecewise

linear curve, which is the intersection of the mid-structures of two surfaces.

CHAPTER 4
PROCEDURE

4.1 Constructing Mid-structures of Tensor-product B6zier Surfaces

The SubLiME package (http://www.cise.ufl.edu/research/SurfLab) provides

utility functions which find SLEFEs of several kinds of polynomial functions with

various degrees and number of break points. Here is the utility function which finds

the SLEFEs for a tensor-product B6zier surface
int tpSlefe ( REAL *coeff,

int strideu, int stride,

int degu, int degv,

int segu, int segv,

REAL* upper, REAL* lower,

int stride_slefeu, int stride_slefev);
where

coeff: coefficients of B6zier surface

strideu, stridev: strides between coefficients for each direction

degu, degv: degree of Bernstein polynomial for each direction

segu, segv: number of piecewise linear segments for each direction ( # of

break points 1)

upper, lower: .ii.i.-', where the upper and lower bounds at each break point

are stored.

stride_slefeu, stride_slefev: strides between SLEFE bounds for each

direction.

As mentioned in 3.1.7, we have to call this function for each x, y and z component.

m/1

/
Pl

Figure 4-1: Intersection of triangle and line segment.

4.2 Finding the Intersection of Mid-structures

To find the intersection of two mid-structures, the collection of piecewise linear

curves, we first need to find the intersections of all the pairs of triangles in each

triangle mesh. After that, we construct the piecewise linear curves by connecting

the line segments properly.

4.2.1 Finding the Intersection of Two Triangles

To find the intersection of two triangles, we need to check the intersection of

each edge of one triangle with the other triangle, thus six intersection tests.

Intersection of a line segment and a triangle. A point p inside a

triangle (including its vertices and edges) can be expressed as a convex combination

of the vertices vl, v2 and va as follows:

p tv + t2v2 + t3v3 (4.1)

where

ti + t2 +3 1

ti > 0

t2 > 0

t3 > 0.

And a point on a line segment (including its end points) can be expressed as a

convex combination of two end vertices pi and p2:

p sp + ( s)p2 (4.2)

where 0 < s < 1. Now we can express all the equations as follows:

P2,x Vl,x V2,x V3,x P2,x Pl,x tl

1. Vl,y i 1P,y t2

P2,z 1,z V2,z V3,z P2,z Pl,z t
1 1 1 1 0 s

Let M be the 4 x 4 matrix above. Then we can find ti, t2, t3 and s by multiplying

the inverse matrix of M on both sides. If all four are non-negative, we can say the

line segment intersects with the triangle.

In most cases, two triangles do not intersect or they intersect in a line segment.

To connect such line segments correctly afterwards, we need to identify each

intersection point uniquely. For the nonsingular and generate cases, a combination

of

index of the edge which intersects with the other triangle

index of the triangle mesh where the above edge belongs

index of the triangle which intersects with the edge above

can be used to identify an intersection point. (Because we have only two triangle

meshes, it is enough to have only the mesh index of the edge.)

Singular cases. The singular cases are:

when any pair of the three vertices of the triangle are same

when all the vertices of the triangle lie on the same line

when the two end points of the line segment are the same

when the line segment is parallel to the plane where the triangle lies.

For simplicity, we deal only with nonsingular cases. We can avoid most of the

singular cases by additional refinement of the SLEFEs.

Once it is confirmed that they intersect (nonsingular case), we can easily find

the intersection point using (4.1) or (4.2).

Degenerate cases. There are three kinds of degenerate intersection points.

1. when two vertices from each triangle meet (red points in Figure 4-3)

2. when one vertex of one triangle and one edge of the other triangle meet but
not at any of the end points of the edge (blue points in Figure 4-3)

3. when two edges from each triangle meet but not at any of the end points
(green points in Figure 4-3)

Degenerate cases cause the intersection test to generate duplicated intersection

points, which are actually the same. So we need an additional algorithm to prevent

such cases.

1. If vertex v, of one triangle T1 lies on the other triangle T2, duplicated
intersection points may be found by the intersection test of two edges el and
el which share the vertex v0. To prevent it, we make the edges exclusive of
each other (Figure 4-2). In other words, any point on the edge e< is defined
as

tvi_ + (1 t)vi, (4.3)

where 0 < t < 1, i + k = (i+ k + 3) mod 3, andj E {1, 2}. Notice the range
of t does not include 1, which makes the edges exclusive of each other.

2. To correctly identify the intersection points, when any of the vertices is also
an intersection point, instead of using the three properties as the identifier,
we use
index of the vertex
index of the mesh where the vertex belongs
as the identifier. This identifier has a higher priority than the previous one
when comparing two intersection points.

V,

S v3 e V2

Figure 4-2: Making triangle edges exclusive of each other.

3. If two vertices from each triangle intersect, any of the vertices can be used
as the identifier. To make it unique, we use the vertex index of T2 as the
identifier.

4. If two edges from each triangle intersect, any of the edges can be used as the
edge index of the identifier. To avoid this, we use the edge index of T2 as the
edge index of the identifier.

Figure 4-3 shows the various degenerate cases. We can find some singular cases

in the figure. With some more tests for the singular cases, we can use the same

algorithm to uniquely identify the intersection points. But we do not deal with the

singular cases in our implementation.

4.2.2 Finding the Topology of Piecewise Linear Intersection Curves

After collecting all the intersecting line segments, we need to connect them

properly. Each intersection line segment is composed of one or two intersection

points. Because we want to approximate the intersection curves with B-Spline

curves, we ignore the case of one intersection point. In addition, we assume all

the vertices can be shared by two edges at most, otherwise we cannot apply the

inversion process. If any vertex if shared by more than two edges, we connect only

pairs of them thus making them separate.

Using the identifier of each intersection point, as described before, the intersec-

tion curve can be constructed as follows.

At any step, there is a collection of piecewise linear curves constructed so far.

Each piecewise linear curve consists of a list of intersection points. For an incoming

Figure 4-3: Degenerate cases of triangle-triangle intersection. Red, blue, and green
points denote each vertex-vertex, vertex-edge, and edge-edge cases.

intersection line segment, its two end points are compared with the first and last

points of each piecewise linear curve. The topology of the current curves change

according to the new line segment as follows (Figure 4-4):

1. Each two end points are the same with the first and last points of the same
curve: The curve becomes closed by the new intersection line segment. No
new point is added.

2. Two end points are the same with the first or last points of two different
curves: The curves are merged together. No new point is added.

3. Only one of the end points is the same with the first or last of a curve: The
other end point is added to the curve.

4. None of the two end points is the same with the first or last of any curve.
The new curve is created with the two end points as its first and last points.
The new curve is created with the two end points as its first and last points.

case 1

case 2

case 3

Figure 4cas Constructin the topology of intersection curves.
Figure 4-4: Constructing the topology of intersection curves.

7

3

4.2.3 Inverting Pircewise Linear Curves to B-Spline Curves

The SubLiME package also provides the utility functions which can be used to

invert a piecewise linear curve to a B-Spline curve. It also provides a function for a

closed curve called bspInvClosed. The function for an open curve is as follows:
int bspInv(REAL* mid, int cpnum, int deg,

int mid_stride, REAL* coeff, int stride);
where

mid: coordinates of mid-structure (piecewise linear curve) to be inverted to a

B-Spline curve

cpnum: number of vertices of mid-structure

deg: degree of B-Spline curve

mid_stride: stride of vertices of mid-structure

coeff: .ii ., where control points of resulting B-Spline curve will be stored

stride: stride of control points

Usage of the function for the closed curve is the same.

CHAPTER 5
ANALYSIS

5.1 Evaluating an Exact Intersection

To see how close our approximation is to the exact intersection, we need to

find the exact intersection. But as described earlier, the exact intersection can be

found only for a few cases. One of the cases is to find the projection of a curve C

lying in xy-plane on the B6zier surface SH where its control points are the height

fields of xy-plane. If we sweep the curve C along z-axis, we can get a surface Sc,

and the projection on the surface SH of C can be considered as the intersection of

the two surfaces SH and Sc (Figure 5-4). In this case, we can evaluate the exact

intersection using composition as follows.

Let the domain DH of SH be the unit square of u-v plane where 0 < u, v < 1,

and Dc of C be the unit length line segment of t axis where 0 < t < 1.

We need to evaluate the points on the intersection curves corresponding to

0 < t < 1. For a given t value, we can easily evaluate the corresponding point

(xc(t), yc(t)) on C. We now need to map this point to a (u, v) value of DH. Let

(XH(U, v), YH(u, v), ZH(U, v)) be the point on SH. Because the x and y coordinate
values of SH are regularly located, we can linearly map a point (x, y) on the x-y

plane to DH. In other words,

u = axH(u,v) + b = axc(t) + b

v = cyH(U,v) d= cxc(t) d

where a and c are not zeros because x and y coordinate values of SH are same with

those of C. Now we can evaluate the z coordinate value of the intersection point

using (u, v). Therefore the points on the intersection curve is

(xc(t), yc(t), ZH(axc(t) + b, (t) + d)).

Figure 5-5 shows an exact intersection curve evaluated in this way.

5.2 Measuring Tolerance

To measure the tolerance of the approximated intersection curve, we need to

simplify its SLEFEs. Let us examine the 2D case. We can easily extend it to the

3D case.

As mentioned before, at each break point, the enclosing bounds built by

SLEFEs result in an axis-aligned box. To make it simple to measure the tolerance

of intersection, we need the upper and lower bounds to be (i) parallel with the

mid-structure and (ii) have the same distance from the mid-structure. To do this,

we find the planes each containing the corners of the bounding boxes at the break

points and select the one with maximum distance from the mid-structure. We need

to find and check N x 2D number of planes where N is the number of break points

for each mid-structure segment and D is the dimension. For example, 2 x 22 8

number of planes are found and checked in 2D case (Figure 3-2). In the 3D case,

we may have 3 x 23 number of planes because we need to find such bounds for each

triangle. Then we get a pair of SLEFEs which satisfy our conditions.

A plane can be expressed as

d = n x =n x

where n is the normal vector. If n is normalized, d is the distance of the plane

from the origin. In other words, all the points on the plane have the same distance

from the origin if they are projected to the same normal vector n. Therefore,

the distance of the plane where a point p belongs and has normal vector n is

nTp. By comparing such distance of all the points, we can find the plane which

Ax,
Ay2

Ay1@

AX,

Figure 5-1:

Finding simple boundaries for a line segment.

e,
sinO

1= e
sin9

0=s180-0
I
/

e= 1~ +1 -211, coso

/e, +e +2e2e,cosO
sin9

e2 + e2 2eje, cos(180- )
sin9

Figure 5-2: Tolerance according to the intersection angle.

is the farthest from the plane of mid-structure. In other words, the tolerance of a

mid-structure segment (triangle in 3D case) e is

e = max InTpi d

where n is the normlized normal vector of the plane where the triangle lies, pi is

one of the corner points, and d is the distance of the mid-structure segment from

origin.

Now, let us consider the case when two SLEFEs intersect (Figure 5-2). From

the figure, we can find that the intersection point of two SLEFEs is enclosed in

a parallelepiped and the maximum tolerance is half of its longer diagonal. If the

SLEFEs intersect with the angle 0 < 90, the tolerance is

e 2 +e 2eCe2cos0
sin 0

where el and e2 are the tolerance of each SLEFE.

Figure 5-3 shows the tolerance with various intersection angles and ratio of

two tolerances. As it shows, the tolerance increases rapidly as the intersection angle

gets close to zero.

For each pair of triangles, we can find a line segment with its tolerance. We

can imagine a cylinder for each line segment of which the radius is the tolerance.

The exact intersection curve is guaranteed to be inside of such cylinders for each

corresponding segment (Figure 5-9).

By inverting the piecewise linear curves to B-Spline curves, we get additional

error bounds siefe/2 between the line segment and its corresponding B-Spline

curve segment. Therefore the overall tolerance is just e + siefe/2.

el=3e2

el=2e2

el=e2

10 20 30 40 50
intersection angle

60 70 80 90

Figure 5
spheres.
curve, e2

3: Tolerance with respect to intersection angle and ratio of bounding
x-axis denotes the intersection angle, el is fixed to 1 and from the bottom
1, 2, 3,... and so on.

Figure 5-4: Example 1. Two surfaces intersecting each other. The cylindrical sur-
face is constructed using four B6zier patches.

Figure 5-5: Example 1. Exact intersection curve computed as described.

Figure 5-6: Mid-structures of Figure 5-4.

Figure 5-7: Intersection of two mid-structures in Figure 5-6.

Figure 5-8: The B-Spline curve inverted from Figure 5-7.

33

"

Figure 5-9: Tolerance of the intersection curve in Figure 5-7 illustrated by cylinder
about the linear segments.

Figure 5-10: Example 2. Two surfaces with the tolerance of its intersection curve.

CHAPTER 6
CONCLUSION AND FUTURE WORK

To approximate the intersection curves of two surfaces, we triangulate the

original surfaces using mid-structures of SLEFEs. The piecewise linear intersection

curves of these two triangle meshes are inverted to B-Spline curves to approximate

the intersection curves. To improve the result, we can apply various methods to

each process.

First, because finding the enclosing bounds in the basis space is offline, we

can apply various methods. For example, we can use some optimization methods

to minimize the width of the SLEFEs. To make the upper and lower SLEFEs

always parallel, we may be able to make the upper and lower SLEFEs parallel

in basis space. All such improvements do not affect the efficiency because they

are once-and-all processes. If we want to use the mid-structure as a method of

triangulation, rather than using the mid-points to get the mid-structure, we can

find an independent piecewise linear curve which approximates the basis function

and use this to get the mid-structures.

Because the process of triangulating the original surfaces is separated from the

process of approximating the piecewise linear curve using B-Spline curves, we can

use other methods to triangulate the surfaces only if the tolerance is known. But

other triangulation methods are probably slower than the SLEFE method.

REFERENCES

 Thomas A. Grandine, "Applications of Contouring," SIAM Review, vol. 42,
no. 2, pp. 297-316, Jun. 2000.

 B. A. Jean and Bernd Hamann, "An efficient surface-surface intersection
algorithm using adaptive surface triangulations and space partitioning trees,"
Mathematical Engineering in Industry, vol. 7, no. 1, pp. 25-40, Sep. 1998.

 Ernst Huber, -IiI i acting general parametric surfaces using bounding
volumes," in Proceedings of the 10th Canadian Conference on Computational
Geometry CCCG'98, pp. 52-53, Montreal, Qudbec, Canada, Aug. 1998.

 Shankar Krishnan and Dinesh Manocha, "An efficient surface intersection
algorithm based on lower-dimensional formulation," ACM Transactions on
Graphics, vol. 16, no. 1, pp. 74-106, Jan. 1997.

 Nicholas M. Patrikalakis, "Surface-to-surface intersections," IEEE Computer
Graphics and Applications, vol. 13, no. 1, pp. 89-95, Jan. 1993.

 Ernst Huber, "Surface-to-surface intersection based on triangular parameter
domain subdivision," in Proceedings of the 11th Canadian Conference on
Computational Geometry -CCCG'99, pp. 100-102, Vancouver, British
Columbia, Canada, Aug. 1999.

 Wilhelm Barth and Ernst Huber, "Computations with tight bounding
volumes for general parametric surfaces," in Proceedings of 15th European
Workshop on Computational Geometry CG'99, pp. 123-126, Antibes,
France, Mar. 1999.

 R. E. Barnhill, G. Farin, M. Jordan and B. R. Piper, "Surface/surface
intersection," Computer Aided Geometric Design, vol. 4, no. 1-2, pp. 3-16,
Jul. 1987.

 S. Lanquetin, S. Foufou, H. Kheddouci and M. Neveu, "Computing subdivi-
sion surface intersection," in Proceedings of WSCG '2003, pp. 73-76, Campus
Bory, Plzen Bory, Czech Republic, Feb. 2003.

 K. Abdel-Malek and H. J. Yeh, "Determining intersection curves between
surfaces of two solids," Computer-Aided Design, vol. 28, no. 6-7, pp. 539-549,
Jun.-Jul. 1996.

 Edwin Boender, "A survey of intersection algorithms for curved surfaces,"
Computers & Graphics, vol. 15, no. 1, pp. 109-115, 1991.

 Thomas A. Grandine and Frederick W. Klein IV, "A new approach to the
surface intersection problem," Computer Aided Geometric Design, vol. 14, no.
2, pp. 111-134, Feb. 1997.

 C. L. Bajaj, C. M. Hoffmann, R. E. Lynch and J. E. H. Hopcroft, "Tracing
surface intersections," Computer Aided Geometric Design, vol. 5, no. 4, pp.
285-307, Nov. 1988.

 Luiz Henrique de Figueiredo, "Surface intersection using affine arithmetic,"
in Proceedings of the Conference on Graphics Interface '96, pp. 168-175, _.i,,-
1996.

 M. Gleicher and M. Kass, "An interval refinement technique for surface
intersection," in Proceedings of the Conference on Graphics Interface '92, pp.
242-249, Vancouver, British Columbia, Canada, M.,,- 1992.

 Jorg Peters and Xiaobin Wu, "Optimized refinable surface enclosure,"
Technical report, University of Florida, Oct. 2000.

 Jorg Peters and Xiaobin Wu, "On the opl iil.]iliv of piecewise linear max-
norm enclosures based on slefes," in Proceedings of Curve and Surface
Design: Saint-Malo 2002, pp. 335-344, Saint-Malo, France, Jul. 2002.

 Jorg Peters, "Efficient one-sided linearization of spline geometry," in
Proceedings of The Mathematics of Surfaces X, pp. 297-319, Leeds, UK, Sep.
2003.

 David Lutterkort and Jorg Peters, "Optimized refinable enclosure of
multivariate polynomial pieces," Computer Aided Geometric Design, vol. 18,
no. 9, pp. 851-863, Nov. 2001.

 G. Farin, "An SSI bibliography," in R. Barnhill, editor, Geometry Processing
for Design and Manufacturing, pp. 205-207, SIAM, Philadelphia, Jan. 1992.

BIOGRAPHICAL SKETCH

Minho Kim was born on March 3, 1974, in Seoul, Republic of Korea. He

received his Bachelor of Science degree in electrical engineering in 1997 from Seoul

National University, Seoul, Republic of Korea. In 2004, he received his Master of

Science degree from the Department of Computer and Information Science and

Engineering at the University of Florida. His major research area is computer

graphics.

I certify that I have read this study and that in my opinion it conforms to
acceptable standards of scholarly presentation and is fully adequate, in scope and
quality, as a thesis for the degree of Master of Science.

Jorg Peters, Jorg Peters

Associate Professor of CISE

I certify that I have read this study and that in my opinion it conforms to
acceptable standards of scholarly presentation and is fully adequate, in scope and
quality, as a thesis for the degree of Master of Science.

Anand Rangarajan

Associate Professor of CISE

I certify that I have read this study and that in my opinion it conforms to
acceptable standards of scholarly presentation and is fully adequate, in scope and
quality, as a thesis for the degree of Master of Science.

Paul Fishwick

Professor of CISE

This thesis was submitted to the Graduate Faculty of the College of Engi-
neering and to the Graduate School and was accepted as partial fulfillment of the
requirements for the degree of Master of Science.

August 2004

Pramod P. Khargonekar

Dean, College of Engineering

Winfred M. Phillips

Dean, Graduate School

TITLE OF THE DISSERTATION

Minho Kim
(352) 377-3788
Department of Computer and Information Science and Engineering
Chair: Jorg Peters
Degree: Master of Science
Graduation Date: August 2004

Enter the text of you general audience abstract here.