just found out that there are 2D primitives too, no need to use DXF... so changed the triangle to use polygon and extrusion, cleaner than doing weird booleans.
This changes the default orientation of the triangle so adapted the servo library too.
This commit is contained in:
parent
f74a94b519
commit
fd3da7a8c1
10
servos.scad
10
servos.scad
|
@ -7,7 +7,7 @@
|
|||
* License: LGPL 2.1
|
||||
*/
|
||||
|
||||
use <triangle.scad>
|
||||
use <triangles.scad>
|
||||
|
||||
/**
|
||||
* Align DS420 digital servo
|
||||
|
@ -57,9 +57,9 @@ module alignds420(position, rotation, screws = 0, axle_lenght = 0)
|
|||
|
||||
}
|
||||
// The large slope
|
||||
translate([6,18,19.0])
|
||||
translate([-6,0,19])
|
||||
{
|
||||
rotate([0,0,180])
|
||||
rotate([90,0,90])
|
||||
{
|
||||
triangle(4, 18, 12);
|
||||
}
|
||||
|
@ -80,9 +80,9 @@ module alignds420(position, rotation, screws = 0, axle_lenght = 0)
|
|||
{
|
||||
cube([12,6.5,4]);
|
||||
}
|
||||
translate([-7,1,24.0])
|
||||
translate([7,-7,24.0])
|
||||
{
|
||||
rotate([180,0,0])
|
||||
rotate([-90,0,90])
|
||||
{
|
||||
triangle(3, 8, 14);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* @param number a_len Lenght of the adjacent side
|
||||
* @param number depth How wide/deep the triangle is in the 3rd dimension
|
||||
*/
|
||||
/*
|
||||
module triangle(o_len, a_len, depth)
|
||||
{
|
||||
difference()
|
||||
|
@ -29,3 +30,26 @@ module triangle(o_len, a_len, depth)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
# triangle(5,10,7);
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Standard right-angled triangle
|
||||
*
|
||||
* @param number o_len Lenght of the opposite side
|
||||
* @param number a_len Lenght of the adjacent side
|
||||
* @param number depth How wide/deep the triangle is in the 3rd dimension
|
||||
* @todo a better way ?
|
||||
*/
|
||||
module triangle(o_len, a_len, depth)
|
||||
{
|
||||
linear_extrude(height=depth)
|
||||
{
|
||||
polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);
|
||||
}
|
||||
}
|
||||
|
||||
triangle(5,10,7);
|
||||
|
||||
|
|
Loading…
Reference in a new issue