added db9 to dsub.scad in library

This commit is contained in:
Edward Kisiel
2024-03-28 14:31:27 -04:00
parent 8a0e9f17a0
commit 88691a6b61
4 changed files with 105 additions and 3 deletions

View File

@@ -66,7 +66,6 @@ module buttons(style, size, radius, post, mask) {
}
}
if(enablemask == false) {
echo(style, size, radius, post, mask);
if(style == "recess") {
difference() {
union() {

View File

@@ -65,8 +65,9 @@ module h3_port_extender(style, mask = false) {
color("silver") translate([1.6, 188.5, 84]) rotate([90, 0, 270]) import("stl/h3_port_extender.stl");
color("dimgrey") translate([-2.5, 0, 29.5]) rotate([270, 0, 90]) import("stl/header_2x2_90.stl");
color("dimgrey")translate([9,-.5,12.75]) rotate([0,270,90]) import("stl/header_encl_2x5_90.stl");
translate([2, 2, 14.08]) rotate([0, 90, 0]) header(12);
translate([2, 2, 11.54]) rotate([0, 90, 0]) header(12);
// translate([2, 2, 14.08]) rotate([0, 90, 0]) header(12);
// translate([2, 2, 11.54]) rotate([0, 90, 0]) header(12);
// header("open", 7.5, 1, 0, "top", 0, [2,12,6], ["thruhole","black","female",2.54,"silver"], 1.6, false, [true,10,2,"default"]);
}
}
}

101
lib/dsub.scad Normal file
View File

@@ -0,0 +1,101 @@
/*
This file is part of SBC Case Builder https://github.com/hominoids/SBC_Case_Builder
Copyright 2022,2023,2024 Edward A. Kisiel hominoid@cablemi.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
NAME: dsub
DESCRIPTION: creates dsub connectors
TODO: 9db male, 25db male and female
USAGE: dsub(style, gender, mask)
style = "db9"
gender = "female","male"
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module dsub(style, gender, mask) {
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
adj = .01;
$fn = 90;
if(enablemask == true && mstyle == "default") {
translate([0,0,-msetback]) union() {
hull() {
translate([-7,3,-5]) cylinder(d=3, h=11+mlength);
translate([7,3,-5]) cylinder(d=3, h=11+mlength);
translate([-6.25,-3,-5]) cylinder(d=3, h=11+mlength);
translate([6.25,-3,-5]) cylinder(d=3, h=11+mlength);
}
// mount holes
translate([-12.5,0,-5]) cylinder(d=3.5, h=11+mlength);
translate([12.5,0,-5]) cylinder(d=3.5, h=11+mlength);
}
}
if(enablemask == false) {
if(style == "db9" && gender =="female") {
difference() {
union() {
color("silver") hull() {
translate([-6.5,2.5,-5]) cylinder(d=3, h=11);
translate([6.5,2.5,-5]) cylinder(d=3, h=11);
translate([-5.75,-2.5,-5]) cylinder(d=3, h=11);
translate([5.75,-2.5,-5]) cylinder(d=3, h=11);
}
color("black") hull() {
translate([-6,2.25,-6]) cylinder(d=3, h=12.25);
translate([6,2.25,-6]) cylinder(d=3, h=12.25);
translate([-5.25,-2.25,-6]) cylinder(d=3, h=12.25);
translate([5.25,-2.25,-6]) cylinder(d=3, h=12.25);
}
// mount plate
translate([-15.5,-6.5,-.25]) slab([31,13,.5], 2);
// rear pins
color("silver") translate([-5.48,1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([-2.74,1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([0,1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([2.74,1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([5.48,1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([-4.12,-1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([-1.38,-1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([1.36,-1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([4,-1.4,-8]) cylinder(d=1.5, h=9);
}
// mount holes
color("silver") translate([-12.5,0,-3]) cylinder(d=3.2, h=6);
color("silver") translate([12.5,0,-3]) cylinder(d=3.2, h=6);
// pin holes
color("silver") translate([-5.48,1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([-2.74,1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([0,1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([2.74,1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([5.48,1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([-4.12,-1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([-1.38,-1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([1.36,-1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([4,-1.4,-9]) cylinder(d=1, h=16);
}
}
}
}

View File

@@ -39,6 +39,7 @@ include <./lib/batteries.scad>;
include <./lib/buttons.scad>;
include <./lib/cable_holder.scad>;
include <./lib/custom.scad>;
include <./lib/dsub.scad>;
include <./lib/fastener.scad>;
include <./lib/feet.scad>;
include <./lib/hd.scad>;