
openscad triangle generator
Description
You can use this module giving only 3 arguments for generate usable triangle, for calculation purposes you can set last variable calc=true, then giving at least two sides and one angle you can pick from SSA and SAS triangles generated in echo() output. AAS calculation is trivial and outputs only one figure or nothing, same with SSS, AAA triangles exists but have any perimeter lenght >0 you wish for, so calculation is used only for generate triangles by two sides and a angle, example: triangle(a=20,b=5,c=4,A=4,B=70,C=30,calc=true); // found 5 triangles: acA abA bcB and two bcC "B" means angle in degrees and "b" means opposite side. triangle(20,5,4,0,70,30,true);// found 3 valid triangles: bcB and two bcC triangle(20,5,4,0,0,30,true);// only two bcC You can import this file using "use <path/to/triangle.scad>"; and use calling triangle() module; Module counts all types of not numeric values as 0, and 0 used as undefined value inside, negative numbers will be converted to absolute value. triangle(4,4,4,"",1/0,[[[]]],[]); is same as triangle(a=4,b=4,c=4,A=0,B=0,C=0,calc=false); and triangle(4,4,4); Module generates a triangle on (x,y)>0 plane for safe mirroring and it's b side will be placed on Y axis for make easy rotate_extrude() calculations. List of usable formulas shown near EOF
Statistics
Likes
2
Downloads
0