diff --git a/tests/test_coords.scad b/tests/test_coords.scad index 64343f8..0022efa 100644 --- a/tests/test_coords.scad +++ b/tests/test_coords.scad @@ -92,6 +92,11 @@ module test_project_plane() { assert_approx(project_plane([2,3,4,2], [[1,1,1],[0,0,0]]),[[0.430748825729,0.146123238594],[0,0]]); assert_approx(project_plane([2,3,4,2]),[[0.920855800833,-0.11871629875,-0.371390676354,0],[-0.11871629875,0.821925551875,-0.557086014531,-2.77555756156e-17],[0.371390676354,0.557086014531,0.742781352708,-0.371390676354],[0,0,0,1]]); assert_approx(project_plane([[1,1,1],[3,1,3],[1,1,4]]),[[-1/sqrt(2),1/sqrt(2),0,0],[0,0,1,-1],[1/sqrt(2),1/sqrt(2),0,-sqrt(2)],[0,0,0,1]]); + + normal = rands(-1,1,3,seed=3)+[2,0,0]; + offset = rands(-1,1,1,seed=4)[0]; + assert_approx(project_plane([0,0,1,offset]),move([0,0,-offset]) ); + assert_approx(project_plane([0,1,0,offset]),xrot(90)*move([0,-offset,0]) ); } test_project_plane(); diff --git a/tests/test_geometry.scad b/tests/test_geometry.scad index ccb4ac7..04f5126 100644 --- a/tests/test_geometry.scad +++ b/tests/test_geometry.scad @@ -42,7 +42,6 @@ test_plane_from_points(); test_plane_from_polygon(); test_plane_normal(); test_plane_offset(); -test_plane_transform(); test_projection_on_plane(); test_plane_point_nearest_origin(); test_distance_from_plane(); @@ -175,16 +174,6 @@ module test_plane_point_nearest_origin(){ test_plane_point_nearest_origin(); -module test_plane_transform(){ - normal = rands(-1,1,3)+[2,0,0]; - offset = rands(-1,1,1)[0]; - info = info_str([["normal = ",normal],["offset = ",offset]]); - assert_approx(plane_transform([0,0,1,offset]),move([0,0,-offset]),info ); - assert_approx(plane_transform([0,1,0,offset]),xrot(90)*move([0,-offset,0]),info ); -} -*test_plane_transform(); - - module test_plane_offset(){ plane = rands(-1,1,4)+[2,0,0,0]; // a valid plane info = info_str([["plane = ",plane]]);