summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/piecepack.scad23
-rw-r--r--src/pyramid.scad6
2 files changed, 29 insertions, 0 deletions
diff --git a/src/piecepack.scad b/src/piecepack.scad
index ef8806b..b35c6ad 100644
--- a/src/piecepack.scad
+++ b/src/piecepack.scad
@@ -93,3 +93,26 @@ module saucer(suite) {
}
}
+module plain_pyramid(w,h,z) {
+ polyhedron(points=[[-w/2,-w/2,z], [w/2,-w/2,z],
+ [w/2,w/2,z], [-w/2,w/2,z], [z,z,h]],
+ triangles=[[0,1,2], [0,2,3],
+ [0,4,1], [1,4,2], [2,4,3], [3,4,0]]);
+}
+
+module pyramid(w,h,suite,value) {
+ difference() {
+ plain_pyramid(w,h,0);
+ plain_pyramid(w-4,h-4,-0.01);
+ if ( suite != "null") {
+ translate([0,-w/2+1,0]) rotate([atan(h/(w/2)),0,0]) linear_extrude(height=2)
+ scale(0.9*w/50) translate([-25,0,0]) import(str("../graphics/",suite,".dxf"));
+ }
+ if ( value != "null") {
+ translate([0,w/2-1,0])
+ rotate([-atan(h/(w/2)),0,0]) rotate([0,0,180]) linear_extrude(height=2)
+ scale(0.9*w/50) translate([-25,0,0]) import(str("../graphics/",value,".dxf"));
+ }
+ }
+}
+
diff --git a/src/pyramid.scad b/src/pyramid.scad
new file mode 100644
index 0000000..47850ca
--- /dev/null
+++ b/src/pyramid.scad
@@ -0,0 +1,6 @@
+use <piecepack.scad>;
+
+suite="arms";
+value="ace";
+
+pyramid(25,45,suite,value);