mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-07 16:06:31 +02:00
Added cutout for trimpot10.
This commit is contained in:
@@ -1925,7 +1925,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
|||||||
| ```rj45(cutout = false)``` | Draw RJ45 Ethernet connector |
|
| ```rj45(cutout = false)``` | Draw RJ45 Ethernet connector |
|
||||||
| ```standoff(h, d, h2, d2)``` | Draw a standoff |
|
| ```standoff(h, d, h2, d2)``` | Draw a standoff |
|
||||||
| ```terminal_35(ways, colour = "blue")``` | Draw 3.5mm terminal block |
|
| ```terminal_35(ways, colour = "blue")``` | Draw 3.5mm terminal block |
|
||||||
| ```trimpot10(vertical, coutout = false)``` | Draw a ten turn trimpot |
|
| ```trimpot10(vertical, cutout = false)``` | Draw a ten turn trimpot |
|
||||||
| ```uSD(size, cutout = false)``` | Draw uSD socket |
|
| ```uSD(size, cutout = false)``` | Draw uSD socket |
|
||||||
| ```usb_Ax1(cutout = false)``` | Draw USB type A single socket |
|
| ```usb_Ax1(cutout = false)``` | Draw USB type A single socket |
|
||||||
| ```usb_Ax2(cutout = false)``` | Draw USB type A dual socket |
|
| ```usb_Ax2(cutout = false)``` | Draw USB type A dual socket |
|
||||||
@@ -2011,7 +2011,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
|||||||
| ```rj45(cutout = false)``` | Draw RJ45 Ethernet connector |
|
| ```rj45(cutout = false)``` | Draw RJ45 Ethernet connector |
|
||||||
| ```standoff(h, d, h2, d2)``` | Draw a standoff |
|
| ```standoff(h, d, h2, d2)``` | Draw a standoff |
|
||||||
| ```terminal_35(ways, colour = "blue")``` | Draw 3.5mm terminal block |
|
| ```terminal_35(ways, colour = "blue")``` | Draw 3.5mm terminal block |
|
||||||
| ```trimpot10(vertical, coutout = false)``` | Draw a ten turn trimpot |
|
| ```trimpot10(vertical, cutout = false)``` | Draw a ten turn trimpot |
|
||||||
| ```uSD(size, cutout = false)``` | Draw uSD socket |
|
| ```uSD(size, cutout = false)``` | Draw uSD socket |
|
||||||
| ```usb_Ax1(cutout = false)``` | Draw USB type A single socket |
|
| ```usb_Ax1(cutout = false)``` | Draw USB type A single socket |
|
||||||
| ```usb_Ax2(cutout = false)``` | Draw USB type A dual socket |
|
| ```usb_Ax2(cutout = false)``` | Draw USB type A dual socket |
|
||||||
|
@@ -735,7 +735,7 @@ module standoff(h, d, h2, d2) { //! Draw a standoff
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module trimpot10(vertical, coutout = false) { //! Draw a ten turn trimpot
|
module trimpot10(vertical, cutout = false) { //! Draw a ten turn trimpot
|
||||||
l = 10;
|
l = 10;
|
||||||
w = 9.5;
|
w = 9.5;
|
||||||
h = 4.8;
|
h = 4.8;
|
||||||
@@ -746,21 +746,29 @@ module trimpot10(vertical, coutout = false) { //! Draw a ten turn trimpot
|
|||||||
slot_w = 0.6;
|
slot_w = 0.6;
|
||||||
slot_h = 0.8;
|
slot_h = 0.8;
|
||||||
|
|
||||||
|
module screw_pos()
|
||||||
|
translate([-w / 2 + screw_d / 2, -l / 2, h - screw_d / 2])
|
||||||
|
rotate([90, 0, 0])
|
||||||
|
children();
|
||||||
|
|
||||||
translate(vertical ? [0, -h / 2, l / 2] : [0, 0])
|
translate(vertical ? [0, -h / 2, l / 2] : [0, 0])
|
||||||
rotate([vertical ? -90 : 0, 0, 0]) {
|
rotate([vertical ? -90 : 0, 0, 0]) {
|
||||||
color("#2CA1FD") {
|
if(cutout)
|
||||||
translate([0, -foot_h / 2, foot_h / 2 + h / 2])
|
screw_pos()
|
||||||
cube([w, l - foot_h, h - foot_h], center = true);
|
cylinder(d = screw_d + 1, h = 100);
|
||||||
|
else
|
||||||
|
color("#2CA1FD") {
|
||||||
|
translate([0, -foot_h / 2, foot_h / 2 + h / 2])
|
||||||
|
cube([w, l - foot_h, h - foot_h], center = true);
|
||||||
|
|
||||||
for(x = [-1, 1], y = [-1, 1])
|
for(x = [-1, 1], y = [-1, 1])
|
||||||
translate([x * (w - foot_w) / 2, y * (l - foot_w) / 2, h / 2])
|
translate([x * (w - foot_w) / 2, y * (l - foot_w) / 2, h / 2])
|
||||||
cube([foot_w, foot_w, h], center = true);
|
cube([foot_w, foot_w, h], center = true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
color(brass)
|
color(brass)
|
||||||
translate([-w / 2 + screw_d / 2, -l / 2, h - screw_d / 2])
|
screw_pos() {
|
||||||
rotate([90, 0, 0]) {
|
|
||||||
cylinder(d = screw_d, h = screw_h - slot_h);
|
cylinder(d = screw_d, h = screw_h - slot_h);
|
||||||
|
|
||||||
linear_extrude(height = screw_h)
|
linear_extrude(height = screw_h)
|
||||||
@@ -770,7 +778,7 @@ module trimpot10(vertical, coutout = false) { //! Draw a ten turn trimpot
|
|||||||
square([slot_w, screw_d + 1], center = true);
|
square([slot_w, screw_d + 1], center = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb component from description
|
module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb component from description
|
||||||
|
Reference in New Issue
Block a user