POV-Ray : Newsgroups : povray.binaries.images : povray.newusers: Infinite car garage : Re: povray.newusers: Infinite car garage Server Time
5 Jul 2024 07:05:08 EDT (-0400)
  Re: povray.newusers: Infinite car garage  
From: Thomas de Groot
Date: 25 Oct 2014 10:19:04
Message: <544bb158$1@news.povray.org>
On 25-10-2014 16:03, Bald Eagle wrote:
> What about the f_helix2 "isosurface by function" in the drop-down POV-Ray Insert
> Menu?
> I'm constantly amazed by how much good stuff is in there that I overlook or
> forget is there!

I tried that first (obviously) but in the end I found the results less 
'reliable' even than with f_helix1.

I finished the construction with some parameters the user can change, 
and added the 'infinity':

//---------------------------------------------------------------------------
#include "functions.inc"

#declare Thickness = 0.02;  //thickness of floors & ramps
#declare Height = 0.5;  //distance between floor levels

#declare Level =
union {
   difference {
     cylinder {
       <0,0,0>,<0,Thickness,0>, 1.00
     }
     #local Prism =
     difference {
       prism {
         -0.01, 0.11, 4
         <-0.50, 0.00>, // first point
         < 0.50, 0.00>,
         < 0.00,-1.00>,
         <-0.50, 0.00>  // last point = first point !!!
         scale <1.00, 1.00, 1.00>
         rotate <0,0,0>
         translate <0.00, 0.00, 1.00>
       }
       cylinder {
         <0,-0.2,0>,<0,0.12,0>, 0.50
         scale <1,1,1> rotate<0,0,0> translate<0,0,0>
       }
     } //end of difference

     object {Prism
       rotate (180+27)*y
     }
     object {Prism
       rotate 27*y
     }
   } //end of difference

   #include "spring.inc"

   // The spring is created with it's base on the origin, oriented on 
the +X axis
   // U and V are the rectangular width and height of the spring wire
   // X_Length is the overall length of the spring
   // Radius is the radius of the spring
   // Coils is the number of turns the spring makes (fractional numbers 
are OK)
   // Rez is the appoximate number of desired triangles in the mesh.

   #local Ramp =
   object {
     // U, V, length, radius, coils, rez
     Spring (Thickness, 0.5, Height, 1.0, 0.5, 5000)
     rotate 90*z
   } 


   object {Ramp
     rotate 90*y
   }
   object {Ramp
     rotate -90*y
   }

   texture {
     pigment {color rgb <1,1,0.8> }
     normal  {bumps 0.1 scale <0.005,0.005,0.005>}
     finish  { phong 0.5 reflection{ 0.00 metallic 0.00} }
   }

} //end of union

#declare N=1;

union {
   object {Level}

   #for (N,1,100)
     object {Level
       rotate -54*y*N
       translate (Height-Thickness)*y*N
   }
   #end

   rotate 160*y
}
//---------------------------------------------------------------------------

Thomas


Post a reply to this message

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