POV-Ray : Newsgroups : povray.newusers : Render to geometry / tesselate CSG : Re: Render to geometry / tesselate CSG Server Time
5 Oct 2024 15:32:50 EDT (-0400)
  Re: Render to geometry / tesselate CSG  
From: Chris B
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

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