POV-Ray : Newsgroups : povray.general : Iris Diaphragm -> Help Please! : Re: Iris Diaphragm -> Help Please! Server Time
30 Jul 2024 12:26:55 EDT (-0400)
  Re: Iris Diaphragm -> Help Please!  
From: Chris B
Date: 13 Feb 2009 20:39:49
Message: <499620e5$1@news.povray.org>
"Anthony D. Baye" <Sha### [at] spamnomorehotmailcom> wrote in message 
news:web.49960b7e1af53e3ce65c467e0@news.povray.org...
>I need to design an Iris diaphragm, preferably like the ones in the 
>following
> pictures:
>
> http://www.microscopy-uk.org.uk/mag/imgmar06/dismantle6.jpg
> http://www.microscopy-uk.org.uk/mag/imgmar06/dismantle7.jpg
> http://www.microscopy-uk.org.uk/mag/imgmar06/dismantle8.jpg
> http://www.microscopy-uk.org.uk/mag/imgmar06/dismantle9.jpg
>
> or something similar.  I need to be able to re-size it to fit my project, 
> and I
> would like to be able to control the aperture size.
>
> I would like to be able to do all of these things, without using a 
> mechanics
> simulator, which is difficult because the shutter blades are interleaved.
>
> Any suggestions would be greatly appreciated.
>

The following code should do it.

The ApertureAngle is the angle through which the elements of the Iris 
Diaphragm are turned inwards.
The element is created as a spiral of small boxes with a circular end. You 
can obviously make that piece as complicated as you like, with the lugs etc. 
I've used random colors so you can clearly distinguish each piece.

Regards,
Chris B.

camera {location <0,5,-15> look_at 0}
light_source {<30,70,-10> color rgb 1}

#include "math.inc"

#declare ApertureAngle = 30;
#declare InnerRadius   = 5;
#declare OuterRadius   = 6.5;
#declare Thickness     = 0.03;

#declare Increment     = 0.2;
#declare Width = OuterRadius-InnerRadius;
#declare MySeed = seed(1);

// Define a single moving part
#declare MetalPiece = difference {
  union {
    #local I = 0;
    #while (I<50)
      box {<-Increment/2,0,0>,<Increment/2,Thickness,Width> rotate z*1 
translate z*InnerRadius
        rotate I*y*asind(Increment/OuterRadius)
        translate y*sind(I*Increment)
      }
      #local I = I+1;
    #end
    rotate -y*180*Width/(2*pi*(InnerRadius+Width/2))
    translate -z*(InnerRadius+Width/2)
  }
  difference {
    box {<-Width,-0.1,-Width><0,2*Thickness,Width>}
    cylinder {-0.2*y,(2*Thickness+0.1)*y,Width/2}
  }
  rotate y*ApertureAngle
  translate z*(InnerRadius+Width/2)
}

// Draw 20 moving parts in a circle
#local I = 0;
#while (I<20)
  object {MetalPiece rotate I*y*360/20 pigment {rgb 
<rand(MySeed),rand(MySeed),rand(MySeed)>}}
  #local I = I+1;
#end


Post a reply to this message

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