POV-Ray : Newsgroups : povray.newusers : Bicubic Patches? Server Time
6 Sep 2024 02:20:46 EDT (-0400)
  Bicubic Patches? (Message 1 to 5 of 5)  
From: Phil Clute
Subject: Bicubic Patches?
Date: 28 Apr 1999 02:52:34
Message: <3726A38D.B5CD4626@tiac.net>
The answer to this question is probably going to go way
over my head, but here goes...
I'm trying to figure out just how these bicubics work.
The pov docs say I should use a modeller, but I wanted to 
try my luck at animating a few patches together, in harmony
using variables for the control points. However, only the 
corners(as far as I know) are stable, that is to say each
corner actually resides at the point in space indicated by its
vector. 
Lets say I have 2 patches side by side, each patch is a square,
together forming a rectangle. When I pull on a corner the middle
seam comes apart.
So, the question is: What frightening math equation do I need to
know and love in order to keep those seams together.


Note: I am mathematically challenged...please explain as though
you are speaking to a moron, because you are. :-)

-- 
...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

From: Ken
Subject: Re: Bicubic Patches?
Date: 28 Apr 1999 03:51:20
Message: <3726AEC2.8EF28ECC@pacbell.net>
Phil Clute wrote:
> 
> The answer to this question is probably going to go way
> over my head, but here goes...
> I'm trying to figure out just how these bicubics work.
> The pov docs say I should use a modeller, but I wanted to
> try my luck at animating a few patches together, in harmony
> using variables for the control points. However, only the
> corners(as far as I know) are stable, that is to say each
> corner actually resides at the point in space indicated by its
> vector.
> Lets say I have 2 patches side by side, each patch is a square,
> together forming a rectangle. When I pull on a corner the middle
> seam comes apart.
> So, the question is: What frightening math equation do I need to
> know and love in order to keep those seams together.
> 
> Note: I am mathematically challenged...please explain as though
> you are speaking to a moron, because you are. :-)
> 
> --
> ...coffee?...yes please! extra sugar,extra cream...Thank you.

  On friday the 24 of april Ron Parker offered some insight on the
subject of bicubic patches in the advanced users group. As well as
being informative perhaps as a follow up to that thread you could
repost your question in hopes of getting more information related
to your question.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Scott David Daniels
Subject: Re: Bicubic Patches?
Date: 5 May 1999 01:41:23
Message: <372FCC5A.B26E2CD7@Acm.Org>
Some basic terms:
A _spline_ blends two functions smoothly (for some notion of smooth).
We choose _cubic_ polynomials since they are the lowest degree
polynomials which can "reverse direction" (as in an "S" curve). 
It is _bicubic_ because we are working with a "square" patch -- we have
two sides at "right" angles each controlled by a Bezier curve, to
produce a patch by varying each side over its range.
A _control_point_ is a point that controls some parameter of our curve.
A _knot_ is a control point that the curve must lie on.

Let's start our explanation with one edge in 2-D and scale up.  A
_Bezier_curve_ has four control points, two of which (the first and
fourth) are knots.  The other two control the path between the first and
final points.  If the points are A, B, C, and D in order, then A is a
knot, the vector from A to B is the initial slope of the path, D is a
knot, and when the path meets D it is traveling at the slope of the
vector from C to D.

A neat property of these curves is that the entire curve is always
inside the quadrilateral bounded by A, B, C and D (if the points
zig-zag, the vertices of the bounding quadrilateral may have to be used
in another order).  All of these
properties are independent of any linear transform of the coordinate
space, so you can understand them graphically.  Another neat property is
that the curve can be cut anywhere into a pair of Bezier curves, and the
resultant pair of curves will trace the same points as the original. 
This is good for graphics applications where you may subdivide to see
where a hit point occurs.

So far we have a curve in 2-D.  We can easily give 3-D points for those
four points (makers perfect sense), and we sort of lose the "curve is 
bounded by the quadrilateral" property.  We really don't however, since
and 2-D shadow of our 3-D points produces a curve which is the 3-D 
shadow of the 3-D curve.

Now for a really simple example, let's lay out a line, making the inner 
control points intermediate points on the line between A and D.  Say:
	A = (0,0,0), B = (1,0,0), C = (2,0,0), D = (3,0,0)

We set another Bezier curve parallel to this but offset:
	A'= (0,6,0), B'= (1,6,0), C'= (2,6,0), D'= (3,6,0)

Now we connect the end knots with our straight-line Beziers
	A = (0,0,0), A1= (0,2,0), A2= (0,4,0), A'= (0,6,0)
  and	D = (3,0,0), D1= (3,2,0), D2= (3,4,0), D'= (3,6,0)

We now have our "patch" outlined: A, A', D', D
We simply fill in the intermediate control points with connections
the same way we did the outer, and re-use the intermediate points:

	A = (0,0,0), A1= (0,2,0), A2= (0,4,0), A'= (0,6,0)
  and	B = (1,0,0), B1= (1,2,0), B2= (1,4,0), B'= (3,6,0)
  and	C = (2,0,0), C1= (2,2,0), C2= (2,4,0), C'= (3,6,0)
  and	D = (3,0,0), D1= (3,2,0), D2= (3,4,0), D'= (3,6,0)

So, A-B-C-D, D-D1-D2-D', D'-C'-B'-A', and A'-A2-A1-A bound our patch.

The points B, C, D1, D2, C', B', A2, and A1 control the "wobbliness" 
of the edges.  Lift or lower them a bit to see what happens.

What we really have is a sweep of a Bezier by a Bezier.  At one edge
of our patch we go from A,B,C,D, sweep along to arrive at A',B',C',D'.
Clearly the "A" edge follows the Bezier A-A1-A2-A'.  Similarly the "D" 
edge follows D-D1-D2-D'.  It should not shock you that the control 
points follow Bezier paths B-B1-B2-B' and C-C1-C2-C'.

This is completely symmetric.  We could consider that A-A1-A2-A' is
swept until it becomes D-D1-D2-D'.

To experiment with this, start with a plain box, six sides using 
straight-line Beziers.  Then deflect points: push out the X1s from 
the center of the box, and push in the X2s towards the center for 
example.  As long as the edges match, you can even warp the edges 
off their straight lines.  If you like, you can even split the box
at an edge, by having the attaching edge not use exactly the same 
control points.

Phil Clute wrote:
> 
> The answer to this question is probably going to go way
> over my head, but here goes...
> I'm trying to figure out just how these bicubics work.
> The pov docs say I should use a modeller, but I wanted to
> try my luck at animating a few patches together, in harmony
> using variables for the control points. However, only the
> corners(as far as I know) are stable, that is to say each
> corner actually resides at the point in space indicated by its
> vector.
> Lets say I have 2 patches side by side, each patch is a square,
> together forming a rectangle. When I pull on a corner the middle
> seam comes apart.
> So, the question is: What frightening math equation do I need to
> know and love in order to keep those seams together.
> 
> Note: I am mathematically challenged...please explain as though
> you are speaking to a moron, because you are. :-)
> 
> --
> ...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

From: Phil Clute
Subject: Re: Bicubic Patches?
Date: 5 May 1999 03:22:24
Message: <372FE511.8B38AFAC@tiac.net>
Thanks for your assistence.

-- 
...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

From: Scott David Daniels
Subject: Re: Bicubic Patches?
Date: 5 May 1999 12:16:16
Message: <37306128.5F355FD2@Acm.Org>
One thing I forgot to mention:  To connect a pair of patches along
an edge, the following should be visually "good enough:"

   A: share all of the edge points (obvious, I know, but...),
   B: The pairs of control points one hop away from the edge,
	on both patches should lie on a line with the common knot.

That last sounded a bit like Greek (no offense, please if you are 
Greek).  How about an example:

Original Patch:
	A, A1, A2, A'
	B, B1, B2, B'
	C, C1, C2, C'
	D, D1, D2, D'

New Patch:
	D, D1, D2, D'
	E, E1, E2, E'
	F, F1, F2, F'
	G, G1, G2, G'

Constraints:
	A: share an edge. (Done: D..D' is shared)
	B: C-D-E is a straight line with D between C and E,
	   For all four triples: 
		C-D-E, C1-D1-E1, C2-D2-E2, and C'-D'-E'

You are free to make the Fs and Gs anywhere you like.
Note that C-D and D-E don't need to be the same length; 
our eyes don't notice that second-order continuity.

-Scott


Phil Clute wrote:
> 
> Thanks for your assistence.
> 
> --
> ...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

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