mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-30 09:49:59 +02:00
add test
This commit is contained in:
@@ -19,6 +19,11 @@ module polyhedron_hull(points, polyhedron_abuse = false) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
vts_faces = _convex_hull3(points);
|
vts_faces = _convex_hull3(points);
|
||||||
polyhedron(vts_faces[0], vts_faces[1]);
|
polyhedron(vts_faces[0], vts_faces[1]);
|
||||||
|
test_convex_hull3(vts_faces);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module test_convex_hull3(vts_faces) {
|
||||||
|
|
||||||
}
|
}
|
@@ -8,6 +8,7 @@ include <test_rounded_cube.scad>;
|
|||||||
include <test_rounded_cylinder.scad>;
|
include <test_rounded_cylinder.scad>;
|
||||||
include <test_crystal_ball.scad>;
|
include <test_crystal_ball.scad>;
|
||||||
include <test_line3d.scad>;
|
include <test_line3d.scad>;
|
||||||
|
include <test_polyhedron_hull.scad>;
|
||||||
|
|
||||||
// Transformation
|
// Transformation
|
||||||
include <test_bend.scad>;
|
include <test_bend.scad>;
|
||||||
|
21
test/test_polyhedron_hull.scad
Normal file
21
test/test_polyhedron_hull.scad
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
include <polyhedron_hull.scad>;
|
||||||
|
|
||||||
|
module test_polyhedron_hull() {
|
||||||
|
echo("==== test_polyhedron_hull ====");
|
||||||
|
polyhedron_hull([
|
||||||
|
[1, 1, 1],
|
||||||
|
[1, 1, 0],
|
||||||
|
[-1, 1, 0],
|
||||||
|
[-1, -1, 0],
|
||||||
|
[1, -1, 0],
|
||||||
|
[0, 0, 1],
|
||||||
|
[0, 0, -1]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module test_convex_hull3(vts_faces) {
|
||||||
|
assert(vts_faces == [[[-1, -1, 0], [-1, 1, 0], [0, 0, -1], [0, 0, 1], [1, -1, 0], [1, 1, 0], [1, 1, 1]], [[2, 1, 0], [3, 0, 1], [4, 2, 0], [4, 0, 3], [5, 1, 2], [5, 2, 4], [6, 3, 1], [6, 1, 5], [6, 4, 3], [6, 5, 4]]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
test_polyhedron_hull();
|
Reference in New Issue
Block a user