diff --git a/libtest.png b/libtest.png index e7dfb84..8208a69 100644 Binary files a/libtest.png and b/libtest.png differ diff --git a/readme.md b/readme.md index 88b0a5c..5bdaac1 100644 --- a/readme.md +++ b/readme.md @@ -2010,6 +2010,8 @@ A permanent magnet that can be magnatized and de-magnatized electronically. | Function | Description | |:--- |:--- | | ```opengrab_depth()``` | Module height | +| ```opengrab_pcb()``` | The PCB | +| ```opengrab_pcb_z()``` | PCB offset from the front | | ```opengrab_target_thickness()``` | Target sheet thickness | | ```opengrab_width()``` | Module width | diff --git a/tests/opengrab.scad b/tests/opengrab.scad index 431c1d5..6a8b126 100644 --- a/tests/opengrab.scad +++ b/tests/opengrab.scad @@ -21,11 +21,11 @@ include <../utils/core/core.scad> use <../vitamins/opengrab.scad> module opengrab_test() { - opengrab_target(); - rotate(45) - translate_z(opengrab_target_thickness()) - opengrab(); + opengrab_target(); + + translate_z(opengrab_target_thickness()) + opengrab(); } if($preview) diff --git a/tests/png/opengrab.png b/tests/png/opengrab.png index a5e1839..150e34c 100644 Binary files a/tests/png/opengrab.png and b/tests/png/opengrab.png differ diff --git a/vitamins/opengrab.scad b/vitamins/opengrab.scad index 9181c9f..7a78e87 100644 --- a/vitamins/opengrab.scad +++ b/vitamins/opengrab.scad @@ -24,18 +24,27 @@ // include <../utils/core/core.scad> use <../utils/thread.scad> +use +include pitch = 33.8 / 2; width = 40; depth = 18; magnet = 4.3; -pcb = 0.8; pillar = 6; target = 1; pole_w = 2; pole_l = 36; poles = 15; +pcb = ["", "", width, width, 0.8, 0, 3.5, 0, "darkgreen", false, [], + [ [ 3.45, 19, 0, "button_4p5mm"], + [ 2.75, 24.5, 0, "smd_led", LED0805, "green"], + [ 2.75, 28.0, 0, "smd_led", LED0805, "red"], + [ 28.5, 13, 0, "2p54header", 3, 1, false, undef, true], + ]]; + + module opengrab_hole_positions() //! Position children at the screw positions let($d = 3.2) for($x = [-pitch, pitch], $y = [-pitch, pitch]) @@ -48,9 +57,11 @@ module opengrab_side_hole_positions() //! Position children at the two 4mm hole translate([$x, 0]) children(); -function opengrab_width() = width; //! Module width -function opengrab_depth() = depth; //! Module height -function opengrab_target_thickness() = target; //! Target sheet thickness +function opengrab_width() = width; //! Module width +function opengrab_depth() = depth; //! Module height +function opengrab_target_thickness() = target; //! Target sheet thickness +function opengrab_pcb() = pcb; //! The PCB +function opengrab_pcb_z() = depth - pillar - pcb_thickness(pcb); //! PCB offset from the front module opengrab() { //! Draw OpenGrab module vitamin("opengrab(): OpenGrab V3 electro permanent magnet"); @@ -67,10 +78,9 @@ module opengrab() { //! Draw OpenGrab module cube([pole_w, pole_l, 1], center = true); } - color("darkgreen") - translate_z(depth - pillar - pcb / 2) - cube([width, width, pcb], center = true); - + not_on_bom() + translate_z(opengrab_pcb_z()) + pcb(pcb); translate_z(1) opengrab_hole_positions() {