//gmesh18.pov //povray 3.6 scene file originated by Greg M. Johnson #include"transforms.inc" //parameters to describe your presets #declare numsects=3;//number of splines you pre-define as cross-sections #declare startpts=9;//if you have any rings in your pre-defined splines, //this can count the number of points around the ring //parameters to describe your constructed object #declare numrings=68; // number of rings to be shaped along length. #declare npts=56;//number of points evaluated around ring #declare section=array[numsects+2] #declare ringo=array[numrings+1] // The path. // The path is the backbone of your object. You can animate this like a "bone". // path can be any number of points you like. #declare path=spline{ natural_spline 0,<1,0,1>,0.05,<1,0,0>,0.2,<1,4,0>,0.4,<2,8,0>,0.5,<0,9,0>,0.6,<-2,8,0>,0.8,<-1,4,0>,0.95,<-1,0,0>,1.00,<-1,0,1>} // sectionplaces is the list of places that where sections[n], 0<=n<=1.0 will be defined. // sectionplaces must have numsects+2 elements, and start with 0 and end with 1.0 #declare sectionplaces=array[numsects+2]{0,0.25,0.5,0.75,1.0} //leave these two alone. #declare section[0]=spline{linear_spline //leave these alone: the macro always gives closed start 0,<0,0,0,>,1,<0,0,0,>} #declare section[numsects+1]=spline{linear_spline //leave these alone: the macro always gives closed start 0,<0,0,0,>,1,<0,0,0,>} // your pre-defined sections. // The variable startpts can be a quality setting if you're using circular sections. // Sections ought to be in the y=0 plane. // Sections will be swept along the y axis, from their perspective. #declare section[1]=spline{ cubic_spline #declare n=-1; #while (n #declare n=n+1; #end } #declare section[2]=spline{ linear_spline 0, <1,0,0>,0.25,<0,0,1>,0.5,<-1,0,0>,0.75,<0,0,-1>,1,<1,0,0> } #declare section[3]=spline{ cubic_spline #declare n=-1; #while (n #declare n=n+1; #end } // You shouldn't have to mess with anything below here // #declare newradius=array[npts+1] #declare n=0; #while(n, #declare n=n+1; #end #declare a=1; #declare anen=0; #while(anen0.25) #declare np=0; #while(np, , #declare np=np+1; #end , , #else #declare np=0; #while(np, , #declare np=np+1; #end , , #end #declare nspacer=mod(nspacer+0.5,1); #declare a=a+npts; #declare anen=anen+1; #end #declare n=0; #while(n, #declare n=n+1; #end } pigment {rgb 1} } // NOW TO DISPLAY YOUR THEMESH!! object{themesh rotate 160*y translate -8*x} object{themesh rotate -90*x translate 13*y+8*z} object{themesh rotate -104*y translate 11*x+.5*z} light_source{<0,200,-50> color rgb 1} light_source{<0,200,0> color rgb x rotate -80*x rotate 45*y} light_source{<0,200,0> color rgb z rotate -80*x rotate -45*y} light_source{<0,0,0> color rgb 1 translate 10*x } background{rgb 1} camera{location <2,8,-22> look_at <0,4,0>}