POV-Ray : Newsgroups : povray.general : Mesh polygon reduction? : Re: Mesh polygon reduction? Server Time
20 Nov 2024 10:22:48 EST (-0500)
  Re: Mesh polygon reduction?  
From: Jérôme Grimbert
Date: 3 Oct 2001 05:02:27
Message: <3BBAD42B.BB69449A@atosorigin.com>
Thanks for the clarification.

jarbee wrote:
> 
> After a couple of thousand iterations, the

If so, I suggest you avoid pov-script and rather do that in C as a patch.
Otherwise, speed won't be there...

> values in the 2-d array will now be a 'best fit' solution of the input
> vectors.

Keeping playing with triangles, I can now see how you could simplify a mesh:
Using the vertex, you have to move them to the optimal places. Then you get
some degenerated triangles because two vertices are now identicals.
(Optimimaly, the three vertices are identicals; otherwise, you would need a fine
link between the two extremity to keep connectivity).
And the remaining triangles have been enlarged, so all is well.

> If you watch during the mapping process, it's like a flat sheet of
> paper being slowly pulled up and around the 3d input points.
> 
> My idea isn't to create a professional quality polygon reduction technique,
> or anything of the sort. The above algorithm is fairly simple to program. I
> was basically looking for an easy way to reduce the number of triangles in a
> mesh, with an expected loss of quality, so I could make paper models of some
> of my simple meshes.


Beware, you are thinking of a 3D to 2D mapping. 
Not all surfaces can support that.

IMO, the mapping for simplifying the mesh should be from 3D to 3D.
It could start as the set of vertices of a cubic cristal, into which you
push the initial mesh, fusionning the small triangles and moving the new
vertices along an attraction function (gravity-like, maybe limited scope). 
Then sampling the mesh-vertices along the new vertices set, 
and removing degenerates triangles.

> increase polygon count. 

That's one is easy: in every triangle, lies more triangles.
It can already be done with Warp's patch, as a simple script.
(Choose how you split a triangle: 3 or 4 triangles, recursion is an option).

> Add randomness. 

That's one too: move each vertex according to a 3D-noise pattern.
It can already be done with Warp's patch, as a simple script.

> Restrict
> the minimum or maximum size of each triangle used.

The maximum size restriction is easy, just adding an #if to the increase
of triangles. (But you will like to define the 'size' first, because the
definition might vary).

The minimum is the problem of reducing the number of triangles anyway.

> a Kohonen network



> 
> The analogy I was thinking of is that of color quantization 

Ok, thanks for the analogy, it give some light here!

> 
> This is just an idea at the moment. Am I being too ambitious, or
> thoughtless? Is there an obvious, easier way to accomplish this?

Excepted for the reduction, all the others are easy to do, and can
be done within a pov-scene. (even if parse speed could be increased 
by adding another patch).

The reduction is probably possible, but it will definitely require speed.

IMHO, you are getting addicted to mesh. :-)
You may want to look at some other people pages.
I would recommend: 
  http://www.geocities.com/ccolefax/index.html
  http://www.flash.net/~drsledge/manual/manual.htm


Post a reply to this message

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