25.03.2013 Views

Surface algorithms using bounds on derivatives

Surface algorithms using bounds on derivatives

Surface algorithms using bounds on derivatives

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

304 D. Filip et al. / <str<strong>on</strong>g>Surface</str<strong>on</strong>g> <str<strong>on</strong>g>algorithms</str<strong>on</strong>g><br />

SURF2I(0, S1, SI(0, 0), SI(1, 0), SI(0, 1), SI(1, 1), 0, 0, 1, 1, K1, rl, $2, $2(0, 0), $2(1,0),<br />

$2(0, 1), $2(1, 1), 0, 0, 1, 1, K2, r2)<br />

END SURFACE INTERSECT<br />

Procedure SURF2I(d, S1, P1, P2, P3, P4, ull, vll, u12, v12, K1, rl, $2, Q1, Q2, Q3, Q4, u21,<br />

v21, u22, v22, K2, r2)<br />

/* Input parameter d: the current subdivisi<strong>on</strong> depth */<br />

/* Input Parameters for S1 ($2 are similar): */<br />

/. P1, P2, P3, P4 are c<strong>on</strong>ers points */<br />

/* (ull, vll) is lower left corner of parameter domain •/<br />

/* (u12, v12) is upper right comer of parameter domain */<br />

/. K1 is bounding box swell factor * ,/<br />

/* rl is the maximum subdivisi<strong>on</strong> depth necessary •/<br />

(A0, A1) = min-max bounding box of (P1, P2, P3, P4}<br />

A0 = A0 - (K1, K1, K1)<br />

A1 = A1 + (K1, K1, K1)<br />

(B0, B1) = min-max bounding box of (Q1, Q2, Q3, Q4}<br />

B0 = B0 - (K2, K2, K2)<br />

B1 = B1 + (K2, K2, K2)<br />

if (A0, A1) and (B0, B1) do not intersect<br />

then return<br />

else if kl >/rl and k2 >~ r2 then /* S1 and $2 are flat * ,/<br />

Output intersecti<strong>on</strong> curve of the linear approximati<strong>on</strong>s to S1 and $2<br />

else if kl >~ rl and k2 < r2 then /* S1 flat and $2 not flat */<br />

/* <strong>on</strong>ly generate subpatches for $2 */<br />

u2 = (u21 + u22)/2<br />

v2 = (v21 + v22)/2<br />

Q5 = $2(u2, v21)<br />

Q6 = $2(u21, v2)<br />

Q7 = $2(u2, v2)<br />

Q8 = $2(u22, v2)<br />

Q9 = $2(u2, v22)<br />

SURF2I(d + 1, $1, P1, P2, P3, P4, ull, vll, u12, v12, K1, rl,<br />

$2, Q1, Q5, Q7, Q6, u21, v21, u2, v2, K2/4, r2)<br />

SURF2I(d + 1, S1, P1, P2, P3, P4, u/l, vll, u12, v12, K1, rl,<br />

$2, Q5, Q2, Q7, Q8, u2, v21, u22, v2, K2/4, r2)<br />

SURF2I(d + 1, S1, P1, P2, P3, P4, ull, vll, u12, v12, K1, rl,<br />

$2, Q6, Q7, Q3, Q9, u21, v2, u2, v22, K2/4, r2)<br />

SURF2I(d + 1, S1, P1, P2, P3, P4, ull, vll, u12, v12, K1, rl,<br />

$2, Q7, Q8, Q9, Q4, u2, v2, u22, v22, K2/4, r2)<br />

else if kl < rl and k2 >t r2 then ... /* $2 flat and S1 not flat ,,/<br />

else ... /* both $1 and $2 are not flat * ,/<br />

END SURF2I<br />

We remark here <strong>on</strong> some properities of this algorithm. First, it is independent of any surface<br />

representati<strong>on</strong> and <strong>on</strong>ly depends <strong>on</strong> being able to evaluate the surface and knowing <str<strong>on</strong>g>bounds</str<strong>on</strong>g> <strong>on</strong><br />

the sec<strong>on</strong>d order partials of the surfaces. Sec<strong>on</strong>d, the algorithm <strong>on</strong>ly needs to subdivide the<br />

parameter space and does not need to subdivide the surface definiti<strong>on</strong>, like in traditi<strong>on</strong>al B6zier<br />

subdivisi<strong>on</strong>. Third, the algorithm is adaptive in the sense that <strong>on</strong>ly the porti<strong>on</strong>s of the surfaces<br />

whose bounding boxes intersect need to be subdivided. Fourth, it is <strong>on</strong>ly necessary to find the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!