POV-Ray : Newsgroups : povray.general : Q: Bezier patch generation : Re: Q: Bezier patch generation Server Time
16 Nov 2024 03:22:46 EST (-0500)
  Re: Q: Bezier patch generation  
From: Jerry Anning
Date: 15 Oct 1998 14:16:34
Message: <36262DFF.3EB75E17@dhol.com>
Vidar Madsen wrote:
> 
> Hello.
> 
> I'm writing a small application that is supposed to generate
> bezier patches from a set of linear line-segments. The lines
> are converted to bezier curves (smoothed) internally in
> the program. However, when it comes to spit out the final
> bicubic patch I run into a small problem. As we all know(?),
> a bezier patch consists of 16 vertexes:
>   A b c D
>   e f g h
>   i j k l
>   M n o P
> 
> The control points between the different curves are calculated
> automatically ("e" and "i" for the segment "A"-"M"), and seem
> to work fine. However, I also need control points for the
> center of the patch, "f", "g", "j" and "k". Is there a good
> method to determine these? I have tried averaging a few of the
> other vertices, but I always end up with sharp edges between
> the adjacent patches... If anyone can help me with this, I'd
> be very grateful. Even vague hints are appreciated! ;-)

Take two adjacent patches with control points named thus:

a b c d   A B C D
e f g h   E F G H
i j k l   I J K L
m n o p   M N O P

then for true g1 continuity between patches you need to meet the
following conditions:
d=A, h=E, l=I, p=M,
cd and AB are collinear,
gh and EF are collinear,
kl and IJ are collinear,
op and MN are collinear.
This is quite restrictive, but there is another interpretation of
continuity that is also used. For this, you need to meet the following
conditions:
d=a, h=E, l=I, p=M,
c, d, A, B, h and E are coplanar,
l, I, o, p, M and N are coplanar.

If you use the first method, it determines your interior control points.
The second method leaves them free, but you could consider creating them
by interpolating your (constrained) edge control points.

Jerry Anning
cle### [at] dholcom


Post a reply to this message

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