mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-03 20:32:35 +02:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7090c714ce | ||
|
654f094304 | ||
|
1e5e5860e1 | ||
|
3d8a9ec8aa | ||
|
7ec059142f | ||
|
7f0d96b824 | ||
|
b7b5c837bd | ||
|
dc4e24b63a | ||
|
56ec8e03ad | ||
|
728b7adf38 |
@@ -1760,6 +1760,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```barrel_jack(cutout = false)``` | Draw barrel power jack |
|
||||
| ```buzzer(height, diameter, colour)``` | Draw PCB buzzer with specified height, diameter and color |
|
||||
| ```chip(length, width, thickness, colour, cutout = false)``` | Draw a coloured cube to represent a chip, or other rectangular component |
|
||||
| ```flat_flex(cutout = false)``` | Draw flat flexistrip connector as used on RPI0 |
|
||||
| ```flex(cutout = false)``` | Draw flexistrip connector |
|
||||
@@ -2562,7 +2563,7 @@ Filament spool models
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```spool(type)``` | Draw specified spool |
|
||||
| ```spool(type, filament_depth = 0, filament_colour = "white", filament_d = 3)``` | Draw specified spool with optional filament |
|
||||
|
||||

|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 162 KiB |
@@ -23,9 +23,9 @@ use <../utils/layout.scad>
|
||||
include <../vitamins/spools.scad>
|
||||
|
||||
module spools()
|
||||
layout([for(s = spools) spool_height(s)], 100)
|
||||
layout([for(s = spools) spool_height(s)], 100) let(s = spools[$i])
|
||||
rotate([90, 0, 90])
|
||||
spool(spools[$i]);
|
||||
spool(s, filament_depth = spool_depth(s) / 2, filament_colour = [pp1_colour, pp2_colour, pp3_colour, pp4_colour][$i % 4], filament_d = $i ? 3 : 1.75);
|
||||
|
||||
if($preview)
|
||||
spools();
|
||||
|
@@ -200,6 +200,13 @@ module jack(cutout = false) { //! Draw 3.5mm jack
|
||||
}
|
||||
}
|
||||
|
||||
module buzzer(height, diameter, colour) { //! Draw PCB buzzer with specified height, diameter and color
|
||||
color (colour)
|
||||
tube(or = diameter / 2, ir = height > 5 ? 1 : 0.75, h = height);
|
||||
color("white")
|
||||
cylinder(d = 2, h = max(height - 3 , 0.5));
|
||||
}
|
||||
|
||||
function hdmi_depth(type) = type[2]; //! Front to back depth
|
||||
function hdmi_width1(type) = type[3]; //! Inside width at the top
|
||||
function hdmi_width2(type) = type[4]; //! Inside width at the bottom
|
||||
@@ -710,6 +717,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
|
||||
if(show(comp, "usb_Ax2")) usb_Ax2(cutouts);
|
||||
if(show(comp, "usb_uA")) usb_uA(cutouts);
|
||||
if(show(comp, "usb_B")) usb_B(cutouts);
|
||||
if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey20));
|
||||
if(show(comp, "jack")) jack(cutouts);
|
||||
if(show(comp, "barrel_jack")) barrel_jack(cutouts);
|
||||
if(show(comp, "hdmi")) hdmi(hdmi_full, cutouts);
|
||||
|
@@ -20,6 +20,7 @@
|
||||
//! Filament spool models
|
||||
|
||||
include <../core.scad>
|
||||
include <../utils/tube.scad>
|
||||
|
||||
function spool_diameter(type) = type[1]; //! Outside diameter
|
||||
function spool_width(type) = type[2]; //! Internal width
|
||||
@@ -32,7 +33,7 @@ function spool_hub_taper(type) = type[8]; //! Diameter at which it tapers do
|
||||
function spool_height(type) = spool_width(type) + 2 * spool_hub_thickness(type); //! Outside width
|
||||
function spool_pitch(type) = spool_width(type) + spool_rim_thickness(type); //! Spacing of the rims
|
||||
|
||||
module spool(type) { //! Draw specified spool
|
||||
module spool(type, filament_depth = 0, filament_colour = "white", filament_d = 3) { //! Draw specified spool with optional filament
|
||||
vitamin(str("spool(", type[0], "): Filament spool ", spool_diameter(type), " x ", spool_width(type)));
|
||||
|
||||
h = spool_height(type);
|
||||
@@ -57,4 +58,25 @@ module spool(type) { //! Draw specified spool
|
||||
[r3, h - spool_hub_thickness(type) + spool_rim_thickness(type)],
|
||||
[r2, h],
|
||||
]);
|
||||
|
||||
if(filament_depth) {
|
||||
w = spool_width(type);
|
||||
r = r5 + filament_depth;
|
||||
color(filament_colour)
|
||||
if(filament_d) {
|
||||
n = round(w / filament_d) + 1;
|
||||
fd = w / n;
|
||||
rotate_extrude($fn = 180) {
|
||||
for(i = [0 : n -1])
|
||||
translate([r - fd / 2, i * fd - w / 2 + fd / 2])
|
||||
circle(d = fd, $fn = 32);
|
||||
|
||||
translate([r5, -w / 2])
|
||||
square([filament_depth - fd / 2, w]);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
tube(r, r5, w, $fn = 180);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user