chiark / gitweb /
fairphone-case: ButtonPlan: swap args in demo (nfc)
[reprap-play.git] / pandemic-quarantines.scad
1 // -*- C -*-
2
3 prisml = 13;
4 triedge = 13;
5
6 etchdepth = 1.0;
7
8 figboxsize = 13;
9
10 // calculated
11
12 triheight = triedge / 2 * sqrt(3);
13 tricentre = triedge / 2 * tan(30);
14
15 module Number(number) {
16   translate([-figboxsize/2, -figboxsize/2])
17     import(file=str("pandemic-quarantine-l",number,".dxf"), convexity=100);
18 }
19
20 module FaceTriangle(){
21   x = triedge / 2;
22   y = triheight;
23   polygon([[-x,  0],
24            [ 0,  y],
25            [ x,  0]]);
26 }
27
28 module Body(){
29   translate([0, prisml/2, 0])
30     rotate([90,0,0])
31     linear_extrude(height=prisml) FaceTriangle();
32 }
33
34 module NumberCut(number){
35   translate([0,0, -etchdepth])
36     linear_extrude(height= etchdepth + 1)
37     Number(number);
38 }
39
40 module Etchings(){
41   for (rot=[0,180]) {
42     rotate([0,0, rot])
43       translate([0, -prisml/2, triedge * 0.3])
44       rotate([90, 0, 0])
45       NumberCut(2);
46   }
47   for (rot=[0,120,240]) {
48     translate([0,0, tricentre])
49       rotate([0, rot, 0])
50       translate([0,0, -tricentre])
51       rotate([0,180,0])
52       rotate([0,0, rot==240 ? 90 : -90])
53       NumberCut(1);
54   }
55 }
56
57 module Counter(){
58   difference(){
59     Body();
60     Etchings();
61   }
62 }
63
64 Counter();
65 //NumberCut(1);