2022-06-06 13:11:46 +08:00
|
|
|
use <unittest.scad>
|
|
|
|
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();
|