Started work an a possibly better version
This commit is contained in:
parent
867950ea25
commit
71f20287b0
13
bottom.scad
13
bottom.scad
|
@ -1,13 +0,0 @@
|
||||||
include <constants.scad>
|
|
||||||
use <cap.scad>
|
|
||||||
|
|
||||||
difference() {
|
|
||||||
|
|
||||||
cap();
|
|
||||||
|
|
||||||
// Make the cap hollow
|
|
||||||
translate([0, 0, -1.5 * height_unit])
|
|
||||||
cylinder(r = body_hole_diameter / 2,
|
|
||||||
h = 4 * height_unit + 0.1,
|
|
||||||
center = true);
|
|
||||||
}
|
|
23970
bottom.stl
23970
bottom.stl
File diff suppressed because it is too large
Load Diff
80
cap.scad
80
cap.scad
|
@ -1,80 +0,0 @@
|
||||||
include <constants.scad>;
|
|
||||||
|
|
||||||
module cap() {
|
|
||||||
difference() {
|
|
||||||
|
|
||||||
// Actual cap
|
|
||||||
union() {
|
|
||||||
// Bumper
|
|
||||||
cylinder(r = bumper_diameter / 2,
|
|
||||||
h = height_unit,
|
|
||||||
center = true);
|
|
||||||
|
|
||||||
// Lower cone
|
|
||||||
translate([0, 0, - 1.5 * height_unit])
|
|
||||||
cylinder(r2 = bumper_diameter / 2,
|
|
||||||
r1 = body_diameter /2,
|
|
||||||
h = height_unit * 2,
|
|
||||||
center = true);
|
|
||||||
|
|
||||||
// Upper cone
|
|
||||||
translate([0, 0, height_unit])
|
|
||||||
cylinder(r1 = bumper_diameter / 2,
|
|
||||||
r2 = body_diameter /2,
|
|
||||||
h = height_unit,
|
|
||||||
center = true);
|
|
||||||
|
|
||||||
// End piece that goes into the tube
|
|
||||||
translate([0, 0, -2.5 * height_unit])
|
|
||||||
cylinder(r = body_diameter / 2,
|
|
||||||
h = 2 * height_unit,
|
|
||||||
center = true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make a grove to slide the tube into
|
|
||||||
#translate([0, 0, -1.75 * height_unit])
|
|
||||||
difference() {
|
|
||||||
cylinder(r = tube_outer_diameter / 2,
|
|
||||||
h = 1.5 * height_unit,
|
|
||||||
center = true);
|
|
||||||
|
|
||||||
cylinder(r = body_diameter / 2,
|
|
||||||
h = 1.5 * height_unit + 0.1,
|
|
||||||
center = true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make the end piece of the cap hollow
|
|
||||||
translate([0, 0, -2.5 * height_unit])
|
|
||||||
cylinder(r = body_hole_diameter / 2,
|
|
||||||
h = 2 * height_unit + 0.1,
|
|
||||||
center = true);
|
|
||||||
|
|
||||||
|
|
||||||
// Place the nuts
|
|
||||||
nut_y_offset = body_diameter / 2
|
|
||||||
- (body_diameter/2 - body_hole_diameter/2)
|
|
||||||
+ m3nut_depth / 2 - 0.5;
|
|
||||||
|
|
||||||
for(angle = [0, 90, 180, 270]) {
|
|
||||||
rotate([0,0,angle])
|
|
||||||
translate([0,
|
|
||||||
nut_y_offset,
|
|
||||||
- 2.5 * height_unit])
|
|
||||||
rotate([90, 0 ,0])
|
|
||||||
//This is one nut and the hole attched to it
|
|
||||||
union() {
|
|
||||||
cylinder(r = m3nut_diameter / 2,
|
|
||||||
h = m3nut_depth,
|
|
||||||
center = true,
|
|
||||||
$fn = 6);
|
|
||||||
|
|
||||||
translate([0, 0, -m3hole_depth / 2 -m3nut_depth / 2])
|
|
||||||
cylinder(r = m3hole_diameter / 2,
|
|
||||||
h = m3hole_depth + 0.1,
|
|
||||||
center = true);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cap();
|
|
|
@ -1,25 +1,6 @@
|
||||||
$fn = 90;
|
$fn = 90;
|
||||||
|
|
||||||
bumper_diameter = 85;
|
bumper_diameter = 80;
|
||||||
body_diameter = 70;
|
|
||||||
body_hole_diameter = body_diameter - 10;
|
|
||||||
|
|
||||||
|
tube_inner_diameter = 71;
|
||||||
tube_outer_diameter = 76;
|
tube_outer_diameter = 76;
|
||||||
|
|
||||||
m3nut_diameter = 6.5;
|
|
||||||
m3nut_depth = 3.6;
|
|
||||||
|
|
||||||
m3hole_diameter = 3.5;
|
|
||||||
m3hole_depth = (body_diameter - body_hole_diameter) / 2 - m3nut_depth + 0.5;
|
|
||||||
|
|
||||||
height_unit = 5;
|
|
||||||
|
|
||||||
thread_diameter = body_diameter - 12;
|
|
||||||
thread_hole_diameter = thread_diameter - 5;
|
|
||||||
thread_pitch = 4;
|
|
||||||
thread_lenght_top = 12.5;
|
|
||||||
thread_lenght_lid = 7.5;
|
|
||||||
thread_tolerance = 0.25;
|
|
||||||
|
|
||||||
lid_diameter = body_diameter - 5;
|
|
||||||
lid_tolerance = 0.1;
|
|
||||||
|
|
110
lid.scad
110
lid.scad
|
@ -1,56 +1,66 @@
|
||||||
include <constants.scad>;
|
$fn = 90;
|
||||||
|
|
||||||
use <cap.scad>;
|
module lid(outer_diameter,
|
||||||
use <threads.scad>;
|
inner_diameter,
|
||||||
|
latch_width,
|
||||||
|
latch_height,
|
||||||
|
lid_height) {
|
||||||
|
|
||||||
|
|
||||||
|
translate([0,0, latch_height / 2])
|
||||||
|
intersection() {
|
||||||
|
cube([outer_diameter,
|
||||||
|
latch_width,
|
||||||
|
latch_height],
|
||||||
|
center = true);
|
||||||
|
|
||||||
|
cylinder(r = outer_diameter / 2,
|
||||||
|
h = latch_height,
|
||||||
|
center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
cylinder(r = inner_diameter / 2, h = lid_height);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
module thread() {
|
module hole(outer_diameter,
|
||||||
intersection() {
|
inner_diameter,
|
||||||
metric_thread(thread_diameter - thread_tolerance,
|
latch_width,
|
||||||
thread_pitch,
|
latch_height,
|
||||||
thread_lenght_lid);
|
lid_height) {
|
||||||
union() {
|
|
||||||
translate([0, 0, 0.5 * height_unit])
|
translate([0, 0, lid_height / 2])
|
||||||
cylinder(r = thread_diameter / 2,
|
intersection() {
|
||||||
h = thread_lenght_lid - 0.5 * height_unit);
|
cube([outer_diameter,
|
||||||
|
latch_width,
|
||||||
cylinder(r2 = thread_diameter / 2,
|
lid_height],
|
||||||
r1 = thread_diameter / 2 - height_unit,
|
center = true);
|
||||||
h = 0.5 * height_unit);
|
|
||||||
}
|
cylinder(r = outer_diameter / 2,
|
||||||
}
|
h = lid_height,
|
||||||
|
center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([0, 0, latch_height / 2])
|
||||||
|
difference() {
|
||||||
|
cylinder(r = outer_diameter / 2,
|
||||||
|
h = latch_height,
|
||||||
|
center = true);
|
||||||
|
|
||||||
|
for(pos = [outer_diameter / 4, -outer_diameter / 4])
|
||||||
|
translate([pos, pos, 0])
|
||||||
|
cube([outer_diameter / 2,
|
||||||
|
outer_diameter / 2,
|
||||||
|
latch_height],
|
||||||
|
center=true);
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([0,0, lid_height / 2])
|
||||||
|
cylinder(r = inner_diameter / 2,
|
||||||
|
h = lid_height,
|
||||||
|
center = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
hole(78,72,10,5,10);
|
||||||
|
|
||||||
|
|
||||||
difference() {
|
|
||||||
union() {
|
|
||||||
translate([0, 0, 0.25 * height_unit])
|
|
||||||
cylinder(r = lid_diameter / 2,
|
|
||||||
h=0.5 * height_unit,
|
|
||||||
center=true);
|
|
||||||
|
|
||||||
translate([0, 0, -thread_lenght_lid])
|
|
||||||
thread();
|
|
||||||
}
|
|
||||||
|
|
||||||
union() {
|
|
||||||
for(pos = [-3 * height_unit, 3 * height_unit]) {
|
|
||||||
translate([pos, 0, height_unit])
|
|
||||||
sphere(r = 1.5 * height_unit, center=true);
|
|
||||||
}
|
|
||||||
translate([0, 0, height_unit])
|
|
||||||
rotate([0, 90, 0])
|
|
||||||
cylinder(r = 1.5 * height_unit, h=6 * height_unit, center=true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Make the thread hollow
|
|
||||||
translate([0, 0, - 1.5 * height_unit])
|
|
||||||
cylinder(r = thread_diameter / 2 - 5,
|
|
||||||
h = 1.5 * height_unit + 0.01,
|
|
||||||
center=true);
|
|
||||||
}
|
|
312
threads.scad
312
threads.scad
|
@ -1,312 +0,0 @@
|
||||||
/*
|
|
||||||
* ISO-standard metric threads, following this specification:
|
|
||||||
* http://en.wikipedia.org/wiki/ISO_metric_screw_thread
|
|
||||||
*
|
|
||||||
* Dan Kirshner - dan_kirshner@yahoo.com
|
|
||||||
*
|
|
||||||
* You are welcome to make free use of this software. Retention of my
|
|
||||||
* authorship credit would be appreciated.
|
|
||||||
*
|
|
||||||
* Version 1.7. 2015-11-28 Larger x-increment - for small-diameters.
|
|
||||||
* Version 1.6. 2015-09-01 Options: square threads, rectangular threads.
|
|
||||||
* Version 1.5. 2015-06-12 Options: thread_size, groove.
|
|
||||||
* Version 1.4. 2014-10-17 Use "faces" instead of "triangles" for polyhedron
|
|
||||||
* Version 1.3. 2013-12-01 Correct loop over turns -- don't have early cut-off
|
|
||||||
* Version 1.2. 2012-09-09 Use discrete polyhedra rather than linear_extrude ()
|
|
||||||
* Version 1.1. 2012-09-07 Corrected to right-hand threads!
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Examples.
|
|
||||||
//
|
|
||||||
// Standard M8 x 1.
|
|
||||||
// metric_thread (diameter=8, pitch=1, length=4);
|
|
||||||
|
|
||||||
// Square thread.
|
|
||||||
// metric_thread (diameter=8, pitch=1, length=4, square=true);
|
|
||||||
|
|
||||||
// Non-standard: long pitch, same thread size.
|
|
||||||
//metric_thread (diameter=8, pitch=4, length=4, thread_size=1, groove=true);
|
|
||||||
|
|
||||||
// Non-standard: 20 mm diameter, long pitch, square "trough" width 3 mm,
|
|
||||||
// depth 1 mm.
|
|
||||||
//metric_thread (diameter=20, pitch=8, length=16, square=true, thread_size=6,
|
|
||||||
// groove=true, rectangle=0.333);
|
|
||||||
|
|
||||||
// English: 1/4 x 20.
|
|
||||||
//english_thread (diameter=1/4, threads_per_inch=20, length=1);
|
|
||||||
|
|
||||||
// Thread for mounting on Rohloff hub.
|
|
||||||
//difference () {
|
|
||||||
// cylinder (r=20, h=10, $fn=100);
|
|
||||||
//
|
|
||||||
// metric_thread (diameter=34, pitch=1, length=10, internal=true, n_starts=6);
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
function segments (diameter) = min (50, ceil (diameter*6));
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// internal - true = clearances for internal thread (e.g., a nut).
|
|
||||||
// false = clearances for external thread (e.g., a bolt).
|
|
||||||
// (Internal threads should be "cut out" from a solid using
|
|
||||||
// difference ()).
|
|
||||||
// n_starts - Number of thread starts (e.g., DNA, a "double helix," has
|
|
||||||
// n_starts=2). See wikipedia Screw_thread.
|
|
||||||
// thread_size - (non-standard) size of a single thread "V" - independent of
|
|
||||||
// pitch. Default: same as pitch.
|
|
||||||
// groove - (non-standard) subtract inverted "V" from cylinder (rather than
|
|
||||||
// add protruding "V" to cylinder).
|
|
||||||
// square - Square threads (per
|
|
||||||
// https://en.wikipedia.org/wiki/Square_thread_form).
|
|
||||||
// rectangle - (non-standard) "Rectangular" thread - ratio depth/width
|
|
||||||
// Default: 1 (square).
|
|
||||||
module metric_thread (diameter=8, pitch=1, length=1, internal=false, n_starts=1,
|
|
||||||
thread_size=-1, groove=false, square=false, rectangle=0)
|
|
||||||
{
|
|
||||||
// thread_size: size of thread "V" different than travel per turn (pitch).
|
|
||||||
// Default: same as pitch.
|
|
||||||
local_thread_size = thread_size == -1 ? pitch : thread_size;
|
|
||||||
local_rectangle = rectangle ? rectangle : 1;
|
|
||||||
|
|
||||||
n_segments = segments (diameter);
|
|
||||||
h = (square || rectangle) ? local_thread_size*local_rectangle/2 : local_thread_size * cos (30);
|
|
||||||
|
|
||||||
h_fac1 = (square || rectangle) ? 0.90 : 0.625;
|
|
||||||
|
|
||||||
// External thread includes additional relief.
|
|
||||||
h_fac2 = (square || rectangle) ? 0.95 : 5.3/8;
|
|
||||||
|
|
||||||
if (! groove) {
|
|
||||||
metric_thread_turns (diameter, pitch, length, internal, n_starts,
|
|
||||||
local_thread_size, groove, square, rectangle);
|
|
||||||
}
|
|
||||||
|
|
||||||
difference () {
|
|
||||||
|
|
||||||
// Solid center, including Dmin truncation.
|
|
||||||
if (groove) {
|
|
||||||
cylinder (r=diameter/2, h=length, $fn=n_segments);
|
|
||||||
} else if (internal) {
|
|
||||||
cylinder (r=diameter/2 - h*h_fac1, h=length, $fn=n_segments);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// External thread.
|
|
||||||
cylinder (r=diameter/2 - h*h_fac2, h=length, $fn=n_segments);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (groove) {
|
|
||||||
metric_thread_turns (diameter, pitch, length, internal, n_starts,
|
|
||||||
local_thread_size, groove, square, rectangle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// Input units in inches.
|
|
||||||
// Note: units of measure in drawing are mm!
|
|
||||||
module english_thread (diameter=0.25, threads_per_inch=20, length=1,
|
|
||||||
internal=false, n_starts=1, thread_size=-1, groove=false,
|
|
||||||
square=false, rectangle=0)
|
|
||||||
{
|
|
||||||
// Convert to mm.
|
|
||||||
mm_diameter = diameter*25.4;
|
|
||||||
mm_pitch = (1.0/threads_per_inch)*25.4;
|
|
||||||
mm_length = length*25.4;
|
|
||||||
|
|
||||||
echo (str ("mm_diameter: ", mm_diameter));
|
|
||||||
echo (str ("mm_pitch: ", mm_pitch));
|
|
||||||
echo (str ("mm_length: ", mm_length));
|
|
||||||
metric_thread (mm_diameter, mm_pitch, mm_length, internal, n_starts,
|
|
||||||
thread_size, groove, square, rectangle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
module metric_thread_turns (diameter, pitch, length, internal, n_starts,
|
|
||||||
thread_size, groove, square, rectangle)
|
|
||||||
{
|
|
||||||
// Number of turns needed.
|
|
||||||
n_turns = floor (length/pitch);
|
|
||||||
|
|
||||||
intersection () {
|
|
||||||
|
|
||||||
// Start one below z = 0. Gives an extra turn at each end.
|
|
||||||
for (i=[-1*n_starts : n_turns+1]) {
|
|
||||||
translate ([0, 0, i*pitch]) {
|
|
||||||
metric_thread_turn (diameter, pitch, internal, n_starts,
|
|
||||||
thread_size, groove, square, rectangle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cut to length.
|
|
||||||
translate ([0, 0, length/2]) {
|
|
||||||
cube ([diameter*3, diameter*3, length], center=true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
module metric_thread_turn (diameter, pitch, internal, n_starts, thread_size,
|
|
||||||
groove, square, rectangle)
|
|
||||||
{
|
|
||||||
n_segments = segments (diameter);
|
|
||||||
fraction_circle = 1.0/n_segments;
|
|
||||||
for (i=[0 : n_segments-1]) {
|
|
||||||
rotate ([0, 0, i*360*fraction_circle]) {
|
|
||||||
translate ([0, 0, i*n_starts*pitch*fraction_circle]) {
|
|
||||||
thread_polyhedron (diameter/2, pitch, internal, n_starts,
|
|
||||||
thread_size, groove, square, rectangle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// z (see diagram) as function of current radius.
|
|
||||||
// (Only good for first half-pitch.)
|
|
||||||
function z_fct (current_radius, radius, pitch)
|
|
||||||
= 0.5* (current_radius - (radius - 0.875*pitch*cos (30)))
|
|
||||||
/cos (30);
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
module thread_polyhedron (radius, pitch, internal, n_starts, thread_size,
|
|
||||||
groove, square, rectangle)
|
|
||||||
{
|
|
||||||
n_segments = segments (radius*2);
|
|
||||||
fraction_circle = 1.0/n_segments;
|
|
||||||
|
|
||||||
local_rectangle = rectangle ? rectangle : 1;
|
|
||||||
|
|
||||||
h = (square || rectangle) ? thread_size*local_rectangle/2 : thread_size * cos (30);
|
|
||||||
outer_r = radius + (internal ? h/20 : 0); // Adds internal relief.
|
|
||||||
//echo (str ("outer_r: ", outer_r));
|
|
||||||
|
|
||||||
// A little extra on square thread -- make sure overlaps cylinder.
|
|
||||||
h_fac1 = (square || rectangle) ? 1.1 : 0.875;
|
|
||||||
inner_r = radius - h*h_fac1; // Does NOT do Dmin_truncation - do later with
|
|
||||||
// cylinder.
|
|
||||||
|
|
||||||
translate_y = groove ? outer_r + inner_r : 0;
|
|
||||||
reflect_x = groove ? 1 : 0;
|
|
||||||
|
|
||||||
// Make these just slightly bigger (keep in proportion) so polyhedra will
|
|
||||||
// overlap.
|
|
||||||
x_incr_outer = (! groove ? outer_r : inner_r) * fraction_circle * 2 * PI * 1.02;
|
|
||||||
x_incr_inner = (! groove ? inner_r : outer_r) * fraction_circle * 2 * PI * 1.02;
|
|
||||||
z_incr = n_starts * pitch * fraction_circle * 1.005;
|
|
||||||
|
|
||||||
/*
|
|
||||||
(angles x0 and x3 inner are actually 60 deg)
|
|
||||||
|
|
||||||
/\ (x2_inner, z2_inner) [2]
|
|
||||||
/ \
|
|
||||||
(x3_inner, z3_inner) / \
|
|
||||||
[3] \ \
|
|
||||||
|\ \ (x2_outer, z2_outer) [6]
|
|
||||||
| \ /
|
|
||||||
| \ /|
|
|
||||||
z |[7]\/ / (x1_outer, z1_outer) [5]
|
|
||||||
| | | /
|
|
||||||
| x | |/
|
|
||||||
| / | / (x0_outer, z0_outer) [4]
|
|
||||||
| / | / (behind: (x1_inner, z1_inner) [1]
|
|
||||||
|/ | /
|
|
||||||
y________| |/
|
|
||||||
(r) / (x0_inner, z0_inner) [0]
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
x1_outer = outer_r * fraction_circle * 2 * PI;
|
|
||||||
|
|
||||||
z0_outer = z_fct (outer_r, radius, thread_size);
|
|
||||||
//echo (str ("z0_outer: ", z0_outer));
|
|
||||||
|
|
||||||
//polygon ([[inner_r, 0], [outer_r, z0_outer],
|
|
||||||
// [outer_r, 0.5*pitch], [inner_r, 0.5*pitch]]);
|
|
||||||
z1_outer = z0_outer + z_incr;
|
|
||||||
|
|
||||||
// Give internal square threads some clearance in the z direction, too.
|
|
||||||
bottom = internal ? 0.235 : 0.25;
|
|
||||||
top = internal ? 0.765 : 0.75;
|
|
||||||
|
|
||||||
translate ([0, translate_y, 0]) {
|
|
||||||
mirror ([reflect_x, 0, 0]) {
|
|
||||||
|
|
||||||
if (square || rectangle) {
|
|
||||||
|
|
||||||
// Rule for face ordering: look at polyhedron from outside: points must
|
|
||||||
// be in clockwise order.
|
|
||||||
polyhedron (
|
|
||||||
points = [
|
|
||||||
[-x_incr_inner/2, -inner_r, bottom*thread_size], // [0]
|
|
||||||
[x_incr_inner/2, -inner_r, bottom*thread_size + z_incr], // [1]
|
|
||||||
[x_incr_inner/2, -inner_r, top*thread_size + z_incr], // [2]
|
|
||||||
[-x_incr_inner/2, -inner_r, top*thread_size], // [3]
|
|
||||||
|
|
||||||
[-x_incr_outer/2, -outer_r, bottom*thread_size], // [4]
|
|
||||||
[x_incr_outer/2, -outer_r, bottom*thread_size + z_incr], // [5]
|
|
||||||
[x_incr_outer/2, -outer_r, top*thread_size + z_incr], // [6]
|
|
||||||
[-x_incr_outer/2, -outer_r, top*thread_size] // [7]
|
|
||||||
],
|
|
||||||
|
|
||||||
faces = [
|
|
||||||
[0, 3, 7, 4], // This-side trapezoid
|
|
||||||
|
|
||||||
[1, 5, 6, 2], // Back-side trapezoid
|
|
||||||
|
|
||||||
[0, 1, 2, 3], // Inner rectangle
|
|
||||||
|
|
||||||
[4, 7, 6, 5], // Outer rectangle
|
|
||||||
|
|
||||||
// These are not planar, so do with separate triangles.
|
|
||||||
[7, 2, 6], // Upper rectangle, bottom
|
|
||||||
[7, 3, 2], // Upper rectangle, top
|
|
||||||
|
|
||||||
[0, 5, 1], // Lower rectangle, bottom
|
|
||||||
[0, 4, 5] // Lower rectangle, top
|
|
||||||
]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// Rule for face ordering: look at polyhedron from outside: points must
|
|
||||||
// be in clockwise order.
|
|
||||||
polyhedron (
|
|
||||||
points = [
|
|
||||||
[-x_incr_inner/2, -inner_r, 0], // [0]
|
|
||||||
[x_incr_inner/2, -inner_r, z_incr], // [1]
|
|
||||||
[x_incr_inner/2, -inner_r, thread_size + z_incr], // [2]
|
|
||||||
[-x_incr_inner/2, -inner_r, thread_size], // [3]
|
|
||||||
|
|
||||||
[-x_incr_outer/2, -outer_r, z0_outer], // [4]
|
|
||||||
[x_incr_outer/2, -outer_r, z0_outer + z_incr], // [5]
|
|
||||||
[x_incr_outer/2, -outer_r, thread_size - z0_outer + z_incr], // [6]
|
|
||||||
[-x_incr_outer/2, -outer_r, thread_size - z0_outer] // [7]
|
|
||||||
],
|
|
||||||
|
|
||||||
faces = [
|
|
||||||
[0, 3, 7, 4], // This-side trapezoid
|
|
||||||
|
|
||||||
[1, 5, 6, 2], // Back-side trapezoid
|
|
||||||
|
|
||||||
[0, 1, 2, 3], // Inner rectangle
|
|
||||||
|
|
||||||
[4, 7, 6, 5], // Outer rectangle
|
|
||||||
|
|
||||||
// These are not planar, so do with separate triangles.
|
|
||||||
[7, 2, 6], // Upper rectangle, bottom
|
|
||||||
[7, 3, 2], // Upper rectangle, top
|
|
||||||
|
|
||||||
[0, 5, 1], // Lower rectangle, bottom
|
|
||||||
[0, 4, 5] // Lower rectangle, top
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
46
top.scad
46
top.scad
|
@ -1,46 +0,0 @@
|
||||||
include <constants.scad>;
|
|
||||||
|
|
||||||
use <threads.scad>;
|
|
||||||
use <cap.scad>;
|
|
||||||
|
|
||||||
|
|
||||||
module thread() {
|
|
||||||
metric_thread(thread_diameter + thread_tolerance,
|
|
||||||
thread_pitch,
|
|
||||||
thread_lenght_top,
|
|
||||||
internal=true);
|
|
||||||
|
|
||||||
translate([0, 0, thread_lenght_top - height_unit])
|
|
||||||
cylinder(r2 = body_hole_diameter / 2,
|
|
||||||
r1 = thread_hole_diameter / 2,
|
|
||||||
h = height_unit);
|
|
||||||
|
|
||||||
cylinder(r1 = body_hole_diameter / 2,
|
|
||||||
r2 = thread_hole_diameter / 2,
|
|
||||||
h = height_unit);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
difference() {
|
|
||||||
|
|
||||||
cap();
|
|
||||||
|
|
||||||
// Hole for the lid
|
|
||||||
union() {
|
|
||||||
|
|
||||||
// Metric Thread
|
|
||||||
translate([0, 0, - 1 * height_unit])
|
|
||||||
thread();
|
|
||||||
|
|
||||||
|
|
||||||
// Make the rest of the cap hollow
|
|
||||||
translate([0, 0, -height_unit])
|
|
||||||
cylinder(r = body_hole_diameter / 2,
|
|
||||||
h = 1 * height_unit + 0.01,
|
|
||||||
center = true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue