POV-Ray : Newsgroups : povray.newusers : Accuracy with parametric: An infinite car garage : Re: Accuracy with parametric: An infinite car garage Server Time
7 May 2024 05:40:10 EDT (-0400)
  Re: Accuracy with parametric: An infinite car garage  
From: Thomas de Groot
Date: 24 Oct 2014 10:38:28
Message: <544a6464$1@news.povray.org>
On 24-10-2014 2:19, Bald Eagle wrote:
> Wouldn't a more robust fix focus on adding some thickness to the surfaces?
> Use cylinders and boxes and CSG for one level, and then just stack the resulting
> optimized unit with a loop...
>

That's what I thought too. I have been playing a little bit with the 
concept and came up with something like this:

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

union {
   difference {
     cylinder {
       <0,0,0>,<0,0.10,0>, 1.00
       scale <1,1,1> rotate<0,0,0> translate<0,0,0>
     }

     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

     rotate 180*y
   } //end of difference

   intersection {

     difference {
       isosurface {
         function {
           f_helix1(
             x,y,z,
             1,    // number of helixes, (1 = single helix, 2 = double 
helix etc.)
             2,    // period,      turns on the length of 2*pi
             0.5,  // minor radius,
             0.90, // major radius,
             0.15, // shape parameter,
             0,    // cross section type, (0.0 to 1.0 = square ... 
rounded to circle
                   //                 over 2.0 to 3.0 = rounded to 
diamond and concave diamond
             0     // cross section rotation angle
           )
         }
         contained_by {box {<-1,0,-1>,<1,2,1>}}
         max_gradient 10
         scale 1.0
         rotate <0, -120, 0>
         translate <0,0,0>
       }
       cylinder {<0,-0.01,0>,<0,10,0>,0.5}
     } //end of difference

     cylinder {<0.0,0>,<0,10,0>,1}

   } //end of intersection

   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} }
   }

   rotate 25*y
} //end of union
//---------------------------------------------------------------------------

The most difficult to control imo is the isosurface. Some more 
documentation in addition to the POV-Ray docs and Mike Williams' 
explanation (http://www.econym.demon.co.uk/isotut/builtin1.htm) would be 
welcome in fact.

Thomas


Post a reply to this message

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