Spring2.png(320 × 240 pixels, file size: 35 KB, MIME type: image/png)

File information
Description

A right-handed Spring

Source

Own work

Date
Author

Zom-B (talk) (Uploads)

Permission
(Reusing this file)

See below.

Additional information 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

Licensing edit

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current20:54, 12 November 2005Thumbnail for version as of 20:54, 12 November 2005320 × 240 (35 KB)Zom-B (talk | contribs)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 use this file (pages on other projects are not listed):