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

Added smd_250V_fuse() and rd_box_cap().

Fixed missing value parameters from a lot of the SMD component instantiation examples.
This commit is contained in:
Chris Palmer
2024-08-15 22:52:32 +01:00
parent a974e4fa9d
commit bc7f294f99
12 changed files with 226 additions and 56 deletions

101
readme.md
View File

@@ -2668,6 +2668,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `potentiometer(BTT_encoder)` | BTT_encoder |
| 1 | `box_header(2p54header, 4, 2)` | Box header 4 x 2 |
| 1 | `box_header(2p54header, 4, 2, right_angle = true)` | Box header 4 x 2 right angle |
| 1 | `rd_disc(6p4mm_disc, "100n")` | Ceramic capacitor, 6p4mm_disc 100n |
| 1 | `rd_xtal(ACT1100, "40MHz")` | Crystal ACT1100 40MHz |
| 1 | `rd_xtal(ACT1700, "80MHz")` | Crystal ACT1700 80MHz |
| 1 | `rd_xtal(C_002RX, "60KHz")` | Crystal C_002RX 60KHz |
@@ -2675,14 +2676,15 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `rd_xtal(HC49_4H, "10MHz")` | Crystal HC49_4H 10MHz |
| 1 | `d_plug(DCONN9, pcb = true)` | D-type 9 way PCB mount plug |
| 1 | `dil_socket(12, 15.24)` | DIL socket 24 x 0.6" |
| 1 | `smd_diode(DO214AC)` | DO214AC package SS34 |
| 1 | `smd_diode(DO214AC, "SS34")` | DO214AC package SS34 |
| 2 | `ax_diode(DO_41, "1N4007")` | Diode 1N4007 |
| 2 | `ax_diode(DO_35, "1N4148")` | Diode 1N4148 |
| 1 | `rd_electrolytic(ECAP8x12, "220uF35V")` | Electolytic capacitor ECAP8x12 220uF35V |
| 1 | `hdmi(hdmi_full)` | HDMI socket |
| 1 | `pdip(24, 27C32, w = 15.24)` | IC 27C32 PDIP24 |
| 1 | `pdip(8, NE555)` | IC NE555 PDIP8 |
| 1 | `idc_transition(2p54header, 5)` | IDC transition header 5 x 2 |
| 1 | `smd_inductor(IND2525)` | IND2525 package 4R7 |
| 1 | `smd_inductor(IND2525 ,"4R7")` | IND2525 package 4R7 |
| 1 | `jst_xh_header(jst_ph_header, 2)` | JST PH connector 2 way |
| 1 | `jst_xh_header(jst_xh_header, 2)` | JST XH connector 2 way |
| 1 | `jst_xh_header(jst_zh_header, 2)` | JST ZH connector 2 way |
@@ -2703,40 +2705,42 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `pin_socket(2p54header, 6, 1)` | Pin socket 6 x 1 |
| 2 | `pin_socket(2p54header, 8, 1)` | Pin socket 8 x 1 |
| 1 | `rd_transistor(TO92, "78L05")` | Regulator TO92 78L05 |
| 1 | `rd_module(HF33F, "012-HSL-3F")` | Relay HF33F / 012-HSL-3F |
| 1 | `ax_res(res1_2, 10, tol = 10)` | Resistor 10 Ohms 10% 0.5W |
| 1 | `ax_res(res1_4, 100, tol = 2)` | Resistor 100 Ohms 2% 0.25W |
| 1 | `ax_res(res1_8, 1000)` | Resistor 1000 Ohms 5% 0.125W |
| 1 | `ax_res(res1_4, 10000)` | Resistor 10000 Ohms 5% 0.25W |
| 1 | `ax_res(res1_2, 100000)` | Resistor 100000 Ohms 5% 0.5W |
| 1 | `ax_res(res1_8, 1e+6, tol = 1)` | Resistor 1e+6 Ohms 1% 0.125W |
| 1 | `smd_led(LED0603, orange)` | SMD LED 0603 orange |
| 1 | `smd_led(LED0805, red)` | SMD LED 0805 red |
| 1 | `smd_led(LED1206, blue)` | SMD LED 1306 blue |
| 1 | `smd_tant(TANT_A)` | SMD Tantalum capacitor package A ,1uF, 2.5V |
| 1 | `smd_tant(TANT_B)` | SMD Tantalum capacitor package B ,10uF, 10V |
| 1 | `smd_tant(TANT_C)` | SMD Tantalum capacitor package C ,100uF, 16V |
| 1 | `smd_capacitor(CAP0402)` | SMD capacitor 0402 10nF |
| 1 | `smd_capacitor(CAP0502)` | SMD capacitor 0502 10nF |
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 10nF |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 100nF |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 1uF |
| 1 | `smd_qfp(QFP50P1200X1200X160_64N)` | SMD chip: ATSAM4S4BA, package : QFP50P1200X1200X160_64N |
| 1 | `smd_led(LED0603, "orange")` | SMD LED 0603 orange |
| 1 | `smd_led(LED0805, "red")` | SMD LED 0805 red |
| 1 | `smd_led(LED1206, "blue")` | SMD LED 1306 blue |
| 1 | `smd_tant(TANT_A, value = "105e")` | SMD Tantalum capacitor package A ,1uF, 2.5V |
| 1 | `smd_tant(TANT_B, value = "106A")` | SMD Tantalum capacitor package B ,10uF, 10V |
| 1 | `smd_tant(TANT_C, value = "107C")` | SMD Tantalum capacitor package C ,100uF, 16V |
| 1 | `smd_capacitor(CAP0402, value = "10nF")` | SMD capacitor 0402 10nF |
| 1 | `smd_capacitor(CAP0502, value = "10nF")` | SMD capacitor 0502 10nF |
| 1 | `smd_capacitor(CAP0603, value = "10nF")` | SMD capacitor 0603 10nF |
| 1 | `smd_capacitor(CAP0805, value = "100nF")` | SMD capacitor 0805 100nF |
| 1 | `smd_capacitor(CAP1206, value = "1uF")` | SMD capacitor 1206 1uF |
| 1 | `smd_qfp(QFP50P1200X1200X160_64N, "ATSAM4S4BA")` | SMD chip: ATSAM4S4BA, package : QFP50P1200X1200X160_64N |
| 1 | `smd_resistor(L2012C, 1u)` | SMD choke 0805 1u |
| 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 |
| 1 | `smd_250V_fuse(OMT250, "2A 250V")` | SMD fuse: OMT250 2A 250V |
| 1 | `smd_resistor(RES0402, 1)` | SMD resistor 0402 1 0.0625W |
| 1 | `smd_resistor(RES0502, 10)` | SMD resistor 0502 10 0.05W |
| 1 | `smd_resistor(RES0603, 100)` | SMD resistor 0603 100 0.1W |
| 1 | `smd_resistor(RES0805, 1K)` | SMD resistor 0805 1K 0.125W |
| 1 | `smd_resistor(RES1206, 1M)` | SMD resistor 1206 1M 0.25W |
| 1 | `smd_soic(SOIC14)` | SOIC14 package 74HC00 |
| 1 | `smd_soic(SOIC16)` | SOIC16 package ICL323 |
| 1 | `smd_soic(SOIC18)` | SOIC18 package PIC18F88 |
| 1 | `smd_soic(SOIC8)` | SOIC8 package M34063 |
| 1 | `smd_sot(SOT223)` | SOT223 package LM117 |
| 1 | `smd_sot(SOT23)` | SOT23 package 2N7000 |
| 1 | `smd_soic(SOIC14, "74HC00")` | SOIC14 package 74HC00 |
| 1 | `smd_soic(SOIC16, "ICL323")` | SOIC16 package ICL323 |
| 1 | `smd_soic(SOIC18, "PIC18F88")` | SOIC18 package PIC18F88 |
| 1 | `smd_soic(SOIC8, "M34063")` | SOIC8 package M34063 |
| 1 | `smd_sot(SOT223, "LM117")` | SOT223 package LM117 |
| 1 | `smd_sot(SOT23, "2N7000")` | SOT23 package 2N7000 |
| 1 | `square_button(button_4p5mm)` | Square button 4.5mm |
| 1 | `square_button(button_6mm)` | Square button 6mm |
| 1 | `smd_pot(TC33X1)` | TC33X1 package 10K |
| 1 | `smd_pot(TC33X1, "10K")` | TC33X1 package 10K |
| 1 | `pcb(TMC2130)` | TMC2130 |
| 1 | `green_terminal(gt_5p08, 2)` | Terminal block 2 way 0.2" |
| 2 | `green_terminal(gt_6p35, 2)` | Terminal block 2 way 0.25" |
@@ -2749,11 +2753,14 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `terminal_35(4)` | Terminal block 4 way 3.5mm |
| 1 | `pcb(test_pcb)` | Test PCB |
| 1 | `rd_transistor(E_LINE, "ZTX853")` | Transistor E_LINE ZTX853 |
| 1 | `rd_disc(ERZV07D471, "471")` | Varistor, ERZV07D471 471 |
| 2 | `vero_pin()` | Vero board pin |
| 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" |
| 1 | `wire_link(0.8, 10.16, h = 0.75, sleeve = [1.5, "red"])` | Wire link 0.8mm x 0.4" with red sleeving |
| 1 | `wire_link(0.8, 0, h = 5)` | Wire link 0.8mm x 8mm |
| 1 | `rd_boxc(BOXC18x5x11, "X2 rated film capacitor", "0.1uF 250V" )` | X2 rated film capacitor 0.1uF 250V |
| 1 | `rd_boxc(BOXC18x10x16, "X2 rated film capacitor", "0.47uF 250V" )` | X2 rated film capacitor 0.47uF 250V |
<a href="#top">Top</a>
@@ -3399,6 +3406,11 @@ Radial components for PCBs.
### Properties
| Function | Description |
|:--- |:--- |
| `rd_boxc_colours(type)` | Case colour and resin fill colour |
| `rd_boxc_leads(type)` | Lead pitch, diameter and length |
| `rd_boxc_size(type)` | Overall size and corner radius |
| `rd_boxc_skirt(type)` | Skirt slot, thickness, height |
| `rd_boxc_z(type)` | Height of inner base above PCB. |
| `rd_disc_colours(type)` | Colours of body and text |
| `rd_disc_kind(type)` | Capacitor, etc |
| `rd_disc_lead_d(type)` | Lead diameter and sleeve diameter |
@@ -3428,6 +3440,7 @@ Radial components for PCBs.
### Modules
| Module | Description |
|:--- |:--- |
| `rd_box_cap(type, kind, value)` | Draw radial boxed film capacitor |
| `rd_disc(type, value, pitch = undef, z = 0, tail = 3)` | Draw a radial disc component |
| `rd_electrolytic(type, value, pitch = undef, z = 0, tail = 3)` | Draw a radial electrolytic capcacitor |
| `rd_module(type, value)` | Draw a PCB mounted potted module, e.g. PSU or relay |
@@ -3453,6 +3466,8 @@ Radial components for PCBs.
| 1 | `rd_transistor(E_LINE, "ZTX853")` | Transistor E_LINE ZTX853 |
| 1 | `rd_transistor(TO92, "BC337")` | Transistor TO92 BC337 |
| 1 | `rd_disc(ERZV07D471, "470V")` | Varistor, ERZV07D471 470V |
| 1 | `rd_boxc(BOXC18x5x11, "X2 rated film capacitor", "0.1uF 250V" )` | X2 rated film capacitor 0.1uF 250V |
| 1 | `rd_boxc(BOXC18x10x16, "X2 rated film capacitor", "0.47uF 250V" )` | X2 rated film capacitor 0.47uF 250V |
<a href="#top">Top</a>
@@ -4147,6 +4162,10 @@ E.g. 475A is 4.7uF 10V on the parts list.
### Properties
| Function | Description |
|:--- |:--- |
| `smd_250V_fuse_base(type)` | Base length |
| `smd_250V_fuse_size(type)` | Bounding box of the body |
| `smd_250V_fuse_step(type)` | End cutout length, width and height |
| `smd_250V_fuse_z(type)` | Height of body above the PCB surface |
| `smd_cap_end_cap(type)` | End cap width |
| `smd_cap_size(type)` | Body length, width |
| `smd_coax_base_r(type)` | Corner radius of the base |
@@ -4211,6 +4230,7 @@ E.g. 475A is 4.7uF 10V on the parts list.
### Modules
| Module | Description |
|:--- |:--- |
| `smd_250V_fuse(type, value)` | Draw an SMD mains fuse |
| `smd_capacitor(type, height, value = undef)` | Draw an SMD capacitor with specified height |
| `smd_coax(type)` | Draw an SMD coaxial connector |
| `smd_diode(type, value)` | Draw an SMD diode |
@@ -4228,38 +4248,39 @@ E.g. 475A is 4.7uF 10V on the parts list.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `smd_inductor(CDRH104)` | CDRH104 package 10R |
| 1 | `smd_diode(DO214AC)` | DO214AC package SS34 |
| 1 | `smd_inductor(IND2525)` | IND2525 package 4R7 |
| 1 | `smd_led(LED0603, green)` | SMD LED 0603 green |
| 1 | `smd_led(LED0805, blue)` | SMD LED 0805 blue |
| 1 | `smd_led(LED1206, red)` | SMD LED 1306 red |
| 1 | `smd_tant(TANT_A)` | SMD Tantalum capacitor package A ,1uF, 2.5V |
| 1 | `smd_tant(TANT_B)` | SMD Tantalum capacitor package B ,10uF, 6.3V |
| 1 | `smd_tant(TANT_C)` | SMD Tantalum capacitor package C ,100uF, 10V |
| 1 | `smd_inductor(CDRH104 ,"10R")` | CDRH104 package 10R |
| 1 | `smd_diode(DO214AC, "SS34")` | DO214AC package SS34 |
| 1 | `smd_inductor(IND2525 ,"4R7")` | IND2525 package 4R7 |
| 1 | `smd_led(LED0603, "green")` | SMD LED 0603 green |
| 1 | `smd_led(LED0805, "blue")` | SMD LED 0805 blue |
| 1 | `smd_led(LED1206, "red")` | SMD LED 1306 red |
| 1 | `smd_tant(TANT_A, value = "105e")` | SMD Tantalum capacitor package A ,1uF, 2.5V |
| 1 | `smd_tant(TANT_B, value = "106J")` | SMD Tantalum capacitor package B ,10uF, 6.3V |
| 1 | `smd_tant(TANT_C, value = "107A")` | SMD Tantalum capacitor package C ,100uF, 10V |
| 1 | `smd_capacitor(CAP0402)` | SMD capacitor 0402 |
| 1 | `smd_capacitor(CAP0502)` | SMD capacitor 0502 |
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 |
| 1 | `smd_capacitor(CAP1210)` | SMD capacitor 1210 |
| 1 | `smd_qfp(QFP50P1200X1200X160_64N)` | SMD chip: ATSAM4S4BA, package : QFP50P1200X1200X160_64N |
| 1 | `smd_qfp(QFP50P1200X1200X160_64N, "ATSAM4S4BA")` | SMD chip: ATSAM4S4BA, package : QFP50P1200X1200X160_64N |
| 1 | `smd_resistor(L2012C, 10u)` | SMD choke 0805 10u |
| 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 |
| 1 | `smd_250V_fuse(OMT250, "2A 250V")` | SMD fuse: OMT250 2A 250V |
| 1 | `smd_resistor(RES0402, 1R0)` | SMD resistor 0402 1R0 0.0625W |
| 1 | `smd_resistor(RES0502, 10)` | SMD resistor 0502 10 0.05W |
| 1 | `smd_resistor(RES0603, 100)` | SMD resistor 0603 100 0.1W |
| 1 | `smd_resistor(RES0805, 10M)` | SMD resistor 0805 10M 0.125W |
| 1 | `smd_resistor(RES1206, 100K)` | SMD resistor 1206 100K 0.25W |
| 1 | `smd_soic(SOIC14)` | SOIC14 package SOIC14 |
| 1 | `smd_soic(SOIC16)` | SOIC16 package SOIC16 |
| 1 | `smd_soic(SOIC18)` | SOIC18 package SOIC18 |
| 1 | `smd_soic(SOIC8)` | SOIC8 package SOIC8 |
| 1 | `smd_sot(SOT223)` | SOT223 package FZT851 |
| 1 | `smd_sot(SOT23)` | SOT23 package 2N7000 |
| 1 | `smd_soic(SOT23_6)` | SOT23_6 package SOT23_6 |
| 1 | `smd_pot(TC33X1)` | TC33X1 package 10K |
| 1 | `smd_soic(TSOT23_8)` | TSOT23_8 package TSOT23_8 |
| 1 | `smd_soic(SOIC14, "SOIC14")` | SOIC14 package SOIC14 |
| 1 | `smd_soic(SOIC16, "SOIC16")` | SOIC16 package SOIC16 |
| 1 | `smd_soic(SOIC18, "SOIC18")` | SOIC18 package SOIC18 |
| 1 | `smd_soic(SOIC8, "SOIC8")` | SOIC8 package SOIC8 |
| 1 | `smd_sot(SOT223, "FZT851")` | SOT223 package FZT851 |
| 1 | `smd_sot(SOT23, "2N7000")` | SOT23 package 2N7000 |
| 1 | `smd_soic(SOT23_6, "SOT23_6")` | SOT23_6 package SOT23_6 |
| 1 | `smd_pot(TC33X1, "10K")` | TC33X1 package 10K |
| 1 | `smd_soic(TSOT23_8, "TSOT23_8")` | TSOT23_8 package TSOT23_8 |
<a href="#top">Top</a>

View File

@@ -61,7 +61,7 @@ test_pcb = ["test_pcb", "Test PCB",
// components
[
[ 20, -5, 180, "trimpot10"],
[ 20, -15, 90, "trimpot10", true],
[ 20, -18, 90, "trimpot10", true],
[ 19, 2, 90, "smd_led", LED1206, "blue"],
[ 16, 2, 90, "smd_led", LED0805, "red"],
[ 13, 2, 90, "smd_led", LED0603, "orange"],
@@ -82,6 +82,7 @@ test_pcb = ["test_pcb", "Test PCB",
[ 32, 3, -90, "smd_diode",DO214AC, "SS34"],
[ 26, 2, -90, "smd_pot", TC33X1, "10K"],
[ 26, 6, -90, "smd_coax",U_FL_R_SMT_1],
[ 8, 23, 0, "smd_250V_fuse", OMT250, "2A 250V"],
[ 26, 10, -90, "smd_sot", SOT23, "2N7000"],
[ 28, 16, -90, "smd_sot", SOT223, "LM117"],
@@ -116,8 +117,8 @@ test_pcb = ["test_pcb", "Test PCB",
[ 5, 220, 180, "hdmi"],
[ 3, 235, 180, "mini_hdmi"],
[ 38, 190, -90, "text", 25, 4, "Silkscreen", "Liberation Sans:style=Bold"],
[ 25, 200, 0, "buzzer", 4.5, 8.5],
[ 25, 218, 0, "buzzer"],
[ 25, 205, 0, "buzzer", 4.5, 8.5],
[ 25, 220, 0, "buzzer"],
[ 45, 1, 0, "link", inch(0.4), 0.75, undef, undef, [1.5, "red"]], // Sleeved link
[ 45, 3, 0, "link", inch(0.4)], // Flat link
@@ -130,6 +131,10 @@ test_pcb = ["test_pcb", "Test PCB",
[ 35, 17, 0, "vero_pin", true],
[ 35, 8, 180, "rd_transistor", TO92, "78L05", undef, undef, "Regulator"],
[ 35, 13, 180, "rd_transistor", E_LINE, "ZTX853"],
[ 25, 190, 0, "rd_electrolytic", ECAP8x11, "220uF35V"],
[ 25, 180, 90, "rd_disc", ERZV07D471, "471"],
[ 25, 170, 90, "rd_disc", 6p4mm_disc, "100n"],
[ 90, 135, -90, "rd_module", HF33F, "012-HSL-3F"],
[ 35, 3, 0, "link", 0, 5], // Vertical wire
[ 60, 3, 0, "link", inch(0.2), inch(0.4)], // Raised link
@@ -147,6 +152,9 @@ test_pcb = ["test_pcb", "Test PCB",
[ 30, 130,-90, "rd_xtal", ACT1100, "40MHz", 0.5 ],
[ 30, 150,-90, "rd_xtal", ACT1700, "80MHz", 0.5 ],
[ 93, 230,-90, "rd_box_cap", BOXC18x10x16, "X2 rated film capacitor", "0.47uF 250V" ],
[ 93, 210,-90, "rd_box_cap", BOXC18x5x11, "X2 rated film capacitor", "0.1uF 250V" ],
[ 77, 15, -90, "flex"],
[ 95, 15, -90, "flat_flex"],
[ 87, 15, -90, "flat_flex", true],
@@ -179,7 +187,7 @@ test_pcb = ["test_pcb", "Test PCB",
[ 55, 170, 0, "button_4p5mm"],
[ 50, 185, 0, "microswitch", small_microswitch],
[ 52, 200, 0, "pcb", 11, TMC2130 ],
[ 80, 210, 0, "pdip", 24, "27C32", true, inch(0.6) ],
[ 76, 210, 0, "pdip", 24, "27C32", true, inch(0.6) ],
[ 80, 180, 0, "pdip", 8, "NE555" ],
[ 71, 180, 0, "smd_inductor", IND2525, "4R7"],

View File

@@ -64,7 +64,12 @@ module smds() {
let(s = smd_soics[$i])
smd_soic(s, s[0]);
translate([0, 39])
translate([0, 36.5])
layout([for(i = smd_250V_fuses) smd_250V_fuse_size(i).x], 1)
let(i = smd_250V_fuses[$i])
smd_250V_fuse(i, "2A 250V");
translate([0, 45])
layout([for(i = smd_inductors) smd_inductor_leads(i).x], 1)
let(i = smd_inductors[$i])
smd_inductor(i, ["4R7", "10R"][$i % 2]);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 189 KiB

View File

@@ -28,10 +28,14 @@ module radials() {
pcb_grid(pcb, 10, 12)
rd_module(rd_modules[2], "12V 900ma");
for(i = [0: len(rd_electrolytics) - 1])
for(i = [0 : len(rd_electrolytics) - 1])
pcb_grid(pcb, i * 3, 2)
rotate(-90)
rd_electrolytic(rd_electrolytics[i], "220uF35V", z = 3, pitch = inch(0.2));
for(i = [0 : len(rd_box_caps) - 1])
pcb_grid(pcb, 20, i * 4)
rd_box_cap(rd_box_caps[i], "X2 rated film capacitor", ["0.1uF 250V", "0.47uF 250V"][i]);
}
$solder = pcb_solder(pcb);

View File

@@ -1169,6 +1169,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "rd_module")) rd_module(type = comp[4], value = comp[5]);
if(show(comp, "rd_transistor")) rd_transistor(type = comp[4], value = comp[5], lead_positions = param(6, undef), z = param(7, 5), kind = param(8,"Transistor"));
// type, value, lead positions, z, kind
if(show(comp, "rd_box_cap")) rd_box_cap(type = comp[4], kind = comp[5], value = comp[6]);
if(show(comp, "link")) wire_link(l = comp[4], h = param(5, 1), d = param(6, 0.8), tail = param(7, 3), sleeve = param(8, false));
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], param(5, 0), param(6, undef));
@@ -1177,6 +1178,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "jst_zh")) jst_xh_header(jst_zh_header, comp[4], param(5, false), param(6, false), param(7, undef));
if(show(comp, "potentiometer")) let(pot = param(4, BTT_encoder)) translate_z(pot_size(pot).z) vflip() potentiometer(pot, shaft_length = param(5, undef));
if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey(20)));
if(show(comp, "smd_250V_fuse")) smd_250V_fuse(comp[4], comp[5]);
if(show(comp, "smd_res")) smd_resistor(comp[4], comp[5]);
if(show(comp, "smd_cap")) smd_capacitor(comp[4], comp[5], param(6, undef));
if(show(comp, "smd_tant")) smd_tant(comp[4], param(5, undef));

View File

@@ -158,6 +158,7 @@ module rd_module(type, value) { //! Draw a PCB mounted potted module, e.g. PSU o
r = rd_module_radius(type);
size = rd_module_size(type);
pin = rd_module_pin_size(type);
color(rd_module_colour(type))
rounded_top_rectangle(size, r, r);
@@ -393,3 +394,60 @@ module rd_electrolytic(type, value, pitch = undef, z = 0, tail = 3) { //! Draw a
cylinder(r = jacket_ir, h = eps);
}
}
function rd_boxc_size(type) = type[1]; //! Overall size and corner radius
function rd_boxc_z(type) = type[2]; //! Height of inner base above PCB.
function rd_boxc_skirt(type) = type[3]; //! Skirt slot, thickness, height
function rd_boxc_leads(type) = type[4]; //! Lead pitch, diameter and length
function rd_boxc_colours(type) = type[5]; //! Case colour and resin fill colour
module rd_box_cap(type, kind, value) { //! Draw radial boxed film capacitor
vitamin(str("rd_boxc(", type[0], ", \"", kind, "\", \"", value, "\" ): ", kind, " ", value));
size = rd_boxc_size(type);
r = size[3];
skirt = rd_boxc_skirt(type);
inset = skirt.y * 2;
leads = rd_boxc_leads(type);
c = rd_boxc_colours(type);
z = rd_boxc_z(type);
$fn = fn;
color(c[0]) {
translate_z(z)
rounded_top_rectangle([size.x, size.y, size.z - z], r, r);
for(i = [0, 1])
translate_z(i * skirt.z)
linear_extrude(z)
difference() {
rounded_square([size.x, size.y], r);
square([size.x - inset, size.y - inset], center = true);
if(!i)
square([skirt.x, size.y], center = true);
}
}
color(c[1])
translate_z(z)
cube([size.x - inset, size.y - inset, 2 * eps], center = true);
color(silver)
for(end = [-1, 1])
translate([end * leads.x / 2, 0]) {
translate_z(- leads.z)
cylinder(d = leads.y, h = leads.z + z);
solder(leads.y / 2);
}
color("black")
translate([0, -size.y / 2])
rotate([90, 0, 0])
linear_extrude(eps)
translate([-size.x * 0.45, size.z * 0.75])
resize([size.x * 0.9, size.z / 6])
text(value, halign = "left", valign = "top");
}

View File

@@ -54,4 +54,10 @@ ECAP8x11 = ["ECAP8x12", [8.2, 7.5, 12.5], 0.5, [2.4, 2.5], 0.5, inch(0.1), [grey
rd_electrolytics = [ECAP8x11];
// Boxed plastic film capacitors
BOXC18x5x11 = ["BOXC18x5x11", [18, 5, 11, 0.25], 1.2, [8, 0.6, 0.4], [15, 0.6, 4.4], [grey(40), "LightYellow"]];
BOXC18x10x16 = ["BOXC18x10x16", [18, 10, 16, 0.25], 1.7, [12, 0.8, 0.4], [15, 0.8, 4.4], [grey(40), "LightYellow"]];
rd_box_caps = [BOXC18x5x11, BOXC18x10x16];
use <radial.scad>

View File

@@ -55,7 +55,7 @@ function smd_size(size) = //! Convert size to 1/100" notation
module smd_led(type, colour, cutout) { //! Draw an SMD LED with specified `colour`
size = smd_led_size(type);
vitamin(str("smd_led(", type[0], ", ", colour, "): SMD LED ", smd_size(size), " ", colour));
vitamin(str("smd_led(", type[0], ", \"", colour, "\"): SMD LED ", smd_size(size), " ", colour));
lens = smd_led_lens(type);
r = size.y * 0.32;
@@ -137,7 +137,7 @@ function smd_cap_end_cap(type) = type[2]; //! End cap width
module smd_capacitor(type, height, value = undef) { //! Draw an SMD capacitor with specified height
size = smd_cap_size(type);
vitamin(str("smd_capacitor(", type[0], "): SMD capacitor ", smd_size(size), !is_undef(value) ? str(" ", value) : ""));
vitamin(str("smd_capacitor(", type[0], arg(value, undef, "value"), "): SMD capacitor ", smd_size(size), !is_undef(value) ? str(" ", value) : ""));
cap = smd_cap_end_cap(type);
@@ -161,7 +161,7 @@ function smd_sot_lead_size(type) = type[6]; //! Lead width, foot depth, lead
function smd_sot_tab_width(type) = type[7]; //! The wide lead at the top
module smd_sot(type, value) { //! Draw an SMD transistor
vitamin(str("smd_sot(", type[0], "): ", type[0], " package ", value));
vitamin(str("smd_sot(", type[0], ", \"", value, "\"): ", type[0], " package ", value));
size = smd_sot_size(type);
z0 = smd_sot_z(type);
@@ -197,7 +197,6 @@ module smd_sot(type, value) { //! Draw an SMD transistor
linear_extrude(eps)
resize([size.x - 4 * (z2 - z1) * tan(slant), size.y / 2])
text(value, halign = "center", valign = "center");
}
function smd_soic_size(type) = type[1]; //! Body length, width and height
@@ -208,7 +207,7 @@ function smd_soic_lead_span(type) = type[5]; //! Total span of leads
function smd_soic_lead_size(type) = type[6]; //! Lead width, foot depth, lead thickness
module smd_soic(type, value) { //! Draw an SMD SOIC
vitamin(str("smd_soic(", type[0], "): ", type[0], " package ", value));
vitamin(str("smd_soic(", type[0], ", \"", value, "\"): ", type[0], " package ", value));
size = smd_soic_size(type);
z0 = smd_soic_z(type);
@@ -261,7 +260,7 @@ function smd_diode_leads(type) = type[4]; //! Lead extent in x, width, thicknes
function smd_diode_colour(type) = type[5]; //! Body colour
module smd_diode(type, value) { //! Draw an SMD diode
vitamin(str("smd_diode(", type[0], "): ", type[0], " package ", value));
vitamin(str("smd_diode(", type[0], ", \"", value, "\"): ", type[0], " package ", value));
slant = 5; //! 5 degree body draft angle
size = smd_diode_size(type);
@@ -326,7 +325,7 @@ module smd_tant(type, value) { //! Draw an SMD tantalum capacitor
volts = is_undef(value) ? "" : let(c = value[3])
assert(in(codes, c), str("expected the 4th character of value to be a voltage code: ", codes, ", got ", c))
str(", ", voltages[search(c, codes)[0]], "V");
vitamin(str("smd_tant(", type[0], "): SMD Tantalum capacitor package ", type[0][len(type[0]) -1], uF, volts));
vitamin(str("smd_tant(", type[0], arg(value, undef, "value"), "): SMD Tantalum capacitor package ", type[0][len(type[0]) -1], uF, volts));
size = smd_tant_size(type);
slant = 5; //! 5 degree body draft angle
@@ -388,7 +387,7 @@ function smd_inductor_leads(type) = type[4]; //! Lead extent in x, width, thick
function smd_inductor_colour(type) = type[5]; //! Body colour
module smd_inductor(type, value) { //! Draw an SMD inductor
vitamin(str("smd_inductor(", type[0], "): ", type[0], " package ", value));
vitamin(str("smd_inductor(", type[0], " ,\"", value, "\"): ", type[0], " package ", value));
size = smd_inductor_size(type);
z0 = smd_inductor_z(type);
@@ -437,7 +436,7 @@ function smd_pot_cross(type) = type[4]; //! Cross head slot for screwdriver
function smd_pot_flat(type) = type[5]; //! Flat at the back of the wiper
module smd_pot(type, value) { //! Draw an SMD pot
vitamin(str("smd_pot(", type[0], "): ", type[0], " package ", value));
vitamin(str("smd_pot(", type[0], ", \"", value, "\"): ", type[0], " package ", value));
size = smd_pot_size(type);
contacts = smd_pot_contacts(type);
@@ -601,7 +600,7 @@ function smd_qfp_pin_size(type) = type[5]; //! Pins dimensions
function smd_qfp_gullwing(type) = type[6]; //! Gullwing S, L, R1, R2
module smd_qfp(type, value) { //! Draw and SMD QFP package
vitamin(str("smd_qfp(", type[0], "): SMD chip: ", value, ", package : ", type[0]));
vitamin(str("smd_qfp(", type[0], ", \"", value, "\"): SMD chip: ", value, ", package : ", type[0]));
size = smd_qfp_body_size(type);
offset = size.z / 2 * tan(smd_qfp_slant(type));
@@ -652,3 +651,66 @@ module smd_qfp(type, value) { //! Draw and SMD QFP package
circle(r = pin.y, $fn = fn);
}
}
function smd_250V_fuse_size(type) = type[1]; //! Bounding box of the body
function smd_250V_fuse_z(type) = type[2]; //! Height of body above the PCB surface
function smd_250V_fuse_step(type) = type[3]; //! End cutout length, width and height
function smd_250V_fuse_base(type) = type[4]; //! Base length
module gcube(s) translate_z(s.z / 2) cube(s, center = true);
module smd_250V_fuse(type, value) { //! Draw an SMD mains fuse
size = smd_250V_fuse_size(type);
step = smd_250V_fuse_step(type);
base = smd_250V_fuse_base(type);
z = smd_250V_fuse_z(type);
vitamin(str("smd_250V_fuse(", type[0], ", \"", value, "\"): SMD fuse: ", type[0], " ", value));
color("LightYellow")
translate_z(z) {
gcube(base);
translate_z(base.z)
gcube([size.x - step.x * 2, size.y, size.z - base.z]);
for(end = [-1, 1], side = [-1,1]) {
translate([end * (size.x / 2 - step.x / 2), side * (size.y / 2 - step.y / 2)])
gcube(step);
translate([end * (size.x / 2 - step.x / 2 - eps), 0])
gcube([step.x, size.y, base.z]);
}
}
color(silver) {
contact_h = step.z - 0.2;
fuse_d = size.y - 2 * step.y;
for(end = [-1, 1])
translate([end * (size.x / 2 - step.x), 0, contact_h / 2])
rotate([90, 0, 0])
linear_extrude(size.y - 2 * step.y, center = true)
difference() {
rounded_square([step.x * 2, contact_h], 0.2, $fn = fn);
translate([-step.x * end, 0])
square([step.x * 2, contact_h], center = true);
}
translate_z(step.z - fuse_d / 2)
rotate([0, 90, 0])
linear_extrude(size.x - (2 * step.x - eps), center = true)
scale([1, size.y / fuse_d - eps])
rotate(90)
semi_circle(fuse_d / 2);
}
color("black")
translate_z(z + size.z)
linear_extrude(eps)
resize([(size.x - 2 * step.x) * 0.9, size.y / 2])
text(value, halign = "center", valign = "center");
}

View File

@@ -87,4 +87,8 @@ QFP50P1200X1200X160_64N = ["QFP50P1200X1200X160_64N", [10, 10, 1.6], 12, 64, 0.5
smd_qfps = [ QFP50P1200X1200X160_64N ];
OMT250 = ["OMT250", [11, 4.6, 3.3], 0.15, [1.9,0.5, 2.7], [5.5, 4.6, 0.5]];
smd_250V_fuses = [OMT250];
use <smd.scad>