Image:Spring2.png

From Wikipedia, the free encyclopedia

Spring2.png (35KB, MIME type: image/png)

A right-handed Spring

Pov-ray source code:

#include "colors.inc"
#include "shapes.inc"

global_settings {
  assumed_gamma 1.0
  max_trace_level 3
  ambient_light 1
}

#declare simple = texture {
  pigment { color<0, 0, 1, 0, 0.5> }
  finish { specular .5 phong .5 phong_size 250}
}

#declare p_radius = 0.25;
#declare w_radius = 0.01;
#declare p_torus = 0.5;
#declare p_spiral = 1;

camera {
  perspective
  location <-15, 0, 7>
  right x/0.75 up z sky z
  look_at  <0, 0, 2>
  angle 22
}

light_source {
  <2,2,2>
  color White
  parallel
  point_at <0,0,0>
}

light_source  {
  <-2,2,2>
  color White
  parallel
  point_at <0,0,0>
}

plane {
  z, -p_radius
  texture { pigment { checker White, <.8,.8,.8> } }
}

isosurface {
  function {  pow(p_torus-sqrt(x*x+y*y), 2) + pow((z + atan2(x,y)/3.14159*p_spiral), 2) }
  contained_by { box { <-p_torus-p_radius, -p_torus-p_radius, -p_spiral-p_radius>, <p_torus+p_radius, p_torus+p_radius, p_spiral+p_radius> } }

  threshold p_radius*p_radius
  accuracy 0.01
  max_gradient 770
  open

  translate <0, 0, 1>
  texture { simple }
}

isosurface {
  function {  pow(p_torus-sqrt(x*x+y*y), 2) + pow((z + atan2(x,y)/3.14159*p_spiral), 2) }
  contained_by { box { <-p_torus-p_radius, -p_torus-p_radius, -p_spiral-p_radius>, <p_torus+p_radius, p_torus+p_radius, p_spiral+p_radius> } }

  threshold p_radius*p_radius
  accuracy 0.01
  max_gradient 770
  open

  translate <0, 0, 3>
  texture { simple }
}

isosurface {
  function {  pow(p_torus-sqrt(x*x+y*y), 2) + pow((z + atan2(x,y)/3.14159*p_spiral), 2) }
  contained_by { box { <-p_torus-w_radius, -p_torus-w_radius, -p_spiral-w_radius>, <p_torus+w_radius, p_torus+w_radius, p_spiral+w_radius> } }

  threshold w_radius*w_radius
  accuracy 0.01
  max_gradient 770
  open

  translate <0, 0, 1>
  texture { pigment { Black } }
}

isosurface {
  function {  pow(p_torus-sqrt(x*x+y*y), 2) + pow((z + atan2(x,y)/3.14159*p_spiral), 2) }
  contained_by { box { <-p_torus-w_radius, -p_torus-w_radius, -p_spiral-w_radius>, <p_torus+w_radius, p_torus+w_radius, p_spiral+w_radius> } }

  threshold w_radius*w_radius
  accuracy 0.01
  max_gradient 770
  open

  translate <0, 0, 3>
  texture { pigment { Black } }
}

#declare py=0;
#while (py <= 4)
  #declare ph=py*3.141593;
  #declare ph2=py*180+90;
  torus {
    p_torus/2, w_radius
    rotate z*ph2
    translate <p_torus*sin(ph), -p_torus*cos(ph), py*p_spiral>

    texture { pigment { Black } }
  }

  #declare py = py + 1/10;
#end

[edit] Licensing

Creative Commons License
Creative Commons Attribution icon
This file is licensed under Creative Commons Attribution 2.0 License.
Attribution: Zom-B

File history

Legend: (cur) = this is the current file, (del) = delete this old version, (rev) = revert to this old version.
Click on date to download the file or see the image uploaded on that date.

  • (del) (cur) 20:54, 12 November 2005 . . Zom-B (Talk | contribs) . . 320×240 (35,661 bytes) (A right-handed Spring Pov-ray source code: <pre>#include "colors.inc" #include "shapes.inc" global_settings { assumed_gamma 1.0 max_trace_level 3 ambient_light 1 } #declare simple = texture { pigment { color<0, 0, 1, 0, 0.5> })

The following pages on the English Wikipedia link to this file (pages on other projects are not listed):