2010-08-25 10:00:19 -05:00
|
|
|
/**
|
|
|
|
* Servo outline library
|
|
|
|
*
|
|
|
|
* Authors:
|
2010-08-25 11:35:45 -05:00
|
|
|
* - Eero 'rambo' af Heurlin 2010-
|
2010-08-25 10:00:19 -05:00
|
|
|
*
|
2010-08-25 11:35:45 -05:00
|
|
|
* License: LGPL 2.1
|
2010-08-25 10:00:19 -05:00
|
|
|
*/
|
|
|
|
|
2010-08-26 02:08:44 -05:00
|
|
|
use <triangles.scad>
|
2010-08-25 10:00:19 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Align DS420 digital servo
|
|
|
|
*
|
|
|
|
* @param vector position The position vector
|
|
|
|
* @param vector rotation The rotation vector
|
|
|
|
* @param boolean screws If defined then "screws" will be added and when the module is differenced() from something if will have holes for the screws
|
|
|
|
* @param number axle_lenght If defined this will draw "backgound" indicator for the main axle
|
|
|
|
*/
|
|
|
|
module alignds420(position, rotation, screws = 0, axle_lenght = 0)
|
|
|
|
{
|
|
|
|
translate(position)
|
|
|
|
{
|
|
|
|
rotate(rotation)
|
|
|
|
{
|
|
|
|
union()
|
|
|
|
{
|
|
|
|
// Main axle
|
|
|
|
translate([0,0,17])
|
|
|
|
{
|
|
|
|
cylinder(r=6, h=8, $fn=30);
|
|
|
|
cylinder(r=2.5, h=10.5, $fn=20);
|
|
|
|
}
|
|
|
|
// Box and ears
|
|
|
|
translate([-6,-6,0])
|
|
|
|
{
|
|
|
|
cube([12, 22.8,19.5], false);
|
2010-08-25 11:35:45 -05:00
|
|
|
translate([0,-5, 17])
|
2010-08-25 10:00:19 -05:00
|
|
|
{
|
|
|
|
cube([12, 7, 2.5]);
|
|
|
|
}
|
2010-08-25 11:35:45 -05:00
|
|
|
translate([0, 20.8, 17])
|
2010-08-25 10:00:19 -05:00
|
|
|
{
|
|
|
|
cube([12, 7, 2.5]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (screws > 0)
|
|
|
|
{
|
|
|
|
translate([0,(-10.2 + 1.8),11.5])
|
|
|
|
{
|
|
|
|
# cylinder(r=1.8/2, h=6, $fn=6);
|
|
|
|
}
|
|
|
|
translate([0,(21.0 - 1.8),11.5])
|
|
|
|
{
|
|
|
|
# cylinder(r=1.8/2, h=6, $fn=6);
|
|
|
|
}
|
2010-08-25 11:35:45 -05:00
|
|
|
|
2010-08-25 10:00:19 -05:00
|
|
|
}
|
|
|
|
// The large slope
|
2010-08-26 02:08:44 -05:00
|
|
|
translate([-6,0,19])
|
2010-08-25 10:00:19 -05:00
|
|
|
{
|
2010-08-26 02:08:44 -05:00
|
|
|
rotate([90,0,90])
|
2010-08-25 10:00:19 -05:00
|
|
|
{
|
|
|
|
triangle(4, 18, 12);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-25 11:35:45 -05:00
|
|
|
/**
|
2010-08-25 10:00:19 -05:00
|
|
|
* This seems to get too complex fast
|
|
|
|
// Small additional axes
|
|
|
|
translate([0,6,17])
|
|
|
|
{
|
|
|
|
cylinder(r=2.5, h=6, $fn=10);
|
|
|
|
cylinder(r=1.25, h=8, $fn=10);
|
|
|
|
}
|
|
|
|
// Small slope
|
|
|
|
difference()
|
|
|
|
{
|
|
|
|
translate([-6,-6,19.0])
|
|
|
|
{
|
|
|
|
cube([12,6.5,4]);
|
|
|
|
}
|
2010-08-26 02:08:44 -05:00
|
|
|
translate([7,-7,24.0])
|
2010-08-25 10:00:19 -05:00
|
|
|
{
|
2010-08-26 02:08:44 -05:00
|
|
|
rotate([-90,0,90])
|
2010-08-25 10:00:19 -05:00
|
|
|
{
|
2010-08-26 02:08:44 -05:00
|
|
|
triangle(3, 8, 14);
|
2010-08-25 10:00:19 -05:00
|
|
|
}
|
|
|
|
}
|
2010-08-25 11:35:45 -05:00
|
|
|
|
2010-08-25 10:00:19 -05:00
|
|
|
}
|
|
|
|
*/
|
|
|
|
// So we render a cube instead of the small slope on a cube
|
|
|
|
translate([-6,-6,19.0])
|
|
|
|
{
|
|
|
|
cube([12,6.5,4]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (axle_lenght > 0)
|
|
|
|
{
|
|
|
|
% cylinder(r=0.9, h=axle_lenght, center=true, $fn=8);
|
|
|
|
}
|
|
|
|
}
|
2010-08-25 11:35:45 -05:00
|
|
|
}
|
2010-08-25 10:00:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Example, uncomment to test
|
|
|
|
alignds420(screws=1);
|