mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-03 12:22:46 +02:00
Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1928ec6fb1 | ||
|
f4b9ab961c | ||
|
ac7c4403b9 | ||
|
b7b40ba6a4 | ||
|
317b485ee1 | ||
|
6218287e2a | ||
|
d04f2bc8d1 | ||
|
49c26079fe | ||
|
b5ee63bfc4 | ||
|
a5bc80c0e8 | ||
|
bf8014fba0 | ||
|
ccf2b8e21b | ||
|
99f277de8d | ||
|
fe1ab5d59a | ||
|
e06b485d3e | ||
|
72d9c398bc | ||
|
608f0b2db0 | ||
|
7f8dfb9e73 | ||
|
c9de51fbbb | ||
|
30b7d966a1 | ||
|
abe1b1db01 | ||
|
8835fa0b7d | ||
|
71f935de8e | ||
|
b0a6a873c0 | ||
|
0771d4742c | ||
|
8682d0a470 | ||
|
4138ed438e |
39
CHANGELOG.md
39
CHANGELOG.md
@@ -3,6 +3,45 @@
|
||||
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
|
||||
|
||||
|
||||
#### [v18.3.1](https://github.com/nophead/NopSCADlib/releases/tag/v18.3.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v18.3.0...v18.3.1 "diff with v18.3.0")
|
||||
* 2022-01-10 [`317b485`](https://github.com/nophead/NopSCADlib/commit/317b485ee1c17ef8f8004014a54f1c6706201932 "show commit") [C.P.](# "Chris Palmer") Updated the image.
|
||||
|
||||
* 2022-01-11 [`ccf2b8e`](https://github.com/nophead/NopSCADlib/commit/ccf2b8e21b0b3a4d8ab72ea5cdecb0cdfb542e47 "show commit") [G.G.](# "Giampiero Gabbiani") Reverted PERF74x51
|
||||
|
||||
* 2022-01-08 [`99f277d`](https://github.com/nophead/NopSCADlib/commit/99f277de8d71f289d1a7340995d25309369e145c "show commit") [G.G.](# "Giampiero Gabbiani") Fixed offset calculations
|
||||
|
||||
* 2022-01-07 [`fe1ab5d`](https://github.com/nophead/NopSCADlib/commit/fe1ab5d59a5a4746a383111d1d2a558385f820f6 "show commit") [G.G.](# "Giampiero Gabbiani") Fixed grid origin offsets
|
||||
|
||||
### [v18.3.0](https://github.com/nophead/NopSCADlib/releases/tag/v18.3.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v18.2.0...v18.3.0 "diff with v18.2.0")
|
||||
* 2022-01-10 [`49c2607`](https://github.com/nophead/NopSCADlib/commit/49c26079fea1be8eb4a69d7468fb12df4595ec4c "show commit") [C.P.](# "Chris Palmer") Added `M3x6_hex_pillar`.
|
||||
|
||||
* 2022-01-10 [`b5ee63b`](https://github.com/nophead/NopSCADlib/commit/b5ee63bfc40b9ee698d44f435e58cfbc49ec259c "show commit") [C.P.](# "Chris Palmer") Added more documentation for microswitches.
|
||||
|
||||
* 2022-01-10 [`a5bc80c`](https://github.com/nophead/NopSCADlib/commit/a5bc80c0e865335cde29db9203438fe4bc659f43 "show commit") [C.P.](# "Chris Palmer") Added `D_plug_d()` function.
|
||||
|
||||
* 2022-01-10 [`bf8014f`](https://github.com/nophead/NopSCADlib/commit/bf8014fba0ed630898037712d2fdc432d7966d97 "show commit") [C.P.](# "Chris Palmer") Added `tubing_ir()` function.
|
||||
|
||||
### [v18.2.0](https://github.com/nophead/NopSCADlib/releases/tag/v18.2.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v18.1.0...v18.2.0 "diff with v18.1.0")
|
||||
* 2021-12-14 [`608f0b2`](https://github.com/nophead/NopSCADlib/commit/608f0b2db052b0c79597be39de5e89b9989e9270 "show commit") [C.P.](# "Chris Palmer") Simplified teardrop top length calculation.
|
||||
|
||||
* 2021-12-11 [`8682d0a`](https://github.com/nophead/NopSCADlib/commit/8682d0a4705ed2d85213d85702b5b9b039906f48 "show commit") [M.B.](# "Martin Budden") Allow configuration of teardrop angle.
|
||||
|
||||
### [v18.1.0](https://github.com/nophead/NopSCADlib/releases/tag/v18.1.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v18.0.0...v18.1.0 "diff with v18.0.0")
|
||||
* 2021-12-14 [`abe1b1d`](https://github.com/nophead/NopSCADlib/commit/abe1b1db0157a86af14a68ec42bdaa3e079e73a3 "show commit") [C.P.](# "Chris Palmer") Updated readme.
|
||||
|
||||
* 2021-12-14 [`71f935d`](https://github.com/nophead/NopSCADlib/commit/71f935de8e24673a10707cfe434a2faaf3de1c28 "show commit") [M.B.](# "Martin Budden") Corrected FOV handling.
|
||||
|
||||
* 2021-08-09 [`4138ed4`](https://github.com/nophead/NopSCADlib/commit/4138ed438e1111bafbe3bee17021a922966c334b "show commit") [M.B.](# "Martin Budden") Added ability to display camera field of view.
|
||||
|
||||
## [v18.0.0](https://github.com/nophead/NopSCADlib/releases/tag/v18.0.0 "show release") Breaking Changes [...](https://github.com/nophead/NopSCADlib/compare/v17.10.0...v18.0.0 "diff with v17.10.0")
|
||||
* 2021-12-12 [`970c538`](https://github.com/nophead/NopSCADlib/commit/970c5384960bb4c436cb789a1c5869c0a4adfaa5 "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
|
||||
|
||||
* 2021-12-12 [`cec790e`](https://github.com/nophead/NopSCADlib/commit/cec790ec09befd2631734cda88f3254043955638 "show commit") [M.B.](# "Martin Budden") Fixed y-carriage plain pulley and test.
|
||||
|
||||
* 2021-11-27 [`e71db80`](https://github.com/nophead/NopSCADlib/commit/e71db80093e5131908dff4a6ecba02e5c213a7d8 "show commit") [M.B.](# "Martin Budden") Improvements to `core_xy`
|
||||
1. Better default parameters
|
||||
2. Changed `plain_idler_offset` to work in x and y, to facilitate larger idler pulleys
|
||||
|
||||
### [v17.10.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.10.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.9.0...v17.10.0 "diff with v17.9.0")
|
||||
* 2021-12-12 [`c31f58a`](https://github.com/nophead/NopSCADlib/commit/c31f58a4fdf5163dc56b98e89f1a98d08cdfded2 "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
|
||||
|
||||
|
@@ -35,6 +35,7 @@ cnc_bit_r = is_undef($cnc_bit_r) ? 1.2 : $cnc_bit_r; // min
|
||||
show_rays = is_undef($show_rays) ? false : $show_rays; // show camera sight lines and light direction
|
||||
show_threads = is_undef($show_threads) ? false : $show_threads; // show screw threads
|
||||
show_plugs = is_undef($show_plugs) ? false : $show_plugs; // plugs on headers
|
||||
teardrop_angle = is_undef($teardrop_angle) ? 45 : $teardrop_angle; // teardrop angle
|
||||
pp1_colour = is_undef($pp1_colour) ? rr_green : $pp1_colour;// printed part colour 1, RepRap logo colour
|
||||
pp2_colour = is_undef($pp2_colour) ? crimson : $pp2_colour;// printed part colour 2
|
||||
pp3_colour = is_undef($pp3_colour) ? "SteelBlue" : $pp3_colour;// printed part colour 3
|
||||
|
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 944 KiB After Width: | Height: | Size: 945 KiB |
@@ -50,12 +50,13 @@ function box_sheets(type) = type[3]; //! Sheet type used for the sides
|
||||
function box_top_sheet(type) = type[4]; //! Sheet type for the top
|
||||
function box_base_sheet(type) = type[5]; //! Sheet type for the bottom
|
||||
function box_feet(type) = type[6]; //! True to enable feet on the bottom bezel
|
||||
function box_width(type) = type[7]; //! Internal width
|
||||
function box_depth(type) = type[8]; //! Internal depth
|
||||
function box_height(type) = type[9]; //! Internal height
|
||||
function box_name(type) = type[7]; //! Name for projects with more than one box
|
||||
function box_width(type) = type[8]; //! Internal width
|
||||
function box_depth(type) = type[9]; //! Internal depth
|
||||
function box_height(type) = type[10];//! Internal height
|
||||
|
||||
function box(screw, wall, sheets, top_sheet, base_sheet, size, feet = false, shelf_screw = undef) = //! Construct a property list for a box.
|
||||
concat([screw, is_undef(shelf_screw) ? screw : shelf_screw, wall, sheets, top_sheet, base_sheet, feet], size);
|
||||
function box(screw, wall, sheets, top_sheet, base_sheet, size, feet = false, shelf_screw = undef, name = "box") = //! Construct a property list for a box.
|
||||
concat([screw, is_undef(shelf_screw) ? screw : shelf_screw, wall, sheets, top_sheet, base_sheet, feet, name], size);
|
||||
|
||||
function box_bezel_clearance(type) = bezel_clearance;
|
||||
|
||||
@@ -66,7 +67,7 @@ function box_washer(type) = screw_washer(box_screw(type));
|
||||
function box_insert(type) = screw_insert(box_screw(type));
|
||||
function box_shelf_insert(type) = screw_insert(box_shelf_screw(type));
|
||||
|
||||
function box_hole_inset(type) = washer_radius(box_washer(type)) + 1;
|
||||
function box_hole_inset(type) = washer_radius(box_washer(type)) + 1; //! Screw inset from the corner of the internal dimensions
|
||||
function box_insert_r(type) = insert_hole_radius(box_insert(type));
|
||||
function box_insert_l(type) = insert_length(box_insert(type));
|
||||
function box_boss_r(type) = ceil(corrected_radius(box_insert_r(type)) + box_wall(type));
|
||||
@@ -91,6 +92,8 @@ function box_bezel_height(type, bottom) = //! Bezel height for top or bottom
|
||||
let(t1 = sheet_thickness(box_base_sheet(type)), t2 = sheet_thickness(box_top_sheet(type)))
|
||||
box_corner_rad(type) + box_profile_overlap(type) + (bottom ? max(t1, t2) : t2) - sheet_thickness(box_sheets(type));
|
||||
|
||||
function box_bc_name(type, suffix) = let(name = box_name(type)) name == "box" ? suffix : str(name, "_", suffix); // Backwards compatibale name
|
||||
|
||||
grill_hole = 5;
|
||||
grill_gap = 1.9;
|
||||
|
||||
@@ -143,7 +146,7 @@ module box_corner_profile_2D(type) { //! The 2D shape of the corner profile.
|
||||
module box_corner_profile(type) { //! Generates the corner profile STL for 3D printing.
|
||||
length = box_height(type) - 2 * box_margin(type);
|
||||
|
||||
stl("box_corner_profile")
|
||||
stl(str(box_name(type), "_corner_profile"))
|
||||
difference() {
|
||||
linear_extrude(length, center = true, convexity = 5)
|
||||
box_corner_profile_2D(type);
|
||||
@@ -192,7 +195,7 @@ module box_corner_profile_section(type, section, sections) { //! Generates inter
|
||||
}
|
||||
|
||||
module box_corner_profile_sections(type, section, sections) { //! Generate four copies of a corner profile section
|
||||
stl("box_corner_profile");
|
||||
stl(str(box_name(type), "_corner_profile"));
|
||||
offset = box_boss_r(type) + 1;
|
||||
for(i = [0 : 3])
|
||||
rotate(i * 90)
|
||||
@@ -222,7 +225,7 @@ module box_bezel(type, bottom) { //! Generates top and bottom bezel STLs
|
||||
height = box_bezel_height(type, bottom);
|
||||
foot_extension = foot_height - height;
|
||||
|
||||
stl(bottom ? "bottom_bezel" : "top_bezel")
|
||||
stl(box_bc_name(type, bottom ? "bottom_bezel" : "top_bezel"))
|
||||
difference() {
|
||||
w = box_width(type);
|
||||
d = box_depth(type);
|
||||
@@ -355,7 +358,6 @@ module box_bezel_section(type, bottom, rows, cols, x, y) { //! Generates interlo
|
||||
|
||||
translate([0, bw2 / 2, dh2 / 2])
|
||||
cube([eps, bw2 - 2 * dowel_wall + 2 * extrusion_width, dh2], center = true);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -440,7 +442,7 @@ module box_screw_hole_positions(type) {
|
||||
}
|
||||
|
||||
module box_base_blank(type) { //! Generates a 2D template for the base sheet
|
||||
dxf("box_base");
|
||||
dxf(str(box_name(type), "_base"));
|
||||
|
||||
difference() {
|
||||
sheet_2D(box_base_sheet(type), box_width(type), box_depth(type), box_sheet_r(type));
|
||||
@@ -451,7 +453,7 @@ module box_base_blank(type) { //! Generates a 2D template for the base sheet
|
||||
}
|
||||
|
||||
module box_top_blank(type) { //! Generates a 2D template for the top sheet
|
||||
dxf("box_top");
|
||||
dxf(str(box_name(type), "_top"));
|
||||
|
||||
difference() {
|
||||
sheet_2D(box_top_sheet(type), box_width(type), box_depth(type), box_sheet_r(type));
|
||||
@@ -466,7 +468,7 @@ function subst_sheet(type, sheet) =
|
||||
sheet ? assert(sheet_thickness(sheet) == sheet_thickness(s)) sheet : s;
|
||||
|
||||
module box_shelf_blank(type, sheet = false) { //! Generates a 2D template for a shelf sheet
|
||||
dxf("box_shelf");
|
||||
dxf(str(box_name(type), "_shelf"));
|
||||
|
||||
difference() {
|
||||
sheet_2D(subst_sheet(type, sheet), box_width(type) - bezel_clearance, box_depth(type) - bezel_clearance, 1);
|
||||
@@ -514,7 +516,7 @@ module box_shelf_bracket(type, screw_positions, wall = undef) { //! Generates a
|
||||
square([lip, eps]);
|
||||
}
|
||||
|
||||
stl("shelf_bracket")
|
||||
stl(box_bc_name(type, "shelf_bracket"))
|
||||
difference() {
|
||||
union() {
|
||||
linear_extrude(w)
|
||||
@@ -567,25 +569,25 @@ module box_shelf_bracket_section(type, rows, cols, x, y) { //! Generates section
|
||||
}
|
||||
|
||||
module box_left_blank(type, sheet = false) { //! Generates a 2D template for the left sheet, `sheet` can be set to override the type
|
||||
dxf("box_left");
|
||||
dxf(str(box_name(type), "_left"));
|
||||
|
||||
sheet_2D(subst_sheet(type, sheet), box_depth(type) - sheet_reduction(type), box_height(type) - sheet_reduction(type), 1);
|
||||
}
|
||||
|
||||
module box_right_blank(type, sheet = false) { //! Generates a 2D template for the right sheet, `sheet` can be set to override the type
|
||||
dxf("box_right");
|
||||
dxf(str(box_name(type), "_right"));
|
||||
|
||||
sheet_2D(subst_sheet(type, sheet), box_depth(type) - sheet_reduction(type), box_height(type) - sheet_reduction(type), 1);
|
||||
}
|
||||
|
||||
module box_front_blank(type, sheet = false) { //! Generates a 2D template for the front sheet, `sheet` can be set to override the type
|
||||
dxf("box_front");
|
||||
dxf(str(box_name(type), "_front"));
|
||||
|
||||
sheet_2D(subst_sheet(type, sheet), box_width(type) - sheet_reduction(type), box_height(type) - sheet_reduction(type), 1);
|
||||
}
|
||||
|
||||
module box_back_blank(type, sheet = false) { //! Generates a 2D template for the back sheet, `sheet` can be set to override the type
|
||||
dxf("box_back");
|
||||
dxf(str(box_name(type), "_back"));
|
||||
|
||||
sheet_2D(subst_sheet(type, sheet), box_width(type) - sheet_reduction(type), box_height(type) - sheet_reduction(type), 1);
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@
|
||||
// parameters to make the assembly views. E.g. module box_assembly() _box_assembly(box);
|
||||
//
|
||||
module _box_assembly(type, top = true, base = true, left = true, right = true, back = true, front = true, bezels = true, corners = 4)
|
||||
assembly("box") {
|
||||
assembly(box_name(type)) {
|
||||
echo("Box:", box_width(type), box_depth(type), box_height(type));
|
||||
|
||||
t = sheet_thickness(box_sheets(type));
|
||||
|
15
readme.md
15
readme.md
@@ -442,6 +442,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour
|
||||
<a name="Blowers"></a>
|
||||
## Blowers
|
||||
Models of radial blowers.
|
||||
Note that blower_exit() and blower_exit_offset() are for the inside of the exit for square blowers but the outside for spiral blowers.
|
||||
|
||||
[vitamins/blowers.scad](vitamins/blowers.scad) Object definitions.
|
||||
|
||||
@@ -678,6 +679,7 @@ PCB cameras.
|
||||
|:--- |:--- |
|
||||
| `camera_connector_pos(type)` | The flex connector block for the camera itself's position |
|
||||
| `camera_connector_size(type)` | The flex connector block for the camera itself's size |
|
||||
| `camera_fov(type)` | The field of view of the camera lens |
|
||||
| `camera_lens(type)` | Stack of lens parts, can be round, rectangular or rounded rectangular, with optional tapered aperture |
|
||||
| `camera_lens_offset(type)` | Offset of the lens center from the PCB centre |
|
||||
| `camera_pcb(type)` | The PCB part of the camera |
|
||||
@@ -685,7 +687,7 @@ PCB cameras.
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `camera(type, show_lens = true)` | Draw specified PCB camera |
|
||||
| `camera(type, show_lens = true, fov_distance = 0, fov = undef)` | Draw specified PCB camera |
|
||||
| `camera_lens(type, offset = 0, show_lens = true)` | Draw the lens stack, with optional offset for making a clearance hole |
|
||||
|
||||

|
||||
@@ -875,6 +877,7 @@ D-connectors. Can be any number of ways, male or female, solder buckets, PCB mou
|
||||
| `d_connector_holes(type)` | Place children at the screw hole positions |
|
||||
| `d_pillar()` | Draw a pillar for a D-connector |
|
||||
| `d_plug(type, socket = false, pcb = false, idc = false)` | Draw specified D plug, which can be IDC, PCB or plain solder bucket |
|
||||
| `d_plug_D(length, width, rad)` | D plug D shape |
|
||||
| `d_socket(connector, pcb = false, idc = false)` | Draw specified D socket, which can be IDC, PCB or plain solder bucket |
|
||||
|
||||

|
||||
@@ -1960,7 +1963,9 @@ UK 13A sockets at the moment.
|
||||
## Microswitches
|
||||
Used for limit switches. Currently only the button type is supported as the lever and roller types are less accurate.
|
||||
|
||||
The switch is drawn with the button at the nominal operation point. This can be plus or minus `microswitch_op_tol(type)`.
|
||||
The origin of the switch is in the center of the body. `microswitch_button_pos()` is the offset to tip of the button at its operating point.
|
||||
|
||||
The switch is drawn with the button at the nominal operation point. This actual trigger point can be plus or minus `microswitch_op_tol(type)`.
|
||||
|
||||
When the button is released it comes out by a maximum of `microswitch_fp_max(type)` from the nominal operating point.
|
||||
|
||||
@@ -2669,6 +2674,7 @@ Threaded pillars. Each end can be male or female.
|
||||
| ---:|:--- |:---|
|
||||
| 1 | `pillar(M3x13_hex_pillar)` | Pillar hex M/F M3x13 |
|
||||
| 1 | `pillar(M3x20_hex_pillar)` | Pillar hex M/F M3x20 |
|
||||
| 1 | `pillar(M3x6_hex_pillar)` | Pillar hex M/F M3x6 |
|
||||
| 1 | `pillar(M3x10_nylon_hex_pillar)` | Pillar hex nylon M/F M3x10 |
|
||||
| 1 | `pillar(M3x20_nylon_hex_pillar)` | Pillar hex nylon M/F M3x20 |
|
||||
| 1 | `pillar(M2x16_brass_pillar)` | Pillar nurled F/M M2x16 |
|
||||
@@ -4068,6 +4074,7 @@ Tubing and sleeving. The internal diameter can be forced to stretch it over some
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `tubing_ir(type)` | Inside radius |
|
||||
| `tubing_or(type)` | Outside radius |
|
||||
|
||||
### Modules
|
||||
@@ -4423,6 +4430,7 @@ Normally the side sheets are the same type but they can be overridden individual
|
||||
| `box_depth(type)` | Internal depth |
|
||||
| `box_feet(type)` | True to enable feet on the bottom bezel |
|
||||
| `box_height(type)` | Internal height |
|
||||
| `box_name(type)` | Name for projects with more than one box |
|
||||
| `box_screw(type)` | Screw type to be used at the corners |
|
||||
| `box_sheets(type)` | Sheet type used for the sides |
|
||||
| `box_shelf_screw(type)` | Screw type to hold a shelf |
|
||||
@@ -4433,9 +4441,10 @@ Normally the side sheets are the same type but they can be overridden individual
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `box(screw, wall, sheets, top_sheet, base_sheet, size, feet = false, shelf_screw = undef)` | Construct a property list for a box. |
|
||||
| `box(screw, wall, sheets, top_sheet, base_sheet, size, feet = false, shelf_screw = undef, name = "box")` | Construct a property list for a box. |
|
||||
| `box_bezel_height(type, bottom)` | Bezel height for top or bottom |
|
||||
| `box_corner_gap(type)` | Gap between box_sheets at the corners to connect inside and outside profiles |
|
||||
| `box_hole_inset(type)` | Screw inset from the corner of the internal dimensions |
|
||||
| `box_inset(type)` | How much the bezel intrudes on the specified width and length, away from the corners |
|
||||
| `box_intrusion(type)` | Corner profile intrusion |
|
||||
| `box_margin(type)` | How much the bezel intrudes on the specified height |
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 169 KiB |
Binary file not shown.
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 105 KiB |
@@ -34,15 +34,18 @@ module teardrop(h, r, center = true, truncate = true, chamfer = 0, chamfer_both_
|
||||
mirror([side, 0, 0])
|
||||
intersection() {
|
||||
hull()
|
||||
translate([offset, 0]) {
|
||||
circle4n(R);
|
||||
translate([offset, 0]) {
|
||||
circle4n(R);
|
||||
|
||||
if(truncate)
|
||||
translate([0, R / 2])
|
||||
square([2 * R * (sqrt(2) - 1), R], center = true);
|
||||
else
|
||||
polygon([[0, 0], [eps, 0], [0, R * sqrt(2)]]);
|
||||
}
|
||||
if (teardrop_angle > 0) {
|
||||
x = R * tan(teardrop_angle / 2);
|
||||
if(truncate)
|
||||
translate([0, R / 2])
|
||||
square([2 * x, R], center = true);
|
||||
else
|
||||
polygon([[0, 0], [eps, 0], [0, R + x * tan(min(teardrop_angle, 90 - eps))]]);
|
||||
}
|
||||
}
|
||||
translate([0, -2 * R])
|
||||
square([R, 4 * R]);
|
||||
}
|
||||
|
@@ -20,6 +20,8 @@
|
||||
//
|
||||
//! Models of radial blowers.
|
||||
//
|
||||
//! Note that blower_exit() and blower_exit_offset() are for the inside of the exit for square blowers but the outside for spiral blowers.
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
use <../utils/rounded_cylinder.scad>
|
||||
use <../utils/quadrant.scad>
|
||||
@@ -45,8 +47,10 @@ function blower_wall_left(type) = type[15]; //! Left side wall thickness
|
||||
function blower_wall_right(type) = type[17]; //! Right wall thickness (for square fans)
|
||||
|
||||
function blower_casing_is_square(type) = blower_depth(type) < 15; //! True for square radial fans, false for spiral shape radial blowers
|
||||
function blower_exit_offset(type) = blower_casing_is_square(type) ? blower_length(type) / 2 : blower_exit(type) / 2; //! Offset of exit's centre from the edge
|
||||
|
||||
function blower_exit_offset(type) = //! Offset of exit's centre from the edge
|
||||
blower_casing_is_square(type) ? len(blower_screw_holes(type)) > 2 ? blower_length(type) / 2
|
||||
: blower_wall_left(type) + blower_exit(type) / 2
|
||||
: blower_exit(type) / 2;
|
||||
fan_colour = grey(20);
|
||||
|
||||
module blower_fan(type, casing_is_square) {
|
||||
@@ -100,6 +104,7 @@ module blower_square(type) { //! Draw a square blower
|
||||
// cut out the inside, leaving the corners
|
||||
translate([hole_count == 2 ? wall_left : corner_inset + wall_left, -eps])
|
||||
square([blower_exit(type), width / 2], center = false);
|
||||
|
||||
translate(blower_axis(type))
|
||||
circle(d = blower_bore(type) + 1);
|
||||
} else {
|
||||
@@ -225,6 +230,9 @@ module blower(type) { //! Draw specified blower
|
||||
|
||||
blower_fan(type, is_square);
|
||||
}
|
||||
*translate([blower_exit(type) / 2 + blower_exit_offset(type), 0])
|
||||
rotate(180)
|
||||
#cube([blower_exit(type), 30, depth]);
|
||||
}
|
||||
|
||||
module blower_hole_positions(type) //! Translate children to screw hole positions
|
||||
|
@@ -28,6 +28,7 @@ function camera_lens_offset(type) = type[3]; //! Offset of the lens center fro
|
||||
function camera_lens(type) = type[4]; //! Stack of lens parts, can be round, rectangular or rounded rectangular, with optional tapered aperture
|
||||
function camera_connector_pos(type) = type[5]; //! The flex connector block for the camera itself's position
|
||||
function camera_connector_size(type)= type[6]; //! The flex connector block for the camera itself's size
|
||||
function camera_fov(type) = type[7]; //! The field of view of the camera lens
|
||||
|
||||
module camera_lens(type, offset = 0, show_lens = true) //! Draw the lens stack, with optional offset for making a clearance hole
|
||||
color(grey(20))
|
||||
@@ -57,7 +58,7 @@ module camera_lens(type, offset = 0, show_lens = true) //! Draw the lens stack,
|
||||
}
|
||||
}
|
||||
|
||||
module camera(type, show_lens = true) { //! Draw specified PCB camera
|
||||
module camera(type, show_lens = true, fov_distance = 0, fov = undef) { //! Draw specified PCB camera
|
||||
vitamin(str("camera(", type[0], "): ", type[1]));
|
||||
pcb = camera_pcb(type);
|
||||
|
||||
@@ -66,6 +67,18 @@ module camera(type, show_lens = true) { //! Draw specified PCB camera
|
||||
|
||||
translate_z(pcb_thickness(pcb)) {
|
||||
camera_lens(type, show_lens = show_lens);
|
||||
if (show_lens&& fov_distance > 0) {
|
||||
lens = camera_lens(type);
|
||||
fov = is_undef(fov) ? camera_fov(type) : fov;
|
||||
if (is_list(fov))
|
||||
#translate_z(lens[2][0].z) // note: use of # is deliberate, to show highlighted field of view
|
||||
translate(camera_lens_offset(type))
|
||||
hull() {
|
||||
cube([lens[1][1]/2, lens[1][1]/2, eps], center=true);
|
||||
translate_z(fov_distance)
|
||||
cube([2 * fov_distance * tan(fov.x / 2), 2 * fov_distance * tan(fov.y / 2), eps], center=true);
|
||||
}
|
||||
}
|
||||
|
||||
conn = camera_connector_size(type);
|
||||
if(conn) {
|
||||
|
@@ -32,7 +32,8 @@ rpi_camera_v1 = ["rpi_camera_v1", "Raspberry Pi camera V1", rpi_camera_v1_pcb, [
|
||||
[[0, 0, 4], 7.5 / 2],
|
||||
[[0, 0, 5], 5.5 / 2, [1.5/2, 2/2, 0.5]],
|
||||
],
|
||||
[0, 12 - 1.5 - 2.5], [8, 5, 1]
|
||||
[0, 12 - 1.5 - 2.5], [8, 5, 1],
|
||||
[54, 41] // FOV
|
||||
];
|
||||
|
||||
rpi_camera_v2_pcb = ["", "", 25, 23.862, 1, 2, 2.2, 0, "green", false, [[2, -2], [-2, -2], [2, -14.5], [-2, -14.5]],
|
||||
@@ -47,7 +48,8 @@ rpi_camera_v2 = ["rpi_camera_v2", "Raspberry Pi camera V2", rpi_camera_v2_pcb, [
|
||||
[[0, 0, 4], 7.5 / 2],
|
||||
[[0, 0, 5], 5.5 / 2, [1.5/2, 2/2, 0.5]],
|
||||
],
|
||||
[-13.8 + 12.5, 23.862 / 2 - 4.7], [8.5, 4, 1]
|
||||
[-13.8 + 12.5, 23.862 / 2 - 4.7], [8.5, 4, 1],
|
||||
[62.2, 48.8] // FOV
|
||||
];
|
||||
|
||||
rpi_camera_pcb = ["", "", 36, 36, 1.6, 0, 3.2, 0, "green", false, [[3.5, -3.5], [-3.5, -3.5], [3.5, 3.5], [-3.5, 3.5]],
|
||||
|
@@ -72,6 +72,16 @@ module d_pillar() { //! Draw a pillar for a D-connector
|
||||
female_metric_thread(screw, pitch, height, false, colour = d_pillar_colour);
|
||||
}
|
||||
|
||||
module d_plug_D(length, width, rad) { //! D plug D shape
|
||||
d = width / 2 - rad;
|
||||
offset = d * sin(10);
|
||||
|
||||
hull()
|
||||
for(x = [-1, 1], y = [-1, 1])
|
||||
translate([x * (length / 2 - rad) + y * x * offset, y * (width / 2 - rad)])
|
||||
circle(rad);
|
||||
}
|
||||
|
||||
module d_plug(type, socket = false, pcb = false, idc = false) { //! Draw specified D plug, which can be IDC, PCB or plain solder bucket
|
||||
hole_r = 3.05 / 2;
|
||||
dwall = 0.5;
|
||||
@@ -89,16 +99,6 @@ module d_plug(type, socket = false, pcb = false, idc = false) { //! Draw specifi
|
||||
vitamin(str(socket ? "d_socket(" : "d_plug(", type[0], arg(pcb, false, "pcb"), arg(idc, false, "idc"),
|
||||
"): D-type ", pins, " way ", desc, socket ? " socket" : " plug"));
|
||||
|
||||
module D(length, width, rad) {
|
||||
d = width / 2 - rad;
|
||||
offset = d * sin(10);
|
||||
|
||||
hull()
|
||||
for(x = [-1, 1], y = [-1, 1])
|
||||
translate([x * (length / 2 - rad) + y * x * offset, y * (width / 2 - rad)])
|
||||
circle(rad);
|
||||
}
|
||||
|
||||
module pin_positions()
|
||||
for($i = [1 : pins])
|
||||
translate([($i - (pins + 1) / 2) * 2.77 / 2, ($i % 2 - 0.5) * 2.84])
|
||||
@@ -117,14 +117,14 @@ module d_plug(type, socket = false, pcb = false, idc = false) { //! Draw specifi
|
||||
|
||||
linear_extrude(front_height, convexity = 5)
|
||||
difference() {
|
||||
D(d_length, d_width, 2.5);
|
||||
D(d_length - 2 * dwall, d_width - 2 * dwall, 2.5 - dwall);
|
||||
d_plug_D(d_length, d_width, 2.5);
|
||||
d_plug_D(d_length - 2 * dwall, d_width - 2 * dwall, 2.5 - dwall);
|
||||
}
|
||||
|
||||
if(!idc)
|
||||
rotate([0,180,0])
|
||||
hflip()
|
||||
linear_extrude(back_height, convexity = 5)
|
||||
D(d_lengths(type)[0] + 2 * dwall, d_widths(type)[0] + 2 * dwall, 2.5 + dwall);
|
||||
d_plug_D(d_lengths(type)[0] + 2 * dwall, d_widths(type)[0] + 2 * dwall, 2.5 + dwall);
|
||||
|
||||
}
|
||||
//
|
||||
@@ -134,12 +134,12 @@ module d_plug(type, socket = false, pcb = false, idc = false) { //! Draw specifi
|
||||
translate_z(d_flange_thickness(type) + eps)
|
||||
rotate([0, 180, 0])
|
||||
linear_extrude(back_height + 1 + d_flange_thickness(type), convexity = 5)
|
||||
D(d_length - dwall, d_width - dwall, 2.5 - dwall/2);
|
||||
d_plug_D(d_length - dwall, d_width - dwall, 2.5 - dwall/2);
|
||||
|
||||
if(socket)
|
||||
linear_extrude(front_height - eps, convexity = 5)
|
||||
difference() {
|
||||
D(d_length - dwall, d_width - dwall, 2.5 - dwall/2);
|
||||
d_plug_D(d_length - dwall, d_width - dwall, 2.5 - dwall/2);
|
||||
|
||||
pin_positions()
|
||||
circle(r = 0.7);
|
||||
|
@@ -20,7 +20,9 @@
|
||||
//
|
||||
//! Used for limit switches. Currently only the button type is supported as the lever and roller types are less accurate.
|
||||
//!
|
||||
//! The switch is drawn with the button at the nominal operation point. This can be plus or minus `microswitch_op_tol(type)`.
|
||||
//! The origin of the switch is in the center of the body. `microswitch_button_pos()` is the offset to tip of the button at its operating point.
|
||||
//!
|
||||
//! The switch is drawn with the button at the nominal operation point. This actual trigger point can be plus or minus `microswitch_op_tol(type)`.
|
||||
//!
|
||||
//! When the button is released it comes out by a maximum of `microswitch_fp_max(type)` from the nominal operating point.
|
||||
//
|
||||
|
@@ -721,11 +721,11 @@ MP1584EN = ["MP1584EN", "MP1584EN 3A buck converter", 22, 17, 1.2, 0, 1, [2, 2],
|
||||
[]
|
||||
];
|
||||
|
||||
PERF80x20 = ["PERF80x20", "Perfboard 80 x 20mm", 80, 20, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.87, 3.49]];
|
||||
PERF80x20 = ["PERF80x20", "Perfboard 80 x 20mm", 80, 20, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.71, 3.65]];
|
||||
|
||||
PERF70x50 = ["PERF70x50", "Perfboard 70 x 50mm", 70, 50, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.87, 3.49]];
|
||||
PERF70x50 = ["PERF70x50", "Perfboard 70 x 50mm", 70, 50, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.79, 3.41]];
|
||||
|
||||
PERF70x30 = ["PERF70x30", "Perfboard 70 x 30mm", 70, 30, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.87, 3.49]];
|
||||
PERF70x30 = ["PERF70x30", "Perfboard 70 x 30mm", 70, 30, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.79, 3.57]];
|
||||
|
||||
PERF60x40 = ["PERF60x40", "Perfboard 60 x 40mm", 60, 40, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.87, 3.49]];
|
||||
|
||||
|
@@ -30,6 +30,7 @@
|
||||
// d r r d d
|
||||
//
|
||||
M2x16_brass_pillar = ["M2x16_brass_pillar", "nurled", 2, 16, 3.17, 3.17, 0, 0, brass, brass, 3,-3];
|
||||
M3x6_hex_pillar = ["M3x6_hex_pillar", "hex", 3, 6, 5/cos(30), 5/cos(30), 6, 6, brass, brass, -5, 6];
|
||||
M3x13_hex_pillar = ["M3x13_hex_pillar", "hex", 3, 13, 5/cos(30), 5/cos(30), 6, 6, "silver", silver, -6, 6];
|
||||
M3x20_hex_pillar = ["M3x20_hex_pillar", "hex", 3, 20, 5/cos(30), 5/cos(30), 6, 6, "silver", silver, -8, 8];
|
||||
M3x20_nylon_pillar = ["M3x20_nylon_pillar", "nylon", 3, 20, 8, 5/cos(30), 0, 6, "white", brass, -6, 6];
|
||||
@@ -38,6 +39,6 @@ M3x20_nylon_hex_pillar = ["M3x20_nylon_hex_pillar", "hex nylon", 3, 20, 8/cos(30
|
||||
M3x10_nylon_hex_pillar = ["M3x10_nylon_hex_pillar", "hex nylon", 3, 10,5.5/cos(30),5.5/cos(30),6, 6, grey(20), grey(20), -6, 6];
|
||||
|
||||
|
||||
pillars = [M2x16_brass_pillar, M3x13_hex_pillar, M3x20_hex_pillar, M3x20_nylon_pillar, M4x17_nylon_pillar, M3x10_nylon_hex_pillar, M3x20_nylon_hex_pillar];
|
||||
pillars = [M2x16_brass_pillar, M3x6_hex_pillar, M3x13_hex_pillar, M3x20_hex_pillar, M3x20_nylon_pillar, M4x17_nylon_pillar, M3x10_nylon_hex_pillar, M3x20_nylon_hex_pillar];
|
||||
|
||||
use <pillar.scad>
|
||||
|
@@ -29,6 +29,7 @@ function tubing_id(type) = type[3]; //! Inside diameter
|
||||
function tubing_colour(type) = type[4]; //! Colour
|
||||
|
||||
function tubing_or(type) = tubing_od(type) / 2; //! Outside radius
|
||||
function tubing_ir(type) = tubing_id(type) / 2; //! Inside radius
|
||||
|
||||
module tubing(type, length = 15, forced_id = 0, center = true) { //! Draw specified tubing with optional forced internal diameter
|
||||
original_od = tubing_od(type);
|
||||
@@ -50,4 +51,3 @@ module tubing(type, length = 15, forced_id = 0, center = true) { //! Draw specif
|
||||
circle(d = id);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user