forked from JustinSDK/dotSCAD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_along_with.scad
46 lines (40 loc) · 1.77 KB
/
test_along_with.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use <shape_circle.scad>
include <along_with.scad>
module test_along_with_angles(angles, children) {
if(children == 1) {
// ==== test_along_with_default_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);
}
else {
// ==== test_along_with_children ====
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]];
assert(8 == len(angles));
assertEqualPoints(expected_angles, angles);
}
}
module test_along_with_default_angles() {
echo("==== test_along_with_default_angles ====");
$fn = 24;
points = shape_circle(radius = 50);
along_with(points, method = "EULER_ANGLE")
sphere(5);
}
module test_along_with_children() {
echo("==== test_along_with_children ====");
$fn = 24;
points = shape_circle(radius = 50);
along_with(points, method = "EULER_ANGLE") {
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();