1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-09-25 13:59:04 +02:00

add test case

This commit is contained in:
Justin Lin
2019-06-14 21:18:22 +08:00
parent 3be3a271e6
commit d203fe4030
2 changed files with 27 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ include <test_parse_number.scad>;
include <test_cross_sections.scad>; include <test_cross_sections.scad>;
include <test_paths2sections.scad>; include <test_paths2sections.scad>;
include <test_in_polyline.scad>; include <test_in_polyline.scad>;
include <test_triangulate.scad>;
// Path // Path
include <test_circle_path.scad>; include <test_circle_path.scad>;

View File

@@ -0,0 +1,26 @@
include <unittest.scad>;
include <triangulate.scad>;
module test_triangulate() {
echo("==== test_triangulate ====");
shape = [
[0, 0],
[10, 0],
[12, 5],
[5, 10],
[10, 15],
[0, 20],
[-5, 18],
[-18, 3],
[-4, 10]
];
expected = [[8, 0, 1], [1, 2, 3], [3, 4, 5], [5, 6, 7], [8, 1, 3], [5, 7, 8], [8, 3, 5]];
actual = triangulate(shape);
assertEqualPoints(expected, actual);
}
test_triangulate();