-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmockup.scad
119 lines (99 loc) · 2.57 KB
/
mockup.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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
use <bed.scad>;
use <bed-mount.scad>;
use <base.scad>;
use <floor.scad>;
use <cover.scad>;
use <cover-top.scad>;
use <led-mount.scad>;
use <led-mount-pad.scad>;
use <led-mount-clamp.scad>;
use <pcb-mount.scad>;
include <parameters.scad>;
// Whether to explode the design
explode = true;
// Slack between parts
slack = 0;
floor_ = true;
base = true;
// Whether to display the bed mount
bed_mount = true;
// Whether to display the bed
bed = true;
// Whether to display the PCB mount
pcb_mount = true;
led_mount_rib = true;
led_mount_pad = true;
led_mount_clamp = true;
// Whether to display the cover
cover = true;
// Whether to display the top cover
cover_top = true;
e = explode ? 40 : 0;
module endstop () {
difference () {
translate([-endstop_l / 2, 0, -endstop_bolt_offset]) {
cube([endstop_l, endstop_w+1, endstop_h]);
color("red") cube([endstop_l, endstop_w, endstop_deact_h]);
color("green") cube([endstop_l, endstop_w, endstop_act_h]);
}
translate([0, -cover_t, 0]) rotate([270, 0, 0]) endstop_bolts();
}
}
module mockup () {
if (floor_) {
floor_();
}
if (base) {
translate([0, 0, floor_h + e + slack]) base();
}
translate([0, 0, floor_h + inset_base_h + 2 * e + 2 * slack]) {
translate([base_d / 2, base_d / 2]) {
if (bed_mount) {
translate([-bed_mount_d / 2, -bed_mount_d / 2])
bed_mount();
}
if (bed) translate([0, 0, bed_mount_h + e + slack]) bed_mockup();
}
translate([
cover_base_offset,
base_d / 2 - led_mount_rib_w / 2
]) {
if (led_mount_rib) led_mount_rib();
translate([0, 0, led_mount_rib_h / 2]) {
if (led_mount_clamp) {
translate([e + led_mount_rib_t, (led_mount_rib_w - led_mount_clamp_back_w - 2 * led_mount_clamp_t) / 2]) {
led_mount_clamp();
}
}
if (led_mount_pad) {
translate([-e, (led_mount_rib_w - led_mount_pad_w) / 2, (led_mount_clamp_h - led_mount_pad_h) / 2]) {
rotate([90, 0, 90])
led_mount_pad();
}
}
}
}
translate([
cover_base_offset + fit / 2 + standoff_d,
base_d - standoff_d - cover_base_offset - fit / 2,
]) {
if (pcb_mount) pcb_mount();
}
if (cover) {
translate([0, 0, slack + e]) cover_mockup();
}
if (cover_top) {
translate([0, 0, cover_h + slack + 4 * e]) cover_top();
}
}
}
module cover_mockup () {
cover();
translate([0, -cover_t, 0]) to_cover_endstop() endstop();
}
module bed_mockup () {
translate([0, 0, e + slack]) {
if (bed) bed();
}
}
mockup();