|
|
according to thread started at
http://news.povray.org/3c6d8a2c%40news.povray.org
here is a script to make lathe and prism object with shape builded with new
spline{} syntax, image probably after moment at p.b.i
More complicated lathes and prisms need more work.
ABX
//START
#version 3.5;
#include "functions.inc"
light_source{-4+9*y 1}
camera{}
// iso-lathe
#local Max=10;
#local Step=1;
#local MinR=2;
#local MaxR=3;
#local S=seed(0);
#local Lathe_Spline=spline{
cubic_spline
#local N=0;
#while (N<=Max)
N,rand(S)*(MaxR-MinR)+MinR
#local N=N+1;
#end
};
#local f_Lathe_Spline=function{spline{Lathe_Spline}};
isosurface{
function{f_r(x,0,z)-f_Lathe_Spline(y).x}
contained_by{box{<-3,0,-3><3,Max,3>}}
pigment{radial frequency 36}
translate Max*<-.5,-.5,2>
}
// iso-prism
#local Max=20;
#local Height=10;
#local MinR=2;
#local MaxR=3;
#local S=seed(0);
#local Prism_Spline=spline{
cubic_spline
#local N=0;
#while (N<Max)
N,vrotate((rand(S)*(MaxR-MinR)+MinR)*x,y*N*360/Max)
#local N=N+1;
#end
}
#local f_Prism_Spline=function{spline{Prism_Spline}}
parametric{
function{f_Prism_Spline(u).x}
function{v}
function{f_Prism_Spline(u).z}
<0,0><Max-1,Height>
contained_by{box{<-2*MaxR,0,-2*MaxR><2*MaxR,Height,2*MaxR>}}
precompute 18 x,z
pigment{radial frequency Max*3}
translate -.5*Height*y
rotate 45*z
rotate 45*x
rotate 30*y
translate Height*<.5,0,2>
}
//END
Post a reply to this message
|
|