I'm trying to create a macro that simulates a bicubic_patch with thickness.
First a central patch is defined. For each point a vector is calculated along
witch the points are translated in opposite directions. The translated distance
is half the wanted thickness.
Considering a bicubic_patch from P0 to P15, the vectors for the four
cornerpoints are calculated like:
#declare D0 = vnormalize(vcross(vnormalize(P0-P1),vnormalize(P0-P4)));
The edge controll points:
#declare D1 = vnormalize(vnormalize(P1-P0)+vnormalize(P1-P2));
The central controll points:
#declare D5 = vnormalize(vnormalize(P5-P1)+vnormalize(P5-P4)+
vnormalize(P5-P6)+vnormalize(P5-P9));
The points on the new patches are found with:
#declare Pplus0 = P0 +(D0*Thick/2);
#declare Pplus1 = P1 +(D1*Thick/2);
... etc.
#declare Pmin0 = P0 -(D0*Thick/2);
#declare Pmin1 = P1 -(D1*Thick/2);
... etc.
Beside others, my main problem is that not all the Pplus*-points are allways on
the same side of the central patch. How can I check for this and eventually flip
the vector?
ingo
--
Met dank aan de muze met het glazen oog.
Post a reply to this message
|