POV-Ray : Newsgroups : povray.text.scene-files : Isosurface - hexagonal pattern functions Server Time
1 Nov 2024 03:18:37 EDT (-0400)
  Isosurface - hexagonal pattern functions (Message 1 to 1 of 1)  
From: R  Suzuki
Subject: Isosurface - hexagonal pattern functions
Date: 27 Nov 2001 23:32:15
Message: <3c0468cf@news.povray.org>
// The image is shown in p.b.i

// Persistence of Vision Ray Tracer Scene Description File
// File: 011125b.pov
// Vers: 3.5 beta 7
// Desc: Isosurface with hexagonal pattern functions
//       Time for trace: 4 min for 640x480 NoAA on 600MHz Celeron
// Date: 11/27/2001
// Auth: Ryoichi Suzuki  < r-s### [at] aistgojp >
//
#version 3.5;
#include "colors.inc"
#include "functions.inc"
#include "stones.inc"

camera { location  <0, 0., -20.> direction 4.2*z
  right  x*image_width/image_height
  look_at <0.0, 0.0, 0.0>
}

light_source {< 40, 50,-80>*2  color rgb <1.0,0.95,0.8>}
light_source {<-32, 56,-48> color rgb <0.15, 0.25,0.2> shadowless}

sky_sphere { pigment { gradient y
 color_map{[.0 rgb <.2,.25,.1>] [.6 rgb <.0,.1,.25>][1. rgb <.2,.25,.1>]}
}}

#declare S_W=8;
#declare S_H=4.7;
#declare S_R=0.15;
#declare C_IR3=0.577350269; // 1/sqrt(3)
#declare C_IPI4=4/pi;

#declare GX=function{f_hex_x(x,y,z,0)}
#declare GY=function{f_hex_y(x,y,z,0)}
#declare GR=function{sqrt(GX(x,y,z)^2+GY(x,y,z)^2)}
#declare GL=function{abs(GX(x,y,z)*C_IR3-GY(x,y,z))*0.75}
#declare GA=function{sqrt(GR(x,y,z)^2-GL(x,y,z)^2)}

#macro  CYL1(X,Y,MAXG)
isosurface{
   function{ min(Func1(atan2(x,z)*C_IPI4*S_W, y,
      f_sphere(x,y*0.85,z,S_W)),  f_sphere(x, y*0.665, z,
S_W-S_R*1.5)*MAXG)}
   contained_by{box{<-S_W-S_R,-S_H,-S_W-S_R>,
                    <S_W+S_R, S_H, S_W+S_R>}}
   max_gradient MAXG
   translate<X,Y,0>
   texture{T_Stone8}
   scale 0.125
}
#end

// Left
#declare Func1=function(x,y,z){f_rounded_box(GX(x,y,z),0,z, S_R, 0.7,1,S_R)}
object{CYL1(-S_W*2.1, -S_H*3, 1)}

#declare Func1=function(x,y,z){f_rounded_box(.87-GX(x,y,z),0,z,
S_R,0.2,1,S_R)}
object{CYL1(-S_W*2.1, -S_H*1, 1)}

#declare Func1=function(x,y,z){f_rounded_box(GY(x,y,z),0,z,  S_R,0.2,1,S_R)}
object{CYL1(-S_W*2.1,  S_H*1, 1)}

#declare Func1=function(x,y,z){f_rounded_box(GR(x,y,z),0,z,  S_R,0.6,1,S_R)}
object{CYL1(-S_W*2.1, S_H*3, 1) }


// Center
#declare Func1=function(x,y,z){f_rounded_box(GA(x,y,z),0,z,
S_R,0.65,1,S_R)}
object{CYL1(0, -S_H*3, 1) }

#declare Func1=function(x,y,z){f_rounded_box(GX(x,y,z)*1, GL(x,y,z), z,
                                  S_R,0.75,S_R,S_R) }
object{CYL1(0, -S_H*1, 1) }

#declare Func1=function(x,y,z){f_rounded_box(GL(x,y,z),0,z,  S_R, 0.2,
1,S_R)}
object{CYL1(0, S_H*1, 1) }

#declare Func1=function(x,y,z){f_rounded_box(GX(x,y,z)*1, GY(x,y,z), z,
                                  S_R,0.75,0.2,S_R)}
object{CYL1(0, S_H*3, 1) }


// Right
#declare Func1=function(x,y,z){f_rounded_box(GX(x,y,z)-0.4, GL(x,y,z), z,
                                  S_R,0.35,S_R,S_R) }
object{CYL1(S_W*2.1, -S_H*3, 1) }

#declare Func1=function(x,y,z){f_rounded_box(GX(x,y,z)-GY(x,y,z),
GL(x,y,z),z,
                                  S_R,0.4,S_R,S_R) }
object{CYL1(S_W*2.1, -S_H*1, 1.5) }

#declare Func1=function(x,y,z){f_rounded_box(GY(x,y,z), GL(x,y,z), z,
                                  S_R, 0.3,S_R,S_R) }
object{CYL1(S_W*2.1, S_H*1, 1) }

#declare Func1=function(x,y,z){ f_rounded_box(GX(x,y,z)*1, GY(x,y,z), z,
                                     0.1,0.8,0.1,0.1)
  |f_rounded_box(GX(x,y,z)-GY(x,y,z)*0.5-.5, .2-GL(x,y,z),z,
0.1,0.1,0.1,0.1)
  |f_rounded_box(GX(x,y,z)-.4, .2-GL(x,y,z), z,  0.1, 0.1, 0.2, 0.1) }
object{CYL1(S_W*2.1, S_H*3, 1.5)}


Post a reply to this message

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