1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-09 22:51:16 +02:00

Added smd_coax

This commit is contained in:
Chris Palmer
2023-05-01 12:14:23 +01:00
parent c77b18ebc9
commit fbd8d8c7cd
8 changed files with 87 additions and 2 deletions

View File

@@ -1152,6 +1152,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "smd_diode")) smd_diode(comp[4], comp[5]);
if(show(comp, "smd_inductor")) smd_inductor(comp[4], comp[5]);
if(show(comp, "smd_pot")) smd_pot(comp[4], comp[5]);
if(show(comp, "smd_coax")) smd_coax(comp[4]);
if(show(comp, "vero_pin")) vero_pin(param(4, false));
if(show(comp, "terminal")) terminal_block(comp[5], comp[4]);
if(show(comp, "text")) color("white") linear_extrude(eps) resize([comp[4], comp[5]]) text(comp[6], font = param(7, "Liberation Mono"), valign = "center", halign = "center");

View File

@@ -516,3 +516,65 @@ module smd_pot(type, value) { //! Draw an SMD pot
square([track_w, track_l], center = true);
}
}
function smd_coax_base_size(type) = type[1]; //! Size of the insulating base
function smd_coax_base_r(type) = type[2]; //! Corner radius of the base
function smd_coax_tube(type) = type[3]; //! OD, ID, height
function smd_coax_groove(type) = type[4]; //! Groove id, width and z
function smd_coax_pin_d(type) = type[5]; //! Central pin diameter
function smd_coax_lug_size(type) = type[6]; //! lug size
function smd_contact_size(type) = type[7]; //! contact size
module smd_coax(type) { //! Draw an SMD coaxial connector
vitamin(str("smd_coax(", type[0], "): SMD coax connector type: ", type[0]));
size = smd_coax_base_size(type);
t = smd_coax_tube(type);
g = smd_coax_groove(type);
chamfer = (t.x - g.x) / 2;
pin_r = smd_coax_pin_d(type) / 2;
lug = smd_coax_lug_size(type);
contact = smd_contact_size(type);
$fn = 64;
color(grey(90))
translate_z(eps)
rounded_rectangle(size, smd_coax_base_r(type));
color(gold) {
rotate_extrude() {
polygon([
[t.y / 2, 0.1],
[t.y / 2, t.z],
[g.x / 2, t.z],
[t.x / 2, t.z - chamfer],
[t.x / 2, g.z + g.y / 2 + chamfer],
[g.x / 2, g.z + g.y / 2],
[g.x / 2, g.z - g.y / 2],
[t.x / 2, g.z - g.y / 2 - chamfer],
[t.x / 2, 0.1],
]);
}
hull() {
translate_z(t.z - pin_r)
sphere(pin_r);
translate_z(0.1)
cylinder(r = pin_r, h = eps);
}
for(side = [-1, 1])
translate([side * size.x / 2, 0, lug.z / 2])
cube(lug, center = true);
rotate(180)
translate([-contact.x / 2, 0])
cube([contact.x, contact.y / 2, contact.z]);
cylinder(r = pin_r * 9 / 5, h = 0.1);
tube_wall = (t.x - t.y) / 2;
translate([-contact.x / 2, 0, (size.z - tube_wall) / 2])
cube([contact.x, contact.y / 2, tube_wall]);
}
}

View File

@@ -73,4 +73,9 @@ TC33X1 = ["TC33X1", [3.0, 3.8, 0.5], [0.95, 0.9, 0.88, 1.5, 0.2, 0.75],[3.0, 0.1
smd_pots = [TC33X1];
U_FL_R_SMT_1 = ["U_FL_R_SMT_1", [2.6, 2.6, 0.35], 0.2, [2, 1.7, 1.25], [1.86, 0.09, 0.6], 0.5, [0.4, 1.8, 0.2], [0.6, 3.1, 0.2]];
smd_coaxs = [U_FL_R_SMT_1];
use <smd.scad>