POV-Ray : Newsgroups : povray.binaries.images : Made from a Coons patch Server Time
9 Jun 2026 04:42:44 EDT (-0400)
  Made from a Coons patch (Message 1 to 5 of 5)  
From: Tor Olav Kristensen
Subject: Made from a Coons patch
Date: 31 May 2026 12:30:00
Message: <web.6a1c61076b93ffd927b9d23589db30a9@news.povray.org>
I recently stumbled upon a web course on CAGD by Leonardo Fernandez-Jambrina and

https://dcain.etsin.upm.es/~leonardo/eindex.html

What caught my attention was chapter 6, where Coons patches are explained.

I found it interesting that if a Coons patch is made by Bezier curves
along its edges, then one can make a Bezier control grid for the same
patch by doing degree elevation on its control grids.

Once one have such a Bezier control grid, one can use it to find the
partial derivatives of the surface. The cross product of these gives the
surface normal.

When one have the surface normal, one can create offset surfaces. And
offset surfaces are the foundation for the triangle meshes in this image.

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message


Attachments:
Download 'coonspatch.png' (297 KB)

Preview of image 'coonspatch.png'
coonspatch.png


 

From: Bald Eagle
Subject: Re: Made from a Coons patch
Date: 1 Jun 2026 06:45:00
Message: <web.6a1d61c3e827a15d1d09a9825979125@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> I recently stumbled upon a web course on CAGD by Leonardo Fernandez-Jambrina and
>
> https://dcain.etsin.upm.es/~leonardo/eindex.html

Nice.  I've seen that page before - I just haven't had time to delve into that
topic again in any meaningful depth.

> What caught my attention was chapter 6, where Coons patches are explained.
>
> I found it interesting that if a Coons patch is made by Bezier curves
> along its edges, then one can make a Bezier control grid for the same
> patch by doing degree elevation on its control grids.

So that you have a subdivided patch . . . It's not instantly obvious why that's
necessary.  Where does one stop subdividing / degree-elevating?

> Once one have such a Bezier control grid, one can use it to find the
> partial derivatives of the surface. The cross product of these gives the
> surface normal.

Excellent.

> When one have the surface normal, one can create offset surfaces. And
> offset surfaces are the foundation for the triangle meshes in this image.

And of course, it's then trivial to calculate the mean and Gaussian curvature of
the surface at any point.

1. This is such an obviously TOK image, that I would be able to instantly pick
it out from a page of image results.  You have a certain style that endures
across decades of work.  :)

2.  I can't tell you how happy I am that (aside from seeing WHY you'd need to
degree-elevate) I can read what you've posted without any trouble whatsoever,
and and feel confident that (given the control grid points) I could even write
the SDL necessary to replicate your result in full.

Thanks for all of your help in guiding me to this point, and always pushing the
envelope a little bit farther.

- BW


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Made from a Coons patch
Date: 1 Jun 2026 21:00:00
Message: <web.6a1e2a6ce827a1527b9d23589db30a9@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> > I recently stumbled upon a web course on CAGD by Leonardo Fernandez-Jambrina and
> >
> > https://dcain.etsin.upm.es/~leonardo/eindex.html
>
> Nice.  I've seen that page before - I just haven't had time to delve into that
> topic again in any meaningful depth.
>
> > What caught my attention was chapter 6, where Coons patches are explained.
> >
> > I found it interesting that if a Coons patch is made by Bezier curves
> > along its edges, then one can make a Bezier control grid for the same
> > patch by doing degree elevation on its control grids.
>
> So that you have a subdivided patch . . . It's not instantly obvious why that's
> necessary.  Where does one stop subdividing / degree-elevating?

In a Coons patch with Bezier curves as edges, the degrees of the
interpolating polynomials along the edges depend on the number of
control points along each edge.

After that, there are three interpolations going on: one linear
between one pair of opposing boundary curves, one linear between
the other pair of opposing boundary curves, and one bilinear
between the four corner points. Then the last one is subtracted
from the sum of the first two to prevent double counting the
corners.

An alternative way of doing it is to degree elevate the Bezier
curves along each edge, so that the polynomials for each pair
of opposing edges are the same. This also makes the number of
control points along opposing edges the same. Then, one degree
elevates the grids formed by each pair of these control points
so that the number of control points matches the grid dimensions
of the other pair of edges. Thereafter, one degree elevates the
2x2 grid of control points in the corners to the same final grid
dimensions, allowing the control points of the three control
grids to be added and subtracted directly.

I've made an image (attached) that illustrates this alternative
way ofdoing it. (The arrows in it indicates degree elevations.)
Note that here the number of control points along each pair of
edges is already the same, but it does not need to be so. If it
is not, one has to do degree elevation on the lower-degree edge
curves first, until opposing edges have matching degrees and
control point counts. So the degree elevations stop when all
three control grids have the same dimensions.


> > Once one have such a Bezier control grid, one can use it to find the
> > partial derivatives of the surface. The cross product of these gives the
> > surface normal.
>
> Excellent.
>
> > When one have the surface normal, one can create offset surfaces. And
> > offset surfaces are the foundation for the triangle meshes in this image.
>
> And of course, it's then trivial to calculate the mean and Gaussian curvature of
> the surface at any point.

I am afraid you are a bit ahead of me when it comes to those
curvature calculations. It would be nice to have a function
controlled pigment that shows the curvature across the surface.
to see how you would implement that.


> 1. This is such an obviously TOK image, that I would be able to instantly pick
> it out from a page of image results.  You have a certain style that endures
> across decades of work.  :)

Hehe ;)

Thank you, I appreciate that! I didn't know my style was so
recognizable after all these years, but it's nice to know it
stands out.


> 2.  I can't tell you how happy I am that (aside from seeing WHY you'd need to
> degree-elevate) I can read what you've posted without any trouble whatsoever,
> and and feel confident that (given the control grid points) I could even write
> the SDL necessary to replicate your result in full.

Very good!


> Thanks for all of your help in guiding me to this point, and always pushing the
> envelope a little bit farther.

No problem.

Sometimes the process helps me understand things better. In fact,
while writing this, I realized myself that the number of control
points along opposing edges doesn't even need to be the same to
begin with.

It's always fun discussing these things since we enjoy working on
these same kinds of geometry puzzles.

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message


Attachments:
Download 'coons control points to bezier control points.png' (167 KB)

Preview of image 'coons control points to bezier control points.png'
coons control points to bezier control points.png


 

From: Tor Olav Kristensen
Subject: Re: Made from a Coons patch
Date: 1 Jun 2026 21:10:00
Message: <web.6a1e2d28e827a1527b9d23589db30a9@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> ...
> An alternative way of doing it is to degree elevate the Bezier
> curves along each edge, so that the polynomials for each pair
> of opposing edges are the same.
>...

Sorry. Replace "are the same" with "have the same degree".

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

From: Bald Eagle
Subject: Re: Made from a Coons patch
Date: 2 Jun 2026 18:00:00
Message: <web.6a1f5165e827a15d1d09a9825979125@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> there are three interpolations going on: one linear
> between one pair of opposing boundary curves, one linear between
> the other pair of opposing boundary curves, and one bilinear
> between the four corner points. Then the last one is subtracted
> from the sum of the first two to prevent double counting the
> corners.

Excellent.
My code for rendering a Coons patch does exactly that.


> > And of course, it's then trivial to calculate the mean and Gaussian curvature of
> > the surface at any point.
>
> I am afraid you are a bit ahead of me when it comes to those
> curvature calculations. It would be nice to have a function
> controlled pigment that shows the curvature across the surface.
> to see how you would implement that.

See attached.  Let me know if you need any references to explain how to
calculate the curvature.

> In fact,
> while writing this, I realized myself that the number of control
> points along opposing edges doesn't even need to be the same to
> begin with.

Yes, since we can interpolate along any edge, I would agree that the degree of
any Bezier curve describing an edge is irrelevant.


I am very interested in using the curvature to modulate a texture for purposes
similar to proximity patterns.  I know that there is an excellent ShaderToy
shader that demonstrates this.

I also think that using curvature to control "attractors" (discussed in another
recent thread) would be a very interesting application.

Also, there was a discussion about using patches and cubes to distort an object,
and I think it would be interesting to explore the possibility of using a patch
to distort a pattern mapped to a unit square.  I suppose that it would have to
be the inverse mapping of the unit square to the patch . . .

And you are right, this kind of thing is fun.
Regardless of the people who question our unique idea of "fun"  ;)

- BW


Post a reply to this message


Attachments:
Download '2022_surfacecurvatureattempt.pov.txt' (30 KB)

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