-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslotted_float.scad
110 lines (85 loc) · 2.8 KB
/
slotted_float.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
/********************************************************
* Slotted Float - vsergeev
* https://github.com/vsergeev/3d-slotted-float
* CC-BY-4.0
*
* Release Notes
* * v1.0 - 06/20/2023
* * Initial release.
********************************************************/
/* [Basic] */
part = "both"; // [both, float, peg]
// in mm
float_xy_diameter = 20;
// in mm
float_z_length = 22.5;
/* [Advanced] */
// in mm, can be reduced to 0.1 for filaments with less expansion
float_xy_slot_width = 0.2;
// in mm, can be increased to 0.25 for less flexible filaments
float_peg_xy_clearance = 0;
// in mm
peg_xy_diameter = 5;
// in mm
peg_z_base_height = 3;
// in mm
peg_xy_base_lip = 1.5;
// in mm
peg_xy_bore_diameter = 1.5;
// peg length scale factor
peg_z_length_scale = 1.05;
// peg taper scale factor
peg_xy_taper_scale = 1.05;
/* [Hidden] */
$fn = 100;
/******************************************************************************/
/* 3D Extrusions */
/******************************************************************************/
module float() {
cutoff = 0.15; /* 85% */
difference() {
/* Ellipsoid */
intersection() {
translate([0, 0, (float_z_length * (1 - cutoff)) / 2])
scale([1, 1, (float_z_length * (1 + cutoff)) / float_xy_diameter])
sphere(d=float_xy_diameter);
cylinder(h=float_z_length * 2, d=float_xy_diameter * 2);
}
/* Bore */
translate([0, 0, -float_z_length / 4])
cylinder(h=float_z_length * 2, d=peg_xy_diameter + float_peg_xy_clearance);
/* Line Slot */
translate([0, -float_xy_slot_width / 2, -float_z_length / 4])
cube([float_xy_diameter / 1.5, float_xy_slot_width, float_z_length * 2]);
}
}
module peg() {
difference() {
union() {
/* Base */
translate([0, 0, peg_z_length_scale * float_z_length])
cylinder(h=peg_z_base_height, d=peg_xy_taper_scale * peg_xy_diameter + peg_xy_base_lip);
/* Tapered Peg */
cylinder(h=peg_z_length_scale * float_z_length, d1=peg_xy_diameter, d2=peg_xy_taper_scale * peg_xy_diameter);
}
/* Bore */
translate([0, 0, -peg_z_length_scale * float_z_length / 4])
cylinder(h=peg_z_length_scale * float_z_length * 2, d=peg_xy_bore_diameter);
}
}
/******************************************************************************/
/* Top-level */
/******************************************************************************/
if (part == "both") {
color("yellow")
float();
translate([0, 0, -(peg_z_length_scale - 1) * float_z_length])
color("grey")
peg();
} else if (part == "float") {
color("yellow")
float();
} else if (part == "peg") {
color("grey")
peg();
}