POV-Ray : Newsgroups : povray.binaries.images : Isosurface with straight,twist,straight : Isosurface with straight,twist,straight Server Time
9 Aug 2024 09:02:17 EDT (-0400)
  Isosurface with straight,twist,straight  
From: StephenS
Date: 5 Mar 2005 23:29:13
Message: <422a8719@news.povray.org>
I would like to represent a length of metal 1 inch wide by 3/16 inch thick
that has a 90 degree twist over a 1 inch length.
Following the examples in the documentation (6.5.4.3.7 for twist) I have the
basic shape, but would prefer a less dramatic change from straight to twist.
Can the twist function be changed to start with no rotation, quickly
increase to the desired turns/unit and then back to no rotation?

Stephen

background { color <1.000,1.000,1.000> }
camera {
  location  <    -58.033,     -87.696,      83.175>
  sky       <    0.00000,     0.00000,     1.00000>
  up        <        0.0,         0.0,         1.0>
  right     <    1.33343,         0.0,         0.0>
  angle          2.56896
  look_at   <     -3.480,      -4.962,       4.713>
}

light_source {
  <0.0, 0.0, 0.0>
  color rgb <1.000, 1.000, 1.000>
  translate  <-65.474138, -85.344511, 105.18157>
}

#local fn_A=function{abs(x)-.5};
#local fn_B=function{abs(z)-3/16/2};
#local fn_C=function{abs(y)-.5};
#local N=.25;
#local fn_twistY=function{z*sin(x*2*pi*N) + y*cos(x*2*pi*N)};
#local fn_twistZ=function{z*cos(x*2*pi*N) - y*sin(x*2*pi*N)};
#local fn_twist_Box=function{
   max(
     fn_A(x-.5,y,z),
     fn_B(x,fn_twistY(x,y,z),fn_twistZ(x,y,z)),
     fn_C(x,fn_twistY(x,y,z),fn_twistZ(x,y,z))
     )
   };
#local fn_Box=function{max(fn_A(x,y,z),fn_B(x,y,z),fn_C(x,y,z))};
isosurface {
   function {
      min(fn_Box(x-2,z,y),fn_twist_Box(x-.5,y,z),fn_Box(x,y,z))
   }
   contained_by {box{
    <
     -.5,
     -.5,
     -.5>,
    <
     2.5,
     .5,
     .5>}}
   threshold 0
   accuracy 0.001
   max_gradient 1.294
   max_trace 5
pigment { rgb<.8,.8,.8> }
}


Post a reply to this message


Attachments:
Download 'twist.jpg' (3 KB)

Preview of image 'twist.jpg'
twist.jpg


 

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