POV-Ray : Newsgroups : povray.binaries.utilities : place objects on mesh - PERL script Server Time
21 Dec 2024 09:59:31 EST (-0500)
  place objects on mesh - PERL script (Message 1 to 2 of 2)  
From: David El Tom
Subject: place objects on mesh - PERL script
Date: 21 Sep 2005 20:26:16
Message: <4331fa28@news.povray.org>
while trying to model something hairy, I came up with a small PERL 
script that parses an include file with mesh data in mesh2 format and 
creates an include file with arrays of evenly distributed points on the 
mesh and corresponding normals as well as uv informations (if aviable).

Why an external script, you may ask.
The answer is, that I found no way to access the internal data of a 
declared mesh. So I would had to write a parser in SDL to parse the mesh 
include file.
PERL seemed the better choice to me as it is made to analyse and process 
text files (Practical Extraction and Report Language), also I found
that there is an significant speed difference in using this script and 
parsing the result in POVRay compared with pure SDL.

One of the early versions of this script createt an include with over 
1.7 million points and normals form a mesh with roughly 68000 facettes 
in ca. 40 sec.

know issuses are high memory consumption if placing huge numbers of points.

use and / or modify at your will.

would be nice if you drop me a message if you have suggestions for 
improvments.

... dave


Post a reply to this message


Attachments:
Download 'us-ascii' (20 KB)

From: David El Tom
Subject: Re: place objects on mesh - PERL script
Date: 21 Sep 2005 20:40:58
Message: <4331fd9a$1@news.povray.org>
don't know why the web interface doesn't show the name right.
Just save attached file as place_on_mesh of place_on_mesh.pl make it 
executable or feed PERL interpreter directly with it.

... dave


Post a reply to this message

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