/*
Copyright © John Gilmour 2021
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
http://creativecommons.org/licenses/by-nc-sa/4.0/">
This work is licensed under a 1 || xPos<8) && yPos<3)
translate([xPos*19.5,yPos*13.5,B_DEPTH-1]) cylinder(h=10,r=6, $fn=6);
if ((xPos <8) && (yPos<3)) {
translate([(xPos*19.5)+9.75,(yPos*13.5)+6.5,B_DEPTH-1]) cylinder(h=10,r=6, $fn=6);
}
}
}
}
}
module Usb(bSolid){
if (bSolid==true) {
difference() { //ledge with mounting hole cut
translate([0,0,-5]) cube([36.4,2,25]);
translate([17.8,-1,11.5]) rotate([-90,0,0]) cylinder(h=20,d=2.7);
}
translate([0.7,3,-5]) cube([35,11,15]); //usb board slot
}
else{
translate([2.7,5,-5]) cube([30.8,7.5,20]);
translate([2.7,5,0.5]) cube([31,7,20]);
translate([0,2,-2]) cube([36.4,3,20]);
translate([17.8,-5,11.5]) rotate([-90,0,0]) cylinder(h=6,d=5.8, $fn=6);
}
}
module plugs_jack(bSolid){
if (bSolid==true) {
}
else {
for (xPlug=[13.75,34.25]) {
translate([xPlug,72,-1]) cylinder(5,r=4);
}
}
}
module plugs_post(bSolid){
if (bSolid==true) {
}
else {
for (xPlug=[13.75,34.25,58.75,79.25]) {
translate([xPlug,29,-1]) cylinder(5,r=2.1);
}
for (xPlug=[58.75,79.25,]) {
translate([xPlug,72,-1]) cylinder(5,r=2.1);
}
}
}
module plugs_flush(bSolid){
if (bSolid==true) {
for (yPlug=[9.5,25.75]) {
translate([WIDTH-15,yPlug,-1]) rotate([-ANGLE,0,0]) cylinder(6.5,d=15);
}
}
else {
for (yPlug=[9.5,25.75]) {
translate([WIDTH-15,yPlug+1.5,2]) rotate([-ANGLE,0,0]) cylinder(5,d=12);
translate([WIDTH-15,yPlug,-2.7]) rotate([-ANGLE,0,0]) cylinder(5.6,d=15);
}
}
}
module Attiny(bSolid){
if (bSolid==SOLID) {
Post(7,5.25, 1.25,bPin=true);
Post(7,18.75, 1.25);
}
else {
}
}
module Buck(bSolid){
if (bSolid==SOLID) {
Post(37,20, 1.25);
Post(7,4, 1.25);
Post(7,20, 1.25);
Post(37,4, 1.25);
}
else {
}
}
module Osc(bSolid){
if (bSolid==true) {
translate([0,0,THICK]) {
// corner posts
Post(66,-3.5, 1.25);
Post(5,-88, 1.25);
Post(5,-3.5, 1.25);
Post(66,-79.5, 1.25);
//analogue board post
Post(5,-33.5, 1.25);
//encoder posts
Post(46,-81.5, 1.25);
Post(25,-81.5, 1.25);
}
}
else {
// Oscilloscope Screen
translate([11,-48,-1]) minkowski(){
cube([49,38,5]);
cylinder(r=1,h=5);
}
//inset
translate([7,-68,1.5]) cube([57,62,5]);
//buttons
translate([15.1+(0*13.5),-60, -1]) cylinder(5,r=3.6);
translate([15.1+(1*13.5),-60, -1]) cylinder(5,r=3.6);
translate([15.1+(2*13.5),-60, -1]) cylinder(5,r=3.6);
translate([15.1+(3*13.5),-60, -1]) cylinder(5,r=3.6);
//rotary encoder
translate([10+((51)/2),-81.5,-1]) cylinder(5,r=4,center=false);
//top
translate([53,-1,11]) mirror ([0,1,-1]) cylinder(THICK+2,r=6,center=false);
translate([32,-1,5.5]) mirror ([0,1,-1]) cube([5.5,2,THICK+2],center=false);
translate([14,-1,11]) mirror ([0,1,-1]) cube([8,3,THICK+2],center=false);
}
}
module Dsp150(bSolid){
if (bSolid==SOLID) {
}
else {
cube([76.25,39.5,10]);
}
}
module SlideSwitch(bSolid){
if (bSolid==SOLID) {
}
else {
translate([6.25,4.75,1.5]) rotate([180,0,0]) cube([7.75,3.5,4]);
translate([0,0,1.4]) cube([20,6,10]);
}
}
module Meter(bSolid, iCount=1, iDigits=4){
if (bSolid==SOLID) {
for (iMeter=[1:iCount]) {
if (iMeter==1)
difference(){
translate([0,5.9,0]) cube([2,9,11.2+THICK]);
#translate([0-.5,8,8.2+THICK]) cube([4,4.8,2]);
}
if (iCount==1 || iMeter1 && iMeter==iCount)
difference() {
translate([88,5.9,0]) cube([2,9,11.2+THICK]);
translate([88-.5,8,8.2+THICK]) cube([4,4.8,2]);
}
translate([((iMeter-1)*45)+1.5,-2.25,THICK]) cube([41.5,2,5]);
if (iDigits == 4)
translate([((iMeter-1)*45)+1.5,21.95,THICK]) cube([41.5,2,5]);
else
translate([((iMeter-1)*45)+1.5,21.95,THICK]) cube([31.5,2,5]);
}
}
else {
for (xPos=[0:45:(iCount-1)*45]) {
//screen hole and pocket
if (iDigits == 4)
translate([xPos+6.5,1,-1]) cube([32,19.2,5]);
else
translate([xPos+4.5,1,-1]) cube([36,19.2,5]);
translate([xPos+2,0,1.5]) cube([41,21.2,2]);
}
}
}
module Buzzer(bSolid) {
if (bSolid==SOLID) {
cylinder(4,d=14);
}
else {
cylinder(8,d=12.2);
}
}
module Led(bSolid){
if (bSolid==SOLID) {
cylinder(4,d=6.5);
}
else {
cylinder(6,d=5.2);
}
}
module Post(iXOffset,iYOffset,hole_rad,iPostHeight=3, bPin=false){
if (bPin==true) {
translate([iXOffset,iYOffset,0]) cylinder(h=iPostHeight, r1=hole_rad+3, r2=hole_rad+1);
//make pin for the screw hole
translate([iXOffset,iYOffset,0]) cylinder(h=iPostHeight+2, r=hole_rad);
}
else { // make screw hole
difference(){
//translate([iXOffset,iYOffset,THICK]) linear_extrude(height = iPostHeight) circle(r=hole_rad+1);
translate([iXOffset,iYOffset,0]) cylinder(h=iPostHeight, r1=hole_rad+3, r2=hole_rad+1);
//make hole for the screw
translate([iXOffset,iYOffset,0])
linear_extrude(height = iPostHeight+1) circle(r=hole_rad);
}
}
}