1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-21 14:04:53 +02:00

add tetrahedron

This commit is contained in:
Justin Lin
2021-09-22 16:39:04 +08:00
parent 60f3698200
commit 5374999967
2 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
use <experimental/_impl/_geom_platonic_polyhedra.scad>;
function geom_tetrahedron(radius, detail = 0, quick_mode = true) =
let(
t = (1 + sqrt(5)) / 2 ,
tetrahedron_points = [
[1, 1, 1], [-1, -1, 1], [-1, 1, -1], [1, -1, -1]
],
tetrahedron_faces = [
[0, 1, 2], [2, 3, 0], [0, 3, 1], [1, 3, 2]
]
)
_geom_platonic_polyhedra(tetrahedron_points, tetrahedron_faces, radius, detail, quick_mode);

View File

@@ -0,0 +1,6 @@
use <experimental/geom_tetrahedron.scad>;
module tetrahedron(radius, detail = 0, quick_mode = true) {
points_faces = geom_tetrahedron(radius, detail, quick_mode);
polyhedron(points_faces[0], points_faces[1]);
}