diff --git a/readme.md b/readme.md index 12f7f4e..67a2b47 100644 --- a/readme.md +++ b/readme.md @@ -69,6 +69,7 @@ Axial components for PCBs. ### Modules | Module | Description | |:--- |:--- | +| ```ax_res(type, value, tol = 5, pitch = 0)``` | Through hole axial resistor. If ```pitch``` is zero the minimum is used. If below the minimum the resistor is placed vertical. | | ```wire_link(d, l, h = 1)``` | Draw a wire jumper link. | ![axials](tests/png/axials.png) diff --git a/tests/axials.scad b/tests/axials.scad index 15e1dbb..ea3d430 100644 --- a/tests/axials.scad +++ b/tests/axials.scad @@ -29,11 +29,11 @@ module axials() { wire_link(0.8, inch(0.4)); for(i = [0 : len(ax_resistors) - 1]) { - pcb_grid(pcb, 2 * i + 1, 1 + [0, 0.5, 1.5][i]) + pcb_grid(pcb, 2 * i + 2, 1 + [0, 0.5, 1.5][i]) rotate(90) ax_res(ax_resistors[i], [1000, 47000, 8200][i], 5); - pcb_grid(pcb, 2 * i + 1, 6.5) + pcb_grid(pcb, 2 * i + 2, 6.5) rotate(-90) ax_res(ax_resistors[i], [2200, 39000, 8250][i], 1, inch(0.1)); } diff --git a/tests/png/axials.png b/tests/png/axials.png index a487181..80bcd75 100644 Binary files a/tests/png/axials.png and b/tests/png/axials.png differ diff --git a/vitamins/axial.scad b/vitamins/axial.scad index 7c35b57..9cc2a28 100644 --- a/vitamins/axial.scad +++ b/vitamins/axial.scad @@ -54,7 +54,7 @@ function ax_res_end_l(type) = type[5]; //! End cap length function ax_res_wire(type) = type[6]; //! Wire diameter function ax_res_colour(type) = type[7]; //! Body colour -module orient_axial(length, height, pitch, wire_d) { +module orientate_axial(length, height, pitch, wire_d) { // Orient horizontal or vertical and add the wires min_pitch = ceil((length + 1) / inch(0.1)) * inch(0.1); lead_pitch = pitch ? pitch : min_pitch; if(lead_pitch >= min_pitch) { @@ -71,7 +71,7 @@ module orient_axial(length, height, pitch, wire_d) { } } -module ax_res(type, value, tol = 5, pitch = 0) { +module ax_res(type, value, tol = 5, pitch = 0) { //! Through hole axial resistor. If ```pitch``` is zero the minimum is used. If below the minimum the resistor is placed vertical. vitamin(str("ax_res(", type[0], ", ", value, arg(tol, 5, "tol"), "): Resistor ", value, " Ohms ", tol, "% ",ax_res_wattage(type), "W")); wire_d = ax_res_wire(type); @@ -121,7 +121,7 @@ module ax_res(type, value, tol = 5, pitch = 0) { square([50, 100]); } - orient_axial(length, h, pitch, wire_d) { + orientate_axial(length, h, pitch, wire_d) { color(ax_res_colour(type)) rotate_extrude() profile();