diff --git a/test/test_all.scad b/test/test_all.scad index 832e5004..ab43cc84 100644 --- a/test/test_all.scad +++ b/test/test_all.scad @@ -15,6 +15,9 @@ include ; include ; include ; +// Transformation +include ; + // Function include ; diff --git a/test/test_along_with.scad b/test/test_along_with.scad new file mode 100644 index 00000000..52131458 --- /dev/null +++ b/test/test_along_with.scad @@ -0,0 +1,54 @@ +include ; + +module test_along_with_default_angles() { + include ; + include ; + + $fn = 24; + + points = circle_path(radius = 50); + + module test_along_with_angles(angles) { + expected_angles = [[0, 0, 97.5], [0, 0, 97.5], [0, 0, 112.5], [0, 0, 127.5], [0, 0, 142.5], [0, 0, 157.5], [0, 0, 172.5], [0, 0, -172.5], [0, 0, -157.5], [0, 0, -142.5], [0, 0, -127.5], [0, 0, -112.5], [0, 0, -97.5], [0, 0, -82.5], [0, 0, -67.5], [0, 0, -52.5], [0, 0, -37.5], [0, 0, -22.5], [0, 0, -7.5], [0, 0, 7.5], [0, 0, 22.5], [0, 0, 37.5], [0, 0, 52.5], [0, 0, 67.5]]; + + assertEqual($fn, len(angles)); + assertEqualPoints(expected_angles, angles); + + } + + along_with(points) + sphere(5, center = true); + +} + +module test_along_with_children() { + include ; + include ; + + $fn = 24; + + points = circle_path(radius = 50); + + module test_along_with_angles(angles) { + expected_angles = [[0, 0, 97.5], [0, 0, 97.5], [0, 0, 112.5], [0, 0, 127.5], [0, 0, 142.5], [0, 0, 157.5], [0, 0, 172.5], [0, 0, -172.5]]; + + assertEqual(8, len(angles)); + assertEqualPoints(expected_angles, angles); + + } + + along_with(points) { + linear_extrude(10, center = true) text("A", valign = "center", halign = "center"); + linear_extrude(5, center = true) circle(2); + sphere(1); + cube(5); + linear_extrude(10, center = true) text("A", valign = "center", halign = "center"); + linear_extrude(5, center = true) circle(2); + sphere(1); + cube(5); + } + +} + +test_along_with_default_angles(); +test_along_with_children(); \ No newline at end of file