1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-10-01 09:26:48 +02:00

Compare commits

..

11 Commits

Author SHA1 Message Date
Chris Palmer
332933a4fd Made ribbon_clamps parametric on screw size. 2020-09-11 19:53:14 +01:00
Chris Palmer
6b0132c32e Added chamfer option to poly_cylinder(). 2020-09-11 12:36:37 +01:00
Chris Palmer
afac5f9737 Added PCB components to OpenGrab and functions to access PCB. 2020-09-11 12:35:22 +01:00
Chris Palmer
8d8df3cb8a Added 4.5mm button to PCBs. 2020-09-11 12:30:00 +01:00
Chris Palmer
81eb183db9 Fixed PCB cutout for right angle pin headers. 2020-09-11 12:24:07 +01:00
Chris Palmer
c99ed98a64 Can now have right angle pin headers on PCBs.
Fixed bugs right angle pin headers with rows not equal to two.
Added more tests for pin headers.
2020-09-11 00:20:28 +01:00
Chris Palmer
7f65e5d539 Added M2 dome head screws. 2020-09-10 18:38:24 +01:00
Chris Palmer
ffb7f87cc5 Fixed typo in insert name. 2020-09-10 18:27:56 +01:00
Chris Palmer
d0513c7299 Bodge to jhead to allow the ziptie and sleaving to be removed by setting naked to undef. 2020-09-06 12:33:44 +01:00
Chris Palmer
d1429a3b7d Verboard can now have components on the underside, same as PCBs. 2020-09-06 12:32:42 +01:00
Chris Palmer
70513993bd Can now put wire links on PCBs 2020-09-06 12:31:41 +01:00
35 changed files with 220 additions and 118 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 KiB

After

Width:  |  Height:  |  Size: 819 KiB

View File

@@ -117,17 +117,17 @@ cable_grommets_y = 0;
translate([x5, cable_grommets_y]) translate([x5, cable_grommets_y])
cable_grommets(); cable_grommets();
translate([x5, cable_grommets_y + 50]) translate([x5 + 80, cable_grommets_y])
feet(); ribbon_clamps();
translate([x5, cable_grommets_y + 75]) translate([x5, cable_grommets_y + 60])
fixing_blocks(); fixing_blocks();
translate([x5, cable_grommets_y + 100]) translate([x5, cable_grommets_y + 90])
corner_blocks(); corner_blocks();
translate([x5, cable_grommets_y + 150]) translate([x5, cable_grommets_y + 150])
ribbon_clamps(); feet();
translate([x5 + 70, cable_grommets_y + 150]) translate([x5 + 70, cable_grommets_y + 150])
screw_knobs(); screw_knobs();

View File

@@ -24,69 +24,72 @@ include <../core.scad>
use <../vitamins/insert.scad> use <../vitamins/insert.scad>
use <../vitamins/cable_strip.scad> use <../vitamins/cable_strip.scad>
wall = 2; wall = 1.6;
min_wall = 2 * extrusion_width; min_wall = 2 * extrusion_width;
screw = M3_cap_screw; screw = M3_cap_screw;
insert = screw_insert(screw);
screw_depth = insert_length(insert) + 1;
function ribbon_clamp_hole_pitch(ways) = ribbon_clamp_slot(ways) + 2 * min_wall + 2 * corrected_radius(insert_hole_radius(insert)); //! Hole pitch function ribbon_clamp_screw_depth(screw = screw) = insert_length(screw_insert(screw)) + 1;
function ribbon_clamp_width() = 2 * (insert_hole_radius(insert) + wall); //! Width function ribbon_clamp_hole_pitch(ways, screw = screw) =
function ribbon_clamp_length(ways) = ribbon_clamp_hole_pitch(ways) + ribbon_clamp_width(); //! Length given ways ribbon_clamp_slot(ways) + 2 * min_wall + 2 * corrected_radius(insert_hole_radius(screw_insert(screw))); //! Hole pitch
function ribbon_clamp_height() = screw_depth + 1; //! Height
module ribbon_clamp_hole_positions(ways, side = undef) //! Place children at hole positions function ribbon_clamp_width(screw = screw) = 2 * (insert_hole_radius(screw_insert(screw)) + wall); //! Width
function ribbon_clamp_length(ways, screw = screw) = ribbon_clamp_hole_pitch(ways, screw) + ribbon_clamp_width(screw); //! Length given ways
function ribbon_clamp_height(screw = screw) = ribbon_clamp_screw_depth(screw) + 1; //! Height
module ribbon_clamp_hole_positions(ways, screw = screw, side = undef) //! Place children at hole positions
for(x = is_undef(side) ? [-1, 1] : side) for(x = is_undef(side) ? [-1, 1] : side)
translate([x * ribbon_clamp_hole_pitch(ways) / 2, 0]) translate([x * ribbon_clamp_hole_pitch(ways, screw) / 2, 0])
children(); children();
module ribbon_clamp_holes(ways, h = 20) //! Drill screw holes module ribbon_clamp_holes(ways, h = 20, screw = screw) //! Drill screw holes
ribbon_clamp_hole_positions(ways) ribbon_clamp_hole_positions(ways, screw)
drill(screw_clearance_radius(screw), h); drill(screw_clearance_radius(screw), h);
module ribbon_clamp(ways) { //! Generate STL for given number of ways module ribbon_clamp(ways, screw = screw) { //! Generate STL for given number of ways
stl(str("ribbon_clamp_", ways)); screw_d = screw_radius(screw) * 2;
stl(str("ribbon_clamp_", ways, screw_d != 3 ? str("_", screw_d) : ""));
pitch = ribbon_clamp_hole_pitch(ways); pitch = ribbon_clamp_hole_pitch(ways, screw);
d = ribbon_clamp_width(); d = ribbon_clamp_width(screw);
h = ribbon_clamp_height(); h = ribbon_clamp_height(screw);
t = h - ribbon_clamp_slot_depth() - wall; t = round_to_layer(ribbon_clamp_slot_depth() + wall);
insert = screw_insert(screw);
difference() { difference() {
union() { union() {
hull() { hull() {
translate_z(h - t / 2) translate_z(h - t / 2)
cube([ribbon_clamp_hole_pitch(ways), d, t], center = true); cube([ribbon_clamp_hole_pitch(ways, screw), d, t], center = true);
translate_z(1) translate_z(1)
cube([pitch, max(wall, d - 2 * (h - t)), 2], center = true); cube([pitch, max(wall, d - 2 * (h - t)), 2], center = true);
} }
ribbon_clamp_hole_positions(ways, -1) ribbon_clamp_hole_positions(ways, screw, -1)
cylinder(d = d, h = h); cylinder(d = d, h = h);
ribbon_clamp_hole_positions(ways, 1) ribbon_clamp_hole_positions(ways, screw, 1)
cylinder(d = d, h = h); cylinder(d = d, h = h);
} }
translate_z(h) translate_z(h)
cube([ribbon_clamp_slot(ways), d + 1, ribbon_clamp_slot_depth() * 2], center = true); cube([ribbon_clamp_slot(ways), d + 1, ribbon_clamp_slot_depth() * 2], center = true);
ribbon_clamp_hole_positions(ways) ribbon_clamp_hole_positions(ways, screw)
translate_z(h) translate_z(h)
rotate(22.5) rotate(22.5)
insert_hole(insert, screw_depth - insert_length(insert)); insert_hole(insert, ribbon_clamp_screw_depth(screw) - insert_length(insert));
} }
} }
module ribbon_clamp_assembly(ways) pose([55, 180, 25]) //! Printed part with inserts in place module ribbon_clamp_assembly(ways, screw) pose([55, 180, 25]) //! Printed part with inserts in place
assembly(str("ribbon_clamp_", ways)) { assembly(let(screw_d = screw_radius(screw) * 2)str("ribbon_clamp_", ways, screw_d != 3 ? str("_", screw_d) : "")) {
h = ribbon_clamp_height(); h = ribbon_clamp_height(screw);
insert = screw_insert(screw);
stl_colour(pp1_colour) render() stl_colour(pp1_colour) render()
translate_z(h) vflip() ribbon_clamp(ways); translate_z(h) vflip() ribbon_clamp(ways, screw);
ribbon_clamp_hole_positions(ways) ribbon_clamp_hole_positions(ways, screw)
vflip() vflip()
insert(insert); insert(insert);
} }
@@ -99,20 +102,24 @@ module ribbon_clamp_fastened_assembly(ways, thickness, screw = screw) { //! Clam
vitamin(str(": Tape self amalgamating silicone ",tape_l," x 25mm")); vitamin(str(": Tape self amalgamating silicone ",tape_l," x 25mm"));
washer = screw_washer(screw); washer = screw_washer(screw);
screw_length = screw_shorter_than(2 * washer_thickness(washer) + thickness + screw_depth); screw_length = screw_shorter_than(2 * washer_thickness(washer) + thickness + ribbon_clamp_screw_depth(screw));
ribbon_clamp_assembly(ways); ribbon_clamp_assembly(ways, screw);
color("red") translate_z(tape_thickness / 2) color("red") translate_z(tape_thickness / 2)
cube([tape_l, tape_width, tape_thickness], center = true); cube([tape_l, tape_width, tape_thickness], center = true);
ribbon_clamp_hole_positions(ways) ribbon_clamp_hole_positions(ways, screw)
vflip() vflip()
translate_z(thickness) translate_z(thickness)
screw_and_washer(screw, screw_length, true); screw_and_washer(screw, screw_length, true);
} }
module ribbon_clamp_20_stl() ribbon_clamp(20); module ribbon_clamp_20_stl() ribbon_clamp(20);
module ribbon_clamp_8_2_stl() ribbon_clamp(8, M2_dome_screw);
//! * Place inserts into the holes and press home with a soldering iron with a conical bit heated to 200&deg;C. //! * Place inserts into the holes and press home with a soldering iron with a conical bit heated to 200&deg;C.
module ribbon_clamp_20_assembly() ribbon_clamp_assembly(20); module ribbon_clamp_20_assembly() ribbon_clamp_assembly(20);
//! * Place inserts into the holes and press home with a soldering iron with a conical bit heated to 200&deg;C.
module ribbon_clamp_8_2_assembly() ribbon_clamp_assembly(8, M2_dome_screw);

View File

@@ -85,6 +85,7 @@ Axial components for PCBs.
| 1 | ```ax_res(res1_4, 47000)``` | Resistor 47000 Ohms 5% 0.25W | | 1 | ```ax_res(res1_4, 47000)``` | Resistor 47000 Ohms 5% 0.25W |
| 1 | ```ax_res(res1_2, 8200)``` | Resistor 8200 Ohms 5% 0.5W | | 1 | ```ax_res(res1_2, 8200)``` | Resistor 8200 Ohms 5% 0.5W |
| 1 | ```ax_res(res1_2, 8250, tol = 1)``` | Resistor 8250 Ohms 1% 0.5W | | 1 | ```ax_res(res1_2, 8250, tol = 1)``` | Resistor 8250 Ohms 1% 0.5W |
| 1 | ```wire_link(0.8, 10.16)``` | Wire link 0.8mm x 0.4" |
<a href="#top">Top</a> <a href="#top">Top</a>
@@ -1267,7 +1268,7 @@ Heatfit threaded inserts. Can be pushed into thermoplastics using a soldering ir
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | ```insert(F1BM)``` | Heatfit insert M2 | | 1 | ```insert(F1BM2)``` | Heatfit insert M2 |
| 1 | ```insert(F1BM2p5)``` | Heatfit insert M2.5 | | 1 | ```insert(F1BM2p5)``` | Heatfit insert M2.5 |
| 1 | ```insert(F1BM3)``` | Heatfit insert M3 | | 1 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 1 | ```insert(F1BM4)``` | Heatfit insert M4 | | 1 | ```insert(F1BM4)``` | Heatfit insert M4 |
@@ -2009,6 +2010,8 @@ A permanent magnet that can be magnatized and de-magnatized electronically.
| Function | Description | | Function | Description |
|:--- |:--- | |:--- |:--- |
| ```opengrab_depth()``` | Module height | | ```opengrab_depth()``` | Module height |
| ```opengrab_pcb()``` | The PCB |
| ```opengrab_pcb_z()``` | PCB offset from the front |
| ```opengrab_target_thickness()``` | Target sheet thickness | | ```opengrab_target_thickness()``` | Target sheet thickness |
| ```opengrab_width()``` | Module width | | ```opengrab_width()``` | Module width |
@@ -2211,6 +2214,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | ```smd_resistor(RES0603, 1K)``` | SMD resistor 0603 1K 0.1W | | 1 | ```smd_resistor(RES0603, 1K)``` | SMD resistor 0603 1K 0.1W |
| 1 | ```smd_resistor(RES0805, 1K)``` | SMD resistor 0805 1K 0.125W | | 1 | ```smd_resistor(RES0805, 1K)``` | SMD resistor 0805 1K 0.125W |
| 1 | ```smd_resistor(RES1206, 1K)``` | SMD resistor 1206 1K 0.25W | | 1 | ```smd_resistor(RES1206, 1K)``` | SMD resistor 1206 1K 0.25W |
| 1 | ```square_button(button_4p5mm)``` | Square button 4.5mm |
| 1 | ```square_button(button_6mm)``` | Square button 6mm | | 1 | ```square_button(button_6mm)``` | Square button 6mm |
| 1 | ```pcb(TMC2130)``` | TMC2130 | | 1 | ```pcb(TMC2130)``` | TMC2130 |
| 1 | ```green_terminal(gt_5p08, 2)``` | Terminal block 2 way 0.2" | | 1 | ```green_terminal(gt_5p08, 2)``` | Terminal block 2 way 0.2" |
@@ -2223,6 +2227,8 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 2 | ```green_terminal(gt_3p5, 4)``` | Terminal block 4 way 3.5mm | | 2 | ```green_terminal(gt_3p5, 4)``` | Terminal block 4 way 3.5mm |
| 1 | ```terminal_35(4)``` | Terminal block 4 way 3.5mm | | 1 | ```terminal_35(4)``` | Terminal block 4 way 3.5mm |
| 1 | ```pcb(TestPCB)``` | Test PCB | | 1 | ```pcb(TestPCB)``` | Test PCB |
| 1 | ```wire_link(0.8, 5.08, h = 10.16)``` | Wire link 0.8mm x 0.2" |
| 1 | ```wire_link(0.8, 10.16)``` | Wire link 0.8mm x 0.4" |
<a href="#top">Top</a> <a href="#top">Top</a>
@@ -2473,7 +2479,7 @@ Pin headers and sockets, etc.
|:--- |:--- | |:--- |:--- |
| ```box_header(type, cols = 1, rows = 1, smt = false, cutout = false)``` | Draw box header | | ```box_header(type, cols = 1, rows = 1, smt = false, cutout = false)``` | Draw box header |
| ```idc_transition(type, cols = 5, skip = [], cutout = false)``` | Draw IDC transition header | | ```idc_transition(type, cols = 5, skip = [], cutout = false)``` | Draw IDC transition header |
| ```jst_xh_header(type, pin_count, right_angle=false, colour, pin_colour)``` | Draw JST XH connector | | ```jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false)``` | Draw JST XH connector |
| ```pin(type, length = undef)``` | Draw a header pin | | ```pin(type, length = undef)``` | Draw a header pin |
| ```pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour)``` | Draw pin header | | ```pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour)``` | Draw pin header |
| ```pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour)``` | Draw pin socket | | ```pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour)``` | Draw pin socket |
@@ -2484,11 +2490,18 @@ Pin headers and sockets, etc.
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | ```box_header(2p54header, 10, 2)``` | Box header 10 x 2 | | 1 | ```box_header(2p54header, 10, 2)``` | Box header 10 x 2 |
| 1 | ```box_header(2p54header, 8, 1)``` | Box header 8 x 1 |
| 1 | ```idc_transition(2p54header, 10)``` | IDC transition header 10 x 2 | | 1 | ```idc_transition(2p54header, 10)``` | IDC transition header 10 x 2 |
| 1 | ```pin_header(2p54header, 10, 2)``` | Pin header 10 x 2 | | 1 | ```pin_header(2p54header, 10, 2)``` | Pin header 10 x 2 |
| 1 | ```pin_header(2p54header, 10, 2, right_angle = true)``` | Pin header 10 x 2 right_angle | | 1 | ```pin_header(2p54header, 3, 1, right_angle = true)``` | Pin header 3 x 1 right_angle |
| 1 | ```pin_header(2p54header, 3, 2, right_angle = true)``` | Pin header 3 x 2 right_angle |
| 1 | ```pin_header(2p54header, 3, 3, right_angle = true)``` | Pin header 3 x 3 right_angle |
| 1 | ```pin_header(2p54header, 8, 1)``` | Pin header 8 x 1 |
| 1 | ```pin_socket(2p54header, 10, 2)``` | Pin socket 10 x 2 | | 1 | ```pin_socket(2p54header, 10, 2)``` | Pin socket 10 x 2 |
| 1 | ```pin_socket(2p54header, 10, 2, right_angle = true)``` | Pin socket 10 x 2 right_angle | | 1 | ```pin_socket(2p54header, 3, 1, right_angle = true)``` | Pin socket 3 x 1 right_angle |
| 1 | ```pin_socket(2p54header, 3, 2, right_angle = true)``` | Pin socket 3 x 2 right_angle |
| 1 | ```pin_socket(2p54header, 3, 3, right_angle = true)``` | Pin socket 3 x 3 right_angle |
| 1 | ```pin_socket(2p54header, 8, 1)``` | Pin socket 8 x 1 |
<a href="#top">Top</a> <a href="#top">Top</a>
@@ -2919,6 +2932,7 @@ Machine screws and wood screws with various head styles.
| 1 | ```screw(No632_pan_screw, 30)``` | Screw 6-32 pan x 30mm | | 1 | ```screw(No632_pan_screw, 30)``` | Screw 6-32 pan x 30mm |
| 1 | ```screw(M2_cap_screw, 10)``` | Screw M2 cap x 10mm | | 1 | ```screw(M2_cap_screw, 10)``` | Screw M2 cap x 10mm |
| 1 | ```screw(M2_cs_cap_screw, 10)``` | Screw M2 cs cap x 10mm | | 1 | ```screw(M2_cs_cap_screw, 10)``` | Screw M2 cs cap x 10mm |
| 1 | ```screw(M2_dome_screw, 10)``` | Screw M2 dome x 10mm |
| 1 | ```screw(M2p5_cap_screw, 10)``` | Screw M2.5 cap x 10mm | | 1 | ```screw(M2p5_cap_screw, 10)``` | Screw M2.5 cap x 10mm |
| 1 | ```screw(M2p5_pan_screw, 10)``` | Screw M2.5 pan x 10mm | | 1 | ```screw(M2p5_pan_screw, 10)``` | Screw M2.5 pan x 10mm |
| 1 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm | | 1 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
@@ -4286,7 +4300,7 @@ Star washers can be omitted by setting ```star_washers``` to false.
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 3 | ```insert(F1BM)``` | Heatfit insert M2 | | 3 | ```insert(F1BM2)``` | Heatfit insert M2 |
| 3 | ```insert(F1BM2p5)``` | Heatfit insert M2.5 | | 3 | ```insert(F1BM2p5)``` | Heatfit insert M2.5 |
| 3 | ```insert(F1BM3)``` | Heatfit insert M3 | | 3 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 3 | ```insert(F1BM4)``` | Heatfit insert M4 | | 3 | ```insert(F1BM4)``` | Heatfit insert M4 |
@@ -4506,7 +4520,7 @@ Star washers can be omitted by setting ```star_washers``` to false.
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 3 | ```insert(F1BM)``` | Heatfit insert M2 | | 3 | ```insert(F1BM2)``` | Heatfit insert M2 |
| 3 | ```insert(F1BM2p5)``` | Heatfit insert M2.5 | | 3 | ```insert(F1BM2p5)``` | Heatfit insert M2.5 |
| 3 | ```insert(F1BM3)``` | Heatfit insert M3 | | 3 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 3 | ```insert(F1BM4)``` | Heatfit insert M4 | | 3 | ```insert(F1BM4)``` | Heatfit insert M4 |
@@ -4836,7 +4850,7 @@ It can also have printed feet on the base with the screws doubling up to hold th
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 4 | ```insert(F1BM)``` | Heatfit insert M2 | | 4 | ```insert(F1BM2)``` | Heatfit insert M2 |
| 4 | ```insert(F1BM3)``` | Heatfit insert M3 | | 4 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 4 | ```screw(M2_cap_screw, 6)``` | Screw M2 cap x 6mm | | 4 | ```screw(M2_cap_screw, 6)``` | Screw M2 cap x 6mm |
| 3 | ```screw(M3_pan_screw, 6)``` | Screw M3 pan x 6mm | | 3 | ```screw(M3_pan_screw, 6)``` | Screw M3 pan x 6mm |
@@ -4935,41 +4949,48 @@ Clamp for ribbon cable and polypropylene strip.
### Functions ### Functions
| Function | Description | | Function | Description |
|:--- |:--- | |:--- |:--- |
| ```ribbon_clamp_height()``` | Height | | ```ribbon_clamp_height(screw = screw)``` | Height |
| ```ribbon_clamp_hole_pitch(ways)``` | Hole pitch | | ```ribbon_clamp_length(ways, screw = screw)``` | Length given ways |
| ```ribbon_clamp_length(ways)``` | Length given ways | | ```ribbon_clamp_width(screw = screw)``` | Width |
| ```ribbon_clamp_width()``` | Width |
### Modules ### Modules
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| ```ribbon_clamp(ways)``` | Generate STL for given number of ways | | ```ribbon_clamp(ways, screw = screw)``` | Generate STL for given number of ways |
| ```ribbon_clamp_assembly(ways)``` | Printed part with inserts in place | | ```ribbon_clamp_assembly(ways, screw)``` | Printed part with inserts in place |
| ```ribbon_clamp_fastened_assembly(ways, thickness, screw = screw)``` | Clamp with fasteners in place | | ```ribbon_clamp_fastened_assembly(ways, thickness, screw = screw)``` | Clamp with fasteners in place |
| ```ribbon_clamp_hole_positions(ways, side = undef)``` | Place children at hole positions | | ```ribbon_clamp_hole_positions(ways, screw = screw, side = undef)``` | Place children at hole positions |
| ```ribbon_clamp_holes(ways, h = 20)``` | Drill screw holes | | ```ribbon_clamp_holes(ways, h = 20, screw = screw)``` | Drill screw holes |
![ribbon_clamp](tests/png/ribbon_clamp.png) ![ribbon_clamp](tests/png/ribbon_clamp.png)
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 2 | ```insert(F1BM2)``` | Heatfit insert M2 |
| 2 | ```insert(F1BM3)``` | Heatfit insert M3 | | 2 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 1 | | Ribbon cable 20 way 100mm | | 1 | | Ribbon cable 20 way 100mm |
| 1 | | Ribbon cable 8 way 100mm |
| 2 | ```screw(M2_dome_screw, 8)``` | Screw M2 dome x 8mm |
| 2 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm | | 2 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
| 1 | | Tape self amalgamating silicone 11 x 25mm |
| 1 | | Tape self amalgamating silicone 26 x 25mm | | 1 | | Tape self amalgamating silicone 26 x 25mm |
| 2 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
| 2 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm | | 2 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 2 | ```star_washer(M2_washer)``` | Washer star M2 x 0.3mm |
| 2 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm | | 2 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
### Printed ### Printed
| Qty | Filename | | Qty | Filename |
| ---:|:--- | | ---:|:--- |
| 1 | ribbon_clamp_20.stl | | 1 | ribbon_clamp_20.stl |
| 1 | ribbon_clamp_8_2.stl |
### Assemblies ### Assemblies
| Qty | Name | | Qty | Name |
| ---:|:--- | | ---:|:--- |
| 1 | ribbon_clamp_20_assembly | | 1 | ribbon_clamp_20_assembly |
| 1 | ribbon_clamp_8_2_assembly |
<a href="#top">Top</a> <a href="#top">Top</a>
@@ -5846,7 +5867,7 @@ The module provides `poly_circle()`, `poly_cylinder()` and `poly_ring()` that is
|:--- |:--- | |:--- |:--- |
| ```drill(r, h = 100, center = true)``` | Make a cylinder for drilling holes suitable for CNC routing, set h = 0 for circle | | ```drill(r, h = 100, center = true)``` | Make a cylinder for drilling holes suitable for CNC routing, set h = 0 for circle |
| ```poly_circle(r, sides = 0)``` | Make a circle adjusted to print the correct size | | ```poly_circle(r, sides = 0)``` | Make a circle adjusted to print the correct size |
| ```poly_cylinder(r, h, center = false, sides = 0)``` | Make a cylinder adjusted to print the correct size | | ```poly_cylinder(r, h, center = false, sides = 0, chamfer = false)``` | Make a cylinder adjusted to print the correct size |
| ```poly_drill(r, h = 100, center = true)``` | Make a cylinder for drilling holes suitable for CNC routing if cnc_bit_r is non zero, otherwise a poly_cylinder. | | ```poly_drill(r, h = 100, center = true)``` | Make a cylinder for drilling holes suitable for CNC routing if cnc_bit_r is non zero, otherwise a poly_cylinder. |
| ```poly_ring(or, ir, sides = 0)``` | Make a 2D ring adjusted to have the correct internal radius | | ```poly_ring(or, ir, sides = 0)``` | Make a 2D ring adjusted to have the correct internal radius |
| ```poly_tube(or, ir, h, center = false)``` | Make a tube adjusted to have the correct internal radius | | ```poly_tube(or, ir, h, center = false)``` | Make a tube adjusted to have the correct internal radius |

View File

@@ -86,10 +86,13 @@ test_pcb = ["TestPCB", "Test PCB",
[ 5, 218, 180, "hdmi"], [ 5, 218, 180, "hdmi"],
[ 3, 235, 180, "mini_hdmi"], [ 3, 235, 180, "mini_hdmi"],
[ 6, 175, 180, "uSD", [12, 11.5, 1.4]], [ 6, 175, 180, "uSD", [12, 11.5, 1.4]],
[ 65, 9, 0, "link", inch(0.4)],
[ 65, 12, 0, "ax_res", res1_8, 1000], [ 65, 12, 0, "ax_res", res1_8, 1000],
[ 65, 17, 0, "ax_res", res1_4, 10000], [ 65, 17, 0, "ax_res", res1_4, 10000],
[ 65, 22, 0, "ax_res", res1_2, 100000], [ 65, 22, 0, "ax_res", res1_2, 100000],
[ 80, 9, 0, "link", inch(0.2), inch(0.4)],
[ 80, 12, 0, "ax_res", res1_8, 1000000, 1, inch(0.1)], [ 80, 12, 0, "ax_res", res1_8, 1000000, 1, inch(0.1)],
[ 80, 17, 0, "ax_res", res1_4, 100, 2, inch(0.1)], [ 80, 17, 0, "ax_res", res1_4, 100, 2, inch(0.1)],
[ 80, 22, 0, "ax_res", res1_2, 10, 10, inch(0.2)], [ 80, 22, 0, "ax_res", res1_2, 10, 10, inch(0.2)],
@@ -118,7 +121,8 @@ test_pcb = ["TestPCB", "Test PCB",
[ 70, 130, 180, "term35", 3, "lime"], [ 70, 130, 180, "term35", 3, "lime"],
[ 50, 150, 0, "transition", 5], [ 50, 150, 0, "transition", 5],
[ 50, 160, 0, "block", 10, 5, 8, "orange"], [ 50, 160, 0, "block", 10, 5, 8, "orange"],
[ 50, 170, 0, "button_6mm"], [ 45, 170, 0, "button_6mm"],
[ 55, 170, 0, "button_4p5mm"],
[ 50, 185, 0, "microswitch", small_microswitch], [ 50, 185, 0, "microswitch", small_microswitch],
[ 52, 200, 0, "pcb", 11, TMC2130 ], [ 52, 200, 0, "pcb", 11, TMC2130 ],
[ 80, 200, 0, "pdip", 24, "27C32", true, inch(0.6) ], [ 80, 200, 0, "pdip", 24, "27C32", true, inch(0.6) ],

View File

@@ -21,14 +21,14 @@ use <../printed/foot.scad>
module feet() module feet()
if($preview) { if($preview) {
translate([50, 0]) translate([40, 0])
foot_assembly(3); foot_assembly(3);
translate([foot_diameter(insert_foot()) / 2, 0]) translate([foot_diameter(insert_foot()) / 2, 0])
fastened_insert_foot_assembly(3); fastened_insert_foot_assembly(3);
} }
else { else {
translate([50, 0]) translate([40, 0])
foot(); foot();
insert_foot(); insert_foot();

View File

@@ -21,9 +21,9 @@ include <../utils/core/core.scad>
use <../vitamins/opengrab.scad> use <../vitamins/opengrab.scad>
module opengrab_test() { module opengrab_test() {
rotate(45)
opengrab_target(); opengrab_target();
rotate(45)
translate_z(opengrab_target_thickness()) translate_z(opengrab_target_thickness())
opengrab(); opengrab();
} }

View File

@@ -23,26 +23,53 @@ include <../vitamins/pin_headers.scad>
pins = 10; pins = 10;
module pin_headers() module pin_headers() {
layout([for(p = pin_headers) hdr_pitch(p) * pins], 15) { layout([for(p = pin_headers) hdr_pitch(p) * pins], 15) {
idc_transition(pin_headers[$i], 10); idc_transition(pin_headers[$i], 10);
translate([0, 20]) translate([0, 20])
pin_header(pin_headers[$i], 10, 2, right_angle = true); pin_header(pin_headers[$i], 3, 2, right_angle = true);
translate([-10, 20])
pin_header(pin_headers[$i], 3, 1, right_angle = true);
translate([10, 20])
pin_header(pin_headers[$i], 3, 3, right_angle = true);
translate([0, 30])
pin_header(pin_headers[$i], 8, 1);
translate([0, 40]) translate([0, 40])
pin_header(pin_headers[$i], 10, 2); pin_header(pin_headers[$i], 10, 2);
translate([0, 50])
box_header(pin_headers[$i], 8, 1);
translate([0, 60]) translate([0, 60])
box_header(pin_headers[$i], 10, 2); box_header(pin_headers[$i], 10, 2);
translate([0, 70])
pin_socket(pin_headers[$i], 8, 1);
translate([0, 80]) translate([0, 80])
pin_socket(pin_headers[$i], 10, 2); pin_socket(pin_headers[$i], 10, 2);
translate([0, 110]) translate([-10, 105])
pin_socket(pin_headers[$i], 10, 2, right_angle = true); pin_socket(pin_headers[$i], 3, 1, right_angle = true);
translate([0, 105])
pin_socket(pin_headers[$i], 3, 2, right_angle = true);
translate([10, 105])
pin_socket(pin_headers[$i], 3, 3, right_angle = true);
} }
translate([-20, 0])
jst_xh_header(jst_xh_header, 5);
translate([-20, 20])
jst_xh_header(jst_xh_header, 5, true);
}
if($preview) if($preview)
pin_headers(); pin_headers();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 150 KiB

View File

@@ -16,20 +16,22 @@
// You should have received a copy of the GNU General Public License along with NopSCADlib. // You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>. // If not, see <https://www.gnu.org/licenses/>.
// //
include <../utils/core/core.scad> include <../core.scad>
use <../printed/ribbon_clamp.scad> use <../printed/ribbon_clamp.scad>
use <../vitamins/wire.scad> use <../vitamins/wire.scad>
ways = 20; ways = [8, 20];
screws = [M2_dome_screw, M3_cap_screw];
module ribbon_clamps() module ribbon_clamps()
translate([ribbon_clamp_length(ways) / 2, 0]) for(i = [0 : len(screws) - 1])
translate([ribbon_clamp_length(ways[i]) / 2, i * 30])
if($preview) { if($preview) {
ribbon_clamp_fastened_assembly(ways, 3); ribbon_clamp_fastened_assembly(ways[i], 3, screws[i]);
ribbon_cable(ways, 100); ribbon_cable(ways[i], 100);
} }
else else
ribbon_clamp(ways); ribbon_clamp(ways[i], screws[i]);
ribbon_clamps(); ribbon_clamps();

View File

@@ -32,10 +32,14 @@ module poly_circle(r, sides = 0) { //! Make a circle adjusted to print the corre
circle(r = corrected_radius(r,n), $fn = n); circle(r = corrected_radius(r,n), $fn = n);
} }
module poly_cylinder(r, h, center = false, sides = 0) //! Make a cylinder adjusted to print the correct size module poly_cylinder(r, h, center = false, sides = 0, chamfer = false) {//! Make a cylinder adjusted to print the correct size
extrude_if(h, center) extrude_if(h, center)
poly_circle(r, sides); poly_circle(r, sides);
if(h && chamfer)
poly_cylinder(r + layer_height, center ? layer_height * 2 : layer_height, center, sides = sides ? sides : sides(r));
}
module poly_ring(or, ir, sides = 0) { //! Make a 2D ring adjusted to have the correct internal radius module poly_ring(or, ir, sides = 0) { //! Make a 2D ring adjusted to have the correct internal radius
cir = corrected_radius(ir, sides); cir = corrected_radius(ir, sides);
filaments = (or - cir) / extrusion_width; filaments = (or - cir) / extrusion_width;

View File

@@ -24,6 +24,7 @@ include <../utils/core/core.scad>
include <../utils/round.scad> include <../utils/round.scad>
module wire_link(d, l, h = 1, tail = 3) { //! Draw a wire jumper link. module wire_link(d, l, h = 1, tail = 3) { //! Draw a wire jumper link.
vitamin(str("wire_link(", d, ", ", l, arg(h, 1, "h"), arg(tail, 3, "tail"), "): Wire link ", d, "mm x ", l / inch(1), "\""));
r = d; r = d;
$fn = 32; $fn = 32;
@@ -57,12 +58,15 @@ module orientate_axial(length, height, pitch, wire_d) { // Orient horizontal or
min_pitch = ceil((length + 1) / inch(0.1)) * inch(0.1); min_pitch = ceil((length + 1) / inch(0.1)) * inch(0.1);
lead_pitch = pitch ? pitch : min_pitch; lead_pitch = pitch ? pitch : min_pitch;
if(lead_pitch >= min_pitch) { if(lead_pitch >= min_pitch) {
not_on_bom()
wire_link(wire_d, lead_pitch, height); wire_link(wire_d, lead_pitch, height);
translate_z(height) translate_z(height)
rotate([0, 90, 0]) rotate([0, 90, 0])
children(); children();
} }
else { else {
not_on_bom()
wire_link(wire_d, lead_pitch, length + 0.7 + wire_d); wire_link(wire_d, lead_pitch, length + 0.7 + wire_d);
translate([-pitch / 2, 0, length / 2 + 0.2]) translate([-pitch / 2, 0, length / 2 + 0.2])

View File

@@ -29,7 +29,7 @@
// d d h d d // d d h d d
// d // d
// //
F1BM2 = [ "F1BM", 4.0, 3.6, 3.2, 2, 3.0, 1.0, 3.4, 3.1 ]; F1BM2 = [ "F1BM2", 4.0, 3.6, 3.2, 2, 3.0, 1.0, 3.4, 3.1 ];
F1BM2p5 = [ "F1BM2p5", 5.8, 4.6, 4.0, 2.5, 3.65, 1.6, 4.4, 3.9 ]; F1BM2p5 = [ "F1BM2p5", 5.8, 4.6, 4.0, 2.5, 3.65, 1.6, 4.4, 3.9 ];
F1BM3 = [ "F1BM3", 5.8, 4.6, 4.0, 3, 3.65, 1.6, 4.4, 3.9 ]; F1BM3 = [ "F1BM3", 5.8, 4.6, 4.0, 3, 3.65, 1.6, 4.4, 3.9 ];
F1BM4 = [ "F1BM4", 8.2, 6.3, 5.6, 4, 5.15, 2.3, 6.0, 5.55 ]; F1BM4 = [ "F1BM4", 8.2, 6.3, 5.6, 4, 5.15, 2.3, 6.0, 5.55 ];

View File

@@ -138,7 +138,7 @@ module jhead_hot_end_assembly(type, filament, naked = false) { //! Assembly with
// //
// silcone tape // silcone tape
// //
if(!naked) if(is_undef(naked) || !naked)
color("red") color("red")
if(exploded()) if(exploded())
translate([0, max(hot_end_insulator_diameter(type) / 2, heater_length(heater) / 2 - nozzle_x(heater)), translate([0, max(hot_end_insulator_diameter(type) / 2, heater_length(heater) / 2 - nozzle_x(heater)),
@@ -156,7 +156,7 @@ module jhead_hot_end_assembly(type, filament, naked = false) { //! Assembly with
// //
// Zip tie and heatshrink // Zip tie and heatshrink
// //
if(!naked) if(!naked && !is_undef(naked))
rotate(10) { rotate(10) {
dia = hot_end_insulator_diameter(type); dia = hot_end_insulator_diameter(type);
scale([1, (bundle + dia) / dia]) scale([1, (bundle + dia) / dia])

View File

@@ -85,6 +85,7 @@ module meter(type, colour = "red", value = "888", display_colour = false) //! Dr
translate([0, meter_shunt_y(type), size.z]) translate([0, meter_shunt_y(type), size.z])
vflip() vflip()
color("#b87333") color("#b87333")
not_on_bom()
wire_link(shunt.y, shunt.x, shunt.z, tail = 2); wire_link(shunt.y, shunt.x, shunt.z, tail = 2);
} }

View File

@@ -24,18 +24,27 @@
// //
include <../utils/core/core.scad> include <../utils/core/core.scad>
use <../utils/thread.scad> use <../utils/thread.scad>
use <pcb.scad>
include <smds.scad>
pitch = 33.8 / 2; pitch = 33.8 / 2;
width = 40; width = 40;
depth = 18; depth = 18;
magnet = 4.3; magnet = 4.3;
pcb = 0.8;
pillar = 6; pillar = 6;
target = 1; target = 1;
pole_w = 2; pole_w = 2;
pole_l = 36; pole_l = 36;
poles = 15; 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 module opengrab_hole_positions() //! Position children at the screw positions
let($d = 3.2) let($d = 3.2)
for($x = [-pitch, pitch], $y = [-pitch, pitch]) for($x = [-pitch, pitch], $y = [-pitch, pitch])
@@ -51,6 +60,8 @@ module opengrab_side_hole_positions() //! Position children at the two 4mm hole
function opengrab_width() = width; //! Module width function opengrab_width() = width; //! Module width
function opengrab_depth() = depth; //! Module height function opengrab_depth() = depth; //! Module height
function opengrab_target_thickness() = target; //! Target sheet thickness 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 module opengrab() { //! Draw OpenGrab module
vitamin("opengrab(): OpenGrab V3 electro permanent magnet"); vitamin("opengrab(): OpenGrab V3 electro permanent magnet");
@@ -67,10 +78,9 @@ module opengrab() { //! Draw OpenGrab module
cube([pole_w, pole_l, 1], center = true); cube([pole_w, pole_l, 1], center = true);
} }
color("darkgreen") not_on_bom()
translate_z(depth - pillar - pcb / 2) translate_z(opengrab_pcb_z())
cube([width, width, pcb], center = true); pcb(pcb);
translate_z(1) translate_z(1)
opengrab_hole_positions() { opengrab_hole_positions() {

View File

@@ -915,7 +915,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
function param(n, default = 0) = len(comp) > n ? comp[n] : default; function param(n, default = 0) = len(comp) > n ? comp[n] : default;
rotate(comp.z) { rotate(comp.z) {
// Components that have a cutout parameter go in this section // Components that have a cutout parameter go in this section
if(show(comp, "2p54header")) pin_header(2p54header, comp[4], comp[5], param(6, false), false, cutouts, colour = param(7, undef)); if(show(comp, "2p54header")) pin_header(2p54header, comp[4], comp[5], param(6, false), param(8, false), cutouts, colour = param(7, undef));
if(show(comp, "2p54boxhdr")) box_header(2p54header, comp[4], comp[5], param(6, false), cutouts); if(show(comp, "2p54boxhdr")) box_header(2p54header, comp[4], comp[5], param(6, false), cutouts);
if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7, 0), param(8, false), cutouts, param(9, undef)); if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7, 0), param(8, false), cutouts, param(9, undef));
if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], param(7, grey(30)), cutouts); if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], param(7, grey(30)), cutouts);
@@ -940,6 +940,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(!cutouts) { if(!cutouts) {
// Components that don't have a cutout parameter go in this section // Components that don't have a cutout parameter go in this section
if(show(comp, "button_6mm")) square_button(button_6mm); if(show(comp, "button_6mm")) square_button(button_6mm);
if(show(comp, "button_4p5mm")) square_button(button_4p5mm);
if(show(comp, "microswitch")) translate_z(microswitch_thickness(comp[4])/2) microswitch(comp[4]); if(show(comp, "microswitch")) translate_z(microswitch_thickness(comp[4])/2) microswitch(comp[4]);
if(show(comp, "pcb")) translate_z(comp[4]) pcb(comp[5]); if(show(comp, "pcb")) translate_z(comp[4]) pcb(comp[5]);
if(show(comp, "standoff")) standoff(comp[4], comp[5], comp[6], comp[7]); if(show(comp, "standoff")) standoff(comp[4], comp[5], comp[6], comp[7]);
@@ -953,6 +954,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "led")) led(comp[4], comp[5], 2.6); if(show(comp, "led")) led(comp[4], comp[5], 2.6);
if(show(comp, "pdip")) pdip(comp[4], comp[5], param(6, false), param(7, inch(0.3))); if(show(comp, "pdip")) pdip(comp[4], comp[5], param(6, false), param(7, inch(0.3)));
if(show(comp, "ax_res")) ax_res(comp[4], comp[5], param(6, 5), param(7, 0)); if(show(comp, "ax_res")) ax_res(comp[4], comp[5], param(6, 5), param(7, 0));
if(show(comp, "link")) wire_link(l = comp[4], h = param(5, 1), d = param(6, 0.8), tail = param(7, 3));
if(show(comp, "D_plug")) translate_z(d_pcb_offset(comp[4])) d_plug(comp[4], pcb = true); if(show(comp, "D_plug")) translate_z(d_pcb_offset(comp[4])) d_plug(comp[4], pcb = true);
if(show(comp, "molex_hdr")) molex_254(comp[4]); if(show(comp, "molex_hdr")) molex_254(comp[4]);
if(show(comp, "jst_xh")) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, "white"), param(7, undef)); if(show(comp, "jst_xh")) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, "white"), param(7, undef));

View File

@@ -50,26 +50,37 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
ra_offset = 2.4; ra_offset = 2.4;
width = pitch * rows; width = pitch * rows;
if(cutout) module cutout()
dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false); dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false);
if(cutout) {
if(right_angle)
translate_z(width / 2)
rotate([-90, 0, 180])
cutout();
else
cutout();
}
else { else {
vitamin(str("pin_header(", type[0], ", ", cols, ", ", rows, vitamin(str("pin_header(", type[0], ", ", cols, ", ", rows,
arg(smt, false, "smt"), arg(right_angle, false, "right_angle"), "): Pin header ", cols, " x ", rows, right_angle ? " right_angle" : "")); arg(smt, false, "smt"), arg(right_angle, false, "right_angle"), "): Pin header ", cols, " x ", rows, right_angle ? " right_angle" : ""));
translate_z(smt ? 3.5 - h : 0) { translate_z(smt ? 3.5 - h : 0) {
for(x = [0 : cols - 1], y = [0 : rows - 1]) { for(x = [0 : cols - 1], y = [0 : rows - 1]) {
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0]) // Vertical part of the pin
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2)])
if(right_angle) if(right_angle)
pin(type, hdr_pin_below(type) + width / 2 + (y - 0.5) * pitch); pin(type, hdr_pin_below(type) + (y + 0.5) * pitch);
else else
pin(type); pin(type);
if(right_angle) { if(right_angle) {
w = hdr_pin_width(type); w = hdr_pin_width(type);
// Horizontal part of the pin
rotate([-90, 0, 180]) rotate([-90, 0, 180])
translate([pitch * (x - (cols - 1) / 2), -pitch * (y - (rows - 1) / 2) -width / 2, hdr_pin_below(type) - (y - 0.5) * pitch]) translate([pitch * (x - (cols - 1) / 2), -pitch * (y - (rows - 1) / 2) - width / 2, hdr_pin_below(type) - (y - (rows - 1) / 2) * pitch])
pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + pitch / 2 + (y - 0.5) * pitch); pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + pitch / 2 + (y - 0.5) * pitch);
// corner
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2) - w / 2, pitch * (y - (rows - 1) / 2) + width / 2 - w / 2]) translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2) - w / 2, pitch * (y - (rows - 1) / 2) + width / 2 - w / 2])
rotate([0, -90, 0]) rotate([0, -90, 0])
color(hdr_pin_colour(type)) color(hdr_pin_colour(type))
@@ -78,7 +89,8 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
square(w); square(w);
} }
} }
translate([0, right_angle ? -ra_offset - pitch / 2 : 0, right_angle ? width / 2 : 0]) // Insulator
translate([0, right_angle ? -ra_offset - (rows - 1) * pitch / 2 : 0, right_angle ? width / 2 : 0])
rotate([right_angle ? 90 : 0, 0, 0]) rotate([right_angle ? 90 : 0, 0, 0])
color(base_colour) color(base_colour)
linear_extrude(h) linear_extrude(h)
@@ -176,7 +188,7 @@ module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt
vitamin(str("pin_socket(", type[0], ", ", cols, ", ", rows, arg(right_angle, false, "right_angle"), arg(height, 0, "height"), arg(smt, false, "smt"), vitamin(str("pin_socket(", type[0], ", ", cols, ", ", rows, arg(right_angle, false, "right_angle"), arg(height, 0, "height"), arg(smt, false, "smt"),
"): Pin socket ", cols, " x ", rows, right_angle ? " right_angle" : "")); "): Pin socket ", cols, " x ", rows, right_angle ? " right_angle" : ""));
color(base_colour) color(base_colour)
translate([0, right_angle ? -ra_offset - pitch / 2 : 0, right_angle ? width / 2 : 0]) translate([0, right_angle ? -ra_offset - (rows - 1) * pitch / 2 : 0, right_angle ? width / 2 : 0])
rotate([right_angle ? 90 : 0, 0, 0]) rotate([right_angle ? 90 : 0, 0, 0])
translate_z(depth / 2) translate_z(depth / 2)
linear_extrude(depth, center = true) linear_extrude(depth, center = true)
@@ -192,11 +204,11 @@ module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt
for(x = [0 : cols - 1], y = [0 : rows -1]) { for(x = [0 : cols - 1], y = [0 : rows -1]) {
if(!smt) if(!smt)
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0]) translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
pin(type, hdr_pin_below(type) + width / 2 + (y - 0.5) * pitch); pin(type, hdr_pin_below(type) + (y + 0.5) * pitch);
if(right_angle) { if(right_angle) {
rotate([-90, 0, 0]) rotate([-90, 0, 180])
translate([pitch * (x - (cols - 1) / 2), -pitch * (y - (rows - 1) / 2) -width / 2, 0]) translate([pitch * (x - (cols - 1) / 2), -pitch * (y - (rows - 1) / 2) - width / 2, hdr_pin_below(type) - (y - (rows - 1) / 2) * pitch])
pin(type, hdr_pin_below(type) + (y - 0.5) * pitch); pin(type, hdr_pin_below(type) + (y - 0.5) * pitch);
w = hdr_pin_width(type); w = hdr_pin_width(type);
@@ -210,7 +222,7 @@ module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt
} }
} }
module jst_xh_header(type, pin_count, right_angle=false, colour, pin_colour) { //! Draw JST XH connector module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false) { //! Draw JST XH connector
colour = colour ? colour : hdr_base_colour(type); colour = colour ? colour : hdr_base_colour(type);
pin_colour = pin_colour ? pin_colour : hdr_pin_colour(type); pin_colour = pin_colour ? pin_colour : hdr_pin_colour(type);
sizeY = 5.75; sizeY = 5.75;

View File

@@ -25,7 +25,7 @@
// c // c
// //
2p54header = ["2p54header", 2.54, 11.6, 3.2, 0.66, "gold", grey(20), 8.5]; 2p54header = ["2p54header", 2.54, 11.6, 3.2, 0.66, "gold", grey(20), 8.5];
jst_xh_header = ["JST XH header",2.5,10,3.4, 0.64, "gold", grey(90), 7]; jst_xh_header = ["JST XH header",2.5, 10, 3.4, 0.64, "gold", grey(90), 7];
pin_headers = [ 2p54header ]; pin_headers = [ 2p54header ];

View File

@@ -175,12 +175,15 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
if(head_type == hs_dome) { if(head_type == hs_dome) {
lift = 0.38; lift = 0.38;
h = head_height - lift;
r = min(2 * head_height, (sqr(head_rad) + sqr(h)) / 2 * h); // Special case for M2
y = sqrt(sqr(r) - sqr(head_rad));
color(colour) { color(colour) {
rotate_extrude() { rotate_extrude() {
difference() { difference() {
intersection() { intersection() {
translate([0, -head_height + lift]) translate([0, -y + lift])
circle(2 * head_height); circle(r);
square([head_rad, head_height]); square([head_rad, head_height]);
} }

View File

@@ -75,10 +75,11 @@ M5_cap_screw = ["M5_cap", "M5 cap", hs_cap, 5, 8.5, 5, 2.5, 4.0
M6_cap_screw = ["M6_cap", "M6 cap", hs_cap, 6, 10, 6, 3.3, 5.0, 24, M6_washer, M6_nut, M6_tap_radius, M6_clearance_radius]; M6_cap_screw = ["M6_cap", "M6 cap", hs_cap, 6, 10, 6, 3.3, 5.0, 24, M6_washer, M6_nut, M6_tap_radius, M6_clearance_radius];
M8_cap_screw = ["M8_cap", "M8 cap", hs_cap, 8, 13, 8, 4.3, 6.0, 28, M8_washer, M8_nut, M8_tap_radius, M8_clearance_radius]; M8_cap_screw = ["M8_cap", "M8 cap", hs_cap, 8, 13, 8, 4.3, 6.0, 28, M8_washer, M8_nut, M8_tap_radius, M8_clearance_radius];
M2_cs_cap_screw = ["M2_cs_cap","M2 cs cap", hs_cs_cap,2, 3.8, 0, 0.65,1.27,16, M2_washer, M2_nut, M2_tap_radius, M2_clearance_radius]; M2_cs_cap_screw = ["M2_cs_cap","M2 cs cap", hs_cs_cap,2, 3.8, 0, 0.65,1.3, 16, M2_washer, M2_nut, M2_tap_radius, M2_clearance_radius];
M3_cs_cap_screw = ["M3_cs_cap","M3 cs cap", hs_cs_cap,3, 6.0, 0, 1.05,2.0, 18, M3_washer, M3_nut, M3_tap_radius, M3_clearance_radius]; M3_cs_cap_screw = ["M3_cs_cap","M3 cs cap", hs_cs_cap,3, 6.0, 0, 1.05,2.0, 18, M3_washer, M3_nut, M3_tap_radius, M3_clearance_radius];
M4_cs_cap_screw = ["M4_cs_cap","M4 cs cap", hs_cs_cap,4, 8.0, 0, 1.49,2.5, 20, M4_washer, M4_nut, M4_tap_radius, M4_clearance_radius]; M4_cs_cap_screw = ["M4_cs_cap","M4 cs cap", hs_cs_cap,4, 8.0, 0, 1.49,2.5, 20, M4_washer, M4_nut, M4_tap_radius, M4_clearance_radius];
M2_dome_screw = ["M2_dome", "M2 dome", hs_dome, 2, 3.5, 1.3, 0.6, 1.3, 16, M2_washer, M2_nut, M2_tap_radius, M2_clearance_radius];
M3_dome_screw = ["M3_dome", "M3 dome", hs_dome, 3, 5.7, 1.65, 1.04,2.0, 18, M3_washer, M3_nut, M3_tap_radius, M3_clearance_radius]; M3_dome_screw = ["M3_dome", "M3 dome", hs_dome, 3, 5.7, 1.65, 1.04,2.0, 18, M3_washer, M3_nut, M3_tap_radius, M3_clearance_radius];
M4_dome_screw = ["M4_dome", "M4 dome", hs_dome, 4, 7.6, 2.2, 1.3, 2.5, 20, M4_washer, M4_nut, M4_tap_radius, M4_clearance_radius]; M4_dome_screw = ["M4_dome", "M4 dome", hs_dome, 4, 7.6, 2.2, 1.3, 2.5, 20, M4_washer, M4_nut, M4_tap_radius, M4_clearance_radius];
@@ -112,7 +113,7 @@ screw_lists = [
[ 0, M2p5_pan_screw, M3_pan_screw, M4_pan_screw, M5_pan_screw, M6_pan_screw, No632_pan_screw], [ 0, M2p5_pan_screw, M3_pan_screw, M4_pan_screw, M5_pan_screw, M6_pan_screw, No632_pan_screw],
[ 0, No2_screw, No4_screw, No6_screw, No6_cs_screw], [ 0, No2_screw, No4_screw, No6_screw, No6_cs_screw],
[ 0, M2_cs_cap_screw,M3_cs_cap_screw, M4_cs_cap_screw], [ 0, M2_cs_cap_screw,M3_cs_cap_screw, M4_cs_cap_screw],
[ 0, 0, M3_dome_screw, M4_dome_screw], [ 0, M2_dome_screw, M3_dome_screw, M4_dome_screw],
[ 0, 0, M3_grub_screw, M4_grub_screw] [ 0, 0, M3_grub_screw, M4_grub_screw]
]; ];

View File

@@ -132,6 +132,10 @@ module veroboard(type) { //! Draw specified veroboard with missing tracks and tr
module vero_components(type, cutouts = false, angle = undef) module vero_components(type, cutouts = false, angle = undef)
for(comp = vero_components(type)) for(comp = vero_components(type))
vero_grid_pos(type, comp.x, comp.y) vero_grid_pos(type, comp.x, comp.y)
if(comp[3][0] == "-")
vflip()
pcb_component(comp, cutouts, angle);
else
translate_z(vero_thickness(type)) translate_z(vero_thickness(type))
pcb_component(comp, cutouts, angle); pcb_component(comp, cutouts, angle);