Browse Source

Merge branch 'master' of git.xythobuz.de:thomas/3d-print-designs

Thomas Buck 5 years ago
parent
commit
223cc723e5

+ 159952
- 0
shower-hack/shower-adapter-bolt.stl
File diff suppressed because it is too large
View File


+ 3502
- 0
shower-hack/shower-adapter-female.stl
File diff suppressed because it is too large
View File


+ 2998
- 0
shower-hack/shower-adapter-male.stl
File diff suppressed because it is too large
View File


+ 40994
- 0
shower-hack/shower-adapter-nut.stl
File diff suppressed because it is too large
View File


+ 173
- 0
shower-hack/shower-adapter.scad View File

@@ -0,0 +1,173 @@
1
+
2
+plug_dia = 10.5;
3
+plug_length = 20.0;
4
+plug_wall = 2.0;
5
+shower_wall = 4.0;
6
+shower_dia_min = 23.0;
7
+shower_dia_max = 25.0;
8
+shower_length = 40.0;
9
+shower_cut = 15.0;
10
+shower_angle = 45;
11
+
12
+plate_width = 20;
13
+plate_hole = 8.5;
14
+bolt_dia = 8.0;
15
+bolt_len = 33;
16
+
17
+knob_dia = 15.0;
18
+knob_height = 4.0;
19
+nut_dia = 15.0;
20
+nut_height = 8.0;
21
+
22
+$fn = 30;
23
+
24
+include <threads.scad>;
25
+
26
+module plug() {
27
+    difference() {
28
+        cylinder(d = plug_dia + plug_wall * 2, h = plug_length + plug_wall);
29
+        
30
+        translate([0, 0, -1])
31
+        cylinder(d = plug_dia, h = plug_length + 1);
32
+    }
33
+}
34
+
35
+module shower() {
36
+    difference() {
37
+        cylinder(d1 = shower_dia_min + shower_wall * 2, d2 = shower_dia_max + shower_wall * 2, h = shower_length);
38
+        
39
+        translate([0, 0, -1])
40
+        cylinder(d1 = shower_dia_min, d2 = shower_dia_max, h = shower_length + 2);
41
+        
42
+        translate([-shower_cut / 2, 0, -1])
43
+        cube([shower_cut, shower_dia_max, shower_length + 2]);
44
+    }
45
+}
46
+
47
+module holder() {
48
+    plug();
49
+    
50
+    translate([-(plug_dia + plug_wall) / 2, shower_dia_min / 2 + shower_wall + (plug_dia + plug_wall) / 2, 0])
51
+    rotate([0, shower_angle, 0])
52
+    shower();
53
+    
54
+    difference() {
55
+        hull() {
56
+            cylinder(d = plug_dia + plug_wall * 2, h = 1);
57
+            
58
+            translate([0, 0, plug_length + plug_wall - 1])
59
+            cylinder(d = plug_dia + plug_wall * 2, h = 1);
60
+        
61
+            translate([0, 15, 26])
62
+            cube([1, 1, 1]);
63
+            translate([-10, 10, 10])
64
+            cube([1, 1, 1]);
65
+            translate([20, 5, 26])
66
+            cube([1, 1, 1]);
67
+            translate([20, 10, 10])
68
+            cube([1, 1, 1]);
69
+        }
70
+        
71
+        translate([0, 0, -1])
72
+        cylinder(d = plug_dia, h = plug_length + 1);
73
+        
74
+        translate([-(plug_dia + plug_wall) / 2, shower_dia_min / 2 + shower_wall + (plug_dia + plug_wall) / 2, 0])
75
+        rotate([0, shower_angle, 0])
76
+        translate([0, 0, -1])
77
+        cylinder(d1 = shower_dia_min, d2 = shower_dia_max, h = shower_length + 2);
78
+    }
79
+}
80
+
81
+module adapter_a() {
82
+    difference() {
83
+        union() {
84
+            hull() {
85
+                cylinder(d = plug_dia - 0.3, h = plug_wall);
86
+                
87
+                translate([-plate_width / 2, plug_dia / 2, -plate_width])
88
+                cube([plate_width, plug_wall, plate_width]);
89
+            }
90
+        
91
+            translate([0, plug_wall + plug_dia / 2, -plate_width / 2])
92
+            rotate([90, 0, 0])
93
+            cylinder(d = plate_hole + 5, h = 11);
94
+        }
95
+        
96
+        translate([0, plug_wall + 8 + plug_dia / 2, -plate_width / 2])
97
+        rotate([90, 0, 0])
98
+        cylinder(d = plate_hole, h = plate_width);
99
+    }
100
+    
101
+    translate([0, 0, plug_wall])
102
+    cylinder(d = plug_dia - 0.3, h = plug_length);
103
+}
104
+
105
+module adapter_b() {
106
+    difference() {
107
+        union() {
108
+            hull() {
109
+                translate([0, 0, plug_length + plug_wall])
110
+                rotate([180, 0, 0])
111
+                plug();
112
+                
113
+                translate([-plate_width / 2, plug_dia / 2, -plate_width])
114
+                cube([plate_width, plug_wall, plate_width]);
115
+            }
116
+        
117
+            translate([0, plug_wall + plug_dia / 2, -plate_width / 2])
118
+            rotate([90, 0, 0])
119
+            cylinder(d = plate_hole + 5, h = 13);
120
+        }
121
+        
122
+        translate([0, plug_wall + 6 + plug_dia / 2, -plate_width / 2])
123
+        rotate([90, 0, 0])
124
+        cylinder(d = plate_hole, h = plate_width);
125
+        
126
+        translate([0, 0, plug_wall])
127
+        cylinder(d = plug_dia, h = plug_length + 1);
128
+    }
129
+}
130
+
131
+module thread(length, internal) {
132
+    metric_thread(diameter=bolt_dia, pitch=2.54,
133
+        length=length, internal=internal, n_starts=1,
134
+        thread_size=-1, angle=40, leadin=1, leadfac=1.5);
135
+    
136
+    //cylinder(d = bolt_dia, h = length);
137
+}
138
+
139
+module bolt() {
140
+    cylinder(d = knob_dia, h = knob_height, $fn = 12);
141
+    
142
+    translate([0, 0, knob_height])
143
+    thread(bolt_len, false);
144
+}
145
+
146
+module nut() {
147
+    difference() {
148
+        cylinder(d = nut_dia, h = nut_height, $fn = 12);
149
+        
150
+        translate([0, 0, -0.1])
151
+        thread(nut_height + 0.2, true);
152
+    }
153
+}
154
+
155
+/*
156
+translate([0, 0, 3])
157
+scale([1, -1, 1])
158
+holder();
159
+
160
+adapter_a();
161
+
162
+translate([0, 15, -plate_width])
163
+rotate([0, 180, 180])
164
+adapter_b();
165
+*/
166
+
167
+//translate([0, -8, -10])
168
+//rotate([90, 0, 180])
169
+//bolt();
170
+
171
+//translate([0, 29, -10])
172
+//rotate([90, 0, 0])
173
+nut();

+ 4496
- 0
shower-hack/shower-adapter.stl
File diff suppressed because it is too large
View File


+ 28
- 0
shower-hack/shower-knob.scad View File

@@ -0,0 +1,28 @@
1
+knob_dia = 40.0;
2
+knob_height = 15.0;
3
+knob_wall = 4.0;
4
+
5
+post_dia = 13.8 - 0.5;
6
+post_height = 32.0;
7
+
8
+pipe_off_x = 6.5 - 0.5;
9
+pipe_off_z = 22.0;
10
+pipe_dia = 20.0;
11
+
12
+$fn = 25;
13
+
14
+difference() {
15
+    cylinder(d = knob_dia, h = knob_height, $fn = 12);
16
+    
17
+    translate([0, 0, knob_wall])
18
+    cylinder(d = knob_dia - knob_wall * 2, h = knob_height);
19
+}
20
+
21
+difference() {
22
+    translate([0, 0, knob_wall])
23
+    cylinder(d = post_dia, h = post_height);
24
+
25
+    translate([post_dia / 2 + pipe_off_x, 10, knob_wall + pipe_off_z])
26
+    rotate([90, 0, 0])
27
+    cylinder(d = pipe_dia, h = 20);
28
+}

+ 2186
- 0
shower-hack/shower-knob.stl
File diff suppressed because it is too large
View File


+ 374
- 0
shower-hack/threads.scad View File

@@ -0,0 +1,374 @@
1
+/*
2
+ * ISO-standard metric threads, following this specification:
3
+ *          http://en.wikipedia.org/wiki/ISO_metric_screw_thread
4
+ *
5
+ * Copyright 2017 Dan Kirshner - dan_kirshner@yahoo.com
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * See <http://www.gnu.org/licenses/>.
17
+ *
18
+ * Version 2.3.  2017-08-31  Default for leadin: 0 (best for internal threads).
19
+ * Version 2.2.  2017-01-01  Correction for angle; leadfac option.  (Thanks to
20
+ *                           Andrew Allen <a2intl@gmail.com>.)
21
+ * Version 2.1.  2016-12-04  Chamfer bottom end (low-z); leadin option.
22
+ * Version 2.0.  2016-11-05  Backwards compatibility (earlier OpenSCAD) fixes.
23
+ * Version 1.9.  2016-07-03  Option: tapered.
24
+ * Version 1.8.  2016-01-08  Option: (non-standard) angle.
25
+ * Version 1.7.  2015-11-28  Larger x-increment - for small-diameters.
26
+ * Version 1.6.  2015-09-01  Options: square threads, rectangular threads.
27
+ * Version 1.5.  2015-06-12  Options: thread_size, groove.
28
+ * Version 1.4.  2014-10-17  Use "faces" instead of "triangles" for polyhedron
29
+ * Version 1.3.  2013-12-01  Correct loop over turns -- don't have early cut-off
30
+ * Version 1.2.  2012-09-09  Use discrete polyhedra rather than linear_extrude ()
31
+ * Version 1.1.  2012-09-07  Corrected to right-hand threads!
32
+ */
33
+
34
+// Examples.
35
+//
36
+// Standard M8 x 1.
37
+// metric_thread (diameter=8, pitch=1, length=4);
38
+
39
+// Square thread.
40
+// metric_thread (diameter=8, pitch=1, length=4, square=true);
41
+
42
+// Non-standard: long pitch, same thread size.
43
+//metric_thread (diameter=8, pitch=4, length=4, thread_size=1, groove=true);
44
+
45
+// Non-standard: 20 mm diameter, long pitch, square "trough" width 3 mm,
46
+// depth 1 mm.
47
+//metric_thread (diameter=20, pitch=8, length=16, square=true, thread_size=6,
48
+//               groove=true, rectangle=0.333);
49
+
50
+// English: 1/4 x 20.
51
+//english_thread (diameter=1/4, threads_per_inch=20, length=1);
52
+
53
+// Tapered.  Example -- pipe size 3/4" -- per:
54
+// http://www.engineeringtoolbox.com/npt-national-pipe-taper-threads-d_750.html
55
+// english_thread (diameter=1.05, threads_per_inch=14, length=3/4, taper=1/16);
56
+
57
+// Thread for mounting on Rohloff hub.
58
+//difference () {
59
+//   cylinder (r=20, h=10, $fn=100);
60
+//
61
+//   metric_thread (diameter=34, pitch=1, length=10, internal=true, n_starts=6);
62
+//}
63
+
64
+
65
+// ----------------------------------------------------------------------------
66
+function segments (diameter) = min (50, ceil (diameter*6));
67
+
68
+
69
+// ----------------------------------------------------------------------------
70
+// diameter -    outside diameter of threads in mm. Default: 8.
71
+// pitch    -    thread axial "travel" per turn in mm.  Default: 1.
72
+// length   -    overall axial length of thread in mm.  Default: 1.
73
+// internal -    true = clearances for internal thread (e.g., a nut).
74
+//               false = clearances for external thread (e.g., a bolt).
75
+//               (Internal threads should be "cut out" from a solid using
76
+//               difference ()).
77
+// n_starts -    Number of thread starts (e.g., DNA, a "double helix," has
78
+//               n_starts=2).  See wikipedia Screw_thread.
79
+// thread_size - (non-standard) axial width of a single thread "V" - independent
80
+//               of pitch.  Default: same as pitch.
81
+// groove      - (non-standard) subtract inverted "V" from cylinder (rather than
82
+//               add protruding "V" to cylinder).
83
+// square      - Square threads (per
84
+//               https://en.wikipedia.org/wiki/Square_thread_form).
85
+// rectangle   - (non-standard) "Rectangular" thread - ratio depth/(axial) width
86
+//               Default: 1 (square).
87
+// angle       - (non-standard) angle (deg) of thread side from perpendicular to
88
+//               axis (default = standard = 30 degrees).
89
+// taper       - diameter change per length (National Pipe Thread/ANSI B1.20.1
90
+//               is 1" diameter per 16" length). Taper decreases from 'diameter'
91
+//               as z increases.
92
+// leadin      - 0 (default): no chamfer; 1: chamfer (45 degree) at max-z end;
93
+//               2: chamfer at both ends, 3: chamfer at z=0 end.
94
+// leadfac     - scale of leadin chamfer (default: 1.0 = 1/2 thread).
95
+module metric_thread (diameter=8, pitch=1, length=1, internal=false, n_starts=1,
96
+                      thread_size=-1, groove=false, square=false, rectangle=0,
97
+                      angle=30, taper=0, leadin=0, leadfac=1.0)
98
+{
99
+   // thread_size: size of thread "V" different than travel per turn (pitch).
100
+   // Default: same as pitch.
101
+   local_thread_size = thread_size == -1 ? pitch : thread_size;
102
+   local_rectangle = rectangle ? rectangle : 1;
103
+
104
+   n_segments = segments (diameter);
105
+   h = (square || rectangle) ? local_thread_size*local_rectangle/2 : local_thread_size / (2 * tan(angle));
106
+
107
+   h_fac1 = (square || rectangle) ? 0.90 : 0.625;
108
+
109
+   // External thread includes additional relief.
110
+   h_fac2 = (square || rectangle) ? 0.95 : 5.3/8;
111
+
112
+   tapered_diameter = diameter - length*taper;
113
+
114
+   difference () {
115
+      union () {
116
+         if (! groove) {
117
+            metric_thread_turns (diameter, pitch, length, internal, n_starts,
118
+                                 local_thread_size, groove, square, rectangle, angle,
119
+                                 taper);
120
+         }
121
+
122
+         difference () {
123
+
124
+            // Solid center, including Dmin truncation.
125
+            if (groove) {
126
+               cylinder (r1=diameter/2, r2=tapered_diameter/2,
127
+                         h=length, $fn=n_segments);
128
+            } else if (internal) {
129
+               cylinder (r1=diameter/2 - h*h_fac1, r2=tapered_diameter/2 - h*h_fac1,
130
+                         h=length, $fn=n_segments);
131
+            } else {
132
+
133
+               // External thread.
134
+               cylinder (r1=diameter/2 - h*h_fac2, r2=tapered_diameter/2 - h*h_fac2,
135
+                         h=length, $fn=n_segments);
136
+            }
137
+
138
+            if (groove) {
139
+               metric_thread_turns (diameter, pitch, length, internal, n_starts,
140
+                                    local_thread_size, groove, square, rectangle,
141
+                                    angle, taper);
142
+            }
143
+         }
144
+      }
145
+
146
+      // chamfer z=0 end if leadin is 2 or 3
147
+      if (leadin == 2 || leadin == 3) {
148
+         difference () {
149
+            cylinder (r=diameter/2 + 1, h=h*h_fac1*leadfac, $fn=n_segments);
150
+
151
+            cylinder (r2=diameter/2, r1=diameter/2 - h*h_fac1*leadfac, h=h*h_fac1*leadfac,
152
+                      $fn=n_segments);
153
+         }
154
+      }
155
+
156
+      // chamfer z-max end if leadin is 1 or 2.
157
+      if (leadin == 1 || leadin == 2) {
158
+         translate ([0, 0, length + 0.05 - h*h_fac1*leadfac]) {
159
+            difference () {
160
+               cylinder (r=diameter/2 + 1, h=h*h_fac1*leadfac, $fn=n_segments);
161
+               cylinder (r1=tapered_diameter/2, r2=tapered_diameter/2 - h*h_fac1*leadfac, h=h*h_fac1*leadfac,
162
+                         $fn=n_segments);
163
+            }
164
+         }
165
+      }
166
+   }
167
+}
168
+
169
+
170
+// ----------------------------------------------------------------------------
171
+// Input units in inches.
172
+// Note: units of measure in drawing are mm!
173
+module english_thread (diameter=0.25, threads_per_inch=20, length=1,
174
+                      internal=false, n_starts=1, thread_size=-1, groove=false,
175
+                      square=false, rectangle=0, angle=30, taper=0, leadin=0,
176
+                      leadfac=1.0)
177
+{
178
+   // Convert to mm.
179
+   mm_diameter = diameter*25.4;
180
+   mm_pitch = (1.0/threads_per_inch)*25.4;
181
+   mm_length = length*25.4;
182
+
183
+   echo (str ("mm_diameter: ", mm_diameter));
184
+   echo (str ("mm_pitch: ", mm_pitch));
185
+   echo (str ("mm_length: ", mm_length));
186
+   metric_thread (mm_diameter, mm_pitch, mm_length, internal, n_starts,
187
+                  thread_size, groove, square, rectangle, angle, taper, leadin,
188
+                  leadfac);
189
+}
190
+
191
+// ----------------------------------------------------------------------------
192
+module metric_thread_turns (diameter, pitch, length, internal, n_starts,
193
+                            thread_size, groove, square, rectangle, angle,
194
+                            taper)
195
+{
196
+   // Number of turns needed.
197
+   n_turns = floor (length/pitch);
198
+
199
+   intersection () {
200
+
201
+      // Start one below z = 0.  Gives an extra turn at each end.
202
+      for (i=[-1*n_starts : n_turns+1]) {
203
+         translate ([0, 0, i*pitch]) {
204
+            metric_thread_turn (diameter, pitch, internal, n_starts,
205
+                                thread_size, groove, square, rectangle, angle,
206
+                                taper, i*pitch);
207
+         }
208
+      }
209
+
210
+      // Cut to length.
211
+      translate ([0, 0, length/2]) {
212
+         cube ([diameter*3, diameter*3, length], center=true);
213
+      }
214
+   }
215
+}
216
+
217
+
218
+// ----------------------------------------------------------------------------
219
+module metric_thread_turn (diameter, pitch, internal, n_starts, thread_size,
220
+                           groove, square, rectangle, angle, taper, z)
221
+{
222
+   n_segments = segments (diameter);
223
+   fraction_circle = 1.0/n_segments;
224
+   for (i=[0 : n_segments-1]) {
225
+      rotate ([0, 0, i*360*fraction_circle]) {
226
+         translate ([0, 0, i*n_starts*pitch*fraction_circle]) {
227
+            //current_diameter = diameter - taper*(z + i*n_starts*pitch*fraction_circle);
228
+            thread_polyhedron ((diameter - taper*(z + i*n_starts*pitch*fraction_circle))/2,
229
+                               pitch, internal, n_starts, thread_size, groove,
230
+                               square, rectangle, angle);
231
+         }
232
+      }
233
+   }
234
+}
235
+
236
+
237
+// ----------------------------------------------------------------------------
238
+module thread_polyhedron (radius, pitch, internal, n_starts, thread_size,
239
+                          groove, square, rectangle, angle)
240
+{
241
+   n_segments = segments (radius*2);
242
+   fraction_circle = 1.0/n_segments;
243
+
244
+   local_rectangle = rectangle ? rectangle : 1;
245
+
246
+   h = (square || rectangle) ? thread_size*local_rectangle/2 : thread_size / (2 * tan(angle));
247
+   outer_r = radius + (internal ? h/20 : 0); // Adds internal relief.
248
+   //echo (str ("outer_r: ", outer_r));
249
+
250
+   // A little extra on square thread -- make sure overlaps cylinder.
251
+   h_fac1 = (square || rectangle) ? 1.1 : 0.875;
252
+   inner_r = radius - h*h_fac1; // Does NOT do Dmin_truncation - do later with
253
+                                // cylinder.
254
+
255
+   translate_y = groove ? outer_r + inner_r : 0;
256
+   reflect_x   = groove ? 1 : 0;
257
+
258
+   // Make these just slightly bigger (keep in proportion) so polyhedra will
259
+   // overlap.
260
+   x_incr_outer = (! groove ? outer_r : inner_r) * fraction_circle * 2 * PI * 1.02;
261
+   x_incr_inner = (! groove ? inner_r : outer_r) * fraction_circle * 2 * PI * 1.02;
262
+   z_incr = n_starts * pitch * fraction_circle * 1.005;
263
+
264
+   /*
265
+    (angles x0 and x3 inner are actually 60 deg)
266
+
267
+                          /\  (x2_inner, z2_inner) [2]
268
+                         /  \
269
+   (x3_inner, z3_inner) /    \
270
+                  [3]   \     \
271
+                        |\     \ (x2_outer, z2_outer) [6]
272
+                        | \    /
273
+                        |  \  /|
274
+             z          |[7]\/ / (x1_outer, z1_outer) [5]
275
+             |          |   | /
276
+             |   x      |   |/
277
+             |  /       |   / (x0_outer, z0_outer) [4]
278
+             | /        |  /     (behind: (x1_inner, z1_inner) [1]
279
+             |/         | /
280
+    y________|          |/
281
+   (r)                  / (x0_inner, z0_inner) [0]
282
+
283
+   */
284
+
285
+   x1_outer = outer_r * fraction_circle * 2 * PI;
286
+
287
+   z0_outer = (outer_r - inner_r) * tan(angle);
288
+   //echo (str ("z0_outer: ", z0_outer));
289
+
290
+   //polygon ([[inner_r, 0], [outer_r, z0_outer],
291
+   //        [outer_r, 0.5*pitch], [inner_r, 0.5*pitch]]);
292
+   z1_outer = z0_outer + z_incr;
293
+
294
+   // Give internal square threads some clearance in the z direction, too.
295
+   bottom = internal ? 0.235 : 0.25;
296
+   top    = internal ? 0.765 : 0.75;
297
+
298
+   translate ([0, translate_y, 0]) {
299
+      mirror ([reflect_x, 0, 0]) {
300
+
301
+         if (square || rectangle) {
302
+
303
+            // Rule for face ordering: look at polyhedron from outside: points must
304
+            // be in clockwise order.
305
+            polyhedron (
306
+               points = [
307
+                         [-x_incr_inner/2, -inner_r, bottom*thread_size],         // [0]
308
+                         [x_incr_inner/2, -inner_r, bottom*thread_size + z_incr], // [1]
309
+                         [x_incr_inner/2, -inner_r, top*thread_size + z_incr],    // [2]
310
+                         [-x_incr_inner/2, -inner_r, top*thread_size],            // [3]
311
+
312
+                         [-x_incr_outer/2, -outer_r, bottom*thread_size],         // [4]
313
+                         [x_incr_outer/2, -outer_r, bottom*thread_size + z_incr], // [5]
314
+                         [x_incr_outer/2, -outer_r, top*thread_size + z_incr],    // [6]
315
+                         [-x_incr_outer/2, -outer_r, top*thread_size]             // [7]
316
+                        ],
317
+
318
+               faces = [
319
+                         [0, 3, 7, 4],  // This-side trapezoid
320
+
321
+                         [1, 5, 6, 2],  // Back-side trapezoid
322
+
323
+                         [0, 1, 2, 3],  // Inner rectangle
324
+
325
+                         [4, 7, 6, 5],  // Outer rectangle
326
+
327
+                         // These are not planar, so do with separate triangles.
328
+                         [7, 2, 6],     // Upper rectangle, bottom
329
+                         [7, 3, 2],     // Upper rectangle, top
330
+
331
+                         [0, 5, 1],     // Lower rectangle, bottom
332
+                         [0, 4, 5]      // Lower rectangle, top
333
+                        ]
334
+            );
335
+         } else {
336
+
337
+            // Rule for face ordering: look at polyhedron from outside: points must
338
+            // be in clockwise order.
339
+            polyhedron (
340
+               points = [
341
+                         [-x_incr_inner/2, -inner_r, 0],                        // [0]
342
+                         [x_incr_inner/2, -inner_r, z_incr],                    // [1]
343
+                         [x_incr_inner/2, -inner_r, thread_size + z_incr],      // [2]
344
+                         [-x_incr_inner/2, -inner_r, thread_size],              // [3]
345
+
346
+                         [-x_incr_outer/2, -outer_r, z0_outer],                 // [4]
347
+                         [x_incr_outer/2, -outer_r, z0_outer + z_incr],         // [5]
348
+                         [x_incr_outer/2, -outer_r, thread_size - z0_outer + z_incr], // [6]
349
+                         [-x_incr_outer/2, -outer_r, thread_size - z0_outer]    // [7]
350
+                        ],
351
+
352
+               faces = [
353
+                         [0, 3, 7, 4],  // This-side trapezoid
354
+
355
+                         [1, 5, 6, 2],  // Back-side trapezoid
356
+
357
+                         [0, 1, 2, 3],  // Inner rectangle
358
+
359
+                         [4, 7, 6, 5],  // Outer rectangle
360
+
361
+                         // These are not planar, so do with separate triangles.
362
+                         [7, 2, 6],     // Upper rectangle, bottom
363
+                         [7, 3, 2],     // Upper rectangle, top
364
+
365
+                         [0, 5, 1],     // Lower rectangle, bottom
366
+                         [0, 4, 5]      // Lower rectangle, top
367
+                        ]
368
+            );
369
+         }
370
+      }
371
+   }
372
+}
373
+
374
+

Loading…
Cancel
Save