ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/patch3w.cal
Revision: 1.1
Committed: Sat Feb 22 02:07:21 2003 UTC (21 years, 2 months ago) by greg
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# User Rev Content
1 greg 1.1 {
2     Uniform Rational Patch
3    
4     02Mar90
5    
6     Define Px(i,j), Py(i,j), Pz(i,j) and W(i,j), nrows, ncols
7     }
8     { default basis functions }
9     br(a,b,c,d,s) = b3(a,b,c,d,s);
10     bc(a,b,c,d,t) = b3(a,b,c,d,t);
11     b3(a,b,c,d,p) = bezier(a,b,c,d,p);
12     { default patch interpolation }
13     rint = interpolate;
14     cint = interpolate;
15     interpolate = 1;
16    
17     x(s,t) = patch(s,t,Px);
18     y(s,t) = patch(s,t,Py);
19     z(s,t) = patch(s,t,Pz);
20    
21     patch(s,t,p) = bc(P2(s,c0(t)+1,p), P2(s,c0(t)+2,p),
22     P2(s,c0(t)+3,p), P2(s,c0(t)+4,p), cf(t)) /
23     bc(W2(s,c0(t)+1), W2(s,c0(t)+2),
24     W2(s,c0(t)+3), W2(s,c0(t)+4), cf(t)) ;
25    
26     P2(s,j,p) = br(W(1+r0(s),j)*p(1+r0(s),j), W(2+r0(s),j)*p(2+r0(s),j),
27     W(3+r0(s),j)*p(3+r0(s),j), W(4+r0(s),j)*p(4+r0(s),j), rf(s)) ;
28    
29     W2(s,j) = br(W(1+r0(s),j), W(2+r0(s),j), W(3+r0(s),j), W(4+r0(s),j), rf(s)) ;
30    
31     r0(s) = rmult*floor(clamp(s)*npr);
32     rf(s) = s*npr - floor(clamp(s)*npr);
33     c0(t) = cmult*floor(clamp(t)*npc);
34     cf(t) = t*npc - floor(clamp(t)*npc);
35    
36     rmult = if(rint, 4, 1);
37     cmult = if(cint, 4, 1);
38     npr = if(rint, nrows/4, nrows-3);
39     npc = if(cint, ncols/4, ncols-3);
40    
41     clamp(p) = if(p, if(1-p, p, .9999999), .0000001);