mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-01-17 14:18:13 +01:00
26 lines
497 B
OpenSCAD
26 lines
497 B
OpenSCAD
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(); |