1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-22 22:35:18 +02:00

add octahedron

This commit is contained in:
Justin Lin
2021-09-22 16:35:22 +08:00
parent b2d2940ef1
commit 83b1843f3f
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
use <experimental/_impl/_geom_platonic_polyhedra.scad>;
function geom_octahedron(radius, detail = 0, quick_mode = true) =
let(
t = (1 + sqrt(5)) / 2 ,
octahedron_points = [
[1, 0, 0], [-1, 0, 0], [0, 1, 0],
[0, -1, 0], [0, 0, 1], [0, 0, -1]
],
octahedron_faces = [
[4, 2, 0], [3, 4, 0], [5, 3, 0],
[2, 5, 0], [5, 2, 1], [3, 5, 1],
[4, 3, 1], [2, 4, 1]
]
)
_geom_platonic_polyhedra(octahedron_points, octahedron_faces, radius, detail, quick_mode);

View File

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