POV-Ray : Newsgroups : povray.general : Envelope deformation : Re: Envelope deformation Server Time
8 Aug 2025 15:36:54 EDT (-0400)
  Re: Envelope deformation  
From: Bald Eagle
Date: 25 Jul 2025 06:10:00
Message: <web.6883575e27ff66201f9dae3025979125@news.povray.org>
Josh English <Jos### [at] joshuarenglishcom> wrote:
> On 7/24/2025 3:32 PM, Bald Eagle wrote:
> > "jr" <cre### [at] gmailcom> wrote:
> >
> >> "there you are" ;-).  (attached, 42 vectors, 80 faces)
> >
> > Rock, paper, scissors.
> >
> > Bezier Parallelpiped crushes them all.
> >
> > - BE
>
> Are you transforming the mesh as a whole or pulling the vertices out and
> transforming them?
>
> Josh

Unfortunately, there's not a way (that I know of) to access the vertices in a
native mesh.

So I cut/pasted the vertices into an array, and put a loop into the mesh2 to
cycle through the array.

To be able to easily reuse the mesh2 definition, I set a flag to either use the
original vertices, or run a macro to apply the Bezier distortion.

#macro MakeMesh (Distorted)

 mesh2 {
  vertex_vectors {
  42,
  #for (V, 0, 41)
   #if (Distorted)
    DistortedVertex (MeshVertices [V]),
   #else
    MeshVertices [V],
   #end
  #end
  }
.. . . etc.

I know it would be great if we could just easily include any mesh, or run it
through a macro, but at present, I don't think that there's any way to do that.

I am pretty happy that it just required some "minor" modification to the formula
generating code, and this wasn't a major multiple-month project.

Anyway, it shows proof of concept.     :)

- BE

Attached please find all the gnarly, hastily modified code.


Post a reply to this message


Attachments:
Download 'bezier_3d_for_mesh.pov.txt' (19 KB)

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