POV-Ray : Newsgroups : povray.general : bezier patches problem Server Time
7 Aug 2024 17:29:18 EDT (-0400)
  bezier patches problem (Message 1 to 8 of 8)  
From: Reusser
Subject: bezier patches problem
Date: 23 Jun 2001 15:41:01
Message: <3B34EFD2.C908DD47@chorus.net>
Lately, I've been trying to create a carbon bike frame with bezier
patches.  It's going relatively well (and SLOWLY), but there's one thing
I can't stand.  I've found that I only need the control points on the
corners (marked by X's).  All that really matters is that the patches
are seamless and the center points are not necessary for this.

It seems like there should be a way to interpolate those points without
having to enter them manually.  Has anyone ever written a macro to do
this?  Is there a simple way around this?

X-----X-----X-----X
|         |        |         |
X-----0------0-----X
|         |        |         |
X-----0------0-----X
|         |        |         |
X-----X-----X-----X

Thanks in advance.

 - Rico


Post a reply to this message

From: Reusser
Subject: Re: bezier patches problem
Date: 23 Jun 2001 15:42:42
Message: <3B34F050.E47D0D3D@chorus.net>
Reusser wrote:

> X-----X-----X-----X
> |         |        |         |
> X-----0------0-----X
> |         |        |         |
> X-----0------0-----X
> |         |        |         |
> X-----X-----X-----X

Looks like the spacing got messed up in a different font, but you get the
idea.


Post a reply to this message

From: Warp
Subject: Re: bezier patches problem
Date: 23 Jun 2001 15:55:13
Message: <3b34f420@news.povray.org>
Reusser <reu### [at] chorusnet> wrote:
: X-----X-----X-----X
: |         |        |         |
: X-----0------0-----X
: |         |        |         |
: X-----0------0-----X
: |         |        |         |
: X-----X-----X-----X

  Using variable width fonts to make ascii-art is always a very bad idea.
In fact, using variable width fonts *at all* in anything that involves
news (reading and writing) is a bad idea. You should never use a variable
width font but always a fixed-width font when reading or writing articles
so that you always can be sure to read and that people read everything in
the way it was intended.
  If you use a variable width font to make ascii-art, you are assuming that
*EVERYONE* in the whole world is using the *EXACT* same font and newsreader
settings than you are.
  It's like assuming that in everyone's house the fridge is exactly 10 meters
and 25 centimeters from the out door of the house and make instructions based
on that assumption.

  Also when using a fixed-width font, the more square the font is, the
better. A very tall font (eg. 16x8 pixels) tends to deform any ascii-art
vertically in unwanted ways.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: j charter
Subject: Re: bezier patches problem
Date: 24 Jun 2001 13:11:40
Message: <3B364A04.B7E0BED@aol.com>
I have been using this:

#macro fillpoints ( c0, c1, c2, c3 )

        #declare A = c0;
        #declare D = c1;
        #declare M = c2;
        #declare P = c3;

        #declare B = A+((D - A)*1/3);
        #declare C = A+((D - A)*2/3);

        #declare N = M+((P - M)*1/3);
        #declare O = M+((P - M)*2/3);

        #declare E = A+((M - A)*1/3);
        #declare I = A+((M - A)*2/3);

        #declare H = D+((P - D)*1/3);
        #declare L = D+((P - D)*2/3);

        #declare F = A+((P - A)*1/3);
        #declare K = A+((P - A)*2/3);

        #declare G = M+((D - M)*1/3);
        #declare J = M+((D - M)*2/3);
#end
bicubic_patch  {   type 1  flatness 0.5  u_steps 3  v_steps 3 A B C D E F G
H I J K L M N O P   }


Post a reply to this message

From: Warp
Subject: Re: bezier patches problem
Date: 24 Jun 2001 13:44:39
Message: <3b362707@news.povray.org>
Wouldn't it be handier this way?


#macro fillpoints ( c0, c1, c2, c3 )
  c0,
  c0+((c1 - c0)*1/3),
  c0+((c1 - c0)*2/3),
  c1,
  c0+((c2 - c0)*1/3),
  c0+((c3 - c0)*1/3),
  c2+((c1 - c2)*1/3),
  c1+((c3 - c1)*1/3),
  c0+((c2 - c0)*2/3),
  c2+((c1 - c2)*2/3),
  c0+((c3 - c0)*2/3),
  c1+((c3 - c1)*2/3),
  c2,
  c2+((c3 - c2)*1/3),
  c2+((c3 - c2)*2/3),
  c3
#end


bicubic_patch
{ type 1  flatness 0.5  u_steps 3  v_steps 3
  fillpoints(p1, p2, p3, p4)
}




-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: j charter
Subject: Re: bezier patches problem
Date: 24 Jun 2001 21:53:07
Message: <3B36C43F.51A5838C@aol.com>
yep, I thank yee

Warp wrote:

>   Wouldn't it be handier this way?
>
> #macro fillpoints ( c0, c1, c2, c3 )
>   c0,
>   c0+((c1 - c0)*1/3),
>   c0+((c1 - c0)*2/3),
>   c1,
>   c0+((c2 - c0)*1/3),
>   c0+((c3 - c0)*1/3),
>   c2+((c1 - c2)*1/3),
>   c1+((c3 - c1)*1/3),
>   c0+((c2 - c0)*2/3),
>   c2+((c1 - c2)*2/3),
>   c0+((c3 - c0)*2/3),
>   c1+((c3 - c1)*2/3),
>   c2,
>   c2+((c3 - c2)*1/3),
>   c2+((c3 - c2)*2/3),
>   c3
> #end
>
> bicubic_patch
> { type 1  flatness 0.5  u_steps 3  v_steps 3
>   fillpoints(p1, p2, p3, p4)
> }
>
> --
> #macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
> rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
> ],13),8)-3,10>#end blob{N(array[6]{11117333955,
> 7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Reusser
Subject: Re: bezier patches problem
Date: 25 Jun 2001 01:02:43
Message: <3B36C4FE.A0471CE1@chorus.net>
j charter wrote:

> I have been using this:
>


I'm not quite sure if that's what I needed.  Won't this just stretch a sheet
between four points?  I need to have it so you can specify additional tangents
to those points.  Otherwise the patches will not quite match up perfectly.  I
posted an image in p.b.i. to illustrate my problem.  I want to specify the
green tangents, but have it interpolate the red points.

Also, I use megapov now and just realized that bezier patches are only in
megapov.  (Sorry for posting this in general)  Are there major differences
between bicubic and bezier patches?  Do they behave the same way?  Is this a
dumb question?

Thanks a million.

 - Rico


Post a reply to this message

From: Ben Chambers
Subject: Re: bezier patches problem
Date: 16 Jul 2001 03:01:14
Message: <3b52913a@news.povray.org>
The two middle control points only affect the slope of the curve.
The curve begins with a slope from c0 to c1, and ends with a
slope of c2 to c3.  So, if you line up c2 and c3 from one curve
on a straight line with c0 and c1 from the next curve over, they
fit.

...Chambers

PS BTW, I recently wrote a small utility to generate a mesh based
on a bezier patch.  The meshes render on my system up to 3x
faster than the patches, even when evaluated to thousands of
triangles.

Reusser <reu### [at] chorusnet> wrote in message
news:3B34EFD2.C908DD47@chorus.net...
> Lately, I've been trying to create a carbon bike frame with bezier
> patches.  It's going relatively well (and SLOWLY), but there's one thing
> I can't stand.  I've found that I only need the control points on the
> corners (marked by X's).  All that really matters is that the patches
> are seamless and the center points are not necessary for this.
>
> It seems like there should be a way to interpolate those points without
> having to enter them manually.  Has anyone ever written a macro to do
> this?  Is there a simple way around this?
>
> X-----X-----X-----X
> |         |        |         |
> X-----0------0-----X
> |         |        |         |
> X-----0------0-----X
> |         |        |         |
> X-----X-----X-----X
>
> Thanks in advance.
>
>  - Rico
>


Post a reply to this message

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