POV-Ray : Newsgroups : povray.general : Envelope deformation Server Time
8 Aug 2025 12:36:27 EDT (-0400)
  Envelope deformation (Message 19 to 28 of 28)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Josh English
Subject: Re: Envelope deformation
Date: 27 Jul 2025 19:04:11
Message: <6886b06b$1@news.povray.org>
On 7/26/2025 10:46 PM, ingo wrote:
> Josh,
> 
> for mesh and bicubic patches deformations of pre-made models is hard. One can
> use scripts to extract .obj files in to mesh.
> 
> When one creates mesh and patches, things are easier. You can "just" remodel the
> object with different parameters. Think extruding, lofting, sor or even
> parametrics. Very old code below for patch modelling and clock guided
> deformation.
> 
> The use of deformation grids (cubes) in 3d works. Sorry, my experiments for that
> are lost. It is basically not so different from "boning", you have to virtually
> "attach" vertices to the cubes in a grid. In similar vain you can use a single
> spline to deform a mesh. But, it all has to be done to arrays. That's why I
> build arrays first and the mesh from that in the meshmaker macros. When you
> adapt the array building system you can add springiness, like in cloth
> generation systems to get gel like objects that deform.

My modeling system does this with a Modeling array and it then creates 
the array of Control points needed to create the array of bicubic 
patches I want.

I found Nathan Reed's page, quoting Inigo Quilez' 
https://iquilezles.org/articles/ibilinear/, on the same bilinear 
interpolation I've been doing on my modeling grids. What I hadn't been 
doing was all the algebra that allows for hopefully a faster calculation.

My bicubic modeling system can handle sheets and cylinders and box-like 
shapes, but so far I don't have an easy way to combine models into one 
modeling array that would allow for sharp corners. I have a few ideas 
brewing, but only sketches of how I could do it. I suspect for each 
element of a building I want to have I'll need to create a macro to 
generate the section, and then deform the control grid as needed. I'm 
still noodling on it.

Josh


Post a reply to this message

From: Bald Eagle
Subject: Re: Envelope deformation
Date: 27 Jul 2025 19:55:00
Message: <web.6886bbf327ff66201f9dae3025979125@news.povray.org>
Josh English <Jos### [at] joshuarenglishcom> wrote:
> . . . but so far I don't have an easy way to combine models into one
> modeling array that would allow for sharp corners.

https://news.povray.org/povray.binaries.images/thread/%3Cweb.5da27a2a65c96eb4eec112d0%40news.povray.org%3E/?ttop=445868
&toff=650&mtop=428668

Like the leftmost part?

https://news.povray.org/povray.binaries.images/attachment/%3Cweb.5da912bb21826f334eec112d0%40news.povray.org%3E/serpent
inebeltprism.png?ttop=445868&toff=650

- BW


Post a reply to this message

From: Josh English
Subject: Re: Envelope deformation
Date: 28 Jul 2025 11:41:35
Message: <68879a2f$1@news.povray.org>
On 7/25/2025 7:04 PM, Bald Eagle wrote:
> Josh English <Jos### [at] joshuarenglishcom> wrote:
>> On 7/25/2025 9:16 AM, Bald Eagle wrote:
>>> Perhaps a script could be written to convert mesh and mesh2 objects to arrays,
>>> and then we can have a macro to define the mesh from those arrays.
>>
>> We would need to be able to serialize the mesh objects, though. I don't
>> know if 4.0 has any plans for that sort of thing. It would be nice to be
>> able to export them after a complicated modeling job.
>>
>> Then again, I have Python at hand and I suspect most of us know other
>> coding languages that could do the same job. I'm trying to be an SDL
>> purist, probably to my detriment.
>>
>> Josh
> 
> Well, we have #read and #write.
> I've written tens of thousands of bicubic patch objects to files that way.
> 
> So it shouldn't be that big of a problem to write a distorted mesh to a new
> file.
> 
> - BE
> 
I do that, too. I create arrays that track arrays and shove them all 
into a mesh2 object. It would be nice to be able to take the created 
mesh2 object and serialize instead of creating everything, writing to a 
file, then importing it. But that's a high-level language thing.

I keep getting tripped up with my years of Python where everything is an 
object.


Post a reply to this message

From: ingo
Subject: Re: Envelope deformation
Date: 28 Jul 2025 12:00:00
Message: <web.68879e0927ff662017bac71e8ffb8ce3@news.povray.org>
but so far I don't have an easy way to combine models into one
> modeling array that would allow for sharp corners.

Mmmm, what about weighting the knots? for maximum smoothness than handles shoud
be equally long and have the exact opposite direction. Lets call that a weight
of 1.

Weight of 0 could be handle length 0.0. other weights are interpolation of the
two extrema.

This scheme is not exact, for example, it does not account for asymmetric
handles, but it could be a starting point for tinkering.

With a modeller, no idea if it is not build in.

ingo


Post a reply to this message

From: Bald Eagle
Subject: Re: Envelope deformation
Date: 28 Jul 2025 17:15:00
Message: <web.6887e74827ff66201f9dae3025979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> I think that with a second
> example perhaps and "fleshing out" your notes, this topic too would make a
> useful/valuable reference in the wiki.

Well, yes - however I was thinking about it today and tracking down some details
as a refresher, and any circle needs 4 bezier splines to get a good
approximation, so several of those shapes would really require 4-16 Bezier
Parallelpipeds to be stitched together.

Might not be so bad since I already worked that out and have example code but
.....  ugh.  Work.


I will add it to The List.

- BW


Post a reply to this message

From: Josh English
Subject: Re: Envelope deformation
Date: 28 Jul 2025 20:38:54
Message: <6888181e$1@news.povray.org>
On 7/28/2025 8:58 AM, ingo wrote:
>   but so far I don't have an easy way to combine models into one
>> modeling array that would allow for sharp corners.
> 
> Mmmm, what about weighting the knots? for maximum smoothness than handles shoud
> be equally long and have the exact opposite direction. Lets call that a weight
> of 1.
> 
> Weight of 0 could be handle length 0.0. other weights are interpolation of the
> two extrema.
> 
> This scheme is not exact, for example, it does not account for asymmetric
> handles, but it could be a starting point for tinkering.
> 
> With a modeller, no idea if it is not build in.
> 
> ingo
> 
> 
> 
My rough rough rough idea is to build a copy of the Modeling Grid (which 
is a 2D array) with a equally sized grid of <1,1,1,1> values (which 
would cover positive and negative U and positive and negative V 
weights). When I create the control point grid I create the internal 
control points as 1/3rd the distance towards the adjoining point by 
default.

So I could multiply that 1/3rd distance by the weight factor, or just 
default the weight (or smoothness) factor to 1/3 across the board and 
then tighten things up as necessary, making sure to not set any of them 
to 0 because that will collapse the bicubic patch. At least, I think it 
will break the bicubic patch.

I have to play with it down the road. I'm still trying to mimic  Oskar 
Stålberg's irregular grids from Townscaper for this project.

Josh


Post a reply to this message

From: Bald Eagle
Subject: Re: Envelope deformation
Date: 29 Jul 2025 13:55:00
Message: <web.68890ae927ff66205985c6de25979125@news.povray.org>
Josh English <Jos### [at] joshuarenglishcom> wrote:

> I have to play with it down the road. I'm still trying to mimic  Oskar

>
> Josh

Is there a problem with simply butting 2 Bezier splines next to one another and
making a sharp bend that way?



irregular grids, and provided tutorials.

I see where the Wavefront Collapse is going now.  :)

- BE


Post a reply to this message

From: Bald Eagle
Subject: Re: Envelope deformation
Date: 29 Jul 2025 14:15:00
Message: <web.68890e7f27ff66205985c6de25979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
 so several of those shapes would really require 4-16 Bezier
> Parallelpipeds to be stitched together.
>
> Might not be so bad since I already worked that out and have example code but
> .....  ugh.  Work.

However . . . I just recalled working out how to split a Bezier spline into 2 -
so I could do that recursively, and get a whole connected series of cubes, and
then just work out where the control points need to be for any given shape.

- BW


Post a reply to this message

From: Josh English
Subject: Re: Envelope deformation
Date: 31 Jul 2025 11:18:47
Message: <688b8957$1@news.povray.org>
On 7/29/2025 10:54 AM, Bald Eagle wrote:
> Josh English <Jos### [at] joshuarenglishcom> wrote:
> 
>> I have to play with it down the road. I'm still trying to mimic  Oskar
>> Stålberg's irregular grids from Townscaper for this project.
>>
>> Josh
> 
> Is there a problem with simply butting 2 Bezier splines next to one another and
> making a sharp bend that way?
> 
> 
> There seem to be a number of people who have implemented Oskar Stålberg's
> irregular grids, and provided tutorials.
> 
> I see where the Wavefront Collapse is going now.  :)
> 
> - BE
> 
> 
> 
My box modeler does this by extracting each face and generating the 
bicubic patches for each side.

The problem as I see it is how do I tell my modeling system "this bit is 
flat but that bit is round"?

As for the irregular grids, it's also not a matter of finding the 
quadrilaterals and drawing them, it's a matter of creating them and 
keeping track of them so I can traverse the irregular relaxed grid.

And yes, this is exactly all for this wave function collapse thing I'm 
building.

Josh


Post a reply to this message

From: Bald Eagle
Subject: Re: Envelope deformation
Date: 31 Jul 2025 11:55:00
Message: <web.688b91d027ff6620e6b881e925979125@news.povray.org>
Josh English <Jos### [at] joshuarenglishcom> wrote:

> My box modeler does this by extracting each face and generating the
> bicubic patches for each side.
>
> The problem as I see it is how do I tell my modeling system "this bit is
> flat but that bit is round"?

Need way more information and context to offer intelligent advice / solution.
Where is your input coming from?
Flat and round where?  On the edges?  On the face?
Can you use trace () ?
Maybe you need iterative interaction like I did with my analytical tangent
scene.
Details.

> As for the irregular grids, it's also not a matter of finding the
> quadrilaterals and drawing them, it's a matter of creating them and
> keeping track of them so I can traverse the irregular relaxed grid.

When I was making the Bezier stitched torus, I had my shape that was defined by
a set of parametric equations.  So I wrote macros to use where I was on the
parametric to find what patch I was on, and where in that patch I was.

Provide a workflow, diagrams, examples, etc - and there are surely solutions for
doing this.
If people are already doing it in other languages / software packages, we can
surely do it in POV-Ray.

> And yes, this is exactly all for this wave function collapse thing I'm
> building.

I see you like to bite off huge projects like I do  :D


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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