1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-02-06 08:08:32 +01:00
dotSCAD/test/test_triangulate.scad
2020-01-27 16:31:13 +08:00

26 lines
489 B
OpenSCAD

use <unittest.scad>;
use <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();