common/2020T-Slot.scad

131 lines
4.8 KiB
OpenSCAD
Raw Normal View History

2023-04-24 01:56:23 +00:00
/**
* @file
* Generic library for fractional T-Slot extrusions.
*
* Creative Commons Share Alike 3.0
* Copyright (c) 2014 Manuel García
*
* Original library (David Lee Miller)
* https://www.thingiverse.com/thing:136430
*
* Modified to be used in customizer
*/
2023-04-25 03:27:00 +00:00
include <./common.scad>;
2023-04-24 01:56:23 +00:00
//CUSTOMIZER VARIABLES
ProfileCore = 4.3 * 1; // Profile core Ø (Default M5).
minkR_TS = 0.04 * 20; // Minkowski radius for the T-Slot.
minkR_IC = 0.075 * 20; // Minkowski radius for the inner cutout.
minkR_PF = 0.05 * 20; // Minkowski radius for the profile corners.
//CUSTOMIZER VARIABLES END
2023-04-25 03:27:00 +00:00
module 2020_profile(height, core = ProfileCore) {
2023-04-24 01:56:23 +00:00
linear_extrude(height = height, center = true)
union() {
difference() {
minkowski() {
2023-04-24 03:59:02 +00:00
translate([0, 0, 0]) circle(r = minkR_PF, $fn = 32);
2023-04-24 01:56:23 +00:00
square([1 * 20 - 2 * minkR_PF, 1 * 20 - 2 * minkR_PF], center = true);
}
translate([0, 0, 0]) circle(r = core / 2, $fn = 24);
2023-04-25 03:27:00 +00:00
translate([-0.5 * 20 + 0.087 * 20, 0, 0]) 2020_tslot();
rotate([0, 0, 180]) translate([-0.5 * 20 + 0.087 * 20, 0, 0]) 2020_tslot();
translate([0, -0.5 * 20 + 0.087 * 20, 0]) rotate([0, 0, 90]) 2020_tslot();
translate([0, 0.5 * 20 - 0.087 * 20, 0]) rotate([0, 0, -90]) 2020_tslot();
2023-04-24 01:56:23 +00:00
}
}
}
module fillet(rad) {
translate([-rad, -rad, 0])
difference() {
translate([0, 0, 0]) square([rad + 0.01, rad + 0.01]);
2023-04-24 03:59:02 +00:00
circle(r = rad, $fn = 32);
2023-04-24 01:56:23 +00:00
}
}
2023-04-25 03:27:00 +00:00
module inside_cutout() {
2023-04-24 01:56:23 +00:00
minkowski() {
translate([0, 0, 0]) circle(r = minkR_IC, center = true, $fn = 32);
hull() {
square([0.2 * 20 - minkR_IC, 0.645 * 20 - 2 * minkR_IC], center = true);
square([0.8 * 20 - 2 * minkR_IC, 0.001 * 20], center = true);
}
}
}
2023-04-25 03:27:00 +00:00
module double_cutout() {
2023-04-24 01:56:23 +00:00
union() {
minkowski() {
translate([0, 0, 0]) circle(r = minkR_IC, center = true, $fn = 32);
union() {
rotate([0, 0, 0]) hull() {
translate([-0.5 * 20, 0, 0]) hull() {
square([0.2 * 20 - minkR_IC, 0.645 * 20 - 2 * minkR_IC], center = true);
square([0.8 * 20 - 2 * minkR_IC, 0.001 * 20], center = true);
}
translate([0.5 * 20, 0, 0]) hull() {
square([0.2 * 20 - minkR_IC, 0.645 * 20 - 2 * minkR_IC], center = true);
square([0.8 * 20 - 2 * minkR_IC, 0.001 * 20], center = true);
}
}
rotate([0, 0, 90]) hull() {
translate([-0.5 * 20, 0, 0]) hull() {
square([0.2 * 20 - minkR_IC, 0.645 * 20 - 2 * minkR_IC], center = true);
square([0.8 * 20 - 2 * minkR_IC, 0.001 * 20], center = true);
}
translate([0.5 * 20, 0, 0]) hull() {
square([0.2 * 20 - minkR_IC, 0.645 * 20 - 2 * minkR_IC], center = true);
square([0.8 * 20 - 2 * minkR_IC, 0.001 * 20], center = true);
}
}
}
}
rotate([0, 0, 0]) translate([-0.645 * 20 / 2, -0.645 * 20 / 2, 0]) fillet(minkR_IC);
rotate([0, 0, 180]) translate([-0.645 * 20 / 2, -0.645 * 20 / 2, 0]) fillet(minkR_IC);
rotate([0, 0, 90]) translate([-0.645 * 20 / 2, -0.645 * 20 / 2, 0]) fillet(minkR_IC);
rotate([0, 0, -90]) translate([-0.645 * 20 / 2, -0.645 * 20 / 2, 0]) fillet(minkR_IC);
}
}
2023-04-25 03:27:00 +00:00
module 2020_tslot() {
2023-04-24 01:56:23 +00:00
union() {
translate([minkR_TS, 0, 0])
minkowski() {
2023-04-24 03:59:02 +00:00
translate([0, 0, 0]) circle(r = minkR_TS, $fn = 32);
2023-04-24 01:56:23 +00:00
hull() {
square([0.001 * 20, 0.585 * 20 - 2 * minkR_TS], center = true);
translate([(0.233 * 20 - 2 * minkR_TS) / 2, 0, 0]) square([0.233 * 20 - 2 * minkR_TS, 0.2 * 20], center = true);
}
}
translate([-0.255 * 20 / 2 + 0.01, 0, 0]) square(0.255 * 20, center = true);
translate([-0.35 * 20 / 2 - 0.087 * 20 + 0.01, 0, 0]) square(0.35 * 20, center = true);
translate([0, -0.255 * 20 / 2, 0]) fillet(minkR_TS / 2);
translate([-0.087 * 20, -0.255 * 20 / 2, 0]) rotate([0, 0, 90]) fillet(minkR_TS / 2);
scale([1, -1, 1]) translate([0, -0.255 * 20 / 2, 0]) fillet(minkR_TS / 2);
scale([1, -1, 1]) translate([-0.087 * 20, -0.255 * 20 / 2, 0]) rotate([0, 0, 90]) fillet(minkR_TS / 2);
}
2023-04-25 03:27:00 +00:00
}
module 2020_tslot_insert (pos = [0, 0, 0], rot = [0, 0, 0]) {
H = 6;
TopGapY = 7.3;
TopGapZ = 4.3;
BottomBevelY = 5;
BottomBevelZ = -4;
BevelAngle = 45;
translate(pos) rotate(rot) difference() {
cube([10, 10, H], center = true);
//
translate([0, TopGapY, TopGapZ]) cube([11, 10, H], center = true);
translate([0, -TopGapY, TopGapZ]) cube([11, 10, H], center = true);
//
translate([0, -BottomBevelY, BottomBevelZ]) rotate([-BevelAngle, 0, 0]) cube([11, 10, H], center = true);
translate([0, BottomBevelY, BottomBevelZ]) rotate([BevelAngle, 0, 0]) cube([11, 10, H], center = true);
//nut
translate([0, 0, -(H/2) + (3/2) - 0.01]) m3_nut(3);
//bolt
cylinder(r = R(3.25), h = H + 1, center = true, $fn = 30);
}
2023-04-24 01:56:23 +00:00
}