POV-Ray : Newsgroups : povray.advanced-users : Thickness for bicubic_patch Server Time
26 Nov 2024 22:39:02 EST (-0500)
  Thickness for bicubic_patch (Message 1 to 2 of 2)  
From: ingo
Subject: Thickness for bicubic_patch
Date: 15 Aug 1999 07:23:19
Message: <37b6a327@news.povray.org>
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

From: ingo
Subject: Re: Thickness for bicubic_patch
Date: 16 Aug 1999 12:16:20
Message: <37b83954@news.povray.org>
ingo heeft geschreven in bericht <37b6a327@news.povray.org>...
>...
>The edge controll points:
>#declare D1 = vnormalize(vnormalize(P1-P0)+vnormalize(P1-P2));

This should be D1= vnormalize(vcross(closest_edgepoint-closest_cornerpoint,
closest_midpoint-closest_cornerpoint)), (I think).

But it does not solve my main problem.

ingo
--
Met dank aan de muze met het glazen oog.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.