mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-01-16 13:50:23 +01:00
merge drive files
add functions to compute depth/diam of phillips recess
This commit is contained in:
parent
48ccc85c16
commit
880c245d3f
@ -8,8 +8,7 @@
|
||||
|
||||
|
||||
include <threading.scad>
|
||||
include <phillips_drive.scad>
|
||||
include <torx_drive.scad>
|
||||
include <screw_drive.scad>
|
||||
|
||||
|
||||
// Section: Functions
|
||||
@ -607,13 +606,13 @@ module metric_bolt(
|
||||
// Phillips drive hole
|
||||
if (headtype != "socket" && phillips != undef) {
|
||||
down(headtype != "hex"? H/6 : 0) {
|
||||
phillips_drive(size=phillips, shaft=D);
|
||||
phillips_mask(size=phillips, shaft=D);
|
||||
}
|
||||
}
|
||||
|
||||
// Torx drive hole
|
||||
if (headtype != "socket" && torx != undef) {
|
||||
up(1) torx_drive(size=torx, l=H+0.1, center=false);
|
||||
up(1) torx_mask(size=torx, l=H+0.1, center=false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,76 +0,0 @@
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// LibFile: phillips_drive.scad
|
||||
// Phillips driver bits
|
||||
// Includes:
|
||||
// include <BOSL2/std.scad>
|
||||
// include <BOSL2/phillips_drive.scad>
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// Section: Modules
|
||||
|
||||
|
||||
// Module: phillips_drive()
|
||||
// Description: Creates a model of a phillips driver bit of a given named size.
|
||||
// Arguments:
|
||||
// size = The size of the bit as a string. "#0", "#1", "#2", "#3", or "#4"
|
||||
// shaft = The diameter of the drive bit's shaft.
|
||||
// l = The length of the drive bit.
|
||||
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#anchor). Default: `CENTER`
|
||||
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#spin). Default: `0`
|
||||
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#orient). Default: `UP`
|
||||
// Example:
|
||||
// xdistribute(10) {
|
||||
// phillips_drive(size="#1", shaft=4, l=20);
|
||||
// phillips_drive(size="#2", shaft=6, l=20);
|
||||
// phillips_drive(size="#3", shaft=6, l=20);
|
||||
// }
|
||||
module phillips_drive(size="#2", shaft, l=20, $fn=36, anchor=BOTTOM, spin=0, orient=UP) {
|
||||
assert(is_string(size));
|
||||
assert(in_list(size,["#0","#1","#2","#3","#4"]));
|
||||
|
||||
num = ord(size[1]) - ord("0");
|
||||
defshaft = [3,4.5,6,8,10][num];
|
||||
shaft = first_defined([defshaft,shaft,defshaft]);
|
||||
|
||||
b = [0.61, 0.97, 1.47, 2.41, 3.48][num];
|
||||
e = [0.31, 0.435, 0.815, 2.005, 2.415][num];
|
||||
// e = [0.31, 0.435, 0.815, 2.1505, 2.415][num];
|
||||
g = [0.81, 1.27, 2.29, 3.81, 5.08][num];
|
||||
//f = [0.33, 0.53, 0.70, 0.82, 1.23][num];
|
||||
//r = [0.30, 0.50, 0.60, 0.80, 1.00][num];
|
||||
alpha = [ 136, 138, 140, 146, 153][num];
|
||||
beta = [7.00, 7.00, 5.75, 5.75, 7.00][num];
|
||||
gamma = 92.0;
|
||||
ang1 = 28.0;
|
||||
ang2 = 26.5;
|
||||
h1 = adj_ang_to_opp(g/2, ang1); // height of the small conical tip
|
||||
h2 = adj_ang_to_opp((shaft-g)/2, 90-ang2); // height of larger cone
|
||||
h3 = adj_ang_to_opp(b/2, ang1); // height where cutout starts
|
||||
p0 = [0,0];
|
||||
p1 = [adj_ang_to_opp(e/2, 90-alpha/2), -e/2];
|
||||
p2 = p1 + [adj_ang_to_opp((shaft-e)/2, 90-gamma/2),-(shaft-e)/2];
|
||||
attachable(anchor,spin,orient, d=shaft, l=l) {
|
||||
down(l/2) {
|
||||
difference() {
|
||||
rotate_extrude()
|
||||
polygon([[0,0],[g/2,h1],[shaft/2,h1+h2],[shaft/2,l],[0,l]]);
|
||||
zrot(45)
|
||||
zrot_copies(n=4, r=b/2) {
|
||||
up(h3) {
|
||||
yrot(beta) {
|
||||
linear_extrude(height=(h1+h2)*20, convexity=4, center=false) {
|
||||
path = [p0, p1, p2, [p2.x,-p2.y], [p1.x,-p1.y]];
|
||||
polygon(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
children();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|
316
screw_drive.scad
Normal file
316
screw_drive.scad
Normal file
@ -0,0 +1,316 @@
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// LibFile: screw_drive.scad
|
||||
// Recess masks for screw heads
|
||||
// Includes:
|
||||
// include <BOSL2/std.scad>
|
||||
// include <BOSL2/screw_drive.scad>
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// Section: Phillips Drive
|
||||
|
||||
// Module: phillips_mask()
|
||||
// Description: Creates a mask for creating a Phillips drive recess given the Phillips size.
|
||||
// Arguments:
|
||||
// size = The size of the bit as a number or string. "#0", "#1", "#2", "#3", or "#4"
|
||||
// shaft = The diameter of the drive bit's shaft.
|
||||
// l = The length of the drive bit.
|
||||
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#anchor). Default: `CENTER`
|
||||
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#spin). Default: `0`
|
||||
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#orient). Default: `UP`
|
||||
// Example:
|
||||
// xdistribute(10) {
|
||||
// phillips_mask(size="#1", l=20);
|
||||
// phillips_mask(size="#2", l=20);
|
||||
// phillips_mask(size=3, l=20);
|
||||
// phillips_mask(size=4, l=20);
|
||||
// }
|
||||
|
||||
// Specs for phillips recess here:
|
||||
// https://www.fasteners.eu/tech-info/ISO/4757/
|
||||
|
||||
module phillips_mask(size="#2", shaft, l=20, $fn=36, anchor=BOTTOM, spin=0, orient=UP) {
|
||||
assert(in_list(size,["#0","#1","#2","#3","#4",0,1,2,3,4]));
|
||||
num = is_num(size) ? size : ord(size[1]) - ord("0");
|
||||
defshaft = [3,4.5,6,8,10][num];
|
||||
shaft = first_defined([defshaft,shaft,defshaft]);
|
||||
|
||||
b = [0.61, 0.97, 1.47, 2.41, 3.48][num];
|
||||
e = [0.31, 0.435, 0.815, 2.005, 2.415][num];
|
||||
// e = [0.31, 0.435, 0.815, 2.1505, 2.415][num];
|
||||
g = [0.81, 1.27, 2.29, 3.81, 5.08][num];
|
||||
//f = [0.33, 0.53, 0.70, 0.82, 1.23][num];
|
||||
//r = [0.30, 0.50, 0.60, 0.80, 1.00][num];
|
||||
alpha = [ 136, 138, 140, 146, 153][num];
|
||||
beta = [7.00, 7.00, 5.75, 5.75, 7.00][num];
|
||||
gamma = 92.0;
|
||||
ang1 = 28.0;
|
||||
ang2 = 26.5;
|
||||
h1 = adj_ang_to_opp(g/2, ang1); // height of the small conical tip
|
||||
h2 = adj_ang_to_opp((shaft-g)/2, 90-ang2); // height of larger cone
|
||||
h3 = adj_ang_to_opp(b/2, ang1); // height where cutout starts
|
||||
p0 = [0,0];
|
||||
p1 = [adj_ang_to_opp(e/2, 90-alpha/2), -e/2];
|
||||
p2 = p1 + [adj_ang_to_opp((shaft-e)/2, 90-gamma/2),-(shaft-e)/2];
|
||||
attachable(anchor,spin,orient, d=shaft, l=l) {
|
||||
down(l/2) {
|
||||
difference() {
|
||||
rotate_extrude()
|
||||
polygon([[0,0],[g/2,h1],[shaft/2,h1+h2],[shaft/2,l],[0,l]]);
|
||||
zrot(45)
|
||||
zrot_copies(n=4, r=b/2) {
|
||||
up(h3) {
|
||||
yrot(beta) {
|
||||
linear_extrude(height=(h1+h2)*20, convexity=4, center=false) {
|
||||
path = [p0, p1, p2, [p2.x,-p2.y], [p1.x,-p1.y]];
|
||||
polygon(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
children();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Function: phillips_depth()
|
||||
// Usage:
|
||||
// depth = phillips_depth(size, d);
|
||||
// Description:
|
||||
// Returns the depth of the Phillips recess required to produce the specified diameter, or
|
||||
// undef if not possible.
|
||||
// Arguments:
|
||||
// size = size as a number or text string like "#2"
|
||||
// d = desired diameter
|
||||
function phillips_depth(size, d) =
|
||||
assert(in_list(size,["#0","#1","#2","#3","#4",0,1,2,3,4]))
|
||||
let(
|
||||
num = is_num(size) ? size : ord(size[1]) - ord("0"),
|
||||
shaft = [3,4.5,6,8,10][num],
|
||||
g = [0.81, 1.27, 2.29, 3.81, 5.08][num],
|
||||
ang1 = 28.0,
|
||||
ang2 = 26.5,
|
||||
h1 = adj_ang_to_opp(g/2, ang1), // height of the small conical tip
|
||||
h2 = adj_ang_to_opp((shaft-g)/2, 90-ang2) // height of larger cone
|
||||
)
|
||||
d>shaft ? undef :
|
||||
d<g ? undef :
|
||||
(d-g) / 2 / tan(ang2) + h1;
|
||||
|
||||
|
||||
// Function: phillips_diam()
|
||||
// Usage:
|
||||
// diam = phillips_diam(size, depth);
|
||||
// Description:
|
||||
// Returns the diameter at the top of the Phillips recess when constructed at the specified depth.
|
||||
// Arguments:
|
||||
// size = size as number or text string like "#2"
|
||||
// depth = depth of recess to find the diameter of
|
||||
function phillips_diam(size, depth) =
|
||||
assert(in_list(size,["#0","#1","#2","#3","#4",0,1,2,3,4]))
|
||||
let(
|
||||
num = is_num(size) ? size : ord(size[1]) - ord("0"),
|
||||
shaft = [3,4.5,6,8,10][num],
|
||||
ang1 = 28.0,
|
||||
ang2 = 26.5,
|
||||
g = [0.81, 1.27, 2.29, 3.81, 5.08][num],
|
||||
h1 = adj_ang_to_opp(g/2, ang1), // height of the small conical tip
|
||||
h2 = adj_ang_to_opp((shaft-g)/2, 90-ang2) // height of larger cone
|
||||
)
|
||||
depth<h1 ? undef :
|
||||
depth>h1+h2 ? shaft :
|
||||
2 * tan(ang2)*(depth-h1) + g;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Section: Torx Drive
|
||||
|
||||
|
||||
// Function: torx_outer_diam()
|
||||
// Description: Get the typical outer diameter of Torx profile.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
function torx_outer_diam(size) = lookup(size, [
|
||||
[ 6, 1.75],
|
||||
[ 8, 2.40],
|
||||
[ 10, 2.80],
|
||||
[ 15, 3.35],
|
||||
[ 20, 3.95],
|
||||
[ 25, 4.50],
|
||||
[ 30, 5.60],
|
||||
[ 40, 6.75],
|
||||
[ 45, 7.93],
|
||||
[ 50, 8.95],
|
||||
[ 55, 11.35],
|
||||
[ 60, 13.45],
|
||||
[ 70, 15.70],
|
||||
[ 80, 17.75],
|
||||
[ 90, 20.20],
|
||||
[100, 22.40]
|
||||
]);
|
||||
|
||||
|
||||
// Function: torx_inner_diam()
|
||||
// Description: Get typical inner diameter of Torx profile.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
function torx_inner_diam(size) = lookup(size, [
|
||||
[ 6, 1.27],
|
||||
[ 8, 1.75],
|
||||
[ 10, 2.05],
|
||||
[ 15, 2.40],
|
||||
[ 20, 2.85],
|
||||
[ 25, 3.25],
|
||||
[ 30, 4.05],
|
||||
[ 40, 4.85],
|
||||
[ 45, 5.64],
|
||||
[ 50, 6.45],
|
||||
[ 55, 8.05],
|
||||
[ 60, 9.60],
|
||||
[ 70, 11.20],
|
||||
[ 80, 12.80],
|
||||
[ 90, 14.40],
|
||||
[100, 16.00]
|
||||
]);
|
||||
|
||||
|
||||
// Function: torx_depth()
|
||||
// Description: Gets typical drive hole depth.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
function torx_depth(size) = lookup(size, [
|
||||
[ 6, 1.82],
|
||||
[ 8, 3.05],
|
||||
[ 10, 3.56],
|
||||
[ 15, 3.81],
|
||||
[ 20, 4.07],
|
||||
[ 25, 4.45],
|
||||
[ 30, 4.95],
|
||||
[ 40, 5.59],
|
||||
[ 45, 6.22],
|
||||
[ 50, 6.48],
|
||||
[ 55, 6.73],
|
||||
[ 60, 8.17],
|
||||
[ 70, 8.96],
|
||||
[ 80, 9.90],
|
||||
[ 90, 10.56],
|
||||
[100, 11.35]
|
||||
]);
|
||||
|
||||
|
||||
// Function: torx_tip_radius()
|
||||
// Description: Gets minor rounding radius of Torx profile.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
function torx_tip_radius(size) = lookup(size, [
|
||||
[ 6, 0.132],
|
||||
[ 8, 0.190],
|
||||
[ 10, 0.229],
|
||||
[ 15, 0.267],
|
||||
[ 20, 0.305],
|
||||
[ 25, 0.375],
|
||||
[ 30, 0.451],
|
||||
[ 40, 0.546],
|
||||
[ 45, 0.574],
|
||||
[ 50, 0.775],
|
||||
[ 55, 0.867],
|
||||
[ 60, 1.067],
|
||||
[ 70, 1.194],
|
||||
[ 80, 1.526],
|
||||
[ 90, 1.530],
|
||||
[100, 1.720]
|
||||
]);
|
||||
|
||||
|
||||
// Function: torx_rounding_radius()
|
||||
// Description: Gets major rounding radius of Torx profile.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
function torx_rounding_radius(size) = lookup(size, [
|
||||
[ 6, 0.383],
|
||||
[ 8, 0.510],
|
||||
[ 10, 0.598],
|
||||
[ 15, 0.716],
|
||||
[ 20, 0.859],
|
||||
[ 25, 0.920],
|
||||
[ 30, 1.194],
|
||||
[ 40, 1.428],
|
||||
[ 45, 1.796],
|
||||
[ 50, 1.816],
|
||||
[ 55, 2.667],
|
||||
[ 60, 2.883],
|
||||
[ 70, 3.477],
|
||||
[ 80, 3.627],
|
||||
[ 90, 4.468],
|
||||
[100, 4.925]
|
||||
]);
|
||||
|
||||
|
||||
|
||||
// Module: torx_mask2d()
|
||||
// Description: Creates a torx bit 2D profile.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
// Example(2D):
|
||||
// torx_mask2d(size=30, $fa=1, $fs=1);
|
||||
module torx_mask2d(size) {
|
||||
od = torx_outer_diam(size);
|
||||
id = torx_inner_diam(size);
|
||||
tip = torx_tip_radius(size);
|
||||
rounding = torx_rounding_radius(size);
|
||||
base = od - 2*tip;
|
||||
$fn = quantup(segs(od/2),12);
|
||||
difference() {
|
||||
union() {
|
||||
circle(d=base);
|
||||
zrot_copies(n=2) {
|
||||
hull() {
|
||||
zrot_copies(n=3) {
|
||||
translate([base/2,0,0]) {
|
||||
circle(r=tip, $fn=$fn/2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
zrot_copies(n=6) {
|
||||
zrot(180/6) {
|
||||
translate([id/2+rounding,0,0]) {
|
||||
circle(r=rounding);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Module: torx_mask()
|
||||
// Description: Creates a torx bit tip.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
// l = Length of bit.
|
||||
// center = If true, centers bit vertically.
|
||||
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#anchor). Default: `CENTER`
|
||||
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#spin). Default: `0`
|
||||
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#orient). Default: `UP`
|
||||
// Examples:
|
||||
// torx_mask(size=30, l=10, $fa=1, $fs=1);
|
||||
module torx_mask(size, l=5, center, anchor, spin=0, orient=UP) {
|
||||
anchor = get_anchor(anchor, center, BOT, BOT);
|
||||
od = torx_outer_diam(size);
|
||||
attachable(anchor,spin,orient, d=od, l=l) {
|
||||
linear_extrude(height=l, convexity=4, center=true) {
|
||||
torx_mask2d(size);
|
||||
}
|
||||
children();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|
20
screws.scad
20
screws.scad
@ -8,8 +8,8 @@
|
||||
|
||||
include <structs.scad>
|
||||
include <threading.scad>
|
||||
include <phillips_drive.scad>
|
||||
include <torx_drive.scad>
|
||||
include <screw_drive.scad>
|
||||
|
||||
|
||||
// Section: Generic Screw Creation
|
||||
|
||||
@ -1037,8 +1037,8 @@ module _driver(spec)
|
||||
echo(drive_size=drive_size);
|
||||
up(head_top-drive_depth){
|
||||
// recess should be positioned with its bottom center at (0,0) and the correct recess depth given above
|
||||
if (drive=="phillips") phillips_drive(size=str("#",drive_size), shaft=diameter,anchor=BOTTOM);
|
||||
if (drive=="torx") torx_drive(size=drive_size, l=drive_depth+1, center=false);
|
||||
if (drive=="phillips") phillips_mask(drive_size,anchor=BOTTOM);
|
||||
if (drive=="torx") torx_mask(size=drive_size, l=drive_depth+1, center=false);
|
||||
if (drive=="hex") linear_extrude(height=drive_depth+1) hexagon(id=drive_size);
|
||||
if (drive=="slot") cuboid([2*struct_val(spec,"head_size"), drive_width, drive_depth+1],anchor=BOTTOM);
|
||||
}
|
||||
@ -1415,9 +1415,21 @@ http://files.engineering.com/getfile.aspx?folder=76fb0d5e-1fff-4c49-87a5-0597947
|
||||
//
|
||||
// Torx drive depth for UTS and ISO (at least missing for "flat small", which means you can't select torx for this head type)
|
||||
// Handle generic phillips (e.g. ph2) or remove it?
|
||||
|
||||
// https://www.fasteners.eu/tech-info/ISO/7721-2/
|
||||
//
|
||||
// How do you insert a threaded hole into a model?
|
||||
// Default nut thickness
|
||||
//
|
||||
// JIS:
|
||||
//https://www.garagejournal.com/forum/media/jis-b-4633-vs-iso-8764-1-din-5260-ph.84492/
|
||||
|
||||
//square:
|
||||
//https://www.aspenfasteners.com/content/pdf/square_drive_specification.pdf
|
||||
//http://www.globalfastener.com/standards/index.php?narr58=149
|
||||
//https://patents.google.com/patent/US1003657
|
||||
|
||||
// thread standards:
|
||||
// https://www.gewinde-normen.de/en/index.html
|
||||
|
||||
// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|
||||
|
@ -1,5 +1,5 @@
|
||||
include <../std.scad>
|
||||
include <../torx_drive.scad>
|
||||
include <../screw_drive.scad>
|
||||
|
||||
|
||||
module test_torx_outer_diam() {
|
199
torx_drive.scad
199
torx_drive.scad
@ -1,199 +0,0 @@
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// LibFile: torx_drive.scad
|
||||
// Torx driver bits
|
||||
// Includes:
|
||||
// include <BOSL2/std.scad>
|
||||
// include <BOSL2/torx_drive.scad>
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// Section: Functions
|
||||
|
||||
|
||||
// Function: torx_outer_diam()
|
||||
// Description: Get the typical outer diameter of Torx profile.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
function torx_outer_diam(size) = lookup(size, [
|
||||
[ 6, 1.75],
|
||||
[ 8, 2.40],
|
||||
[ 10, 2.80],
|
||||
[ 15, 3.35],
|
||||
[ 20, 3.95],
|
||||
[ 25, 4.50],
|
||||
[ 30, 5.60],
|
||||
[ 40, 6.75],
|
||||
[ 45, 7.93],
|
||||
[ 50, 8.95],
|
||||
[ 55, 11.35],
|
||||
[ 60, 13.45],
|
||||
[ 70, 15.70],
|
||||
[ 80, 17.75],
|
||||
[ 90, 20.20],
|
||||
[100, 22.40]
|
||||
]);
|
||||
|
||||
|
||||
// Function: torx_inner_diam()
|
||||
// Description: Get typical inner diameter of Torx profile.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
function torx_inner_diam(size) = lookup(size, [
|
||||
[ 6, 1.27],
|
||||
[ 8, 1.75],
|
||||
[ 10, 2.05],
|
||||
[ 15, 2.40],
|
||||
[ 20, 2.85],
|
||||
[ 25, 3.25],
|
||||
[ 30, 4.05],
|
||||
[ 40, 4.85],
|
||||
[ 45, 5.64],
|
||||
[ 50, 6.45],
|
||||
[ 55, 8.05],
|
||||
[ 60, 9.60],
|
||||
[ 70, 11.20],
|
||||
[ 80, 12.80],
|
||||
[ 90, 14.40],
|
||||
[100, 16.00]
|
||||
]);
|
||||
|
||||
|
||||
// Function: torx_depth()
|
||||
// Description: Gets typical drive hole depth.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
function torx_depth(size) = lookup(size, [
|
||||
[ 6, 1.82],
|
||||
[ 8, 3.05],
|
||||
[ 10, 3.56],
|
||||
[ 15, 3.81],
|
||||
[ 20, 4.07],
|
||||
[ 25, 4.45],
|
||||
[ 30, 4.95],
|
||||
[ 40, 5.59],
|
||||
[ 45, 6.22],
|
||||
[ 50, 6.48],
|
||||
[ 55, 6.73],
|
||||
[ 60, 8.17],
|
||||
[ 70, 8.96],
|
||||
[ 80, 9.90],
|
||||
[ 90, 10.56],
|
||||
[100, 11.35]
|
||||
]);
|
||||
|
||||
|
||||
// Function: torx_tip_radius()
|
||||
// Description: Gets minor rounding radius of Torx profile.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
function torx_tip_radius(size) = lookup(size, [
|
||||
[ 6, 0.132],
|
||||
[ 8, 0.190],
|
||||
[ 10, 0.229],
|
||||
[ 15, 0.267],
|
||||
[ 20, 0.305],
|
||||
[ 25, 0.375],
|
||||
[ 30, 0.451],
|
||||
[ 40, 0.546],
|
||||
[ 45, 0.574],
|
||||
[ 50, 0.775],
|
||||
[ 55, 0.867],
|
||||
[ 60, 1.067],
|
||||
[ 70, 1.194],
|
||||
[ 80, 1.526],
|
||||
[ 90, 1.530],
|
||||
[100, 1.720]
|
||||
]);
|
||||
|
||||
|
||||
// Function: torx_rounding_radius()
|
||||
// Description: Gets major rounding radius of Torx profile.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
function torx_rounding_radius(size) = lookup(size, [
|
||||
[ 6, 0.383],
|
||||
[ 8, 0.510],
|
||||
[ 10, 0.598],
|
||||
[ 15, 0.716],
|
||||
[ 20, 0.859],
|
||||
[ 25, 0.920],
|
||||
[ 30, 1.194],
|
||||
[ 40, 1.428],
|
||||
[ 45, 1.796],
|
||||
[ 50, 1.816],
|
||||
[ 55, 2.667],
|
||||
[ 60, 2.883],
|
||||
[ 70, 3.477],
|
||||
[ 80, 3.627],
|
||||
[ 90, 4.468],
|
||||
[100, 4.925]
|
||||
]);
|
||||
|
||||
|
||||
// Section: Modules
|
||||
|
||||
|
||||
// Module: torx_drive2d()
|
||||
// Description: Creates a torx bit 2D profile.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
// Example(2D):
|
||||
// torx_drive2d(size=30, $fa=1, $fs=1);
|
||||
module torx_drive2d(size) {
|
||||
od = torx_outer_diam(size);
|
||||
id = torx_inner_diam(size);
|
||||
tip = torx_tip_radius(size);
|
||||
rounding = torx_rounding_radius(size);
|
||||
base = od - 2*tip;
|
||||
$fn = quantup(segs(od/2),12);
|
||||
difference() {
|
||||
union() {
|
||||
circle(d=base);
|
||||
zrot_copies(n=2) {
|
||||
hull() {
|
||||
zrot_copies(n=3) {
|
||||
translate([base/2,0,0]) {
|
||||
circle(r=tip, $fn=$fn/2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
zrot_copies(n=6) {
|
||||
zrot(180/6) {
|
||||
translate([id/2+rounding,0,0]) {
|
||||
circle(r=rounding);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Module: torx_drive()
|
||||
// Description: Creates a torx bit tip.
|
||||
// Arguments:
|
||||
// size = Torx size.
|
||||
// l = Length of bit.
|
||||
// center = If true, centers bit vertically.
|
||||
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#anchor). Default: `CENTER`
|
||||
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#spin). Default: `0`
|
||||
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#orient). Default: `UP`
|
||||
// Examples:
|
||||
// torx_drive(size=30, l=10, $fa=1, $fs=1);
|
||||
module torx_drive(size, l=5, center, anchor, spin=0, orient=UP) {
|
||||
anchor = get_anchor(anchor, center, BOT, BOT);
|
||||
od = torx_outer_diam(size);
|
||||
attachable(anchor,spin,orient, d=od, l=l) {
|
||||
linear_extrude(height=l, convexity=4, center=true) {
|
||||
torx_drive2d(size);
|
||||
}
|
||||
children();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|
||||
|
Loading…
x
Reference in New Issue
Block a user