Merge pull request #933 from adrianVmariano/master

screws updates
This commit is contained in:
Revar Desmera 2022-08-30 19:46:19 -07:00 committed by GitHub
commit dcd20c27ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 618 additions and 380 deletions

View file

@ -9,6 +9,8 @@
//////////////////////////////////////////////////////////////////////
include <structs.scad>
// Section: Phillips Drive
// Module: phillips_mask()
@ -123,11 +125,27 @@ function phillips_diam(size, depth) =
2 * tan(_ph_side_angle())*(depth-h1) + g;
// Section: Hex drive
// Module hex_drive_mask()
// Usage:
// hex_drive_mask(size, length, [anchor], [spin], [orient], [$slop]) [ATTACHMENTS];
// Description:
// Creates a mask for hex drive. Note that the hex recess specs requires
// a slightly oversized recess. You can use $slop to increase the size by
// `2 * $slop` if necessary.
//
module hex_drive_mask(size,length,l,h,height,anchor,spin,orient)
{
length = one_defined([length,height,l,h],"length,height,l,h");
realsize = 1.0072*size + 0.0341 + 2 * get_slop(); // Formula emperically determined from ISO standard
linear_sweep(height=length,hexagon(id=realsize),anchor=anchor,spin=spin,orient=orient) children();
}
function hex_drive_mask(size,length,l,h,height,anchor,spin,orient) = no_function("hex_drive_mask");
// Section: Torx Drive
// Module: torx_mask()
// Usage:
// torx_mask(size, l, [center]) [ATTACHMENTS];
@ -135,7 +153,7 @@ function phillips_diam(size, depth) =
// Arguments:
// size = Torx size.
// l = Length of bit.
// center = If true, centers bit vertically.
// center = If true, centers mask vertically.
// ---
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
@ -210,38 +228,38 @@ module torx_mask2d(size) {
// Arguments:
// size = Torx size.
function torx_info(size) =
let(
info_arr = [
//T# OD ID H Re Ri
[ 1, [ 0.90, 0.65, 1.19, 0.059, 0.201]],
[ 2, [ 1.00, 0.73, 1.70, 0.069, 0.224]],
[ 3, [ 1.20, 0.87, 1.70, 0.081, 0.266]],
[ 4, [ 1.35, 0.98, 1.70, 0.090, 0.308]],
[ 5, [ 1.48, 1.08, 1.70, 0.109, 0.330]],
[ 6, [ 1.75, 1.27, 1.87, 0.132, 0.383]],
[ 7, [ 2.08, 1.50, 3.10, 0.161, 0.446]],
[ 8, [ 2.40, 1.75, 3.10, 0.190, 0.510]],
[ 9, [ 2.58, 1.87, 3.35, 0.207, 0.554]],
[ 10, [ 2.80, 2.05, 3.61, 0.229, 0.598]],
[ 15, [ 3.35, 2.40, 3.86, 0.267, 0.716]],
[ 20, [ 3.95, 2.85, 4.12, 0.305, 0.859]],
[ 25, [ 4.50, 3.25, 4.50, 0.375, 0.920]],
[ 27, [ 5.07, 3.65, 4.75, 0.390, 1.108]],
[ 30, [ 5.60, 4.05, 5.00, 0.451, 1.194]],
[ 40, [ 6.75, 4.85, 5.64, 0.546, 1.428]],
[ 45, [ 7.93, 5.64, 6.27, 0.574, 1.796]],
[ 50, [ 8.95, 6.45, 6.53, 0.775, 1.816]],
[ 55, [ 11.35, 8.05, 6.78, 0.867, 2.667]],
[ 60, [ 13.45, 9.60, 8.22, 1.067, 2.883]],
[ 70, [ 15.70, 11.20, 9.01, 1.194, 3.477]],
[ 80, [ 17.75, 12.80, 9.95, 1.526, 3.627]],
[ 90, [ 20.20, 14.40, 10.61, 1.530, 4.468]],
[100, [ 22.40, 16.00, 11.40, 1.720, 4.925]],
let(
info_arr = [ // Depth is from metric socket head screws, ISO 14583
//T# OD ID H Re Ri
[ 1, [ 0.90, 0.65, 0.40, 0.059, 0.201]], // depth interpolated
[ 2, [ 1.00, 0.73, 0.44, 0.069, 0.224]], // depth interpolated
[ 3, [ 1.20, 0.87, 0.53, 0.081, 0.266]], // depth interpolated
[ 4, [ 1.35, 0.98, 0.59, 0.090, 0.308]], // depth interpolated
[ 5, [ 1.48, 1.08, 0.65, 0.109, 0.330]], // depth interpolated
[ 6, [ 1.75, 1.27, 0.775, 0.132, 0.383]],
[ 7, [ 2.08, 1.50, 0.886, 0.161, 0.446]], // depth interpolated
[ 8, [ 2.40, 1.75, 1.0, 0.190, 0.510]],
[ 9, [ 2.58, 1.87, 1.078, 0.207, 0.554]], // depth interpolated
[ 10, [ 2.80, 2.05, 1.142, 0.229, 0.598]],
[ 15, [ 3.35, 2.40, 1.2, 0.267, 0.716]], // depth interpolated
[ 20, [ 3.95, 2.85, 1.4, 0.305, 0.859]], // depth interpolated
[ 25, [ 4.50, 3.25, 1.61, 0.375, 0.920]],
[ 27, [ 5.07, 3.65, 1.84, 0.390, 1.108]],
[ 30, [ 5.60, 4.05, 2.22, 0.451, 1.194]],
[ 40, [ 6.75, 4.85, 2.63, 0.546, 1.428]],
[ 45, [ 7.93, 5.64, 3.115, 0.574, 1.796]],
[ 50, [ 8.95, 6.45, 3.82, 0.775, 1.816]],
[ 55, [ 11.35, 8.05, 5.015, 0.867, 2.667]],
[ 60, [ 13.45, 9.60, 5.805, 1.067, 2.883]],
[ 70, [ 15.70, 11.20, 6.815, 1.194, 3.477]],
[ 80, [ 17.75, 12.80, 7.75, 1.526, 3.627]],
[ 90, [ 20.20, 14.40, 8.945, 1.530, 4.468]],
[100, [ 22.40, 16.00, 10.79, 1.720, 4.925]],
],
found = [for(info=info_arr) if(info[0]==size) info[1]]
found = struct_val(info_arr,size)
)
assert(found, "Unsupported Torx size.")
found[0];
assert(found, str("Unsupported Torx size, ",size))
found;
// Function: torx_diam()

File diff suppressed because it is too large Load diff

View file

@ -14,12 +14,12 @@ test_torx_diam();
module test_torx_depth() {
assert_approx(torx_depth(10), 3.61);
assert_approx(torx_depth(15), 3.86);
assert_approx(torx_depth(20), 4.12);
assert_approx(torx_depth(25), 4.50);
assert_approx(torx_depth(30), 5,00);
assert_approx(torx_depth(40), 5.64);
assert_approx(torx_depth(10), 1.142);
assert_approx(torx_depth(15), 1.2);
assert_approx(torx_depth(20), 1.4);
assert_approx(torx_depth(25), 1.61);
assert_approx(torx_depth(30), 2.22);
assert_approx(torx_depth(40), 2.63);
}
test_torx_depth();