POV-Ray : Newsgroups : povray.general : Are there any utilities that convert a povray object to a povray mesh2? Server Time
5 Aug 2024 16:13:59 EDT (-0400)
  Are there any utilities that convert a povray object to a povray mesh2? (Message 1 to 7 of 7)  
From: Patrick Dugan
Subject: Are there any utilities that convert a povray object to a povray mesh2?
Date: 6 Aug 2002 13:05:17
Message: <3d5001cd$1@news.povray.org>
Are there any utilities that convert a povray object to a povray mesh2?

For example, I have an object which consists of a box with several spheres
"differenced" out of that box.  (looks like Swiss cheese)

I would assume that a mesh2 version of that object would render much faster
than the "differenced" original version.  Are there such utilities and how
hard would this be to accomplish?  If it really helps I would even prefer
the entire scene get converted to speed up the render.


Patrick Dugan


Post a reply to this message

From: Christopher James Huff
Subject: Re: Are there any utilities that convert a povray object to a povray mesh2?
Date: 6 Aug 2002 13:34:04
Message: <chrishuff-5BC6C0.12235906082002@netplex.aussie.org>
In article <3d5001cd$1@news.povray.org>,
 "Patrick Dugan" <pat### [at] usnetcomcorpcom> wrote:

> Are there any utilities that convert a povray object to a povray mesh2?

No. You could probably use an unofficial version of POV that has Warp's 
patch to tessellate the object and write the mesh to a file, though. 
Someone else wrote a better tesselation patch, but I don't know if it 
has the mesh data access that Warp's patch does.


> I would assume that a mesh2 version of that object would render much faster
> than the "differenced" original version.  Are there such utilities and how
> hard would this be to accomplish? 

That might be a bad assumption. Boxes and spheres are pretty fast, a 
difference using them could easily be faster than an equivalent mesh.


>  If it really helps I would even prefer the entire scene get 
> converted to speed up the render.

It would be extremely difficult to write such a utility, it would have 
to parse the POV-Ray scene language and implement tessellation for all 
the POV-Ray shapes, then output a mesh version of the final scene. And 
then there would be problems with the automatic tesselation of some 
shapes, you would have to use a pretty high resolution. The resulting 
scene would take a huge amount of memory, and probably still have lots 
of visible artifacts from the triangles.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Patrick Dugan
Subject: Re: Are there any utilities that convert a povray object to a povray mesh2?
Date: 6 Aug 2002 15:38:51
Message: <3d5025cb$1@news.povray.org>
> > I would assume that a mesh2 version of that object would render much
faster
> > than the "differenced" original version.  Are there such utilities and
how
> > hard would this be to accomplish?
>
> That might be a bad assumption. Boxes and spheres are pretty fast, a
> difference using them could easily be faster than an equivalent mesh.
>

The reason I am assuming the improvement is: If I create an object using
differences and render it and then create
the same object but using unions and render it, the render time is much
faster.  I thought that differences slowed down
rendering.  I felt that if a mesh (or mesh2) object didn't have differences
it should render faster.
Of course my assumptions are probably as full of holes as my objects!

Patrick Dugan


Post a reply to this message

From: Christopher James Huff
Subject: Re: Are there any utilities that convert a povray object to a povray mesh2?
Date: 6 Aug 2002 15:51:50
Message: <chrishuff-364CF2.14414706082002@netplex.aussie.org>
In article <3d5025cb$1@news.povray.org>,
 "Patrick Dugan" <pat### [at] usnetcomcorpcom> wrote:

> The reason I am assuming the improvement is: If I create an object using
> differences and render it and then create the same object but using 
> unions and render it, the render time is much faster.  I thought that 
> differences slowed down rendering.  I felt that if a mesh (or mesh2) 
> object didn't have differences it should render faster.
> Of course my assumptions are probably as full of holes as my objects!

A difference is harder to calculate than a union, that's why it is 
slower. I don't know what your reasoning is that makes you think a mesh 
is automatically faster because a difference is slower than a union with 
the same shapes. The mesh primitive is a completely separate shape, not 
related to either of those, so you would need to make a mesh version to 
make any comparison.

The mesh code in POV is very efficient, it is quite possible it will 
render faster than your CSG. Or it might not, you would need a lot of 
triangles to get a good approximation of the CSG. It won't be worth the 
trouble and memory unless your CSG is very slow, and there might be a 
way to make the CSG faster.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Warp
Subject: Re: Are there any utilities that convert a povray object to a povray mesh2?
Date: 6 Aug 2002 17:44:47
Message: <3d50434f@news.povray.org>
Christopher James Huff <chr### [at] maccom> wrote:
> No. You could probably use an unofficial version of POV that has Warp's 
> patch to tessellate the object and write the mesh to a file, though. 

  The problem with the tesselation process is that it gives a really
inaccurate result for sharp edges. I don't know if there's some tesselation
algorithm which works good with sharp edges (ie. tries to find them and
make triangle edges to follow them).

  On the other hand, perhaps he was looking at another approach: To have
some mesh creation engine to which you could say things like "create a
box here", "now difference a sphere of this resolution from the box" and
it would create the mesh from this information (in a similar way as Moray
creates its wireframe previews).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Mike Williams
Subject: Re: Are there any utilities that convert a povray object to a povray mesh2?
Date: 7 Aug 2002 00:04:54
Message: <jbKzbDA8vJU9EwZM@econym.demon.co.uk>
Wasn't it Patrick Dugan who wrote:
>Are there any utilities that convert a povray object to a povray mesh2?
>
>For example, I have an object which consists of a box with several spheres
>"differenced" out of that box.  (looks like Swiss cheese)
>
>I would assume that a mesh2 version of that object would render much faster
>than the "differenced" original version.  Are there such utilities and how
>hard would this be to accomplish?  If it really helps I would even prefer
>the entire scene get converted to speed up the render.

It might also be worth taking a look at my POV holes tutorial. 
<http://www.econym.demon.co.uk/holetut/index.htm>

This shows a case where it was possible to speed up the rendering time
of a slab with 1600 holes differenced out of it from over 26 minutes to
only 5 seconds.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Le Forgeron
Subject: Re: Are there any utilities that convert a povray object to a povray mesh2?
Date: 7 Aug 2002 03:31:52
Message: <3D50CCE8.3020308@free.fr>
Christopher James Huff wrote:

> In article <3d5001cd$1@news.povray.org>,
>  "Patrick Dugan" <pat### [at] usnetcomcorpcom> wrote:
> 
> 
>>Are there any utilities that convert a povray object to a povray mesh2?
>>
> 
> No. You could probably use an unofficial version of POV that has Warp's 
> patch to tessellate the object and write the mesh to a file, though. 
> Someone else wrote a better tesselation patch, but I don't know if it 
> has the mesh data access that Warp's patch does.
> 


If you are writing about my tesselation patch, because it is based on
Warp's code, it of course also have the access to the mesh data.
See http://jgrimbert.free.fr/pov/
(main site in french, use of babelfish might help) for download
(Make me think that this part of the patch is not documented on
my page... )

The code is available, but officially forbidden of importation in any 
states of the USA (at least not before end of 2004, unless the law get
some new extension as was done with the Mickey Mouse business lately).

> 
> 
>>I would assume that a mesh2 version of that object would render much faster
>>than the "differenced" original version.  Are there such utilities and how
>>hard would this be to accomplish? 
>>
> 
> That might be a bad assumption. Boxes and spheres are pretty fast, a 
> difference using them could easily be faster than an equivalent mesh.
> 
If you want to difference some meshs, I would suggest that you take a look

at the GTS library. Generating a GTS box and a GTS sphere is "easy",
(GTS: The Gnu Triangulated Surface Library, 
http://sourceforge.net/projects/gts/ ), and they provide the utilities
to make the difference/intersection/union (IIRC).

Alas, Gnu code and Pov do not mix well at the licence level, so all
I provide is a GTS import/export functionnality in the pov patch.
Only trouble with GTS is that there is no texture !


Post a reply to this message

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