POV-Ray : Newsgroups : povray.binaries.images : challenge: surface connecting cubic_splines Server Time: 11 Dec 2018 16:44:08 GMT
 challenge: surface connecting cubic_splines (Message 1 to 10 of 17)
 From: Le Forgeron Subject: challenge: surface connecting cubic_splines Date: 9 Aug 2018 15:22:07 Message: <5b6c5c1f@news.povray.org>
```If I got the problem exposed in "Smoothing bicubic_patchs, A pain":
* you have four non-coplanar points, each pair of the external 4 sided
figure connected by cubic splines (each pair is adjacent on its spline,
no intermediate point on the spline)

Challenge: have a nice surface which joins each splines.

For start, an illustration of a possible setting.
```

Attachments:

Preview of image 'hull0.png'

Preview of image 'hull1.png'

Preview of image 'hull2.png'

Preview of image 'hull3.png'

 From: Bald Eagle Subject: Re: challenge: surface connecting cubic_splines Date: 9 Aug 2018 16:00:01 Message:
```Le_Forgeron <jgr### [at] freefr> wrote:
> If I got the problem exposed in "Smoothing bicubic_patchs, A pain":
> * you have four non-coplanar points, each pair of the external 4 sided
> figure connected by cubic splines (each pair is adjacent on its spline,
> no intermediate point on the spline)
>
>
> Challenge: have a nice surface which joins each splines.
>
>
> For start, an illustration of a possible setting.

Yes, and now if you iteratively made that smaller, you'd approach the true
surface.  I think with smooth_triangles it would look fairly decent.

How you subdivide such rectangles is the challenge, because you have to
interpolate along the splines.
```
 From: BGimeno Subject: Re: challenge: surface connecting cubic_splines Date: 9 Aug 2018 17:30:55 Message: <5b6c7a4f\$1@news.povray.org>
```El 09/08/18 a las 17:59, Bald Eagle escribió:
> Le_Forgeron <jgr### [at] freefr> wrote:
>> If I got the problem exposed in "Smoothing bicubic_patchs, A pain":
>> * you have four non-coplanar points, each pair of the external 4 sided
>> figure connected by cubic splines (each pair is adjacent on its spline,
>> no intermediate point on the spline)
>>
>>
>> Challenge: have a nice surface which joins each splines.
>>
>>
>> For start, an illustration of a possible setting.
>
> Yes, and now if you iteratively made that smaller, you'd approach the true
> surface.  I think with smooth_triangles it would look fairly decent.
>
> How you subdivide such rectangles is the challenge, because you have to
> interpolate along the splines.
>

http://hof.povray.org/btfh02.html

This is an image that someone made with the first version of my macro
years ago. Unfortunately, real life has kept me away from this project
and I did not continue with it, I have left the project abandoned for
quite some time. In that image smooth_triangle is used and the mesh is
made from cylinders and spheres. I'm going to try to subdivide the mesh
and see how it looks. I'm rewriting from scratch and there's still a
long way to go to implement tessellations like that. Patience.

Bruno Gimeno
```
 From: Bald Eagle Subject: Re: challenge: surface connecting cubic_splines Date: 10 Aug 2018 12:50:00 Message:
```I see the link to the original macro does not work, and I haven't seen a copy of
the original posted here in the forums.
Could you post the original so I could have a look, and learn something?

I'm hoping once it cools off a bit, I'll have some time and attention to do some
more coding, and this seems to fit  in nicely with several projects I'd like to
pursue.

Thanks   :)
```
 From: JimT Subject: Re: challenge: surface connecting cubic_splines Date: 10 Aug 2018 13:20:01 Message:
```BGimeno <bru### [at] gmailcom> wrote:
> El 09/08/18 a las 17:59, Bald Eagle escribió:
> > Le_Forgeron <jgr### [at] freefr> wrote:
> >> If I got the problem exposed in "Smoothing bicubic_patchs, A pain":
> >> * you have four non-coplanar points, each pair of the external 4 sided
> >> figure connected by cubic splines (each pair is adjacent on its spline,
> >> no intermediate point on the spline)
> >>
> >>
> >> Challenge: have a nice surface which joins each splines.
> >>
> >>
> >> For start, an illustration of a possible setting.
> >
> > Yes, and now if you iteratively made that smaller, you'd approach the true
> > surface.  I think with smooth_triangles it would look fairly decent.
> >
> > How you subdivide such rectangles is the challenge, because you have to
> > interpolate along the splines.
> >
>
> http://hof.povray.org/btfh02.html
>
> This is an image that someone made with the first version of my macro
> years ago. Unfortunately, real life has kept me away from this project
> and I did not continue with it, I have left the project abandoned for
> quite some time. In that image smooth_triangle is used and the mesh is
> made from cylinders and spheres. I'm going to try to subdivide the mesh
> and see how it looks. I'm rewriting from scratch and there's still a
> long way to go to implement tessellations like that. Patience.
>
> Bruno Gimeno

I think what you are looking for, given a topologically rectangular array of
points, with coordinates that are in some way geometrically rectangular,
cylindrical or toroidal, is to generate a mesh2 of smooth triangles,
interpolating the points of the grid, with a high apparent level of continuity.
I doubt that an intermediate stage involving Bezier quadrilaterals is the way to
go.

I would think about using Hermite cubics to form the gridlines and Coons patches
with Hermite, rather than linear, interpolation for the surface, though for the
cylindrical and toroidal geometry, I think you would need to specify a curvature
at the joins. Most of the big commercial modellers seem to use NURBS for complex
surfaces so I'm not sure how widely such an idea has been implemented. You need
to solve a tridiagonal set of equations to generate the Hermite cubics,  but
that can be done with for loops.

This should produce e.g a generalised approximate torus using as few as 16
co-ordinates, plus another 8 numbers specifying curvature at the joins.

If you think the idea is interesting, I would do some work on it.

JimT
```
 From: Bald Eagle Subject: Re: challenge: surface connecting cubic_splines Date: 10 Aug 2018 14:20:00 Message:
```"JimT" <nomail@nomail> wrote:

> I think what you are looking for, given a topologically rectangular array of
> points, with coordinates that are in some way geometrically rectangular,
> cylindrical or toroidal, is to generate a mesh2 of smooth triangles,
> interpolating the points of the grid, with a high apparent level of continuity.
> I doubt that an intermediate stage involving Bezier quadrilaterals is the way to
> go.

Perhaps not - I hadn't gotten far enough along with the 3x3 Bezier patch project
to know its exact set of pros and cons.
But the thought was that there would be definite points that the patch passed
through, and those could be used as part of the subdivision.

> I would think about using Hermite cubics to form the gridlines and Coons patches
> with Hermite, rather than linear, interpolation for the surface, though for the
> cylindrical and toroidal geometry, I think you would need to specify a curvature
> at the joins.

Yes, that sounds right.
https://en.wikipedia.org/wiki/Coons_patch

> Most of the big commercial modellers seem to use NURBS for complex
> surfaces so I'm not sure how widely such an idea has been implemented. You need
> to solve a tridiagonal set of equations to generate the Hermite cubics,  but
> that can be done with for loops.

Yes, I had worked out doing de Casteljau's algorithm in SDL, and it seemed to
work.

> This should produce e.g a generalised approximate torus using as few as 16
> co-ordinates, plus another 8 numbers specifying curvature at the joins.
>
> If you think the idea is interesting, I would do some work on it.
>
> JimT

It is - and perhaps you could offer me some insight as to what I got mucked up
in the Bezier patch project, since they seem so similar.

```
 From: B  Gimeno Subject: Re: challenge: surface connecting cubic_splines Date: 11 Aug 2018 16:15:01 Message:
```"Bald Eagle" <cre### [at] netscapenet> wrote:
> "JimT" <nomail@nomail> wrote:
>
> > I think what you are looking for, given a topologically rectangular array of
> > points, with coordinates that are in some way geometrically rectangular,
> > cylindrical or toroidal, is to generate a mesh2 of smooth triangles,
> > interpolating the points of the grid, with a high apparent level of continuity.
> > I doubt that an intermediate stage involving Bezier quadrilaterals is the way to
> > go.
>
> Perhaps not - I hadn't gotten far enough along with the 3x3 Bezier patch project
> to know its exact set of pros and cons.
> But the thought was that there would be definite points that the patch passed
> through, and those could be used as part of the subdivision.
>
>
> > I would think about using Hermite cubics to form the gridlines and Coons patches
> > with Hermite, rather than linear, interpolation for the surface, though for the
> > cylindrical and toroidal geometry, I think you would need to specify a curvature
> > at the joins.
>
> Yes, that sounds right.
> https://en.wikipedia.org/wiki/Coons_patch
>
> > Most of the big commercial modellers seem to use NURBS for complex
> > surfaces so I'm not sure how widely such an idea has been implemented. You need
> > to solve a tridiagonal set of equations to generate the Hermite cubics,  but
> > that can be done with for loops.
>
> Yes, I had worked out doing de Casteljau's algorithm in SDL, and it seemed to
> work.
>
> > This should produce e.g a generalised approximate torus using as few as 16
> > co-ordinates, plus another 8 numbers specifying curvature at the joins.
> >
> > If you think the idea is interesting, I would do some work on it.
> >
> > JimT
>
> It is - and perhaps you could offer me some insight as to what I got mucked up
> in the Bezier patch project, since they seem so similar.
>

Thank you both for the notes. You have shown me an unknown path for me. The
negative part is that a part of my macro will not be limited to the generation
of rectangular meshes. Tesellations of hexagonal, triangular symmetry and many
other motifs can be chosen, which with cylinders, spheres and triangles is
relatively easy to implement. An old version of my macro is right now in
p.b.text-files. It does not include sphere_sweep mode, but instead there are too
many parameters and many improvements to make in the textures section. I'll be
publishing updates periodically now that I've put myself into it. Thanks for the
comments and the help, at the moment I will leave this approach aside until
someone knows how to implement non-rectangular patches.

Bruno Gimeno
```
 From: Bald Eagle Subject: Re: challenge: surface connecting cubic_splines Date: 11 Aug 2018 17:20:05 Message:
```"B. Gimeno" <nomail@nomail> wrote:

> Thank you both for the notes. You have shown me an unknown path for me.

>The negative part is that a part of my macro will not be limited to the generation
> of rectangular meshes.

No worries - see below:

> Tesellations of hexagonal, triangular symmetry and many
> other motifs can be chosen, which with cylinders, spheres and triangles is
> relatively easy to implement.

I just took a bicubic_patch scene I had and  "squished" it into a triangle by
multiplying each row of 4 control points by 1, then 2/3, then 1/3, then 0.
That gives me a triangle-shaped bicubic patch.
That ought to work fine - but I'm thinking that the other control points might
need to be "weighted" to offset the squeezing effect of 4 coincident control
points in the first row, and the narrowing of the patch in rows 2 and 3.
But that's a smoothing issue - build it first, then smooth it.   :)

> An old version of my macro is right now in p.b.text-files.

Yes, I finally found that - thank you!  :)
It will be interesting to look through what you've done and learn a thing or two
myself.

.... now I'm thinking about making a circular bicubic patch....   :D
```
 From: Stephen Subject: Re: challenge: surface connecting cubic_splines Date: 11 Aug 2018 17:42:31 Message: <5b6f2007\$1@news.povray.org>
```On 11/08/2018 18:16, Bald Eagle wrote:
> .... now I'm thinking about making a circular bicubic patch....   :D

IIRC Moray could make circular (cylindrical) bicubic patches.

--

Regards
Stephen
```
 From: Bald Eagle Subject: Re: challenge: surface connecting cubic_splines Date: 11 Aug 2018 19:45:00 Message:
```Stephen <mca### [at] aolcom> wrote:
> On 11/08/2018 18:16, Bald Eagle wrote:
> > .... now I'm thinking about making a circular bicubic patch....   :D

> IIRC Moray could make circular (cylindrical) bicubic patches.

I was speaking of circular, as in disc / disk - shaped.

I think I have Moray on my other laptop - I used it to start modeling The Secret
Passage scene.  :)

But this is what I came up with - not a perfect circle, which is why I wanted to
pursue the 3x3 patch to have more exactly-specified corner points.  Trying to
reverse-interpolate where a point will be based on the control points....
bleh.
```

Attachments: