mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-03-14 02:59:42 +01:00
add hexahedron
This commit is contained in:
parent
5374999967
commit
57da4b39ad
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]);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user