POV-Ray : Newsgroups : povray.text.scene-files : iso-lathe, iso-prism Server Time
23 Dec 2024 02:23:09 EST (-0500)
  iso-lathe, iso-prism (Message 1 to 1 of 1)  
From:
Subject: iso-lathe, iso-prism
Date: 18 Feb 2002 05:40:01
Message: <3oj17ukbdclmo92oljkd1pisr6ubsaasf2@4ax.com>
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

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