forked from fieldOfView/Cura-SimpleShapes
-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathParametricBedLevel.scad
55 lines (48 loc) · 1.65 KB
/
ParametricBedLevel.scad
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
// Bed Level
// 5@axes
// Size must be set to 100/100 final shape will be scaled by the plugin
$fn = 40;
bed_width = 100;
bed_depth = 100;
bed_border = 4;
square_xcount = 3;
square_ycount = 3;
square_size = 10;
line_width = 0.8;
thickness = 0.21;
// Build plate size
print_width = bed_width - square_size - (2*bed_border);
print_depth = bed_depth - square_size - (2*bed_border);
translate([-bed_width*0.5, -bed_depth*0.5, 0]) linear_extrude(height = thickness) {
// translate everything to center in print area
translate([(square_size/2)+bed_border,(square_size/2)+bed_border,0]){
// intervals between printed shapes
incremenx = print_width / (square_xcount-1);
incremeny = print_depth / (square_ycount-1);
// draw connection lines along X axis
for(curr_x = [0:square_xcount-1]){
translate([center_x, print_depth/2, 0]){
square([line_width,print_depth], true);
}
center_x = curr_x * incremenx;
}
// draw connection lines along Y axis
for(curr_y = [0:square_ycount-1]){
translate([print_width/2, center_y, 0]){
square([print_width, line_width], true);
}
center_y = curr_y * incremeny;
}
// draw square shapes
for(curr_x = [0:square_xcount-1]){
for(curr_y = [0:square_ycount-1]){
translate([center_x,center_y]){
square([square_size,square_size],true);
//circle(d=square_size);
}
center_y = curr_y * incremeny;
}
center_x = curr_x * incremenx;
}
}
}