mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 18:24:28 +02:00
add hexahedron
This commit is contained in:
19
src/experimental/geom_hexahedron.scad
Normal file
19
src/experimental/geom_hexahedron.scad
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
use <experimental/_impl/_geom_platonic_polyhedra.scad>;
|
||||||
|
|
||||||
|
function geom_hexahedron(radius, detail = 0, quick_mode = true) =
|
||||||
|
let(
|
||||||
|
t = 1 / sqrt(3),
|
||||||
|
hexahedron_points = [
|
||||||
|
[t, t, t], [-t, t, t], [-t, -t, t], [t, -t, t],
|
||||||
|
[t, t, -t], [-t, t, -t], [-t, -t, -t], [t, -t, -t]
|
||||||
|
],
|
||||||
|
hexahedron_faces = [
|
||||||
|
[0, 7, 3], [0, 4, 7],
|
||||||
|
[1, 4, 0], [1, 5, 4],
|
||||||
|
[2, 6, 5], [2, 5, 1],
|
||||||
|
[3, 7, 6], [3, 6, 2],
|
||||||
|
[0, 3, 2], [0, 2, 1],
|
||||||
|
[5, 6, 7], [5, 7, 4]
|
||||||
|
]
|
||||||
|
)
|
||||||
|
_geom_platonic_polyhedra(hexahedron_points, hexahedron_faces, radius, detail, quick_mode);
|
6
src/experimental/hexahedron.scad
Normal file
6
src/experimental/hexahedron.scad
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
use <experimental/geom_hexahedron.scad>;
|
||||||
|
|
||||||
|
module hexahedron(radius, detail = 0, quick_mode = true) {
|
||||||
|
points_faces = geom_hexahedron(radius, detail, quick_mode);
|
||||||
|
polyhedron(points_faces[0], points_faces[1]);
|
||||||
|
}
|
Reference in New Issue
Block a user