POV-Ray : Newsgroups : povray.newusers : Render to geometry / tesselate CSG Server Time
7 Jul 2024 07:38:57 EDT (-0400)
  Render to geometry / tesselate CSG (Message 1 to 7 of 7)  
From: Mr
Subject: Render to geometry / tesselate CSG
Date: 6 Oct 2009 12:25:00
Message: <web.4acb6d8f90192b14fedfeaac0@news.povray.org>
This is probably one of these frequently asked "I haven't understood that Povray
is just a renderer" questions but still :
Does povray have a way to output mesh (OBJ?) out of its primitives or CSG for
reuse in external programs instead of shading, rendering them? This would be so
useful in any pipeline. Any hope of it being implemented one day?


Post a reply to this message

From: Alain
Subject: Re: Render to geometry / tesselate CSG
Date: 6 Oct 2009 13:01:44
Message: <4acb77f8$1@news.povray.org>

> This is probably one of these frequently asked "I haven't understood that Povray
> is just a renderer" questions but still :
> Does povray have a way to output mesh (OBJ?) out of its primitives or CSG for
> reuse in external programs instead of shading, rendering them? This would be so
> useful in any pipeline. Any hope of it being implemented one day?
> 
> 
> 
Not directly.

There are macros that exist to create mesh versions of various objects, 
and, usualy, you can instruct those to create a file containing the mesh 
that was created.
BUT, those mesh are in POV-Ray format: an .inc file containing a mesh or 
mesh2 object(s).
You'd need some more treatment to convert those to another format, like 
OBJ. It may be possible to create that kind of file directly, but you'll 
have to create the header and internal file structure yourself.



Alain


Post a reply to this message

From: Mr
Subject: Re: Render to geometry / tesselate CSG
Date: 6 Oct 2009 13:30:00
Message: <web.4acb7e3b1836af0bfedfeaac0@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:

> Not directly.
>
> There are macros that exist to create mesh versions of various objects,
> and, usualy, you can instruct those to create a file containing the mesh
> that was created.
> BUT, those mesh are in POV-Ray format: an .inc file containing a mesh or
> mesh2 object(s).
> You'd need some more treatment to convert those to another format, like
> OBJ. It may be possible to create that kind of file directly, but you'll
> have to create the header and internal file structure yourself.
>
>
>
> Alain

That's actually better than I expected, You mean with that macro, I can get a
mesh like object out of e.g. combined isosurfaces? Where can I get it?


Post a reply to this message

From: clipka
Subject: Re: Render to geometry / tesselate CSG
Date: 6 Oct 2009 15:14:58
Message: <4acb9732$1@news.povray.org>
Mr schrieb:
> This is probably one of these frequently asked "I haven't understood that Povray
> is just a renderer" questions but still :
> Does povray have a way to output mesh (OBJ?) out of its primitives or CSG for
> reuse in external programs instead of shading, rendering them?

As POV-Ray does not use meshes internally to represent its primitives, 
but works directly with exact mathematical representations instead 
(expcept of course for meshes themselves :-)) this is not a natural 
thing to do for POV-Ray.

Still, it's not entirely impossible, as POV-Ray gives you all the basic 
building blocks you need: Using SDL and the trace() function, you can 
hack up code to simulate a 3D scanner to generate a point cloud, which 
in turn can be processed further to reconstruct a mesh representation of 
the object; you can use the #fopen and #write commands to export this 
information.

 > This would be so
> useful in any pipeline. Any hope of it being implemented one day?

If you'd decide to actually write such a macro, then yes ;-)


Post a reply to this message

From: Chris B
Subject: Re: Render to geometry / tesselate CSG
Date: 6 Oct 2009 16:25:43
Message: <4acba7c7@news.povray.org>
"Mr" <nomail@nomail> wrote in message 
news:web.4acb7e3b1836af0bfedfeaac0@news.povray.org...
> Alain <aze### [at] qwertyorg> wrote:
>>
>> There are macros that exist to create mesh versions of various objects,
>
> That's actually better than I expected, You mean with that macro, I can 
> get a
> mesh like object out of e.g. combined isosurfaces? Where can I get it?
>

I wrote one such macro about 5 years back to scan body parts and generate 
clothing over a human figure. That could get you part of the way towards 
achieving what you want.

If you download POV-Person at 
http://www.geocities.com/povperson/povperson2a1.zip it contains an include 
file called 'ppclothingmacros.inc'. The first macro in that file is called 
'ppLimbScan' (only about 40 lines of code).
It does what Clipka described, scanning in a circle from a succession of 
points along a line through the object using the POV-Ray trace function to 
find points on the surface of that object. It stores the coordinates of the 
points in one array and the surface normals at those locations in a second 
array. As with any such macro you need to give it a fair bit of information 
to get a good 'scan', much like if you use a real 3D scanner, you need to 
get it to scan from the right place to capture all the nooks and crannies. 
There are therefore quite a few arguments on the macro call that can be 
tweaked to improve the scan.

The 'ppMesh2FromArray' macro later on in the same file converts the two 
arrays into a mesh2 object. That macro may serve as a model for writing out 
the data (using the POV-Ray #write directive) so that you can convert it 
into your target format. The file also contains some other macros that can 
manipulate the data in the arrays, before generating the mesh2 object. 
They're all reasonably well described in the file and I'd be happy to answer 
any questions about them.

Regards,
Chris B.


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Render to geometry / tesselate CSG
Date: 6 Oct 2009 19:10:05
Message: <4acbce4d$1@news.povray.org>
Mr wrote:

> That's actually better than I expected, You mean with that macro, I can get a
> mesh like object out of e.g. combined isosurfaces? Where can I get it?

For isosurface in particular, there is

http://www.econym.demon.co.uk/isotut/approx.htm

For converting other objects to isosurfaces you could try

http://news.povray.org/povray.binaries.scene-files/thread/%3Cweb.4aae23151285f23f15ee2c550%40news.povray.org%3E/


Post a reply to this message

From: Mr
Subject: Re: Render to geometry / tesselate CSG
Date: 6 Oct 2009 19:40:01
Message: <web.4acbd4401836af0b3c3174a50@news.povray.org>
Thank you all, it's actually so close to the obj baker I was hoping for, Not
that I really need it now but it crossed my mind, as an extra motivation to
learn more P.O.V. specific modeling in the long run.


Post a reply to this message

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