-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib_cutouts.scad
More file actions
104 lines (100 loc) · 2.45 KB
/
Copy pathlib_cutouts.scad
File metadata and controls
104 lines (100 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
module myBreadboard(w, l, ro, ri) {
echo(w, l, ro, ri);
cols = floor((w - ((ro - ri) * 2)) / 2 / ro) - 1;
rows = floor((l - ((ro - ri) * 2)) / 2 / ro) - 1;
offx = floor((w - (cols * 2 * ro)) / 2);
offy = floor((l - (rows * 2 * ro)) / 2);
echo (cols, rows);
for (col = [0:cols]) {
for (row = [0:rows]) {
translate([2 * ro * col + offx, 2 * ro * row + offy, 0]) {
circle(ri);
}
}
}
}
module myLattice(w, l, ro, ri) {
echo(w, l, ro, ri);
cols = floor((w - ((ro - ri) * 2)) / ro) - 2;
rows = floor((l - ((ro - ri) * 2)) / 2 / ro) - 1;
offx = floor((w - (cols * ro)) / 2);
offy = floor((l - (rows * 2 * ro)) / 2);
echo (cols, rows);
for (col = [0:cols]) {
if (col / 2 == floor(col/2)) {
for (row = [0:rows]) {
translate([ro * col + offx, 2 * ro * row + offy, 0]) {
circle(ri, $fn=4);
}
}
} else {
for (row = [0:rows-1]) {
translate([ro * col + offx, 2 * ro * row + offy + ro, 0]) {
circle(ri, $fn=4);
}
}
}
}
}
module honeycomb(w, l, ro, ri, fn) {
echo(w, l, ro, ri);
cols = floor((w - ((ro - ri) * 2)) / 1.75 / ro) - 1;
rows = floor((l - ((ro - ri) * 2)) / 2 / ro) - 1;
offx = floor((w - (cols * 1.75 * ro)) / 2);
offy = floor((l - (rows * 2 * ro)) / 2);
echo (cols, rows);
for (col = [0:cols]) {
if (col / 2 == floor(col/2)) {
for (row = [0:rows]) {
translate([1.75 * ro * col + offx, 2 * ro * row + offy, 0]) {
circle(ri, $fn=fn);
}
}
} else {
for (row = [0:rows-1]) {
translate([1.75 * ro * col + offx, 2 * ro * row + offy + ro, 0]) {
circle(ri, $fn=fn);
}
}
}
}
}
module myHeart(w, l, ro, ri) {
translate([w/2, l/2-ri, 0]){
rotate([0, 0, 45]){
translate([0, 0, 0]){
square(2*ri);
}
translate([ri, 0, 0]){
circle(ri);
}
translate([0, ri, 0]){
circle(ri);
}
}
}
}
module myPlane(w, l, t, ro, ri) {
wbf = 100+(2*0.8);
lbf = 100-(2*18.2);
tbf = 100-(2*46.8);
scalebf = 2*ri/wbf;
difference() {
linear_extrude(t) {
difference() {
square([w, l]);
//myBreadboard(w, l, ro, ri);
//myLattice(w, l, ro, ri);
//myHoneycomb(w, l, ro, ri);
//myHeart(w, l, ro, ri);
}
}
translate([w-((w-(wbf*scalebf))/2), l-((l-(lbf*scalebf))/2), 1]) {
rotate([0, 0, 180]) {
scale(scalebf){
import("C:\\BTSync\\Paul\\Projects\\printrbot simple\\Documents\\STL Files\\butterfly.STL");
}
}
}
}
}