From 56ec8e03ad2f5cea2fd13382a916a0a218e1ace5 Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Wed, 15 Jan 2020 15:50:18 +0000 Subject: [PATCH 1/2] Added PCB buzzer. --- vitamins/pcb.scad | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vitamins/pcb.scad b/vitamins/pcb.scad index f14f3e8..deec347 100644 --- a/vitamins/pcb.scad +++ b/vitamins/pcb.scad @@ -200,6 +200,17 @@ module jack(cutout = false) { //! Draw 3.5mm jack } } +module buzzer(height, diameter, colour) { //! Draw PCB buzzer with specified height, diameter and color + color (colour) + linear_extrude(height) + difference() { + circle(d = diameter); + circle(d = height > 5 ? 2 : 1.5); + } + color("white") + cylinder(d = 2, h = max(height - 3 , 0.5)); +} + function hdmi_depth(type) = type[2]; //! Front to back depth function hdmi_width1(type) = type[3]; //! Inside width at the top function hdmi_width2(type) = type[4]; //! Inside width at the bottom @@ -710,6 +721,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon if(show(comp, "usb_Ax2")) usb_Ax2(cutouts); if(show(comp, "usb_uA")) usb_uA(cutouts); if(show(comp, "usb_B")) usb_B(cutouts); + if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey20)); if(show(comp, "jack")) jack(cutouts); if(show(comp, "barrel_jack")) barrel_jack(cutouts); if(show(comp, "hdmi")) hdmi(hdmi_full, cutouts); From b7b5c837bd9743ffa5df12945618f70ee2f695fc Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Mon, 17 Feb 2020 19:40:49 +0000 Subject: [PATCH 2/2] Used tube for buzzer. --- vitamins/pcb.scad | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vitamins/pcb.scad b/vitamins/pcb.scad index deec347..6d1b823 100644 --- a/vitamins/pcb.scad +++ b/vitamins/pcb.scad @@ -202,11 +202,7 @@ module jack(cutout = false) { //! Draw 3.5mm jack module buzzer(height, diameter, colour) { //! Draw PCB buzzer with specified height, diameter and color color (colour) - linear_extrude(height) - difference() { - circle(d = diameter); - circle(d = height > 5 ? 2 : 1.5); - } + tube(or = diameter / 2, ir = height > 5 ? 1 : 0.75, h = height); color("white") cylinder(d = 2, h = max(height - 3 , 0.5)); }