aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorElena of Valhalla'' Grandi <valhalla@trueelena.org>2014-11-10 22:27:43 +0100
committerElena of Valhalla'' Grandi <valhalla@trueelena.org>2014-11-10 22:27:43 +0100
commit4c5dfe0f0c6391a6e1902273f5a49a79d17428e8 (patch)
tree3ad6cce28c0e7a03c16c7c76d658c89fce668e9e /lib
parent3dec48bd70405c6748bf223ab497e1e2f3eeac59 (diff)
Updated to use children() instead of child()
Diffstat (limited to 'lib')
-rw-r--r--lib/dice.scad102
1 files changed, 51 insertions, 51 deletions
diff --git a/lib/dice.scad b/lib/dice.scad
index 58d00e8..92eccbb 100644
--- a/lib/dice.scad
+++ b/lib/dice.scad
@@ -14,10 +14,10 @@ module tetrahedron(r) {
module tetrahedron_faces(r, sc_face=0.6) {
union() {
- rotate([180, 0, 180]) translate([0, 0, r/3]) scale([sc_face, sc_face, 1]) child(0);
- rotate([acos(1/3)+180, 0, 0]) rotate([180, 0, 0]) translate([0, 0, r/3]) scale([sc_face, sc_face, 1]) child(1);
- rotate([0, 0, 120]) rotate([acos(1/3)+180, 0, 0]) rotate([180, 0, 0]) translate([0, 0, r/3]) scale([sc_face, sc_face, 1]) child(2);
- rotate([0, 0, 240]) rotate([acos(1/3)+180, 0, 0]) rotate([180, 0, 0]) translate([0, 0, r/3]) scale([sc_face, sc_face, 1]) child(3);
+ rotate([180, 0, 180]) translate([0, 0, r/3]) scale([sc_face, sc_face, 1]) children(0);
+ rotate([acos(1/3)+180, 0, 0]) rotate([180, 0, 0]) translate([0, 0, r/3]) scale([sc_face, sc_face, 1]) children(1);
+ rotate([0, 0, 120]) rotate([acos(1/3)+180, 0, 0]) rotate([180, 0, 0]) translate([0, 0, r/3]) scale([sc_face, sc_face, 1]) children(2);
+ rotate([0, 0, 240]) rotate([acos(1/3)+180, 0, 0]) rotate([180, 0, 0]) translate([0, 0, r/3]) scale([sc_face, sc_face, 1]) children(3);
}
}
@@ -37,12 +37,12 @@ module d4(size=false, side=false) {
module cube_faces(l) {
union() {
- translate([0, 0, l/2]) child(0);
- rotate([90, 0, 0]) translate([0, 0, l/2]) child(1);
- rotate([0, 90, 0]) translate([0, 0, l/2]) child(2);
- rotate([-90, 0, 0]) translate([0, 0, l/2]) child(3);
- rotate([0, -90, 0]) translate([0, 0, l/2]) child(4);
- rotate([180, 0, 0]) translate([0, 0, l/2]) child(5);
+ translate([0, 0, l/2]) children(0);
+ rotate([90, 0, 0]) translate([0, 0, l/2]) children(1);
+ rotate([0, 90, 0]) translate([0, 0, l/2]) children(2);
+ rotate([-90, 0, 0]) translate([0, 0, l/2]) children(3);
+ rotate([0, -90, 0]) translate([0, 0, l/2]) children(4);
+ rotate([180, 0, 0]) translate([0, 0, l/2]) children(5);
}
}
@@ -75,14 +75,14 @@ module octahedron_faces(r, sc_face=0.6) {
c = r*2;
i_r = r / sqrt(3);
union() {
- translate([0, 0, i_r]) rotate([0, 0, 180]) scale([sc_face, sc_face, 1]) child(0);
- rotate([acos(-1/3), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(4);
- rotate([0, 0, 120]) rotate([acos(-1/3)+180, 0, 0]) translate([0, 0, i_r]) rotate([0, 0, 120]) scale([sc_face, sc_face, 1]) child(6);
- rotate([0, 0, -120]) rotate([acos(-1/3)+180, 0, 0]) rotate([0, 0, 240]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(2);
- rotate([0, 0, -120]) rotate([acos(-1/3), 0, 0]) rotate([0, 0, 120]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(5);
- rotate([0, 0, 120]) rotate([acos(-1/3), 0, 0]) rotate([0, 0, 240]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(1);
- rotate([acos(-1/3)+180, 0, 0]) translate([0, 0, i_r])scale([sc_face, sc_face, 1]) child(3);
- rotate([180, 0, 0]) translate([0, 0, i_r])scale([sc_face, sc_face, 1]) child(7);
+ translate([0, 0, i_r]) rotate([0, 0, 180]) scale([sc_face, sc_face, 1]) children(0);
+ rotate([acos(-1/3), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(4);
+ rotate([0, 0, 120]) rotate([acos(-1/3)+180, 0, 0]) translate([0, 0, i_r]) rotate([0, 0, 120]) scale([sc_face, sc_face, 1]) children(6);
+ rotate([0, 0, -120]) rotate([acos(-1/3)+180, 0, 0]) rotate([0, 0, 240]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(2);
+ rotate([0, 0, -120]) rotate([acos(-1/3), 0, 0]) rotate([0, 0, 120]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(5);
+ rotate([0, 0, 120]) rotate([acos(-1/3), 0, 0]) rotate([0, 0, 240]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(1);
+ rotate([acos(-1/3)+180, 0, 0]) translate([0, 0, i_r])scale([sc_face, sc_face, 1]) children(3);
+ rotate([180, 0, 0]) translate([0, 0, i_r])scale([sc_face, sc_face, 1]) children(7);
}
}
@@ -117,19 +117,19 @@ module dodecahedron_faces(r, sc_face=1.1) {
echo(l);
i_r = (l/2)*sqrt(5/2 + 11*sqrt(5)/10);
union() {
- translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(0);
- rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(1);
- rotate([0, 0, 72]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(3);
- rotate([0, 0, 144]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(5);
- rotate([0, 0, 216]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(4);
- rotate([0, 0, 288]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(2);
-
- rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(10);
- rotate([0, 0, 72]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(8);
- rotate([0, 0, 144]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(6);
- rotate([0, 0, 216]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(7);
- rotate([0, 0, 288]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(9);
- rotate([180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(11);
+ translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(0);
+ rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(1);
+ rotate([0, 0, 72]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(3);
+ rotate([0, 0, 144]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(5);
+ rotate([0, 0, 216]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(4);
+ rotate([0, 0, 288]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(2);
+
+ rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(10);
+ rotate([0, 0, 72]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(8);
+ rotate([0, 0, 144]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(6);
+ rotate([0, 0, 216]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(7);
+ rotate([0, 0, 288]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(9);
+ rotate([180, 0, 0]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(11);
}
}
@@ -178,35 +178,35 @@ module icosahedron_faces(r, sc_face=0.5) {
phi = (1+sqrt(5))/2;
rotate([0, -acos((-(1+sqrt(5)))/(2*sqrt(3))), 0])
union() {
- rotate([0, acos((-(1+sqrt(5)))/(2*sqrt(3))), 0]) translate([0, 0, i_r]) rotate([0, 0, 90]) scale([sc_face, sc_face, 1]) child(0);
- rotate([180, acos((-(1+sqrt(5)))/(2*sqrt(3))), 0]) translate([0, 0, i_r]) rotate([0, 0, 270]) scale([sc_face, sc_face, 1]) child(19);
+ rotate([0, acos((-(1+sqrt(5)))/(2*sqrt(3))), 0]) translate([0, 0, i_r]) rotate([0, 0, 90]) scale([sc_face, sc_face, 1]) children(0);
+ rotate([180, acos((-(1+sqrt(5)))/(2*sqrt(3))), 0]) translate([0, 0, i_r]) rotate([0, 0, 270]) scale([sc_face, sc_face, 1]) children(19);
- mirror([1, 0, 0]) rotate([0, acos((-(1+sqrt(5)))/(2*sqrt(3))), 0]) translate([0, 0, i_r]) mirror([0, 1, 0]) rotate([0, 0, 90]) scale([sc_face, sc_face, 1]) child(12);
- mirror([1, 0, 0]) rotate([180, acos((-(1+sqrt(5)))/(2*sqrt(3))), 0]) translate([0, 0, i_r]) mirror([0, 1, 0]) rotate([0, 0, 90]) scale([sc_face, sc_face, 1]) child(7);
+ mirror([1, 0, 0]) rotate([0, acos((-(1+sqrt(5)))/(2*sqrt(3))), 0]) translate([0, 0, i_r]) mirror([0, 1, 0]) rotate([0, 0, 90]) scale([sc_face, sc_face, 1]) children(12);
+ mirror([1, 0, 0]) rotate([180, acos((-(1+sqrt(5)))/(2*sqrt(3))), 0]) translate([0, 0, i_r]) mirror([0, 1, 0]) rotate([0, 0, 90]) scale([sc_face, sc_face, 1]) children(7);
- rotate([0, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(9);
- rotate([180, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) child(10);
+ rotate([0, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(9);
+ rotate([180, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) scale([sc_face, sc_face, 1]) children(10);
- mirror([1, 0, 0]) rotate([0, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([1, 0, 0]) scale([sc_face, sc_face, 1]) child(1);
- mirror([1, 0, 0]) rotate([180, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([1, 0, 0]) scale([sc_face, sc_face, 1]) child(18);
+ mirror([1, 0, 0]) rotate([0, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([1, 0, 0]) scale([sc_face, sc_face, 1]) children(1);
+ mirror([1, 0, 0]) rotate([180, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([1, 0, 0]) scale([sc_face, sc_face, 1]) children(18);
- mirror([0, 1, 0]) rotate([0, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([0, 1, 0]) rotate([0, 0, 180]) scale([sc_face, sc_face, 1]) child(15);
- mirror([0, 1, 0]) rotate([180, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([0, 1, 0]) rotate([0, 0, 180]) scale([sc_face, sc_face, 1]) child(4);
+ mirror([0, 1, 0]) rotate([0, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([0, 1, 0]) rotate([0, 0, 180]) scale([sc_face, sc_face, 1]) children(15);
+ mirror([0, 1, 0]) rotate([180, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([0, 1, 0]) rotate([0, 0, 180]) scale([sc_face, sc_face, 1]) children(4);
- mirror([0, 1, 0]) mirror([1, 0, 0]) rotate([0, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([0, 1, 0]) mirror([0, 1, 0]) scale([sc_face, sc_face, 1]) child(13);
- mirror([0, 1, 0]) mirror([1, 0, 0]) rotate([180, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([0, 1, 0]) mirror([0, 1, 0]) scale([sc_face, sc_face, 1]) child(6);
+ mirror([0, 1, 0]) mirror([1, 0, 0]) rotate([0, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([0, 1, 0]) mirror([0, 1, 0]) scale([sc_face, sc_face, 1]) children(13);
+ mirror([0, 1, 0]) mirror([1, 0, 0]) rotate([180, acos(1/sqrt(3)), -45]) translate([0, 0, i_r]) mirror([0, 1, 0]) mirror([0, 1, 0]) scale([sc_face, sc_face, 1]) children(6);
- rotate([90, 0, 0]) rotate([0, acos((sqrt(5)+1)/(2*sqrt(3))), 90]) translate([0, 0, i_r]) rotate([0, 0, 270]) scale([sc_face, sc_face, 1]) child(11);
- rotate([270, 0, 0]) rotate([0, acos((sqrt(5)+1)/(2*sqrt(3))), 90]) translate([0, 0, i_r]) rotate([0, 0, 270]) scale([sc_face, sc_face, 1]) child(8);
+ rotate([90, 0, 0]) rotate([0, acos((sqrt(5)+1)/(2*sqrt(3))), 90]) translate([0, 0, i_r]) rotate([0, 0, 270]) scale([sc_face, sc_face, 1]) children(11);
+ rotate([270, 0, 0]) rotate([0, acos((sqrt(5)+1)/(2*sqrt(3))), 90]) translate([0, 0, i_r]) rotate([0, 0, 270]) scale([sc_face, sc_face, 1]) children(8);
- mirror([0, 0, 1]) rotate([90, 0, 0]) rotate([0, acos((sqrt(5)+1)/(2*sqrt(3))), 90]) translate([0, 0, i_r]) mirror([1, 0, 0]) rotate([0, 0, 90]) scale([sc_face, sc_face, 1]) child(14);
- mirror([0, 0, 1]) rotate([270, 0, 0]) rotate([0, acos((sqrt(5)+1)/(2*sqrt(3))), 90]) translate([0, 0, i_r]) mirror([1, 0, 0]) rotate([0, 0, 90]) scale([sc_face, sc_face, 1]) child(5);
+ mirror([0, 0, 1]) rotate([90, 0, 0]) rotate([0, acos((sqrt(5)+1)/(2*sqrt(3))), 90]) translate([0, 0, i_r]) mirror([1, 0, 0]) rotate([0, 0, 90]) scale([sc_face, sc_face, 1]) children(14);
+ mirror([0, 0, 1]) rotate([270, 0, 0]) rotate([0, acos((sqrt(5)+1)/(2*sqrt(3))), 90]) translate([0, 0, i_r]) mirror([1, 0, 0]) rotate([0, 0, 90]) scale([sc_face, sc_face, 1]) children(5);
- rotate([0, 90, atan((-sqrt(5)+1)/(sqrt(5)+1))]) translate([0, 0, i_r]) rotate([0, 0, 180]) scale([sc_face, sc_face, 1]) child(16);
- rotate([180, 90, atan((-sqrt(5)+1)/(sqrt(5)+1))]) translate([0, 0, i_r]) rotate([0, 0, 180]) scale([sc_face, sc_face, 1]) child(3);
+ rotate([0, 90, atan((-sqrt(5)+1)/(sqrt(5)+1))]) translate([0, 0, i_r]) rotate([0, 0, 180]) scale([sc_face, sc_face, 1]) children(16);
+ rotate([180, 90, atan((-sqrt(5)+1)/(sqrt(5)+1))]) translate([0, 0, i_r]) rotate([0, 0, 180]) scale([sc_face, sc_face, 1]) children(3);
- mirror([0, 1, 0]) rotate([0, 90, atan((-sqrt(5)+1)/(sqrt(5)+1))]) translate([0, 0, i_r]) mirror([0, 1, 0]) scale([sc_face, sc_face, 1]) child(2);
- mirror([0, 1, 0]) rotate([180, 90, atan((-sqrt(5)+1)/(sqrt(5)+1))]) translate([0, 0, i_r]) mirror([0, 1, 0]) scale([sc_face, sc_face, 1]) child(17);
+ mirror([0, 1, 0]) rotate([0, 90, atan((-sqrt(5)+1)/(sqrt(5)+1))]) translate([0, 0, i_r]) mirror([0, 1, 0]) scale([sc_face, sc_face, 1]) children(2);
+ mirror([0, 1, 0]) rotate([180, 90, atan((-sqrt(5)+1)/(sqrt(5)+1))]) translate([0, 0, i_r]) mirror([0, 1, 0]) scale([sc_face, sc_face, 1]) children(17);
}
}