-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvent.scad
496 lines (383 loc) · 21.2 KB
/
vent.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
// *************************************************************
//
// Modules to build up the vent components
//
// This file instantiates the entire vent as a single object, use
// vent_left.scad and vent_right.scad for the individual parts
//
// *************************************************************
include <libs/Round-Anything/polyround.scad>
include <libs/roundedcube_simple.scad>
include <vent_parameters.scad>
// The hood attachment which connects the vent to the Creator Pro 2 hood
module hood_attachment() {
difference() {
// Base shape
// translate( [ 0, hood_cover_total_width / 2 - epsilon/2, 0 ] )
translate( [ 0, hood_cover_total_width / 2, 0 ] )
rotate( [90, 0 , 0 ] )
extrudeWithRadius( hood_cover_total_width,
hood_cover_back_radius,
hood_cover_front_radius, radiusExtrudefn )
{
polygon( polyRound( hood_cover_outside_radiiPoints, fnn ) );
};
// Cut out side slots the hood slots into (on on both sides)
cut_lenght = hood_hole_height * 2;
translate( [ -hood_hole_top_width/2 - hood_cover_length_over_hood - hood_cover_x_dist/2 + hood_cover_length_over_hood/2,
0, hood_cover_y_dist/2 ] )
rotate( [ 0, asin( (hood_cover_x_dist-0.14) / hood_cover_y_dist ), 0 ] )
rotate( [ 90, 0, -90 ] )
translate( [ 0, 0, -hood_cover_length_over_hood/2 ])
extrudeWithRadius( hood_cover_length_over_hood, hood_cover_front_radius/2, -hood_cover_front_radius*1.5, radiusExtrudefn )
{
square( [ hood_wall_width, cut_lenght ], center=true );
};
translate( [ hood_hole_top_width/2 + hood_cover_length_over_hood + hood_cover_x_dist/2 - hood_cover_length_over_hood/2,
0, hood_cover_y_dist/2 ] )
rotate( [ 0, -asin( (hood_cover_x_dist-0.14) / hood_cover_y_dist ), 0 ] )
rotate( [ 90, 0, 90 ] )
translate( [ 0, 0, -hood_cover_length_over_hood/2 ])
extrudeWithRadius( hood_cover_length_over_hood, hood_cover_front_radius/2, -hood_cover_front_radius*1.5, radiusExtrudefn )
{
square( [ hood_wall_width, cut_lenght ], center=true );
};
// Cut out interior hole for venting
translate( [ 0, hood_cover_total_width / 2, hood_cover_interior_dist_from_bottom ] )
rotate( [90, 0 , 0 ] )
extrudeWithRadius( hood_cover_total_width + epsilon, 0, -hood_cover_front_radius*3, radiusExtrudefn )
{
polygon( polyRound( hood_cover_inside_radiiPoints, fnn ) );
};
};
} // module hood_attachment()
// The curved vent behind the hood attachment point and rotates the vent 90 degrees to face the hose
module hood_corner() {
translate( [ -inside_bottom_horz - hood_corner_curve, hood_cover_total_width/2 - epsilon, hood_cover_interior_dist_from_bottom - hood_corner_width ] )
rotate_extrude( angle = hood_corner_angle, convexity = 2 )
shell2d( hood_corner_width )
translate( [ inside_bottom_horz + hood_corner_curve, hood_corner_width, 0 ] )
polygon( polyRound( hood_cover_inside_radiiPoints, fnn ) );
} // moduel hood_corner()
// The end of the vent that attaches to the air ducts
module hose_attachment() {
translate( [ hose_attachment_location_x, hose_attachment_location_y, hose_attachment_location_z ] )
rotate( [ 0, -90, 0 ] )
union() {
// Build the attachment for the hose
translate( [ 0, 0, hose_attachment_stop_length - epsilon ] )
linear_extrude( hose_attachment_length )
difference() {
circle( d = hose_attachment_od );
circle( d = hose_attachment_od - hose_attachment_width * 2 );
}
// Build the attachment stop
linear_extrude( hose_attachment_stop_length )
difference() {
circle( d = hose_attachment_od + hose_attachment_stop_protrusion * 2 );
circle( d = hose_attachment_od - hose_attachment_width * 2 );
}
// To improve printing add a shelf to the attachment stop ring
translate( [ 0, 0, hose_attachment_stop_length - epsilon ] )
rotate_extrude( angle = 360 )
translate( [ hose_attachment_od/2 - epsilon, 0, 0 ] )
polygon( [
[ 0, 0 ],
[ hose_attachment_stop_protrusion + epsilon, 0 ],
[ 0, hose_attachment_stop_protrusion * hose_attachment_stop_protrusion_print_shelf ],
]);
}
}
// The vent section that connects the hose attachment to the curved section
module pipe() {
// Subtract the outer and inner shapes to build the pipe
difference() {
// Build the outer shape of the pipe
hull() {
// The outside of the pipe attachment shape
translate( [ hose_attachment_location_x - epsilon, hose_attachment_location_y, hose_attachment_location_z ] )
rotate( [ 0, -90, 0 ] )
linear_extrude( epsilon )
circle( d = hose_attachment_od );
// The outside of the curve shape
translate( [ -(hood_corner_curve + inside_bottom_horz) + epsilon,
hood_cover_total_width/2 + hood_corner_curve + inside_bottom_horz,
hood_cover_interior_dist_from_bottom ] )
rotate( [ 90, 0, 90 ] )
linear_extrude( epsilon )
offset( hood_corner_width )
polygon( polyRound( hood_cover_inside_radiiPoints, fnn ) );
}
// Build the inner shape of the pipe to subtract
hull() {
// The inside of the pipe attachment shape
translate( [ hose_attachment_location_x - epsilon, hose_attachment_location_y, hose_attachment_location_z ] )
rotate( [ 0, -90, 0 ] )
linear_extrude( epsilon*2 )
circle( d = hose_attachment_od - hose_attachment_width * 2 );
// The inside of the curve shape
translate( [ -(hood_corner_curve + inside_bottom_horz) + epsilon,
hood_cover_total_width/2 + hood_corner_curve + inside_bottom_horz,
hood_cover_interior_dist_from_bottom ] )
rotate( [ 90, 0, 90 ] )
linear_extrude( epsilon*2 )
polygon( polyRound( hood_cover_inside_radiiPoints, fnn ) );
}
}
}
module bolt_connector_bottom() {
bolt_connector_bottom_radiiPoints = [
[ -bolt_connector_width/2, 0, 0 ],
[ -bolt_connector_width/2, bolt_connector_height, bolt_connector_radius ],
[ bolt_connector_width/2, bolt_connector_height, bolt_connector_radius ],
[ bolt_connector_width/2, 0, 0 ],
];
translate( [ -(hood_corner_curve + inside_bottom_horz - bolt_connector_depth/2),
inside_bottom_horz + hood_corner_curve + hood_corner_width,
hood_cover_interior_dist_from_bottom - epsilon ] )
rotate( [ 0, 0, -90 ] )
difference() {
// Build the connector shape
hull() {
// The connector shape itself
rotate( [ 90, 0, 0 ] )
linear_extrude( bolt_connector_depth )
polygon( polyRound( bolt_connector_bottom_radiiPoints, fnn ) );
// A shape in front of the connector to create a shape for 3 printing without supports
translate( [ 0, -bolt_connector_depth, 0 ] )
rotate( [ 180, 0, 0 ] )
linear_extrude( epsilon )
polygon( polyRound( bolt_connector_bottom_radiiPoints, fnn ) );
}
// Subtract the nut cutouts
// The center cutout
translate( [ 0, 0, bolt_connector_height/2 ] )
rotate( [ 90, 0, 0 ] )
cylinder( h = 200, d = bolt_connector_bolt_dia, center = true );
// The bolt nut cutout
translate( [ 0, -bolt_connector_capture_nut_depth/2 + epsilon, bolt_connector_height/2 ] )
rotate( [ 90, 90, 0 ] )
cylinder( h = bolt_connector_capture_nut_depth, d = bolt_connector_bolt_head_dia, center = true, $fn = 6 );
// A cutout into the left part printing element for the head
translate( [ 0, -bolt_connector_depth - bolt_connector_height/2 + bolt_connector_bolt_dia/2, bolt_connector_height/2 ] )
rotate( [ 90, 0, 0 ] )
cylinder( h = bolt_connector_height, d = bolt_connector_bolt_head_dia );
// A shelf to make printing the head cutout easier
head_shelf_height = ((bolt_connector_bolt_head_dia-bolt_connector_bolt_dia)/2) * hose_attachment_stop_protrusion_print_shelf;
translate( [ 0, -bolt_connector_depth - bolt_connector_height/2 + bolt_connector_bolt_dia/2 - epsilon, bolt_connector_height/2 ] )
rotate( [ 90, 0, 180 ] )
cylinder( h = head_shelf_height, d1 = bolt_connector_bolt_head_dia, d2 = bolt_connector_bolt_dia);
}
}
module bolt_connector_top() {
bolt_connector_top_radiiPoints = [
[ -bolt_connector_width/2, 0, 0 ],
[ -bolt_connector_width/2, bolt_connector_height, bolt_connector_radius ],
[ bolt_connector_width/2, bolt_connector_height, bolt_connector_radius ],
[ bolt_connector_width/2, 0, 0 ],
];
path_slope = ( inside_top_left_vert - inside_top_right_vert ) /
( inside_top_left_horz + inside_top_right_horz );
path_x_mid = ( -inside_top_left_horz + inside_top_right_horz ) /2;
path_y_mid = ( (inside_top_left_vert-hood_cover_interior_width) + (inside_top_right_vert-hood_cover_interior_width) ) / 2;
path_bottom_slope = ( (inside_top_right_vert-hood_cover_interior_width) - 0 ) /
( inside_top_right_horz - inside_bottom_horz );
path_bottom_x_mid = ( inside_top_right_horz * 9 + inside_bottom_horz ) / 10;
path_bottom_y_mid = ( (inside_top_right_vert-hood_cover_interior_width) * 9 + 0 ) / 10;
// Subtracts the bolt holes from the connector's shape
difference() {
// Creates the bolt connector by adding a print element to the bolt connector for the left part
hull() {
// Align to actual position on assembly
translate( [ -(hood_corner_curve + inside_bottom_horz) + epsilon,
hood_cover_total_width/2 + hood_corner_curve + inside_bottom_horz,
hood_cover_interior_dist_from_bottom ] )
rotate( [ 90, 0, 90 ] )
// Builds the bolt connector and right part print elements
hull() {
// Position the bolt connector on the inner cover outline
translate( [ path_x_mid ,
path_y_mid + epsilon,
0 ] )
rotate( [ 90, 0, 180 - atan( path_slope ) ] )
rotate( [ 270, 0, 0 ] )
linear_extrude( bolt_connector_depth, center=true )
polygon( polyRound( bolt_connector_top_radiiPoints, fnn ) );
// Position the element to hull against for the right part
translate( [ path_bottom_x_mid ,
path_bottom_y_mid + epsilon,
0 ] )
rotate( [ 0, 0, 90 + atan( path_bottom_slope ) ] )
linear_extrude( bolt_connector_depth, center=true )
square( [ epsilon, bolt_connector_width/2 ], center = true );
} // hull() to make the bolt connector part
// A section of the base pipe to hull against for printing the left part
translate( [ hose_attachment_location_x - epsilon*2, hose_attachment_location_y, hose_attachment_location_z ] )
rotate( [ 0, -90, 0 ] )
linear_extrude( epsilon )
intersection() {
difference() {
circle( d = hose_attachment_od );
circle( d = hose_attachment_od - hose_attachment_width );
};
translate( [ sin(interface_clip_pipe_section_angle_to_connect) * hose_attachment_od/2 - hose_attachment_od/2 * 0.1,
cos(interface_clip_pipe_section_angle_to_connect) * hose_attachment_od/2 - hose_attachment_od/2 * 0.1,
0 ] )
square(size = hose_attachment_od);
}
} // hull() to add the left part print element
// Subtract the nut cutouts
translate( [ -(hood_corner_curve + inside_bottom_horz) + epsilon,
hood_cover_total_width/2 + hood_corner_curve + inside_bottom_horz,
hood_cover_interior_dist_from_bottom ] )
rotate( [ 90, 0, 90 ] )
translate( [ path_x_mid ,
path_y_mid + epsilon,
0 ] )
rotate( [ 90, 0, 180 - atan( path_slope ) ] )
rotate( [ 270, 0, 0 ] )
union() {
// The center cutout
translate( [ 0, bolt_connector_height/2, 0 ] )
cylinder( h = 200, d = bolt_connector_bolt_dia, center = true );
// The bolt nut cutout
translate( [ 0, bolt_connector_height/2, -bolt_connector_capture_nut_depth/2 + bolt_connector_depth/2 + epsilon ] )
rotate( [ 0, 0, atan( path_slope ) - 90 ] )
cylinder( h = bolt_connector_capture_nut_depth, d = bolt_connector_bolt_head_dia, center = true, $fn = 6 );
// A cutout into the left part printing element for the head
translate( [ 0, bolt_connector_height/2, -bolt_connector_height*10 - bolt_connector_depth/2 - bolt_connector_bolt_dia/2 ] )
cylinder( h = bolt_connector_height*10, d = bolt_connector_bolt_head_dia );
// A shelf to make printing the head cutout easier
head_shelf_height = ((bolt_connector_bolt_head_dia-bolt_connector_bolt_dia)/2) * hose_attachment_stop_protrusion_print_shelf;
translate( [ 0, bolt_connector_height/2, -bolt_connector_depth/2 - bolt_connector_bolt_dia/2 - epsilon ] )
cylinder( h = head_shelf_height, d1 = bolt_connector_bolt_head_dia, d2 = bolt_connector_bolt_dia);
}
} // difference() to subtract the bolt holes
// The inner outline to match position to during development
// shell2d( epsilon )
// polygon( polyRound( hood_cover_inside_radiiPoints, fnn ) );
}
// Line around middle of interface between two parts
module vent_interface_insert( width, depth, margin ) {
difference() {
// Build a line around the entire interface
translate( [ -(hood_corner_curve + inside_bottom_horz) - epsilon,
hood_cover_total_width/2 + hood_corner_curve + inside_bottom_horz,
hood_cover_interior_dist_from_bottom ] )
rotate( [ 90, 0, 90 ] )
linear_extrude( depth + margin )
shell2d( offset1 = hood_corner_width/2 + (width + margin)/2, offset2 = hood_corner_width/2 - (width + margin)/2 ) {
polygon( polyRound( hood_cover_inside_radiiPoints, fnn ) );
};
// Remove the line on the bottom to prevent empty space overhang during printing
translate( [ 0, 0, -cube_subtract_size/2 + hood_cover_interior_dist_from_bottom + hood_cover_interior_radius_bottom*1.25 - margin ] )
cube( size = cube_subtract_size, center = true );
};
}
// The attachment clip on the right part
// Note: This clip is not being used in favor of a bolt connector instead
module right_clip() {
path_slope = ( inside_top_left_vert - inside_top_right_vert ) /
( inside_top_left_horz + inside_top_right_horz );
path_x_mid = ( -inside_top_left_horz + inside_top_right_horz ) /2;
path_y_mid = ( (inside_top_left_vert-hood_cover_interior_width) + (inside_top_right_vert-hood_cover_interior_width) ) / 2;
// Align to actual position on assembly
translate( [ -(hood_corner_curve + inside_bottom_horz) + epsilon,
hood_cover_total_width/2 + hood_corner_curve + inside_bottom_horz,
hood_cover_interior_dist_from_bottom ] )
rotate( [ 90, 0, 90 ] )
// Position the clip on the inner cover outline
translate( [ path_x_mid ,
path_y_mid + epsilon,
0 ] )
rotate( [ 90, 0, 270 - atan( path_slope ) ] )
translate( [ 0, interface_clip_depth, 0 ] )
rotate( [ 180, 0, 0 ] )
linear_extrude( height = interface_clip_width + interface_insert_margin, center = true )
polygon( points = [
[ 0, 0 ],
[ 0, interface_clip_depth ],
[ interface_clip_depth, 0 ]
] );
// The inner outline to match position to during development
// shell2d( epsilon )
// polygon( polyRound( hood_cover_inside_radiiPoints, fnn ) );
}
// The attachment clip on the left part
// Note: This clip is not being used in favor of a bolt connector instead
module left_clip() {
path_slope = ( inside_top_left_vert - inside_top_right_vert ) /
( inside_top_left_horz + inside_top_right_horz );
path_x_mid = ( -inside_top_left_horz + inside_top_right_horz ) /2;
path_y_mid = ( (inside_top_left_vert-hood_cover_interior_width) + (inside_top_right_vert-hood_cover_interior_width) ) / 2;
// Align to actual position on assembly
translate( [ -(hood_corner_curve + inside_bottom_horz) + epsilon,
hood_cover_total_width/2 + hood_corner_curve + inside_bottom_horz,
hood_cover_interior_dist_from_bottom ] )
rotate( [ 90, 0, 90 ] )
// Position the clip on the inner cover outline
translate( [ path_x_mid ,
path_y_mid + epsilon,
0 ] )
union() {
// The end of the clip that locks to the right inner piece
translate( [ 0, 0, interface_clip_depth * 2 + interface_insert_margin ] )
rotate( [ 90, 0, 90 - atan( path_slope ) ] )
translate( [ -interface_clip_depth, -interface_clip_depth, 0 ] )
linear_extrude( height = interface_clip_width - interface_insert_margin*2, center = true )
polygon( points = [
[ 0, 0 ],
[ 0, interface_clip_depth ],
[ interface_clip_depth, 0 ]
] );
// The bracket between the clip end and the bracket to the left assembly
rotate( [ 0, 0, 90 - atan( path_slope ) ] )
translate( [ -interface_clip_depth*1.5 + epsilon, 0, -interface_clip_width/4 + interface_clip_depth * 2 + interface_insert_margin * 3] )
roundedcube_simple( size = [ interface_clip_depth, interface_clip_width, interface_clip_width/2 ],
center = true, radius = interface_insert_margin *2 );
}
// To make the clip possible to print hull the base of the clip with a section of
// the base pipe to create a smooth vertical attachment point
hull() {
// The base of the bracket positioned within the assembley
translate( [ -(hood_corner_curve + inside_bottom_horz) + epsilon,
hood_cover_total_width/2 + hood_corner_curve + inside_bottom_horz,
hood_cover_interior_dist_from_bottom ] )
rotate( [ 90, 0, 90 ] )
translate( [ path_x_mid ,
path_y_mid + epsilon,
0 ] )
rotate( [ 0, 0, 90 - atan( path_slope ) ] )
translate( [ -interface_clip_depth + epsilon, 0, -interface_clip_depth - interface_insert_margin - epsilon*2 ] )
roundedcube_simple( size = [ interface_clip_depth * 2, interface_clip_width, interface_clip_depth ],
center = true, radius = interface_insert_margin *2 );
// A section of the base pipe
translate( [ hose_attachment_location_x - epsilon*2, hose_attachment_location_y, hose_attachment_location_z ] )
rotate( [ 0, -90, 0 ] )
linear_extrude( epsilon )
intersection() {
difference() {
circle( d = hose_attachment_od );
circle( d = hose_attachment_od - hose_attachment_width );
};
translate( [ sin(interface_clip_pipe_section_angle_to_connect) * hose_attachment_od/2 - hose_attachment_od/2 * 0.1,
cos(interface_clip_pipe_section_angle_to_connect) * hose_attachment_od/2 - hose_attachment_od/2 * 0.1,
0 ] )
square(size = hose_attachment_od);
}
}
// The inner outline to match position to during development
// shell2d( epsilon )
// polygon( polyRound( hood_cover_inside_radiiPoints, fnn ) );
}
module vent() {
hood_attachment();
hood_corner();
hose_attachment();
pipe();
bolt_connector_bottom();
right_clip();
left_clip();
}
// Instantiate the entire vent as a single object
vent();