152 lines
3.2 KiB
OpenSCAD
152 lines
3.2 KiB
OpenSCAD
include <threadlib/threadlib.scad>;
|
|
|
|
$fn = 100;
|
|
|
|
// https://www.aliexpress.com/item/1005005144919264.html?spm=a2g0o.order_list.order_list_main.5.d8bc1802v8boh9
|
|
charger_r1 = 37 / 2; // Top radius.
|
|
charger_r2 = 28.8 / 2; // Body outer thread radius.
|
|
charger_thread = 1; // Thread depth.
|
|
charger_r3 = charger_r2 - charger_thread;
|
|
charger_r4 = 37/2; // Nut radius.
|
|
charger_pitch = 13.9/9; // Thread ptich.
|
|
charger_h1 = 3; // Cap height.
|
|
charger_h2 = 36.3; // Body height minus cap.
|
|
lugs_s = [6.3, 11, 10];
|
|
charger_s = [charger_r1, charger_r1, charger_h1 + charger_h2];
|
|
|
|
// https://www.gobilda.com/xt60-connector-pack-mh-fc-x-5-fh-mc-x-5/
|
|
xt60_s = [ 15.8, 8.1, 16 ];
|
|
xt60_wall = 0.6; // Inner wall thickness.
|
|
xt60_h1 = 10.7; // Inner cutout depth.
|
|
xt60_i = 2.6;
|
|
|
|
wall = 1.3;
|
|
tol = 0.25;
|
|
e = 0.004;
|
|
e_z = [ 0, 0, e ];
|
|
inf = 100;
|
|
inf_z = [ 0, 0, inf ];
|
|
|
|
module xt60_base(x, y, h) {
|
|
i = xt60_i * x / xt60_s.x;
|
|
translate([-x/2, -y/2, 0])
|
|
linear_extrude(h)
|
|
polygon([[0, 0],
|
|
[x-i, 0],
|
|
[x, i],
|
|
[x, y-i],
|
|
[x-i, y],
|
|
[0, y]]);
|
|
}
|
|
|
|
module xt60() {
|
|
w = xt60_wall;
|
|
difference() {
|
|
xt60_base(xt60_s.x, xt60_s.y, xt60_s.z);
|
|
translate([w,w,-e])
|
|
xt60_base(xt60_s.x-w*2, xt60_s.y-w*2, xt60_h1);
|
|
}
|
|
}
|
|
|
|
module cap(r, h, inset) {
|
|
// cylinder(r=charger_r1, h=charger_h1);
|
|
rotate_extrude() {
|
|
polygon([
|
|
[0, 0],
|
|
[r, 0],
|
|
[r, h-inset],
|
|
[r-inset, h],
|
|
[0, h],
|
|
]);
|
|
}
|
|
}
|
|
|
|
module charger() {
|
|
translate([0, 0, lugs_s.z]) {
|
|
translate([0, 0, charger_h2])
|
|
cap(charger_r1, charger_h1, 1.5);
|
|
cylinder(r=charger_r3, h=charger_h2);
|
|
translate([0, 0, 5])
|
|
cylinder(r=charger_r2, h=charger_h2-5);
|
|
}
|
|
translate([-lugs_s.x/2, -lugs_s.y/2, 0]) {
|
|
cube([lugs_s.x, 0.3, lugs_s.z]);
|
|
translate([0, lugs_s.y, 0])
|
|
cube([lugs_s.x, 0.3, lugs_s.z]);
|
|
}
|
|
}
|
|
|
|
module upcap(r, h, inset) {
|
|
translate([0, 0, h])
|
|
mirror([0, 0, 1])
|
|
cap(r,h,inset);
|
|
}
|
|
|
|
module body() {
|
|
w = charger_r4;
|
|
difference() {
|
|
upcap(w+wall, charger_h2+lugs_s.z+10, 1.5);
|
|
translate([0, 0, wall])
|
|
upcap(w+wall/2, charger_h2*2, 1.5);
|
|
xt60_hole();
|
|
}
|
|
difference() {
|
|
xt60_sheath();
|
|
translate(-e_z)
|
|
xt60_hole();
|
|
}
|
|
}
|
|
|
|
module top_cap() {
|
|
h = 15;
|
|
w = charger_r4+wall+tol/2;
|
|
difference() {
|
|
union() {
|
|
translate([0, 0, h/2])
|
|
cap(w+wall, h/2, 1.5);
|
|
upcap(w+wall, h/2, 1);
|
|
}
|
|
translate([0, 0, -wall])
|
|
cap(w, h, 1.5);
|
|
cylinder(r=charger_r2+tol, h=inf);
|
|
cut = 20;
|
|
translate([(charger_r2+charger_r1+wall)/2+cut/2, 0, 0])
|
|
cylinder(r=cut/2, h=30);
|
|
translate([-(charger_r2+charger_r1+wall)/2-cut/2, 0, 0])
|
|
cylinder(r=cut/2, h=30);
|
|
}
|
|
}
|
|
|
|
module xt60_sheath() {
|
|
xt60_base(xt60_s.x+wall*2, xt60_s.y+wall*2, xt60_s.z/2);
|
|
}
|
|
|
|
module xt60_hole() {
|
|
xt60_base(xt60_s.x+tol*2, xt60_s.y+tol*2, 20);
|
|
}
|
|
|
|
module test() {
|
|
translate([charger_r1*3, 0, xt60_s.z])
|
|
charger();
|
|
|
|
translate([0, charger_r1*3, 0])
|
|
xt60();
|
|
|
|
translate([0, 0, 60])
|
|
top_cap();
|
|
|
|
body();
|
|
}
|
|
|
|
module print() {
|
|
body();
|
|
// translate([0, 50, 10])
|
|
// mirror([0,0,1]) top_cap();
|
|
}
|
|
|
|
//top_cap();
|
|
//test();
|
|
print();
|
|
//body();
|
|
//# cube([1, 41.6-wall*2, 1], true);
|