POV-Ray : Newsgroups : povray.binaries.images : sweets Server Time
7 Dec 2022 04:31:08 EST (-0500)
  sweets (Message 1 to 3 of 3)  
From: jr
Subject: sweets
Date: 9 Apr 2022 07:00:00
Message: <web.62516693b73d709d5834ab476cde94f1@news.povray.org>
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'
ths.png


 

From: Thomas de Groot
Subject: Re: sweets
Date: 10 Apr 2022 02:25:34
Message: <6252785e$1@news.povray.org>
Op 09/04/2022 om 12:57 schreef jr:
> 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).
> 

Thanks for this. Could be the next fashion for my dried frog pills. :-)

-- 
Thomas


Post a reply to this message

From: jr
Subject: Re: sweets
Date: 11 Apr 2022 03:05:00
Message: <web.6253d23e95d05dff5834ab476cde94f1@news.povray.org>
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)

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