POV-Ray : Newsgroups : povray.general : Curved Triangles : Re: Curved Triangles Server Time
18 Nov 2024 23:19:32 EST (-0500)
  Re: Curved Triangles  
From: Ben Chambers
Date: 29 Jun 2002 16:49:45
Message: <3d1e1d69@news.povray.org>
"John VanSickle" <evi### [at] hotmailcom> wrote in message
news:3D1DCAD0.90317117@hotmail.com...
> Here is the UNTESTED code:
>
> // start of macro code
> #macro TriBezier(pA,pB,pC,pD,pE,pF,pG,pH,pI,pJ,pK,pL,pM,pN,pO,cD)
>   #if(cD<1)
>     smooth_triangle {
>       A,vcross(C-A,B-A),
>       K,vcross(G-K,L-K),
>       O,vcross(N-O,J-O)
>     }
>   #else
> TriBezier(A,(A+B)/2,(A+C)/2,(A+2*B+D)/4,(A+B+C+E)/4,(A+2*C+F)/4,
>   (A+3*B+3*D+G)/8,(A+2*B+D+C+2*E+H)/8,(A+2*C+F+B+2*E+I)/8,
>   (A+3*C+3*F+J)/8,(A+4*B+6*D+4*G+K)/16,(A+3*B+3*D+G+C+3*E+3*H+L)/16,
>   (A+2*C+F+2*B+4*E+2*I+D+2*H+M)/16,(A+3*C+3*F+J+B+3*E+3*I+N)/16,
>   (A+4*C+6*F+4*J+O)/16,cD-1)
>
>
TriBezier((A+4*B+6*D+4*G+K)/16,(B+3*D+3*G+K)/8,(B+C+3*D+3*E+3*G+3*H+K+L)/16,
>   (D+2*G+K)/4,(D+E+2*G+2*H+K+L)/8,(D+2*E+F+2*G+4*H+2*I+K+2*L+M)/16,
>   (G+K)/2,(G+H+K+L)/4,(G+2*H+I+K+2*L+M)/8,(G+3*H+3*I+J+K+3*L+3*M+N)/16,
>   K,(K+L)/2,(K+2*L+M)/4,(K+3*L+3*M+N)/8,(K+4*L+6*M+4*N+O)/16,cD-1)
>
> TriBezier((A+4*C+6*F+4*J+O)/16,(B+C+3*E+3*F+3*I+3*J+N+O)/16,
>   (C+3*F+3*J+O)/8,(D+2*E+F+2*H+4*I+2*J+M+2*N+O)/16,(E+F+2*I+2*J+N+O)/8,
>   (F+2*J+O)/4,(G+3*H+3*I+J+L+3*M+3*N+O)/16,(H+2*I+J+M+2*N+O)/8,
>   (I+J+N+O)/4,(J+O)/2(K+4*L+6*M+4*N+O)/16,(L+3*M+3*N+O)/8,(M+2*N+O)/4,
>   (N+O)/2,O,cD-1)
>
> TriBezier((A+4*B+6*D+4*G+K)/16,(A+3*B+3*D+G+C+3*E+3*H+L)/16,
>   (A+2*B+D+2*C+4*E+2*H+F+2*I+M)/16(A+3*C+3*F+J+B+3*E+3*I+N)/16,
>   (A+4*C+6*F+4*J+O)/16,(B+C+3*D+3*E+3*G+3*H+K+L)/16,
>   (B+C+2*D+3*E+F+G+3*H+2*I+L+M)/16,(B+C+D+3*E+2*F+2*H+3*I+J+M+N)/16,
>   (B+C+3*E+3*F+3*I+3*J+N+O)/16,(D+2*E+F+2*G+4*H+2*I+K+2*L+M)/16,
>   (D+2*E+F+G+3*H+3*I+J+L+2*M+N)/16,(D+2*E+F+2*H+4*I+2*J+M+2*N+O)/16,
>   (G+3*H+3*I+J+K+3*L+3*M+N)/16,(G+3*H+3*I+J+L+3*M+3*N+O)/16,
>   (K+4*L+6*M+4*N+O)/16,cD-1)
>   #end
> #end
>
> // end of macro code

Hmm, seems just a little bit messy.  Where on the triangle are the control
points placed?  (One thing I wanted to achieve with mine is that it uses no
more data than the original triangle - three points, and three normals, so
control points don't have to be generated).

...Chambers


Post a reply to this message

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