// Persistence of Vision Ray Tracer Scene Description File // File: morestuf.pov // Vers: 3.1 // Desc: Some additional shapes to use in scene files, // none of the macros check for illegal numbers // Date: 22 April 2000 // Auth: S Shonfield #macro rounded_box (width_x,highth_y,depth_z,rounding) #union { box {,} box {<0,rounding,rounding>,} box {,} box {,} box {,} box {,} box {,} cylinder {,,rounding} cylinder {,,rounding} cylinder {,,rounding} cylinder {,,rounding} cylinder {,,rounding} cylinder {,,rounding} cylinder {,,rounding} cylinder {,,rounding} cylinder {,,rounding} cylinder {,,rounding} cylinder {,,rounding} cylinder {,,rounding} sphere {,rounding} sphere {,rounding} sphere {,rounding} sphere {,rounding} sphere {,rounding} sphere {,rounding} sphere {,rounding} sphere {,rounding} } #end #macro chamfered_box (width_x,highth_y,depth_z,edge) //not all corners yet #union { box {,} //middle box {,} //sides box {,} box {,} box {<0,edge,edge>,} box {,} box {,} prism {linear_spline linear_sweep edge,highth_y-edge,4,,,<0,edge>,} prism {linear_spline linear_sweep edge,highth_y-edge,4,<0,0>,<0,edge>,,<0,0> translate } prism {linear_spline linear_sweep edge,highth_y-edge,4,<0,0>,<0,edge>,,<0,0> translate } prism {linear_spline linear_sweep edge,highth_y-edge,4,<0,0>,,,<0,0> translate <0,0,depth_z-edge>} prism {linear_spline linear_sweep edge,width_x-edge,4,<0,0>,<-edge,-edge>,<-edge,0>,<0,0> rotate <0,0,-90> translate <0,0,depth_z-edge>} prism {linear_spline linear_sweep edge,width_x-edge,4,<0,edge>,<-edge,edge>,<-edge,0>,<0,edge> rotate <0,0,-90> translate <0,0,0>} prism {linear_spline linear_sweep edge,width_x-edge,4,<0,0>,<-edge,edge>,<0,edge>,<0,0> rotate <0,0,-90> translate <0,highth_y-edge,0>} prism {linear_spline linear_sweep edge,width_x-edge,4,<-edge,0>,<0,0>,<0,edge>,<-edge,0> rotate <0,0,-90> translate <0,highth_y-edge,depth_z-edge>} prism {linear_spline linear_sweep edge,depth_z-edge,4,<0,-edge>,,,<0,-edge> rotate <90,0,0> translate <0,0,0>} prism {linear_spline linear_sweep edge,depth_z-edge,4,<0,0>,,,<0,0> rotate <90,0,0> translate <0,highth_y-edge,0>} prism {linear_spline linear_sweep edge,depth_z-edge,4,<0,-edge>,<-edge,-edge>,<-edge,0>,<0,-edge> rotate <90,0,0> translate } prism {linear_spline linear_sweep edge,depth_z-edge,4,<0,0>,<-edge,0>,<-edge,-edge>,<0,0> rotate <90,0,0> translate } #difference { box {<0,0,0>, rotate <0,45,0>} box {<0,-edge,0>, rotate } rotate <0,-45,0> translate } } #end #macro rounded_cylinder (highth_y,cylinder_radius,rounding) #union { cylinder {<0,rounding,0>,<0,highth_y-rounding,0>,cylinder_radius} cylinder {<0,0,0>,<0,rounding,0>,cylinder_radius-rounding} cylinder {<0,highth_y-rounding,0>,<0,highth_y,0>,cylinder_radius-rounding} torus {cylinder_radius-rounding,rounding translate <0,rounding,0>} torus {cylinder_radius-rounding,rounding translate <0,highth_y-rounding,0>} } #end #macro rounded_cone (highth_y,cylinder_radius,rounding) #union { cone {<0,rounding,0>,cylinder_radius,<0,highth_y-rounding,0>,rounding} // I know this line is wrong, I'll work on it later cylinder {<0,0,0>,<0,rounding,0>,cylinder_radius-rounding} torus {cylinder_radius-rounding,rounding translate <0,rounding,0>} sphere {<0,highth_y-rounding,0>rounding translate <0,highth_y-rounding,0>} } #end #macro wireframe_box (width_x,highth_y,depth_z,wire) #union { cylinder {,,wire} cylinder {,,wire} cylinder {,,wire} cylinder {,,wire} cylinder {,,wire} cylinder {,,wire} cylinder {,,wire} cylinder {,,wire} cylinder {,,wire} cylinder {,,wire} cylinder {,,wire} cylinder {,,wire} sphere {,wire} sphere {,wire} sphere {,wire} sphere {,wire} sphere {,wire} sphere {,wire} sphere {,wire} sphere {,wire} } #end #macro wireframe_sphere_a (sphere_radius,wire) #union { torus {sphere_radius,wire rotate <0,0,0>} torus {sphere_radius,wire rotate <90,0,0>} torus {sphere_radius,wire rotate <0,0,90>} } #end #macro wireframe_sphere_b (sphere_radius,wire) #union { torus {sphere_radius,wire rotate <0,0,0>} torus {sphere_radius,wire rotate <45,0,0>} torus {sphere_radius,wire rotate <90,0,0>} torus {sphere_radius,wire rotate <-45,0,0>} torus {sphere_radius,wire rotate <0,0,45>} torus {sphere_radius,wire rotate <0,0,90>} torus {sphere_radius,wire rotate <0,0,-45>} torus {sphere_radius,wire rotate <90,45,0>} torus {sphere_radius,wire rotate <90,-45,0>} } #end #macro wireframe_cone (cone_highth,base_radius,wire) #union { torus {base_radius,wire} cylinder {,<0,cone_highth,0>,wire rotate <0,0,0>} cylinder {,<0,cone_highth,0>,wire rotate <0,90,0>} cylinder {,<0,cone_highth,0>,wire rotate <0,180,0>} cylinder {,<0,cone_highth,0>,wire rotate <0,270,0>} sphere {<0,cone_highth,0>,wire} } #end #macro wireframe_cylinder (cylinder_highth,cylinder_radius,wire) #union { torus {cylinder_radius,wire} cylinder {,,wire rotate <0,0,0>} cylinder {,,wire rotate <0,90,0>} cylinder {,,wire rotate <0,180,0>} cylinder {,,wire rotate <0,270,0>} torus {cylinder_radius,wire translate <0,cylinder_highth,0>} } #end #macro wireframe_torus (major_radius,minor_radius,wire) #union { torus {major_radius-minor_radius,wire} torus {major_radius+minor_radius,wire} torus {major_radius,wire translate <0,minor_radius,0>} torus {major_radius,wire translate <0,-minor_radius,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,0,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,90,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,180,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,270,0>} } #end #macro wireframe_torus_a (major_radius,minor_radius,wire) #union { torus {major_radius-minor_radius,wire} torus {major_radius+minor_radius,wire} torus {major_radius,wire translate <0,minor_radius,0>} torus {major_radius,wire translate <0,-minor_radius,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,0,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,45,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,90,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,135,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,180,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,225,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,270,0>} torus {minor_radius,wire rotate <90,0,0> translate rotate <0,315,0>} } #end