|
|
hi,
Thomas de Groot <tho### [at] degrootorg> wrote:
> Thanks for this. Could be the next fashion for my dried frog pills. :-)
:-) attached is a "monkeyed" version of the include, it outputs STL instead of
objects -- you now can 3D print the pills! :-)
below is the procedure I follow, assumes a GNU/Linux or POSIX-ish environment.
first create/tune a shape the "normal" way, then copy the dictionary into a new
scene where the (renamed) macro is called as:
#declare n_ = higo2stl(dict);
the value returned is the number of 'facets'. render the scene with
'all_file=true', creating 'alltext.out' with the STL data embedded. I then use
'sed' to extract that data, ie
$ sed -ne '/^P/d;/solid /,/endsolid /p' alltext.out > higo_sweet_{N}.stl
the STL file can be compressed (gzip or xz) to save space. then convert the STL
to a temp GTS, cleanup the data, and convert to POV-Ray mesh2/mesh. eg
$ stl2gts < higo_sweet_3.stl.gz > higo_sweet_3.raw.gts
$ gtscleanup $TVAL < higo_sweet_3.raw.gts > higo_sweet_3.gts
$ gts2pov < higo_sweet_3.gts > higo_sweet_3.inc
for the TVAL (threshold) argument I use a small value wrt data values, and
gts2pov takes options (for inside_vector, declared name, etc).
enjoy, jr.
Post a reply to this message
Attachments:
Download 'higo_sweets_stl.inc.txt' (7 KB)
|
|