|
|
I lost my other two higher-quality sliderules in the Great Destrustion of 2012,
but I found a simplex Pickett sliderule (N902-ES) for $1 :)
It's been too long since I've fiddled with one, and was wondering if anyone had
any experience with them.
I figured if I could model it, I'd gain a much better appreciation of the
meaning and relationships of the scales and special markings.
This also led to me to marvel at the fact that people were making accurate log
scales - without computers - a LONG time ago. I'm really curious how they went
about laying those scales out by hand.
Haven't Povved anything for a while, and just needed to crank something out, and
of course it's technical (and badly coded).
Still puzzling over why the graduation marks between 4 and 9 are messed up, when
they should all look like between 9 and 1.
Transparent texture on the cursor lens sucks too.
Here's the abyssmal code so far. I should really write a few macros to handle
the scales and condense it all down a LOT.
-------------------------------------------------
#version 3.8;
global_settings {assumed_gamma 1.0}
#include "colors.inc"
#declare C = array [3] {
Red, Green, Yellow
}
#declare View = 0;
#switch (View)
#case (0)
#declare Zoom = 290;
camera {
orthographic
location <6, 0.5, -5>
look_at <6, 0.5, 0>
right x*image_width/Zoom
up y*image_height/Zoom
}
#break
#case (1)
#declare Zoom = 300;
camera {
orthographic
location <3, 0.5, -5>
look_at <3, 0.5, 0>
right x*image_width/Zoom
up y*image_height/Zoom
}
#break
#case (2)
#declare Zoom = 300;
camera {
orthographic
location <9, 0.5, -5>
look_at <9, 0.5, 0>
right x*image_width/Zoom
up y*image_height/Zoom
}
#break
#end
sky_sphere {pigment {White}}
light_source {<12, 2, -100> color White}
//#########################################################################
#declare Line = 0.0025;
#declare E = 0.0025;
//#declare Rule = texture {pigment {rgb <1, 1, 0>} normal {agate scale 0.01}
finish {specular 0.1}}
#declare Rule = texture {pigment {rgb <1, 1, 0>}}
#declare Text = texture {pigment {rgb <0, 0, 0>}}
#declare Special = texture {pigment {rgb <0.5, 0, 0>}}
#declare Aluminum = texture {pigment {rgb <0.5, 0.5, 0.5>}}
#declare LensTex = material {texture {pigment {rgbf <1, 1, 0.8, 0.999>} finish
{specular 0.1}} interior {ior 1.1}}
#declare Plastic = texture {pigment {White}}
#declare BottomHeight = 11/32;
#declare MidHeight = 18/32;
#declare TopHeight = 11/32;
#declare FullHeight = BottomHeight+MidHeight+TopHeight;
#declare Length = 12+4/32;
#declare X0 = 34/32;
#declare XN = 10-(5/32);
#declare XT = XN - X0;
#declare HO = 8/32;
#declare HR = 2/32;
#declare LO = 16/32;
#declare LR = 5/32;
#declare XSize = LR*2;
#declare ImageMap = pigment {image_map {png "PovLogo.png" once} };
#declare Resolution = max_extent (ImageMap);
#declare Resolution = Resolution + <0, 0, 1>;
#declare BottomRule =
union {
box {<0, 0, 0>, <Length, BottomHeight, 3/32> texture {Rule}}
// L Scale (Linear)
// a linear scale, used along with the C and D scales for finding base-10
logarithms and powers of 10
#declare Ticks = array [4] {0.450, 0.375, 0.300, 0.250};
#for (Tick, 0, 500)
#if (Tick/50 = int (Tick/50))
#declare N = 3;
text { ttf "crystal.ttf", str(Tick/500, 0, 1), 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.05
translate <0.975*X0+(Tick*XN/500), BottomHeight*0.1, -E >
}
#else
#if (Tick/25 = int (Tick/25))
#declare N = 2;
#else
#if (Tick/5 = int (Tick/5) )
#declare N = 1;
#else
#declare N = 0;
#end
#end
#end
cylinder {<X0+(Tick*XN/500), Ticks[N]*BottomHeight, 0>, <X0+(Tick*XN/500),
0.5*BottomHeight, 0>, Line texture {Text}}
#end
// D Scale
// single-decade logarithmic scale
#for (Tick, 1, 10)
cylinder {<X0+log(Tick)*XN, 0.75*BottomHeight, 0>, <X0+log(Tick)*XN,
BottomHeight, 0>, Line texture {Text}}
text { ttf "crystal.ttf", str(Tick, 0, 0), 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.05
translate <0.995*X0+log(Tick)*XN, BottomHeight*0.55, -E >
}
#end
#declare Ticks = array [3] {0.850, 0.775, 0.750};
#for (Tick, 1, 2, 0.01)
#if (100*Tick/10 = int (100*Tick/10))
#declare N = 2;
#if (Tick > 1 & Tick < 2)
text { ttf "crystal.ttf", str(10*(Tick-1), 0, 0), 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.04
translate <X0+log(Tick)*XN, BottomHeight*0.61, -E >
}
#end
#else
#if (100*Tick/5 = int (100*Tick/5) )
#declare N = 1;
#else
#declare N = 0;
#end
#end
cylinder {<X0+log(Tick)*XN, Ticks[N]*BottomHeight, 0>, <X0+log(Tick)*XN,
BottomHeight, 0>, Line texture {Text}}
#end
#declare Ticks = array [3] {0.850, 0.775, 0.700};
#for (Tick, 2, 4, 0.02)
#if (100*Tick/20 = int (100*Tick/20))
#declare N = 2;
#else
#if (100*Tick/5 = int (100*Tick/5))
#declare N = 1;
#else
#declare N = 0;
#end
#end
cylinder {<X0+log(Tick)*XN, Ticks[N]*BottomHeight, 0>, <X0+log(Tick)*XN,
BottomHeight, 0>, Line texture {Text}}
#end
//Pi marking
cylinder {<X0+log(pi)*XN, Ticks[2]*BottomHeight, 0>, <X0+log(pi)*XN,
BottomHeight, 0>, Line/2 texture {Special}}
text { ttf "crystal.ttf", "Pi", 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.05
translate <0.995*X0+log(pi)*XN, BottomHeight*0.55, -E >
}
// R marking (degrees per radian)
// For small angles, the sin or tan function can be approximated closely by the
equation:
// sin(x) = tan(x) = x / (180/π) = x / 57.3. Most rules have a tick
labeled 'R' at 5.73.
#declare R = 0.1*(180/pi); // 57.295779513
cylinder {<X0+log(R)*XN, Ticks[2]*BottomHeight, 0>, <X0+log(R)*XN,
BottomHeight, 0>, Line/2 texture {Special}}
text { ttf "crystal.ttf", "R", 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.05
translate <0.995*X0+log(R)*XN, BottomHeight*0.55, -E >
}
#declare Ticks = array [3] {0.850, 0.800, 0.700};
#for (Tick, 4, 10, 0.05)
#if (100*Tick/50 = int (100*Tick/50))
#declare N = 2;
#else
#if (100*Tick/2 = int (100*Tick/2) )
#declare N = 1;
#else
#declare N = 0;
#end
#end
cylinder {<X0+log(Tick)*XN, Ticks[N]*BottomHeight, 0>, <X0+log(Tick)*XN,
BottomHeight, 0>, Line texture {Text}}
#end
} // end union BottomRule
#declare MidRule =
union {
box {<0, BottomHeight, 0>, <Length, BottomHeight+E, 3/32> texture {Text}}
box {<0, BottomHeight+MidHeight-E, 0>, <Length, BottomHeight+MidHeight, 3/32>
texture {Text}}
difference {
box {<0, BottomHeight+E, 0>, <Length, BottomHeight+MidHeight-E, 3/32> texture
{Rule}}
cylinder {<HO, BottomHeight+(MidHeight/2), -E>, <HO,
BottomHeight+(MidHeight/2), 3/32+E> HR}
cylinder {<Length-HO, BottomHeight+(MidHeight/2), -E>, <Length-HO,
BottomHeight+(MidHeight/2), 3/32+E> HR}
}
// C Scale (Identical to D Scale On Bottom Rule)
// single-decade logarithmic scale
#for (Tick, 1, 10)
cylinder {<X0+log(Tick)*XN, BottomHeight+E, 0>, <X0+log(Tick)*XN,
BottomHeight+(MidHeight/4), 0>, Line texture {Text}}
text { ttf "crystal.ttf", str(Tick, 0, 0), 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.05
translate <0.995*X0+log(Tick)*XN, BottomHeight+(MidHeight/4), -E >
}
#end
#declare Ticks = array [3] {1-0.850, 1-0.775, 1-0.750};
#for (Tick, 1, 2, 0.01)
#if (100*Tick/10 = int (100*Tick/10))
#declare N = 2;
#if (Tick > 1 & Tick < 2)
text { ttf "crystal.ttf", str(10*(Tick-1), 0, 0), 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.04
translate <X0+log(Tick)*XN, BottomHeight+(MidHeight/4), -E >
}
#end
#else
#if (100*Tick/5 = int (100*Tick/5) )
#declare N = 1;
#else
#declare N = 0;
#end
#end
cylinder {<X0+log(Tick)*XN, BottomHeight+E, 0>, <X0+log(Tick)*XN,
BottomHeight+(Ticks[N]*MidHeight), 0>, Line texture {Text}}
#end
#declare Ticks = array [3] {1-0.850, 1-0.775, 1-0.700};
#for (Tick, 2, 4, 0.02)
#if (100*Tick/20 = int (100*Tick/20))
#declare N = 2;
#else
#if (100*Tick/5 = int (100*Tick/5))
#declare N = 1;
#else
#declare N = 0;
#end
#end
cylinder {<X0+log(Tick)*XN, BottomHeight+E, 0>, <X0+log(Tick)*XN,
BottomHeight+(Ticks[N]*MidHeight), 0>, Line texture {Text}}
#end
//Pi marking
cylinder {<X0+log(pi)*XN, BottomHeight+E, 0>, <X0+log(pi)*XN,
BottomHeight+(Ticks[2]*MidHeight), 0>, Line/2 texture {Special}}
text { ttf "crystal.ttf", "Pi", 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.05
translate <0.995*X0+log(pi)*XN, BottomHeight+(MidHeight/4), -E >
}
// R marking (degrees per radian)
// For small angles, the sin or tan function can be approximated closely by the
equation:
// sin(x) = tan(x) = x / (180/π) = x / 57.3. Most rules have a tick
labeled 'R' at 5.73.
#declare R = 0.1*(180/pi); // 57.295779513
cylinder {<X0+log(R)*XN, BottomHeight+E, 0>, <X0+log(R)*XN,
BottomHeight+(Ticks[2]*MidHeight), 0>, Line/2 texture {Special}}
text { ttf "crystal.ttf", "R", 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.05
translate <0.995*X0+log(R)*XN, BottomHeight+(MidHeight/4), -E >
}
#declare Ticks = array [3] {1-0.850, 1-0.800, 1-0.700};
#for (Tick, 4, 10, 0.05)
#if (100*Tick/50 = int (100*Tick/50))
#declare N = 2;
#else
#if (100*Tick/2 = int (100*Tick/2) )
#declare N = 1;
#else
#declare N = 0;
#end
#end
cylinder {<X0+log(Tick)*XN, BottomHeight+E, 0>, <X0+log(Tick)*XN,
BottomHeight+(Ticks[N]*MidHeight), 0>, Line texture {Text}}
#end
// Cl Scale
// "inverted" scale, running from right to left, used to simplify 1/x steps
// S Scale
// used for finding sines and cosines on the C (or D) scale
// T Scale
// used for finding tangents and cotangents on the C and CI (or D and DI)
scales
// B Scale
// two-decade logarithmic scale, used for finding square roots and squares of
numbers
//Logo
cylinder {<0.5, 0.5, -E>, <0.5, 0.5, 0> 0.5
texture {ImageMap}
translate <-0.5, -0.5, 0>
scale Resolution*(1/Resolution.x)*XSize
translate <Length-LO, BottomHeight+(MidHeight/2), 0>
}
//cylinder {<Length-LO, BottomHeight+(MidHeight/2), -E>, <Length-LO,
BottomHeight+(MidHeight/2), 0> LR}
text { ttf "crystal.ttf", "Made in POV-Ray", 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.05
translate <Length-LO-(0.25*0.75), BottomHeight+(MidHeight*0.1), -E >
}
text { ttf "crystal.ttf", "Bill Walker 1/2019", 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.05
translate <LO, BottomHeight+(MidHeight*0.7), -E >
}
text { ttf "crystal.ttf", " \"Bald Eagle\"", 0.02, 0.0 texture {Text}
scale <1, 1.25, 1>*0.05
translate <LO, BottomHeight+(MidHeight*0.2), -E >
}
} // end union MidRule
#declare TopRule =
union {
box {<0, BottomHeight+MidHeight, 0>, <Length, BottomHeight+MidHeight+TopHeight,
3/32> texture {Rule}}
// A Scale (Identical to B Scale on Mid Rule)
// two-decade logarithmic scale, used for finding square roots and squares of
numbers
// K Scale
// three-decade logarithmic scale, used for finding cube roots and cubes of
numbers
} // end union TopRule
#declare EndWidth = 16/32;
#declare ArcWidth = MidHeight;
#declare AW2 = ArcWidth/2;
#declare ArcDepth = 2/32;
#declare EndRad = (pow(AW2, 2) + pow(ArcDepth, 2)) / (2*ArcDepth);
#declare ArcInset = 6/32;
#declare End =
difference {
union {
box {<0, 0, -1/32>, <EndWidth, BottomHeight, 0>}
box {<0, BottomHeight, -3/64>, <EndWidth, BottomHeight+MidHeight, -1/64>}
box {<0, BottomHeight+MidHeight, -1/32>, <EndWidth,
BottomHeight+MidHeight+TopHeight, 0>}
}
intersection {
box {<-E, BottomHeight, -(2/32+E)>, <EndWidth, BottomHeight+MidHeight,
5/32+E>}
cylinder {<ArcInset+ArcDepth, BottomHeight+MidHeight/2, -(2/32+E)>,
<ArcInset+ArcDepth, BottomHeight+MidHeight/2, 5/32+E> EndRad translate
-x*EndRad}
}
#for (Y, BottomHeight, BottomHeight+MidHeight, MidHeight/22)
cylinder {<ArcInset, Y, -3/64>, <EndWidth, Y, -3/64> Line}
#end
texture {Aluminum}
}
//cylinder {<ArcInset+ArcDepth, BottomHeight+MidHeight/2, -E>,
<ArcInset+ArcDepth, BottomHeight+MidHeight/2, -(3/32+E)> EndRad translate
-x*EndRad}
//box {<-E, BottomHeight, -E>, <EndWidth, BottomHeight+MidHeight, 3/32+E>
pigment {Black}}
#declare CursorWidth = 36/32;
#declare SH = 3/64;
#declare Cursor = union {
box {<EndWidth, -4/32, -E>, <EndWidth+CursorWidth,
BottomHeight+MidHeight+TopHeight+4/32, -3/32> material {LensTex}}
box {<EndWidth, -4/32, (3/32)+E>, <EndWidth+CursorWidth,
BottomHeight+MidHeight+TopHeight+4/32, 5/32> material {LensTex}}
cylinder {<EndWidth+CursorWidth/2, 0, -Line*2>, <EndWidth+CursorWidth/2,
BottomHeight+MidHeight+TopHeight, -Line*2> Line texture {Text}}
box {<EndWidth, 0, 0>, <EndWidth+CursorWidth, -4/32, 3/32> texture {Plastic}}
box {<EndWidth, BottomHeight+MidHeight+TopHeight, 0>, <EndWidth+CursorWidth,
BottomHeight+MidHeight+TopHeight+4/32, 3/32> texture {Plastic}}
cylinder {<EndWidth+7/32, -2/32, -(3/32+Line)>, <EndWidth+7/32, -2/32,
5/32+Line> SH texture {Text}}
cylinder {<EndWidth+CursorWidth-7/32, -2/32, -(3/32+Line)>,
<EndWidth+CursorWidth-7/32, -2/32, 5/32+Line> SH texture {Text}}
cylinder {<EndWidth+CursorWidth/2, BottomHeight+MidHeight+TopHeight+2/32,
-(3/32+Line)>, <EndWidth+CursorWidth/2, BottomHeight+MidHeight+TopHeight+2/32,
5/32+Line> SH texture {Text}}
}
#declare SlideRule = union {
object {BottomRule}
object {MidRule translate x*sin(clock*2*pi)*10}
object {TopRule}
object {End}
object {End scale <-1, 1, 1> translate x*Length}
object {End scale <1, 1, -1> translate z*(3/32)}
object {End scale <1, 1, -1> translate z*(3/32) scale <-1, 1, 1> translate
x*Length}
object {Cursor translate x*3}
}
object {SlideRule}
object {SlideRule rotate x*90 translate -y*9/32}
object {SlideRule rotate -x*90 translate <0, FullHeight+9/32, FullHeight>}
Post a reply to this message
Attachments:
Download 'sliderule.png' (638 KB)
Preview of image 'sliderule.png'
|
|