1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/test/test_hexagons.scad

32 lines
674 B
OpenSCAD
Raw Normal View History

2022-06-06 13:11:46 +08:00
use <unittest.scad>
include <hexagons.scad>
2017-05-29 18:40:38 +08:00
2020-01-27 14:53:26 +08:00
module test_each_hexagon(hex_r, pts_all_lines) {
// ==== test_hexagons_lv2 ====
assertEqualNum(19, hex_r);
2017-05-29 18:40:38 +08:00
2020-01-27 14:53:26 +08:00
expects = [
[[-34.641, 0], [0, 0], [34.641, 0]],
[[-17.3205, 30], [17.3205, 30]],
[[-17.3205, -30], [17.3205, -30]]
];
2017-05-29 18:40:38 +08:00
2020-01-27 14:53:26 +08:00
for(i = [0:len(pts_all_lines) - 1]) {
assertEqualPoints(
expects[i],
pts_all_lines[i]
);
}
}
2017-05-29 18:40:38 +08:00
2020-01-27 14:53:26 +08:00
module test_hexagons_lv2() {
echo("==== test_hexagons_lv2 ====");
2017-05-29 18:40:38 +08:00
radius = 20;
spacing = 2;
2020-01-27 14:53:26 +08:00
levels = 2;
2017-05-29 18:40:38 +08:00
hexagons(radius, spacing, levels);
}
2020-01-27 14:53:26 +08:00
test_hexagons_lv2();