aboutsummaryrefslogtreecommitdiff
path: root/lib/dice.scad
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2026-08-18 16:01:21 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2026-08-19 09:21:41 +0200
commit86095aeb9b7c6cf0b99e6edc8720a0526cddcc75 (patch)
treef8ebd0035f4ef8e9f5a23496a8ea34441106caf8 /lib/dice.scad
parent552ef6579802f7242332598e04a3faa22ef70240 (diff)
New shape: d10
Diffstat (limited to 'lib/dice.scad')
-rw-r--r--lib/dice.scad37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/dice.scad b/lib/dice.scad
index fedc2ed..7ce7c7f 100644
--- a/lib/dice.scad
+++ b/lib/dice.scad
@@ -98,6 +98,43 @@ module d8(size=false, side=false) {
}
}
+// inscribed in a sphere of radius r
+module pentagonal_trapezohedron(r) {
+ c = r*2;
+ i_r = r * 0.70;
+ intersection() {
+ //cube([c, c, i_r*2], center=true);
+ sphere(r=r);
+ intersection_for ( i = [0:5] ) {
+ rotate([0, 0, 72*i]) rotate([0, 48, 0]) cube([c, c, i_r*2], center=true);
+ }
+ }
+}
+
+module pentagonal_trapezohedron_faces(r, sc_face=0.6) {
+ i_r = r * 0.85;
+ union() {
+ for ( i = [0:4] ) {
+ rotate([0, 0, 72*i]) translate([i_r * 0.6, 0, i_r * 0.3]) rotate([48, 0, 90]) scale([sc_face, sc_face, 1]) children(i * 2);
+ rotate([180, 0, 72*i + 180]) translate([i_r * 0.6, 0, i_r * 0.3]) rotate([48, 0, 90]) scale([sc_face, sc_face, 1]) children(10 - i * 2 - 1);
+ }
+ }
+}
+
+module d10(size=false, side=false) {
+ l = side ? side : s2s_d10(size);
+ if (l == false) {
+ echo("ERROR: d10: one of side or size should be defined");
+ }
+ r = sqrt(6)/4*l;
+ difference() {
+ intersection() {
+ sphere(r=r*0.98, $fn=64);
+ pentagonal_trapezohedron(r);
+ }
+ }
+}
+
// Dodecahedron inscribed in a sphere of radius r
module dodecahedron(r) {
c = r*2;