remove center arg from shapes2d.scad

This commit is contained in:
Adrian Mariano
2021-11-20 23:33:04 -05:00
parent 590143ef07
commit 3e292c21cc
3 changed files with 18 additions and 23 deletions

View File

@@ -29,11 +29,8 @@ test_circle();
module test_rect() {
assert_equal(rect(100,anchor=CENTER), [[50,-50],[-50,-50],[-50,50],[50,50]]);
assert_equal(rect(100), [[50,-50],[-50,-50],[-50,50],[50,50]]);
assert_equal(rect(100,center=false), [[100,0],[0,0],[0,100],[100,100]]);
assert_equal(rect([100,80],center=false), [[100,0],[0,0],[0,80],[100,80]]);
assert_equal(rect([100,80],anchor=CENTER), [[50,-40],[-50,-40],[-50,40],[50,40]]);
assert_equal(rect([100,80]), [[50,-40],[-50,-40],[-50,40],[50,40]]);
assert_equal(rect([100,80],center=true), [[50,-40],[-50,-40],[-50,40],[50,40]]);
assert_equal(rect([100,80],anchor=FRONT+LEFT), [[100,0],[0,0],[0,80],[100,80]]);
assert_equal(rect([100,80],anchor=BACK+RIGHT), [[0,-80],[-100,-80],[-100,0],[0,0]]);
assert_approx(rect([100,80],rounding=10,anchor=CENTER,$fn=12), [[50,-30],[48.6602540378,-35],[45,-38.6602540378],[40,-40],[-40,-40],[-45,-38.6602540378],[-48.6602540378,-35],[-50,-30],[-50,30],[-48.6602540378,35],[-45,38.6602540378],[-40,40],[40,40],[45,38.6602540378],[48.6602540378,35],[50,30]]);

View File

@@ -408,10 +408,10 @@ module test_apply() {
module check_path_apply(mat,path)
assert_approx(apply(mat,path),path3d([for (p=path) mat*concat(p,1)]));
check_path_apply(xrot(45), path3d(rect(100,center=true)));
check_path_apply(yrot(45), path3d(rect(100,center=true)));
check_path_apply(zrot(45), path3d(rect(100,center=true)));
check_path_apply(rot([20,30,40])*scale([0.9,1.1,1])*move([10,20,30]), path3d(rect(100,center=true)));
check_path_apply(xrot(45), path3d(rect(100)));
check_path_apply(yrot(45), path3d(rect(100)));
check_path_apply(zrot(45), path3d(rect(100)));
check_path_apply(rot([20,30,40])*scale([0.9,1.1,1])*move([10,20,30]), path3d(rect(100)));
module check_patch_apply(mat,patch)
assert_approx(apply(mat,patch), [for (path=patch) path3d([for (p=path) mat*concat(p,1)])]);