Examples fix

merge primitives stuff into shapes*.scad
move text commands to shapes3d.scad
rename common.scad
This commit is contained in:
Adrian Mariano
2021-09-16 21:50:12 -04:00
parent e6a2ee2084
commit 935a113fcf
15 changed files with 654 additions and 660 deletions

View File

@@ -1,6 +1,29 @@
include <../std.scad>
module test_square() {
assert(square(100, center=true) == [[50,-50],[-50,-50],[-50,50],[50,50]]);
assert(square(100, center=false) == [[100,0],[0,0],[0,100],[100,100]]);
assert(square(100, anchor=FWD+LEFT) == [[100,0],[0,0],[0,100],[100,100]]);
assert(square(100, anchor=BACK+RIGHT) == [[0,-100],[-100,-100],[-100,0],[0,0]]);
}
test_square();
module test_circle() {
for (pt = circle(d=200)) {
assert(approx(norm(pt),100));
}
for (pt = circle(r=100)) {
assert(approx(norm(pt),100));
}
assert(is_polygon_clockwise(circle(d=200)));
assert(is_polygon_clockwise(circle(r=100)));
assert(len(circle(d=100,$fn=6)) == 6);
assert(len(circle(d=100,$fn=36)) == 36);
}
test_circle();
module test_rect() {