1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-07-31 20:50:15 +02:00

Added pcb_grid_components() module for placing parts on a perfboard.

This commit is contained in:
Chris Palmer
2021-09-11 11:46:25 +01:00
parent 181c6ac624
commit 8a838dd1ce
2 changed files with 15 additions and 0 deletions

View File

@@ -2355,6 +2355,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `pcb_components(type, cutouts = false, angle = undef)` | Draw list of PCB components on the PCB | | `pcb_components(type, cutouts = false, angle = undef)` | Draw list of PCB components on the PCB |
| `pcb_cutouts(type, angle = undef)` | Make cut outs to clear components on a PCB | | `pcb_cutouts(type, angle = undef)` | Make cut outs to clear components on a PCB |
| `pcb_grid(type, x, y, z = 0)` | Positions children at specified grid position | | `pcb_grid(type, x, y, z = 0)` | Positions children at specified grid position |
| `pcb_grid_components(type, components, cutouts = false, angle = undef)` | Draw list of components on the PCB grid for perf board |
| `pcb_screw_positions(type)` | Positions children at the mounting hole positions | | `pcb_screw_positions(type)` | Positions children at the mounting hole positions |
| `pcb_spacer(screw, height, wall = 1.8, taper = 0)` | Generate STL for PCB spacer | | `pcb_spacer(screw, height, wall = 1.8, taper = 0)` | Generate STL for PCB spacer |
| `rj45(cutout = false)` | Draw RJ45 Ethernet connector | | `rj45(cutout = false)` | Draw RJ45 Ethernet connector |
@@ -2498,6 +2499,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `pcb_components(type, cutouts = false, angle = undef)` | Draw list of PCB components on the PCB | | `pcb_components(type, cutouts = false, angle = undef)` | Draw list of PCB components on the PCB |
| `pcb_cutouts(type, angle = undef)` | Make cut outs to clear components on a PCB | | `pcb_cutouts(type, angle = undef)` | Make cut outs to clear components on a PCB |
| `pcb_grid(type, x, y, z = 0)` | Positions children at specified grid position | | `pcb_grid(type, x, y, z = 0)` | Positions children at specified grid position |
| `pcb_grid_components(type, components, cutouts = false, angle = undef)` | Draw list of components on the PCB grid for perf board |
| `pcb_screw_positions(type)` | Positions children at the mounting hole positions | | `pcb_screw_positions(type)` | Positions children at the mounting hole positions |
| `pcb_spacer(screw, height, wall = 1.8, taper = 0)` | Generate STL for PCB spacer | | `pcb_spacer(screw, height, wall = 1.8, taper = 0)` | Generate STL for PCB spacer |
| `rj45(cutout = false)` | Draw RJ45 Ethernet connector | | `rj45(cutout = false)` | Draw RJ45 Ethernet connector |

View File

@@ -1093,6 +1093,19 @@ module pcb_components(type, cutouts = false, angle = undef) { //! Draw list of P
} }
} }
module pcb_grid_components(type, components, cutouts = false, angle = undef) //! Draw list of components on the PCB grid for perf board
for(comp = components) {
p = pcb_grid_pos(type, comp.x, comp.y);
if(comp[3][0] == "-")
translate([p.x, p.y])
vflip()
pcb_component(comp, cutouts, angle);
else
translate([p.x, p.y, pcb_thickness(type)])
pcb_component(comp, cutouts, angle);
}
module pcb_cutouts(type, angle = undef) pcb_components(type, true, angle); //! Make cut outs to clear components on a PCB module pcb_cutouts(type, angle = undef) pcb_components(type, true, angle); //! Make cut outs to clear components on a PCB
module pcb_grid_positions(type) { module pcb_grid_positions(type) {