2010-08-25 10:00:19 -05:00
|
|
|
/**
|
|
|
|
* Simple triangles 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
|
|
|
/**
|
|
|
|
* 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]]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-26 06:35:51 -05:00
|
|
|
|
|
|
|
// Tests:
|
|
|
|
module test_triangle(){triangle(5,10,7);}
|
2010-08-26 02:08:44 -05:00
|
|
|
|