1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/test/test_rounded_cube.scad

29 lines
832 B
OpenSCAD
Raw Normal View History

2020-01-27 15:53:24 +08:00
use <unittest.scad>;
2020-01-28 09:44:36 +08:00
include <rounded_cube.scad>;
2017-05-30 16:06:06 +08:00
2020-01-27 15:53:24 +08:00
module test_rounded_edge_corner_center(corner_frags, corners, center_pts) {
2017-05-30 16:06:06 +08:00
size = 20;
2020-01-27 15:53:24 +08:00
half_size = size / 2;
2017-05-30 16:06:06 +08:00
2020-01-27 15:53:24 +08:00
assert(corner_frags % 4 == 0);
2017-05-30 16:06:06 +08:00
2020-01-27 15:53:24 +08:00
expected_corners = [[5.0961, 5.0961, 5.0961], [-5.0961, 5.0961, 5.0961], [5.0961, -5.0961, 5.0961], [-5.0961, -5.0961, 5.0961], [5.0961, 5.0961, -5.0961], [-5.0961, 5.0961, -5.0961], [5.0961, -5.0961, -5.0961], [-5.0961, -5.0961, -5.0961]];
2017-05-30 16:06:06 +08:00
2020-01-27 15:53:24 +08:00
assertEqualPoints(expected_corners, corners);
2017-05-30 16:06:06 +08:00
2020-01-27 15:53:24 +08:00
assertEqualPoint(
[half_size, half_size, half_size],
center_pts
);
2017-05-30 16:06:06 +08:00
}
2020-01-27 15:53:24 +08:00
module test_rounded_cube_size_corner() {
echo("==== test_rounded_cube_size_corner ====");
2017-05-30 16:06:06 +08:00
2020-01-27 15:53:24 +08:00
size = 20;
2017-05-30 16:06:06 +08:00
corner_r = 5;
2020-01-27 15:53:24 +08:00
rounded_cube(size, corner_r);
2017-05-30 16:06:06 +08:00
}
2020-01-27 15:53:24 +08:00
test_rounded_cube_size_corner();