forked from fieldOfView/Cura-SimpleShapes
-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathBridgeTest.scad
159 lines (132 loc) · 5.2 KB
/
BridgeTest.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
// OpenSCAD test object for bridges
// Also tests for on-extruder fan cooling unevenness in X,Y axes.
// Parametrised to use as much space on a print bed as required.
// this design uses only half the spiral of the original.
// Customiser enabled
// preview[view:north east, tilt:top diagonal]
// Source file https://www.thingiverse.com/thing:912248
// Author : Neon22
// The initial design has been slightly modified to add the distance from the bridge on each branch.
/*[Bridges]*/
// length of the shortest bridge
min_bridge_length = 10; //[10:5:180]
// length of the longest bridge
max_bridge_length = 50; //[20:5:200]
// Total number
number_of_bridges = 10; //[4:1:20]
// difference between subsequent bridges
bridge_increment = (max_bridge_length - min_bridge_length) / (number_of_bridges - 1) ; //5;
// Test the XY cooling efficiency
show_XY_test = "no"; // [yes,no]
/*[Shape]*/
// diameter of the central hub
hub_diameter = 20; //[18:1:30]
// width of each bridge
bridge_width = 4; //[1:1:8]
// thickness of the vertical walls
wall_thickness = 1.2; //[1:10]
// layer height of each bridge
bridge_height = 1.0; //[0.1:0.1:2]
// height of each bridge above the previous bridge
bridge_z_gap = 1.0; //[0.2:0.1:1]
/* [Hidden] */
// angle between each bridge
bridge_angle = 180.0 / (number_of_bridges -1);
spiralResolution = 12*1;
spiralIncrement = 1/spiralResolution;
maxAngle = bridge_angle * (number_of_bridges-1);
eps = 0.1 * 1;
$fn = 50;
font = "Arial:style=Bold"; // Police text
letter_size = 3; // Size text
letter_height = 1.2; // Thichness text
function spiralOffset(angle) = min_bridge_length + angle/maxAngle * (max_bridge_length - min_bridge_length);
function extensionAngle(length) = asin((bridge_width*0.5)/length);
module bridgeTest() {
tubeHeight = number_of_bridges * (bridge_height + bridge_z_gap);
heightStride = bridge_height + bridge_z_gap;
difference() {
union() {
// Central hub
cylinder(r = hub_diameter/2, h = tubeHeight);
// The spokes (bridges)
for (i=[0:number_of_bridges-1]) {
length = spiralOffset(i*bridge_angle) + wall_thickness * 2;
start_height = i * heightStride + bridge_z_gap;
txt=str(round(length-2*wall_thickness));
rotate([0, 0, i*bridge_angle]) {
color("red");
translate([hub_diameter*0.8, 0, start_height]) letter(txt);
}
hull() {
rotate([0, 0, i*bridge_angle]) {
translate([hub_diameter/2 - wall_thickness, 0, start_height]) {
union (){
translate([0, -bridge_width/2, 0]) cube([length , bridge_width, bridge_height], center=false);
}
if (i < number_of_bridges-1) {
translate([0, bridge_width/2 - eps, 0]) {
cube([spiralOffset(i*bridge_angle + extensionAngle(length)) + wall_thickness, eps, bridge_height], center=false); // only an approximation
}
}
}
}
}
// Outer Spiral uprights
if (i < number_of_bridges-1) {
for (f=[0 : spiralResolution-1]) {
frac = f / spiralResolution;
top = start_height + bridge_height;
//end = i == number_of_bridges-1 && f == spiralResolution-1;
angle = i*bridge_angle + bridge_angle * f / spiralResolution;
hull() { // This hull sweeps through all the supports making a nice spiral
rotate([0, 0, angle]) {
translate([hub_diameter/2 + spiralOffset(angle), -bridge_width/2, 0]) {
cube([wall_thickness, wall_thickness, top + heightStride * frac], center=false);
}
rotate([0, 0, bridge_angle * spiralIncrement])
translate([hub_diameter/2 + spiralOffset(angle + bridge_angle * spiralIncrement),
-bridge_width/2, 0]) {
cube([wall_thickness, wall_thickness, top + heightStride * (frac + spiralIncrement)], center=false);
}
}
}
}
} else { // last upright of outer spiral
rotate([0, 0, i*bridge_angle]) {
translate([length + hub_diameter/2 - wall_thickness*2, -bridge_width/2, 0]) {
cube([wall_thickness, bridge_width, start_height + heightStride-bridge_z_gap], center=false);
}
}
if (show_XY_test == "yes") {
// extra leg
rotate([0, 0, i*bridge_angle -90]) {
translate([length + hub_diameter/2 - wall_thickness*2, -bridge_width/2, 0]) {
cube([wall_thickness, bridge_width, start_height + heightStride-bridge_z_gap], center=false);
}
}
// extra bridge
rotate([0, 0, i*bridge_angle - 90]) {
translate([hub_diameter/2 - wall_thickness, 0, start_height]) {
translate([0, -bridge_width/2, 0])
cube([length , bridge_width, bridge_height], center=false);
}
}
}
}
}
}
// core out the cylinder and remove the un-needed side
cylinder(r=hub_diameter/2 - wall_thickness, h=tubeHeight*3, center=true);
translate([-hub_diameter/2, -hub_diameter-bridge_width/2, -1]) {
cube([hub_diameter, hub_diameter, tubeHeight+2], center=false);
}
}
}
module letter(l) {
color("Red")
linear_extrude(height = letter_height) {
text(l, size = letter_size, font = font, halign = "center", valign = "center");
}
}
translate([30, -20, 0]) bridgeTest();