diff --git a/src/along_with.scad b/src/along_with.scad index 90474103..69f9d5a7 100644 --- a/src/along_with.scad +++ b/src/along_with.scad @@ -135,6 +135,7 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE") rotate(twist_step_a * i) scale([1, 1, 1] + scale_step_vt * i) children(0); + test_along_with_angles(angs); } // <<< end: modules and functions for "EULER-ANGLE" @@ -192,4 +193,8 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE") } } +} + +module test_along_with_angles(angles) { + } \ No newline at end of file diff --git a/test/test_all.scad b/test/test_all.scad index e38d972f..6bc1c487 100644 --- a/test/test_all.scad +++ b/test/test_all.scad @@ -17,6 +17,7 @@ include ; // Transformation include ; +include ; // Function include ; diff --git a/test/test_along_with.scad b/test/test_along_with.scad new file mode 100644 index 00000000..d8cc4280 --- /dev/null +++ b/test/test_along_with.scad @@ -0,0 +1,59 @@ +include ; + +module test_along_with_default_angles() { + echo("==== test_along_with_default_angles ===="); + + include ; + 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]]; + assert($fn == len(angles)); + assertEqualPoints(expected_angles, angles); + + } + + along_with(points) + sphere(5); + +} + +module test_along_with_children() { + echo("==== test_along_with_children ===="); + + include ; + 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