|  |  | hi,
see p.t.scene-files for corresponding thread.  the image was rendered from the
code below (which was in part "ripped" from Tsutomu Higo's original scene).
#version 3.8;
global_settings {assumed_gamma 1}
light_source {<2,10,-5> * 1e4 color rgb 1 parallel}
light_source {<-6,-3,-4> * 1e4 color rgb 1 parallel}
camera {
  location <0,0,-10000>
  angle 6
  look_at <0,0,0>
}
#include "higo_sweets.inc"
#declare A = array [6];
#for (i_,1,6)
  #declare A[(i_-1)] = HigoSweet(dictionary {.Sweet: i_});
#end
#declare J=0;
#while (J<3)
  #declare I=0;
  #while (I<2)
    union {
      A[(J+I*2+I)]
      rotate <350-50*I,120,20-30*I>
      translate <-360+340*J,-180+360*I,0>
      no_reflection
      no_shadow
    }
    #declare I=I+1;
  #end
  #declare J=J+1;
#end
background {color rgbt <0,0,.2,1>}
regards, jr.
Post a reply to this message
 Attachments:
 Download 'ths.png' (352 KB)
 
 
 Preview of image 'ths.png'
  
 |  | 
|  |  | hi,
Thomas de Groot <tho### [at] degroot org> 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)
 
 
 |  |