2020-01-27 14:59:15 +08:00
|
|
|
use <unittest.scad>;
|
2020-01-28 09:44:36 +08:00
|
|
|
include <hull_polyline2d.scad>;
|
2020-01-27 14:57:04 +08:00
|
|
|
|
|
|
|
module test_hull_polyline2d_line_segment(index, point1, point2, radius) {
|
|
|
|
points = [[1, 2], [-5, -4], [-5, 3], [5, 5]];
|
|
|
|
line_width = 1;
|
|
|
|
|
|
|
|
assertEqualPoint(points[index - 1], point1);
|
|
|
|
assertEqualPoint(points[index], point2);
|
|
|
|
assertEqualNum(line_width, radius * 2);
|
|
|
|
}
|
2017-05-26 20:01:32 +08:00
|
|
|
|
|
|
|
module test_hull_polyline2d() {
|
|
|
|
echo("==== test_hull_polyline2d ====");
|
|
|
|
|
|
|
|
$fn = 4;
|
|
|
|
points = [[1, 2], [-5, -4], [-5, 3], [5, 5]];
|
|
|
|
line_width = 1;
|
|
|
|
|
|
|
|
hull_polyline2d(
|
|
|
|
points = [[1, 2], [-5, -4], [-5, 3], [5, 5]],
|
|
|
|
width = 1
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
test_hull_polyline2d();
|