1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-30 09:49:59 +02:00
This commit is contained in:
Justin Lin
2022-03-10 20:40:06 +08:00
parent 5b04d11ac8
commit 920509c3f1
3 changed files with 28 additions and 1 deletions

View File

@@ -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) {
} }

View File

@@ -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>;

View 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();