1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-13 16:32:36 +02:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Chris Palmer
6f93b6af9a pcb_component_position() can now be passed an index to differentiate between
multiple components of the same type.

Added pcb_grid_pos() function.
2019-11-15 13:30:27 +00:00
Chris Palmer
53f416eef1 Added more detail to the Environ+ pcb.
Changed the RPI0 SD height to be more accurate.
2019-11-15 13:28:02 +00:00
Chris Palmer
6354219627 Added tiny 17x8mm fan. 2019-11-15 13:25:32 +00:00
Chris Palmer
56e2b71bda Updated readme for last PR 2019-10-22 18:01:51 +01:00
Chris
8f5503586d Merge pull request #6 from limitz/e3d_resistor_wire_rotate
E3d resistor wire rotate
2019-10-22 17:57:14 +01:00
Eddy Pronk
d041b18025 Adds an option resistor_wire_rotate 2019-10-21 17:51:19 +02:00
11 changed files with 45 additions and 29 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 KiB

After

Width:  |  Height:  |  Size: 740 KiB

View File

@@ -630,6 +630,7 @@ Can draw three styles: solid, open frame and open frame with screw bosses.
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | ```fan(fan120x25)``` | Fan 120mm x 25mm | | 1 | ```fan(fan120x25)``` | Fan 120mm x 25mm |
| 1 | ```fan(fan17x8)``` | Fan 17mm x 8mm |
| 1 | ```fan(fan25x10)``` | Fan 25mm x 10mm | | 1 | ```fan(fan25x10)``` | Fan 25mm x 10mm |
| 1 | ```fan(fan30x10)``` | Fan 30mm x 10mm | | 1 | ```fan(fan30x10)``` | Fan 30mm x 10mm |
| 1 | ```fan(fan40x11)``` | Fan 40mm x 11mm | | 1 | ```fan(fan40x11)``` | Fan 40mm x 11mm |
@@ -639,14 +640,17 @@ Can draw three styles: solid, open frame and open frame with screw bosses.
| 1 | ```fan(fan70x15)``` | Fan 70mm x 15mm | | 1 | ```fan(fan70x15)``` | Fan 70mm x 15mm |
| 1 | ```fan(fan80x25)``` | Fan 80mm x 25mm | | 1 | ```fan(fan80x25)``` | Fan 80mm x 25mm |
| 1 | ```fan(fan80x38)``` | Fan 80mm x 38mm | | 1 | ```fan(fan80x38)``` | Fan 80mm x 38mm |
| 4 | ```nut(M2_nut, nyloc = true)``` | Nut M2 x 1.6mm nyloc |
| 4 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc | | 4 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 8 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc | | 8 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 28 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc | | 28 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 4 | ```screw(M2_cap_screw, 16)``` | Screw M2 cap x 16mm |
| 4 | ```screw(M2p5_pan_screw, 20)``` | Screw M2.5 pan x 20mm | | 4 | ```screw(M2p5_pan_screw, 20)``` | Screw M2.5 pan x 20mm |
| 8 | ```screw(M3_dome_screw, 20)``` | Screw M3 dome x 20mm | | 8 | ```screw(M3_dome_screw, 20)``` | Screw M3 dome x 20mm |
| 20 | ```screw(M4_dome_screw, 16)``` | Screw M4 dome x 16mm | | 20 | ```screw(M4_dome_screw, 16)``` | Screw M4 dome x 16mm |
| 4 | ```screw(M4_dome_screw, 25)``` | Screw M4 dome x 25mm | | 4 | ```screw(M4_dome_screw, 25)``` | Screw M4 dome x 25mm |
| 4 | ```screw(M4_dome_screw, 30)``` | Screw M4 dome x 30mm | | 4 | ```screw(M4_dome_screw, 30)``` | Screw M4 dome x 30mm |
| 8 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
| 8 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm | | 8 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm |
| 12 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm | | 12 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 32 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm | | 32 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
@@ -825,7 +829,7 @@ Needs updating as mostly obsolete versions.
### Modules ### Modules
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| ```hot_end(type, filament, naked = false)``` | Draw specified hot end | | ```hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0])``` | Draw specified hot end |
![hot_ends](tests/png/hot_ends.png) ![hot_ends](tests/png/hot_ends.png)
@@ -1678,8 +1682,9 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
### Functions ### Functions
| Function | Description | | Function | Description |
|:--- |:--- | |:--- |:--- |
| ```pcb_component_position(type, name)``` | Return x y position of specified component | | ```pcb_component_position(type, name, index = 0)``` | Return x y position of specified component |
| ```pcb_coord(type, p)``` | Convert offsets from the edge to coordinates relative to the centre | | ```pcb_coord(type, p)``` | Convert offsets from the edge to coordinates relative to the centre |
| ```pcb_grid_pos(type, x, y, z = 0)``` | Returns a pcb grid position |
| ```pcb_screw(type, cap = hs_cap)``` | Mounting screw type | | ```pcb_screw(type, cap = hs_cap)``` | Mounting screw type |
### Modules ### Modules
@@ -1699,7 +1704,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| ```pcb_component_position(type, name)``` | Position child at the specified component position | | ```pcb_component_position(type, name)``` | Position child at the specified component position |
| ```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 positions | | ```pcb_grid(type, x, y, z = 0)``` | Positions children at specified grid position |
| ```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 |
@@ -3577,6 +3582,7 @@ The ring spacing as well as the number of spokes can be specified, if zero a gas
| Qty | Filename | | Qty | Filename |
| ---:|:--- | | ---:|:--- |
| 1 | fan_guard_120.stl | | 1 | fan_guard_120.stl |
| 1 | fan_guard_17.stl |
| 1 | fan_guard_25.stl | | 1 | fan_guard_25.stl |
| 1 | fan_guard_30.stl | | 1 | fan_guard_30.stl |
| 1 | fan_guard_40.stl | | 1 | fan_guard_40.stl |

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -61,30 +61,34 @@ heater_y = heater_width / 2;
fan_x_offset = rad_dia / 2 + 4; fan_x_offset = rad_dia / 2 + 4;
module e3d_resistor(type) { module e3d_resistor(type, resistor_wire_rotate = [0,0,0]) {
translate([11 - heater_x, -3 - heater_y, heater_height / 2 + nozzle_h]) { translate([11 - heater_x, -3 - heater_y, heater_height / 2 + nozzle_h]) {
color("grey") color("grey")
rotate([-90, 0, 0]) rotate([-90, 0, 0])
cylinder(r = resistor_dia / 2, h = resistor_len); cylinder(r = resistor_dia / 2, h = resistor_len);
color("red") color("red")
translate([-3.5/2, resistor_len + 3.5/2 + 1, 0]) { translate([0, resistor_len + 3.5/2 + 1, 0]) {
cylinder(d = 3.5, h = 36); rotate(resistor_wire_rotate) {
translate([-3.5/2, 0, 0]) {
cylinder(d = 3.5, h = 36);
translate([3.5, 0, 0]) translate([3.5, 0, 0])
cylinder(r = 3.5 / 2, h = 36); cylinder(r = 3.5 / 2, h = 36);
} }
}
}
} }
} }
module heater_block(type) { module heater_block(type, resistor_wire_rotate = [0,0,0]) {
translate_z(-hot_end_length(type)) { translate_z(-hot_end_length(type)) {
translate_z(nozzle_h) translate_z(nozzle_h)
color("lightgrey") color("lightgrey")
translate([-heater_x, -heater_y, 0]) translate([-heater_x, -heater_y, 0])
cube([heater_length, heater_width, heater_height]); cube([heater_length, heater_width, heater_height]);
e3d_resistor(type); e3d_resistor(type, resistor_wire_rotate);
e3d_nozzle(type); e3d_nozzle(type);
} }
} }
@@ -118,7 +122,7 @@ module e3d_fan(type) {
fan(fan30x10); fan(fan30x10);
} }
module e3d_hot_end(type, filament, naked = false) { module e3d_hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0]) {
insulator_length = hot_end_insulator_length(type); insulator_length = hot_end_insulator_length(type);
inset = hot_end_inset(type); inset = hot_end_inset(type);
h_ailettes = rad_len / (2 * rad_nb_ailettes - 1); h_ailettes = rad_len / (2 * rad_nb_ailettes - 1);
@@ -146,17 +150,17 @@ module e3d_hot_end(type, filament, naked = false) {
} }
rotate(90) rotate(90)
heater_block(type); heater_block(type, resistor_wire_rotate);
if(!naked) if(!naked)
translate_z(inset - insulator_length) translate_z(inset - insulator_length)
e3d_fan(); e3d_fan();
} }
module e3d_hot_end_assembly(type, filament, naked = false) { module e3d_hot_end_assembly(type, filament, naked = false, resistor_wire_rotate = [0,0,0]) {
bundle = 3.2; bundle = 3.2;
e3d_hot_end(type, filament, naked); e3d_hot_end(type, filament, naked, resistor_wire_rotate);
// Wire and ziptie // Wire and ziptie
if(!naked) if(!naked)

View File

@@ -40,7 +40,8 @@ fan50x15 = [50, 15, 48, 20, M4_dome_screw, 25, 12.5,100,7, 0, undef];
fan40x11 = [40, 11, 37, 16, M3_dome_screw, 25, 7.5,100, 9, 0, undef]; fan40x11 = [40, 11, 37, 16, M3_dome_screw, 25, 7.5,100, 9, 0, undef];
fan30x10 = [30, 10, 27, 12, M3_dome_screw, 17, 10, 100, 5, 0, undef]; fan30x10 = [30, 10, 27, 12, M3_dome_screw, 17, 10, 100, 5, 0, undef];
fan25x10 = [25, 10, 24, 10, M2p5_pan_screw, 16, 10, 100, 5, 0, undef]; fan25x10 = [25, 10, 24, 10, M2p5_pan_screw, 16, 10, 100, 5, 0, undef];
fan17x8 = [17, 8, 16, 6.75, M2_cap_screw, 12.6, 8, 100, 7, 0, undef];
fans = [fan25x10, fan30x10, fan40x11, fan50x15, fan60x15, fan60x25, fan70x15, fan80x25, fan80x38, fan120x25]; fans = [fan17x8, fan25x10, fan30x10, fan40x11, fan50x15, fan60x15, fan60x25, fan70x15, fan80x25, fan80x38, fan120x25];
use <fan.scad> use <fan.scad>

View File

@@ -44,10 +44,10 @@ function hot_end_length(type) = hot_end_total_length(type) - hot_end_inset(type)
use <jhead.scad> use <jhead.scad>
use <e3d.scad> use <e3d.scad>
module hot_end(type, filament, naked = false) { //! Draw specified hot end module hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0]) { //! Draw specified hot end
if(hot_end_style(type) == jhead) if(hot_end_style(type) == jhead)
jhead_hot_end_assembly(type, filament, naked); jhead_hot_end_assembly(type, filament, naked);
if(hot_end_style(type) == e3d) if(hot_end_style(type) == e3d)
e3d_hot_end_assembly(type, filament, naked); e3d_hot_end_assembly(type, filament, naked, resistor_wire_rotate);
} }

View File

@@ -49,9 +49,12 @@ function pcb_grid(type) = type[13]; //! Grid if a perfboard
function pcb_polygon(type) = type[14]; //! Optional outline polygon for odd shaped boards function pcb_polygon(type) = type[14]; //! Optional outline polygon for odd shaped boards
function pcb_screw(type, cap = hs_cap) = Len(type[15]) ? type[15] : find_screw(cap, screw_smaller_than(pcb_hole_d(type))); //! Mounting screw type function pcb_screw(type, cap = hs_cap) = Len(type[15]) ? type[15] : find_screw(cap, screw_smaller_than(pcb_hole_d(type))); //! Mounting screw type
module pcb_grid(type, x, y, z = 0) //! Positions children at specified grid positions function pcb_grid_pos(type, x, y, z = 0) = //! Returns a pcb grid position
translate([-pcb_length(type) / 2 + pcb_grid(type).x + 2.54 * x, [-pcb_length(type) / 2 + pcb_grid(type).x + 2.54 * x,
-pcb_width(type) / 2 + pcb_grid(type).y + 2.54 * y, pcb_thickness(type) + z]) -pcb_width(type) / 2 + pcb_grid(type).y + 2.54 * y, pcb_thickness(type) + z];
module pcb_grid(type, x, y, z = 0) //! Positions children at specified grid position
translate(pcb_grid_pos(type, x, y, z))
children(); children();
// allows negative ordinates to represent offsets from the far edge // allows negative ordinates to represent offsets from the far edge
@@ -730,8 +733,8 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
} }
} }
function pcb_component_position(type, name) = //! Return x y position of specified component function pcb_component_position(type, name, index = 0) = //! Return x y position of specified component
[for(comp = pcb_components(type), p = [pcb_coord(type, [comp.x, comp.y])]) if(comp[3] == name) [p.x, p.y]][0]; [for(comp = pcb_components(type), p = [pcb_coord(type, [comp.x, comp.y])]) if(comp[3] == name) [p.x, p.y]][index];
module pcb_component_position(type, name) { //! Position child at the specified component position module pcb_component_position(type, name) { //! Position child at the specified component position
for(comp = pcb_components(type)) { for(comp = pcb_components(type)) {
@@ -807,9 +810,9 @@ module pcb(type) { //! Draw specified PCB
pcb_screw_positions(type) pcb_screw_positions(type)
tube(or = max(pcb_land_d(type), 1) / 2, ir = pcb_hole_d(type) / 2, h = t + 2 * eps); tube(or = max(pcb_land_d(type), 1) / 2, ir = pcb_hole_d(type) / 2, h = t + 2 * eps);
fr4 = pcb_colour(type) == "green"; fr4 = pcb_colour(type) != "sienna";
plating = 0.15; plating = 0.15;
color(fr4 ? "silver" : "gold") color(pcb_colour(type) == "green" ? "silver" : "gold")
translate_z(-plating) translate_z(-plating)
linear_extrude(height = fr4 ? t + 2 * plating : plating) linear_extrude(height = fr4 ? t + 2 * plating : plating)
if(Len(grid)) { if(Len(grid)) {

View File

@@ -218,17 +218,19 @@ RPI0 = ["RPI0", "Raspberry Pi Zero", 65, 30, 1.4, 3, 2.75, 6, "gre
[12.4, 3.4, -90, "mini_hdmi"], [12.4, 3.4, -90, "mini_hdmi"],
[54, 2, -90, "usb_uA"], [54, 2, -90, "usb_uA"],
[41.4, 2, -90, "usb_uA"], [41.4, 2, -90, "usb_uA"],
[7.25, 16.7, 180, "uSD", [12, 11.5, 1.28]], [7.25, 16.7, 180, "uSD", [12, 11.5, 1.4]],
[-1.3, 15, 0, "flat_flex"], [-1.3, 15, 0, "flat_flex"],
], ],
[": Micro SD card"], [": Micro SD card"],
[32.5 - 9.5 * 2.54, 26.5 - 1.27, 20, 2]]; [32.5 - 9.5 * 2.54, 26.5 - 1.27, 20, 2]];
EnviroPlus = ["EnviroPlus", "Enviro+", 65, 30, 1.6, 3, 2.75, 6, "white", false, [[3.5, 3.5], [-3.5, 3.5], [-3.5, -3.5], [3.5, -3.5]], EnviroPlus = ["EnviroPlus", "Enviro+", 65, 30.6, 1.6, 3, 2.75, 6, "white", false, [[3.5, 3.8], [-3.5, 3.8], [-3.5, -3.8], [3.5, -3.8]],
[[32.5, -3.5, 0, "-2p54socket", 20, 2, false, 5, true], [[32.5, -3.8, 0, "-2p54socket", 20, 2, false, 5, true],
[-15.5, 2.5, 0, "-chip", 15, 5, 3, "white"],
[-14.25,16.25, 0, "chip", 27.5, 13.5, 1.5]
], ],
[], [],
[]]; [8, 1.5, 9, 1]];
ArduinoUno3 = ["ArduinoUno3", "Arduino Uno R3", 68.58, 53.34, 1.6, 0, 3.3, 0, "#2140BE", false, [[15.24, 50.8],[66.04, 35.56],[66.04, 7.62],[13.97, 2.54]], ArduinoUno3 = ["ArduinoUno3", "Arduino Uno R3", 68.58, 53.34, 1.6, 0, 3.3, 0, "#2140BE", false, [[15.24, 50.8],[66.04, 35.56],[66.04, 7.62],[13.97, 2.54]],