Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
235caa4101 | ||
|
6a9af0af8a | ||
|
f066b1b8ae | ||
|
4be7b2f0ea | ||
|
3cc3c52b54 | ||
|
7f1634ef06 | ||
|
34c8c31cae | ||
|
a6a08088d9 | ||
|
06443a558b | ||
|
bcf9fb38df | ||
|
18f3d43780 | ||
|
eda88cc8d7 | ||
|
630268d71a | ||
|
66f793b00b | ||
|
cc5654d7d7 | ||
|
9989f13edf | ||
|
d46913ce4f |
12
CHANGELOG.md
@@ -3,6 +3,18 @@
|
||||
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
|
||||
|
||||
|
||||
### [v20.5.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.5.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.4.0...v20.5.0 "diff with v20.4.0")
|
||||
* 2022-05-31 [`cc5654d`](https://github.com/nophead/NopSCADlib/commit/cc5654d7d756287f5311e35104003f38a4a94475 "show commit") [C.](# "Chris") Added `usb_miniA()`.
|
||||
|
||||
### [v20.4.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.4.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.3.1...v20.4.0 "diff with v20.3.1")
|
||||
* 2022-04-01 [`d46913c`](https://github.com/nophead/NopSCADlib/commit/d46913ce4f64656889fd29dccc0709d84d4d9c49 "show commit") [C.P.](# "Chris Palmer") Printed `screw_knob()` is now fully customisable by passing a parameter
|
||||
list, constructed by `screw_knob(),` in place of the screw.
|
||||
|
||||
* Screws can still be passed for backwards compatibility.
|
||||
|
||||
#### [v20.3.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.3.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.3.0...v20.3.1 "diff with v20.3.0")
|
||||
* 2022-04-01 [`b9f676a`](https://github.com/nophead/NopSCADlib/commit/b9f676a75369d666540f79abe0392e209e20d0f0 "show commit") [C.P.](# "Chris Palmer") Documented `insert_hole_length()`.
|
||||
|
||||
### [v20.3.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.3.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.2.0...v20.3.0 "diff with v20.2.0")
|
||||
* 2022-03-17 [`ddc4150`](https://github.com/nophead/NopSCADlib/commit/ddc4150ed73c8300bc3ef4326a91cd4ec54ed9e3 "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
|
||||
|
||||
|
BIN
libtest.png
Before Width: | Height: | Size: 983 KiB After Width: | Height: | Size: 984 KiB |
12
libtest.scad
@@ -163,14 +163,11 @@ corner_blocks_y = fixing_blocks_y + 30;
|
||||
translate([x5, corner_blocks_y])
|
||||
corner_blocks();
|
||||
|
||||
feet_y = corner_blocks_y + 70;
|
||||
translate([x5, feet_y])
|
||||
feet();
|
||||
|
||||
translate([x5 + 70, feet_y])
|
||||
screw_knobs_y = corner_blocks_y + 70;
|
||||
translate([x5, screw_knobs_y])
|
||||
screw_knobs();
|
||||
|
||||
knobs_y = feet_y + 40;
|
||||
knobs_y = screw_knobs_y + 40;
|
||||
translate([640, knobs_y])
|
||||
printed_pulley_test();
|
||||
|
||||
@@ -185,6 +182,9 @@ strap_y = clips_y + 50;
|
||||
translate([x5 + 60, strap_y])
|
||||
strap_handles();
|
||||
|
||||
translate([x6, strap_y])
|
||||
feet();
|
||||
|
||||
handle_y = strap_y + 50;
|
||||
translate([x5, handle_y])
|
||||
handle();
|
||||
|
@@ -19,53 +19,102 @@
|
||||
|
||||
//
|
||||
//! Knob with embedded hex head screw.
|
||||
//!
|
||||
//! Most aspects can be customised, e.g. the flange thickness and radius. It can also be solid or just a wall and be wavey edged or fluted.
|
||||
//
|
||||
include <../core.scad>
|
||||
use <../utils/hanging_hole.scad>
|
||||
|
||||
knob_wall = 2;
|
||||
function screw_knob_screw(type) = type[0]; //! The hex screw
|
||||
function screw_knob_wall(type) = type[1]; //! Wall thickness
|
||||
function screw_knob_stem_h(type) = type[2]; //! The stem height below the flange
|
||||
function screw_knob_flange_t(type) = type[3]; //! The thickness of the flange
|
||||
function screw_knob_flange_r(type) = type[4]; //! The flange outside radius
|
||||
function screw_knob_solid(type) = type[5]; //! Is the flange solid or just a wall
|
||||
function screw_knob_waves(type) = type[6]; //! Number of waves around the flange edge
|
||||
function screw_knob_wave_amp(type) = type[7]; //! Wave amplitude
|
||||
function screw_knob_fluted(type) = type[8]; //! Fluted instead of sine wave
|
||||
|
||||
function screw_knob(screw, wall = 2, stem_h = 6, flange_t = 4, flange_r = 9, solid = true, waves = 5, wave_amp = 2, fluted = false) = //! Constructor
|
||||
[screw, wall, stem_h, flange_t, flange_r, solid, waves, wave_amp, fluted];
|
||||
|
||||
function knob_nut_trap_depth(screw) = round_to_layer(screw_head_height(screw));
|
||||
knob_stem_h = 6;
|
||||
knob_thickness = 4;
|
||||
knob_r = 8;
|
||||
knob_wave = 1;
|
||||
knob_waves = 5;
|
||||
knob_height = knob_stem_h + knob_thickness;
|
||||
function knob_height() = knob_height;
|
||||
function knob_height(type) = //! Total height of the knob
|
||||
let(type = !is_list(type[0]) ? screw_knob(type) : type)
|
||||
screw_knob_stem_h(type) + screw_knob_flange_t(type);
|
||||
|
||||
module screw_knob(screw) { //! Generate the STL for a knob to fit the specified hex screw
|
||||
knob_stem_r = nut_trap_radius(screw_nut(screw)) + knob_wall;
|
||||
module screw_knob(type) { //! Generate the STL for a knob to fit the specified hex screw
|
||||
type = !is_list(type[0]) ? screw_knob(type) : type; // Allow just the screw to be specified for backwards compatability
|
||||
screw = screw_knob_screw(type);
|
||||
wall = screw_knob_wall(type);
|
||||
trap_r = nut_trap_radius(screw_nut(screw));
|
||||
stem_r = trap_r + wall;
|
||||
amp = screw_knob_wave_amp(type);
|
||||
flange_r = max(screw_knob_flange_r(type), stem_r + amp);
|
||||
flange_t = screw_knob_flange_t(type);
|
||||
knob_h = knob_height(type);
|
||||
waves = screw_knob_waves(type);
|
||||
|
||||
function wave(a) = knob_r + sin(a * knob_waves) * knob_wave;
|
||||
function wave(a) = flange_r - amp / 2 + sin(a * waves) * amp / 2;
|
||||
fn = r2sides(flange_r);
|
||||
points = [for(i = [0 : fn - 1], a = i * 360 / fn) wave(a) * [sin(a), cos(a)]];
|
||||
solid = screw_knob_solid(type);
|
||||
|
||||
module shape()
|
||||
if(screw_knob_fluted(type))
|
||||
difference() {
|
||||
circle4n(flange_r);
|
||||
|
||||
c = flange_r * sin(90 / waves); // Flute half chord
|
||||
d = flange_r - flange_r * cos(90 / waves); // Distance from chord to perimeter
|
||||
b = amp - d; // Distance from chord to flute bottom
|
||||
flute_r = (b^2 + c^2) / b / 2;
|
||||
for(i = [0 : waves - 1])
|
||||
rotate(360 * i / waves)
|
||||
translate([0, flange_r - amp + flute_r])
|
||||
circle4n(flute_r);
|
||||
}
|
||||
else
|
||||
polygon(points);
|
||||
|
||||
stl(str("screw_knob_M", screw_radius(screw) * 20))
|
||||
union() {
|
||||
render() difference() {
|
||||
cylinder(r = knob_stem_r, h = knob_thickness + knob_stem_h);
|
||||
cylinder(r = stem_r, h = knob_h);
|
||||
|
||||
hanging_hole(knob_nut_trap_depth(screw), screw_clearance_radius(screw))
|
||||
rotate(45)
|
||||
circle(r = nut_trap_radius(screw_nut(screw)), $fn = 6);
|
||||
circle(r = trap_r, $fn = 6);
|
||||
}
|
||||
linear_extrude(knob_thickness, convexity = 3)
|
||||
difference() {
|
||||
polygon(points = [for(a = [0 : 359]) [wave(a) * sin(a), wave(a) * cos(a)]]);
|
||||
for(i = [0 : 1])
|
||||
linear_extrude(i ? flange_t : round_to_layer(wall), convexity = 3)
|
||||
difference() {
|
||||
shape();
|
||||
|
||||
circle(knob_stem_r - eps);
|
||||
}
|
||||
if(i && ! solid)
|
||||
offset(-wall)
|
||||
shape();
|
||||
|
||||
circle(stem_r - eps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! Place the screw through the printed part
|
||||
module screw_knob_assembly(screw, length) //! Assembly with the screw in place
|
||||
assembly(str("screw_knob_M", 20 * screw_radius(screw), "_", length), ngb = true) {
|
||||
translate_z(knob_height)
|
||||
vflip()
|
||||
stl_colour(pp1_colour) screw_knob(screw);
|
||||
module screw_knob_assembly(type, length) { //! Assembly with the screw in place
|
||||
type = !is_list(type[0]) ? screw_knob(type) : type;
|
||||
screw = screw_knob_screw(type);
|
||||
knob_h = knob_height(type);
|
||||
|
||||
translate_z(knob_height - knob_nut_trap_depth(screw))
|
||||
rotate(-45)
|
||||
screw(screw, length);
|
||||
assembly(str("screw_knob_M", 20 * screw_radius(screw), "_", length), ngb = true) {
|
||||
translate_z(knob_h)
|
||||
vflip()
|
||||
stl_colour(pp1_colour) screw_knob(type);
|
||||
|
||||
translate_z(knob_h - knob_nut_trap_depth(screw))
|
||||
rotate(-45)
|
||||
screw(screw, length);
|
||||
}
|
||||
}
|
||||
|
||||
module screw_knob_M30_stl() screw_knob(M3_hex_screw);
|
||||
|
39
readme.md
@@ -2403,6 +2403,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| `usb_Ax2(cutout = false)` | Draw USB type A dual socket |
|
||||
| `usb_B(cutout = false)` | Draw USB B connector |
|
||||
| `usb_C(cutout = false)` | Draw USB C connector |
|
||||
| `usb_miniA(cutout = false)` | Draw USB mini A connector |
|
||||
| `usb_uA(cutout = false)` | Draw USB micro A connector |
|
||||
| `vero_pin(cropped = false)` | Draw a vero pin |
|
||||
|
||||
@@ -2553,6 +2554,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| `usb_Ax2(cutout = false)` | Draw USB type A dual socket |
|
||||
| `usb_B(cutout = false)` | Draw USB B connector |
|
||||
| `usb_C(cutout = false)` | Draw USB C connector |
|
||||
| `usb_miniA(cutout = false)` | Draw USB mini A connector |
|
||||
| `usb_uA(cutout = false)` | Draw USB micro A connector |
|
||||
| `vero_pin(cropped = false)` | Draw a vero pin |
|
||||
|
||||
@@ -4244,7 +4246,7 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `vero(name, assembly, holes, strips, pitch = inch(0.1)` | Constructor |
|
||||
| `vero(name, assembly, holes, strips, pitch = 2.54, fr4 = false, screw = M3_cap_screw, mounting_holes = [], breaks = [], no_tracks = [], components = [], joints = [])` | Constructor |
|
||||
| `vero_length(type)` | Length of the board |
|
||||
| `vero_size(type)` | Board size |
|
||||
| `vero_thickness(type)` | Thickness of the substrate |
|
||||
@@ -4272,7 +4274,7 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
|
||||
| 4 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
|
||||
| 4 | `screw(M3_dome_screw, 25)` | Screw M3 dome x 25mm |
|
||||
| 2 | `green_terminal(gt_2p54, 10)` | Terminal block 10 way 0.1" |
|
||||
| 2 | `veroboard(z_vb)` | Veroboard 5 holes x 22strips |
|
||||
| 2 | `veroboard(z_vb)` | Veroboard 5 holes x 22 strips |
|
||||
| 8 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
|
||||
|
||||
### Printed
|
||||
@@ -5914,15 +5916,36 @@ Clamp for ribbon cable and polypropylene strip or one or more ribbon cables.
|
||||
## Screw_knob
|
||||
Knob with embedded hex head screw.
|
||||
|
||||
Most aspects can be customised, e.g. the flange thickness and radius. It can also be solid or just a wall and be wavey edged or fluted.
|
||||
|
||||
[printed/screw_knob.scad](printed/screw_knob.scad) Implementation.
|
||||
|
||||
[tests/screw_knob.scad](tests/screw_knob.scad) Code for this example.
|
||||
|
||||
### Properties
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `screw_knob_flange_r(type)` | The flange outside radius |
|
||||
| `screw_knob_flange_t(type)` | The thickness of the flange |
|
||||
| `screw_knob_fluted(type)` | Fluted instead of sine wave |
|
||||
| `screw_knob_screw(type)` | The hex screw |
|
||||
| `screw_knob_solid(type)` | Is the flange solid or just a wall |
|
||||
| `screw_knob_stem_h(type)` | The stem height below the flange |
|
||||
| `screw_knob_wall(type)` | Wall thickness |
|
||||
| `screw_knob_wave_amp(type)` | Wave amplitude |
|
||||
| `screw_knob_waves(type)` | Number of waves around the flange edge |
|
||||
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `knob_height(type)` | Total height of the knob |
|
||||
| `screw_knob(screw, wall = 2, stem_h = 6, flange_t = 4, flange_r = 9, solid = true, waves = 5, wave_amp = 2, fluted = false)` | Constructor |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `screw_knob(screw)` | Generate the STL for a knob to fit the specified hex screw |
|
||||
| `screw_knob_assembly(screw, length)` | Assembly with the screw in place |
|
||||
| `screw_knob(type)` | Generate the STL for a knob to fit the specified hex screw |
|
||||
| `screw_knob_assembly(type, length)` | Assembly with the screw in place |
|
||||
|
||||

|
||||
|
||||
@@ -5931,18 +5954,24 @@ Knob with embedded hex head screw.
|
||||
| ---:|:--- |:---|
|
||||
| 1 | `screw(M3_hex_screw, 16)` | Screw M3 hex x 16mm |
|
||||
| 1 | `screw(M4_hex_screw, 16)` | Screw M4 hex x 16mm |
|
||||
| 1 | `screw(M5_hex_screw, 16)` | Screw M5 hex x 16mm |
|
||||
| 1 | `screw(M6_hex_screw, 16)` | Screw M6 hex x 16mm |
|
||||
|
||||
### Printed
|
||||
| Qty | Filename |
|
||||
| ---:|:--- |
|
||||
| 1 | screw_knob_M30.stl |
|
||||
| 1 | screw_knob_M40.stl |
|
||||
| 1 | screw_knob_M50.stl |
|
||||
| 1 | screw_knob_M60.stl |
|
||||
|
||||
### Assemblies
|
||||
| Qty | Name |
|
||||
| ---:|:--- |
|
||||
| 1 | screw_knob_M30_16_assembly |
|
||||
| 1 | screw_knob_M40_16_assembly |
|
||||
| 1 | screw_knob_M50_16_assembly |
|
||||
| 1 | screw_knob_M60_16_assembly |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
@@ -6854,7 +6883,7 @@ Original version by Doug Moen on the OpenSCAD forum
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `box(xmin, ymin, zmin, xmax, ymax, zmax)` | Construct a box given its bounds |
|
||||
| `clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf)` | Clip child to specified boundaries |
|
||||
| `clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf, convexity = 1)` | Clip child to specified boundaries |
|
||||
|
||||

|
||||
|
||||
|
@@ -157,7 +157,7 @@ if __name__ == '__main__':
|
||||
break
|
||||
j += 1
|
||||
|
||||
# Print verson info
|
||||
# Print version info
|
||||
print('%s [%s](%s "show release") %s %s' % ('#' * (level + 1), ver, url + '/releases/tag/' + ver, type, diff), file = file)
|
||||
|
||||
# Print commits excluding merges
|
||||
|
@@ -26,7 +26,7 @@ from set_config import *
|
||||
from exports import bom_to_parts
|
||||
import os
|
||||
import openscad
|
||||
from tests import do_cmd, update_image, colour_scheme, background
|
||||
from tests import do_cmd, update_image, colour_scheme, background, image_size
|
||||
from deps import mtime
|
||||
from colorama import init
|
||||
import json
|
||||
@@ -95,7 +95,7 @@ def render(target, type):
|
||||
render = "--preview" if type == 'stl' or colour != pp1 else "--render"
|
||||
tmp_name = tmp_dir + '/' + part[:-4] + '.png'
|
||||
dummy_deps_name = tmp_dir + '/tmp.deps' # work around for OpenSCAD issue #3879
|
||||
openscad.run("-o", tmp_name, png_maker_name, colour_scheme, "--projection=p", "--imgsize=4096,4096", cam, render, "--autocenter", "--viewall", "-d", dummy_deps_name)
|
||||
openscad.run("-o", tmp_name, png_maker_name, colour_scheme, "--projection=p", image_size, cam, render, "--autocenter", "--viewall", "-d", dummy_deps_name)
|
||||
do_cmd(("magick "+ tmp_name + " -trim -resize 280x280 -background %s -gravity Center -extent 280x280 -bordercolor %s -border 10 %s"
|
||||
% (background, background, tmp_name)).split())
|
||||
update_image(tmp_name, png_name)
|
||||
|
@@ -57,13 +57,13 @@ def set_config(target, usage = None):
|
||||
sys.exit(1)
|
||||
|
||||
if not targets:
|
||||
print("Not a muli-configuration project (no config_<target>.scad files found)")
|
||||
print("Not a multi-configuration project (no config_<target>.scad files found)")
|
||||
if usage:
|
||||
usage()
|
||||
sys.exit(1)
|
||||
|
||||
if not target in targets:
|
||||
print(target + " is not a configuration, avaliable configurations are: " + valid_targets_string())
|
||||
print(target + " is not a configuration, available configurations are: " + valid_targets_string())
|
||||
if usage:
|
||||
usage()
|
||||
sys.exit(1)
|
||||
|
@@ -36,8 +36,7 @@ from blurb import *
|
||||
from colorama import Fore
|
||||
from tmpdir import *
|
||||
|
||||
w = 4096
|
||||
h = w
|
||||
image_size = "--imgsize=4096,4096"
|
||||
threshold = 20 # Image comparison allowed number of different pixels
|
||||
fuzz = 5 # Image comparison allowed percentage error in pixel value
|
||||
|
||||
@@ -119,7 +118,7 @@ def tests(tests):
|
||||
libtest = True
|
||||
lib_blurb = scrape_blurb(scad_name)
|
||||
if not os.path.isfile(png_name):
|
||||
openscad.run(scad_name, "-o", png_name, colour_scheme, "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,50,0,340,500", "--autocenter", "--viewall");
|
||||
openscad.run(scad_name, "-o", png_name, colour_scheme, "--projection=p", image_size, "--camera=0,0,0,50,0,340,500", "--autocenter", "--viewall");
|
||||
do_cmd(["magick", png_name, "-trim", "-resize", "1280", "-bordercolor", background, "-border", "10", png_name])
|
||||
else:
|
||||
#
|
||||
@@ -240,7 +239,7 @@ def tests(tests):
|
||||
print(changed)
|
||||
t = time.time()
|
||||
tmp_name = tmp_dir + '/tmp.png'
|
||||
openscad.run_list([scad_name, "-o", tmp_name] + options.list() + ["-D$bom=2", colour_scheme, "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,70,0,315,500", "--autocenter", "--viewall", "-d", dname]);
|
||||
openscad.run_list([scad_name, "-o", tmp_name] + options.list() + ["-D$bom=2", colour_scheme, "--projection=p", image_size, "--camera=0,0,0,70,0,315,500", "--autocenter", "--viewall", "-d", dname]);
|
||||
times.add_time(scad_name, t)
|
||||
do_cmd(["magick", tmp_name, "-trim", "-resize", "1000x600", "-bordercolor", background, "-border", "10", tmp_name])
|
||||
update_image(tmp_name, png_name)
|
||||
|
@@ -25,7 +25,7 @@
|
||||
from __future__ import print_function
|
||||
from set_config import *
|
||||
import openscad
|
||||
from tests import do_cmd, update_image, colour_scheme, background
|
||||
from tests import do_cmd, update_image, colour_scheme, background, image_size
|
||||
import time
|
||||
import times
|
||||
import options
|
||||
@@ -223,7 +223,7 @@ def views(target, do_assemblies = None):
|
||||
target_def = ['-D$target="%s"' % target] if target else []
|
||||
cwd_def = ['-D$cwd="%s"' % os.getcwd().replace('\\', '/')]
|
||||
view_def = ['--viewall', '--autocenter'] if not (zoomed & (1 << explode)) else ['--camera=0,0,0,55,0,25,140']
|
||||
openscad.run_list(["-o", tmp_name, png_maker_name] + options.list() + target_def + cwd_def + view_def + ["-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", "--imgsize=4096,4096", "-d", dname]);
|
||||
openscad.run_list(["-o", tmp_name, png_maker_name] + options.list() + target_def + cwd_def + view_def + ["-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", image_size, "-d", dname]);
|
||||
times.add_time(png_name, t)
|
||||
do_cmd(["magick", tmp_name, "-trim", "-resize", "1004x1004", "-bordercolor", background, "-border", "10", tmp_name])
|
||||
update_image(tmp_name, png_name)
|
||||
|
@@ -85,16 +85,18 @@ test_pcb = ["test_pcb", "Test PCB",
|
||||
[ 8, 105, 180, "usb_Ax2"],
|
||||
[ 7, 85, 180, "molex_usb_Ax1"],
|
||||
[ 8.5,125, 180, "molex_usb_Ax2"],
|
||||
[ 3, 140, 180, "usb_uA"],
|
||||
[ 8, 155, 180, "usb_B"],
|
||||
[ 3, 138, 180, "usb_uA"],
|
||||
[ 4.6,148, 180, "usb_miniA"],
|
||||
[ 3.7,158, 180, "usb_C"],
|
||||
[ 8, 170, 180, "usb_B"],
|
||||
[ 6, 184, 180, "uSD", [12, 11.5, 1.4]],
|
||||
[ 8, 196, 180, "jack"],
|
||||
[ 6, 206, 180, "barrel_jack"],
|
||||
[ 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"],
|
||||
[ 38, 190, -90, "text", 25, 4, "Silkscreen", "Liberation Sans:style=Bold"],
|
||||
[ 8, 190, 180, "jack"],
|
||||
[ 6, 200, 180, "barrel_jack"],
|
||||
[ 5, 218, 180, "hdmi"],
|
||||
[ 3, 235, 180, "mini_hdmi"],
|
||||
[ 6, 175, 180, "uSD", [12, 11.5, 1.4]],
|
||||
|
||||
[ 65, 9, 0, "link", inch(0.4)],
|
||||
[ 65, 12, 0, "ax_res", res1_8, 1000],
|
||||
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 165 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 82 KiB |
@@ -17,20 +17,26 @@
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
use <../utils/layout.scad>
|
||||
|
||||
use <../printed/screw_knob.scad>
|
||||
|
||||
screws = [M3_hex_screw, M4_hex_screw];
|
||||
knobs = [
|
||||
M3_hex_screw,
|
||||
M4_hex_screw,
|
||||
screw_knob(M5_hex_screw, flange_r = 12, flange_t = 6, stem_h = 2, waves = 6),
|
||||
screw_knob(M6_hex_screw, flange_r = 15, flange_t = 6, solid = false, stem_h = 2, waves = 6, wall = 1.6, fluted = true),
|
||||
];
|
||||
|
||||
module do_screw_knob(screw)
|
||||
module do_screw_knob(knob) {
|
||||
if($preview)
|
||||
screw_knob_assembly(screw, 16);
|
||||
screw_knob_assembly(knob, 16);
|
||||
else
|
||||
screw_knob(screw);
|
||||
screw_knob(knob);
|
||||
}
|
||||
|
||||
module screw_knobs()
|
||||
for(i = [0 : len(screws) - 1])
|
||||
translate([i * 30, 0])
|
||||
do_screw_knob(screws[i]);
|
||||
layout([for(k = knobs) 2 * screw_knob_flange_r(k)], 10)
|
||||
do_screw_knob(knobs[$i]);
|
||||
|
||||
screw_knobs();
|
||||
|
@@ -41,8 +41,8 @@ module box(xmin, ymin, zmin, xmax, ymax, zmax) //! Construct a box given its bou
|
||||
[0,2,3,1]] // left
|
||||
);
|
||||
|
||||
module clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf) //! Clip child to specified boundaries
|
||||
render() intersection() {
|
||||
module clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf, convexity = 1) //! Clip child to specified boundaries
|
||||
render(convexity = convexity) intersection() {
|
||||
children();
|
||||
|
||||
box(xmin, ymin, zmin, xmax, ymax, zmax);
|
||||
|
@@ -127,8 +127,8 @@ function sweep_transforms(path, loop = false, twist = 0) =
|
||||
i = i + 1,
|
||||
rot = i < len ? rotate_from_to(tangents[i - 1], tangents[i]) * rot : undef) rot],
|
||||
|
||||
missmatch = loop ? calculate_twist(rotations[0], rotations[last]) : 0,
|
||||
rotation = missmatch + twist
|
||||
mismatch = loop ? calculate_twist(rotations[0], rotations[last]) : 0,
|
||||
rotation = mismatch + twist
|
||||
)
|
||||
[for(i = [0 : last])
|
||||
let(za = rotation * lengths[i] / length)
|
||||
|
@@ -20,7 +20,7 @@
|
||||
// Extrusion
|
||||
//
|
||||
// W H d1 d2 sq cw cwi t st f recess
|
||||
E1515 = [ "E1515", 15, 15, -2.5, 0, 5.7, 3.4, 5.7, 1.1, 1.1, 0.5, false ];
|
||||
E1515 = [ "E1515", 15, 15, -3.3, 0, 5.5, 6.2, 9.5, 1.0, 0.9, 0.5, false ];
|
||||
E2020 = [ "E2020", 20, 20, -4.2, -3, 8, 6, 12.0, 2, 2, 1, false ];
|
||||
E2020t = [ "E2020t",20, 20, -5.0, -3, 7.8, 6.2, 11.0, 1.8, 1.5, 1.5, [7.2, 0.5] ];
|
||||
E2040 = [ "E2040", 20, 40, -4.2, -3, 8, 6, 12.0, 2, 2, 1, false ];
|
||||
|
@@ -485,6 +485,50 @@ module usb_uA(cutout = false) { //! Draw USB micro A connector
|
||||
}
|
||||
}
|
||||
|
||||
module usb_miniA(cutout = false) { //! Draw USB mini A connector
|
||||
l = 9.2;
|
||||
iw1 = 7.0;
|
||||
iw2 = 6.0;
|
||||
ih1 = 1.05;
|
||||
ih2 = 1.0;
|
||||
h = 4.0;
|
||||
t = 0.4;
|
||||
|
||||
module D() {
|
||||
hull() {
|
||||
translate([-iw1 / 2, h - t - ih1])
|
||||
square([iw1, ih1]);
|
||||
|
||||
translate([-iw2 / 2, t + ih2])
|
||||
square([iw2, eps]);
|
||||
|
||||
}
|
||||
translate([-iw2 / 2, t])
|
||||
square([iw2, ih2]);
|
||||
}
|
||||
|
||||
if(cutout)
|
||||
rotate([90, 0, 90])
|
||||
linear_extrude(100)
|
||||
offset(2 * panel_clearance)
|
||||
D();
|
||||
else
|
||||
color("silver") rotate([90, 0, 90]) {
|
||||
linear_extrude(l, center = true)
|
||||
difference() {
|
||||
offset(t)
|
||||
D();
|
||||
|
||||
D();
|
||||
}
|
||||
|
||||
translate_z(-l / 2)
|
||||
linear_extrude(1)
|
||||
offset(t)
|
||||
D();
|
||||
}
|
||||
}
|
||||
|
||||
module usb_C(cutout = false) { //! Draw USB C connector
|
||||
l = 7.35;
|
||||
w = 8.94;
|
||||
@@ -1046,6 +1090,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
|
||||
if(show(comp, "usb_A")) usb_Ax1(cutouts);
|
||||
if(show(comp, "usb_Ax2")) usb_Ax2(cutouts);
|
||||
if(show(comp, "usb_uA")) usb_uA(cutouts);
|
||||
if(show(comp, "usb_miniA")) usb_miniA(cutouts);
|
||||
if(show(comp, "usb_B")) usb_B(cutouts);
|
||||
if(show(comp, "usb_C")) usb_C(cutouts);
|
||||
if(show(comp, "jack")) jack(cutouts);
|
||||
|
@@ -885,7 +885,7 @@ ArduinoNano = let(l = 43.18, w = 17.78, pitch = inch(0.6), pins = 15, poffset =
|
||||
[l / 2 + poffset, w / 2 - pitch / 2, 0, "-2p54joiner", pins, 1],
|
||||
[l / 2 + poffset, w / 2 + pitch / 2, 0, "-2p54joiner", pins, 1],
|
||||
[l / 2 + poffset + inch(0.75), w / 2, 0, "2p54header", 2, 3, false, undef, false, false],
|
||||
[1.75, w / 2, 180, "usb_uA" ],
|
||||
[3.1, w / 2, 180, "usb_miniA" ],
|
||||
[l / 2 - inch(0.25), w / 2, 45, "chip", 7, 7, 1.3],
|
||||
[l / 2 + poffset + inch(0.15), w / 2, 0, "chip", 3.5, 6, 1.8, silver ], // mock button
|
||||
[l / 2 + poffset + inch(0.15), w / 2, 0, "chip", 1.3, 2.6, 2.6, grey(90) ], // mock button
|
||||
|
@@ -41,7 +41,7 @@ function vero_track_width(type) = vero_pitch(type) * 0.8; //! The width of th
|
||||
function vero_length(type) = vero_holes(type) * vero_pitch(type); //! Length of the board
|
||||
function vero_width(type) = vero_strips(type) * vero_pitch(type); //! Width of the board
|
||||
|
||||
function vero(name, assembly, holes, strips, pitch = inch(0.1), fr4 = false, screw = M3_cap_screw, mounting_holes = [], breaks = [], no_tracks = [], components = [], joints = []) = //! Constructor
|
||||
function vero(name, assembly, holes, strips, pitch = 2.54, fr4 = false, screw = M3_cap_screw, mounting_holes = [], breaks = [], no_tracks = [], components = [], joints = []) = //! Constructor
|
||||
[ name, assembly, holes, strips, pitch, fr4, screw, mounting_holes, breaks, no_tracks, components, joints ];
|
||||
|
||||
function vero_size(type) = [vero_length(type), vero_width(type), vero_thickness(type)]; //! Board size
|
||||
@@ -89,7 +89,7 @@ module veroboard(type) { //! Draw specified veroboard with missing tracks and tr
|
||||
tc = vero_fr4(type) ? "silver" : copper;
|
||||
no_track = vero_no_track(type);
|
||||
|
||||
vitamin(str("veroboard(", type[0], "): Veroboard ", holes, " holes x ", strips, "strips"));
|
||||
vitamin(str("veroboard(", type[0], "): Veroboard ", holes, " holes x ", strips, " strips"));
|
||||
|
||||
color(colour) linear_extrude(vero_thickness(type))
|
||||
difference() {
|
||||
|