1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-25 14:39:01 +02:00

Compare commits

..

3 Commits

Author SHA1 Message Date
Chris Palmer
59eeb2c5d4 Trimmed the ribbon clamp tape. 2022-02-15 10:52:38 +00:00
Chris Palmer
7ea4dbe6cb Fixed double application of r2sides() in rounded_path().
Added check for radius too big for corner in rounded_path().
Spiral paths can now have 0 twists.
2022-02-15 10:44:13 +00:00
Chris Palmer
0d062c24fa Updated changelog. 2022-02-11 09:11:05 +00:00
8 changed files with 16 additions and 5 deletions

View File

@@ -3,6 +3,13 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
### [v19.9.0](https://github.com/nophead/NopSCADlib/releases/tag/v19.9.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v19.8.1...v19.9.0 "diff with v19.8.1")
* 2022-02-11 [`95b6771`](https://github.com/nophead/NopSCADlib/commit/95b6771811fd48af46b5c2d426c42c04cd8e5af3 "show commit") [C.P.](# "Chris Palmer") Added printed cable clips.
* 2022-02-11 [`ed46cbb`](https://github.com/nophead/NopSCADlib/commit/ed46cbb1470587d4fa3ee4e0e8e0513c82693b1b "show commit") [C.P.](# "Chris Palmer") Fixed `cable_bundle()` bugs and added test.
Added `cable_bundle_positions()`.
Can now mark cables as ribbon to force a flat layout.
#### [v19.8.1](https://github.com/nophead/NopSCADlib/releases/tag/v19.8.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v19.8.0...v19.8.1 "diff with v19.8.0")
* 2022-02-09 [`2a2b7d8`](https://github.com/nophead/NopSCADlib/commit/2a2b7d8bd60f0ea8ad2c428593e7aea1dfa06e9c "show commit") [C.P.](# "Chris Palmer") Added a second example project.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 KiB

After

Width:  |  Height:  |  Size: 982 KiB

View File

@@ -105,7 +105,7 @@ assembly(let(screw_d = screw_radius(screw) * 2)str("ribbon_clamp_", str_ways(way
module ribbon_clamp_fastened_assembly(ways, thickness, screw = screw) { //! Clamp with fasteners in place
tape_l = floor(ribbon_clamp_slot(ways));
tape_width = 25;
tape_width = ribbon_clamp_width(screw) + 2;
tape_thickness = 0.5;
vitamin(str(": Tape self amalgamating silicone ",tape_l," x 25mm"));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

View File

@@ -215,12 +215,16 @@ function rounded_path(path) = //! Convert a rounded_path, consisting of a start
p0 - p1, // Calculate vectors between vertices
v2 = p2 - p1,
a = angle_between(v1, -v2), // Angle turned through
arc_start = p1 + unit(v1) * r * tan(a / 2), // Calc the start position
d = r * tan(a / 2), // Distance from vertex to tangents
room = min(norm(v1), norm(v2)), // Maximum distance
arc_start = assert(d <= room,
str("Can't fit radius ", r, " into corner at vertex path[", i, "] = ", p1, " only room for radius ", room / tan(a / 2)))
p1 + unit(v1) * d, // Calc the start position
z_axis = unit(cross(v1, v2)), // z_axis is perpendicular to both vectors
centre = arc_start + unit(cross(z_axis, v1)) * r, // Arc center is a radius away, and perpendicular to v1 and the z_axis.
x_axis = arc_start - centre, // Make the x_axis along the radius to the start point, includes radius a scale factor
y_axis = cross(x_axis, z_axis), // y_axis perpendicular to the other two
sides = r2sides(ceil(r2sides(r) * a / 360)) // Sides needed to make the arc
sides = ceil(r2sides(r) * a / 360) // Sides needed to make the arc
)
for(j = [0 : sides], t = a * j / sides) // For each vertex in the arc
cos(t) * x_axis + sin(t) * y_axis + centre, // Circular arc in the tiled xy plane.
@@ -240,7 +244,7 @@ function segmented_path(path, min_segment) = [ //! Add points to a path to enfo
];
function spiral_paths(path, n, r, twists, start_angle) = let( //! Create a new paths which sprial around the given path. Use for making twisted cables
segment = path_length(path) / twists / r2sides(2 * r),
segment = twists ? path_length(path) / twists / r2sides(2 * r) : inf,
transforms = sweep_transforms(segmented_path(path, segment), twist = 360 * twists),
initial = [r, 0, 0, 1] * rotate(start_angle)
) [for(i = [0 : n - 1]) let(initial = [r, 0, 0, 1] * rotate(start_angle + i * 360 / n)) [for(t = transforms) initial * t]];

View File

@@ -153,7 +153,7 @@ module smd_sot(type, value) { //! Draw an SMD transistor
ls = smd_sot_lead_size(type);
r = ls.z;
gullwing = rounded_path([[0, 0, ls.z / 2], [0, ls.y - ls.z, ls.z / 2], r, [0, ls.y -ls.z + z1 - ls.z, z1 - ls.z / 2], r, [0, span / 2, z1 - ls.z / 2]]);
gullwing = rounded_path([[0, 0, ls.z / 2], [0, ls.y - ls.z, ls.z / 2], r, [0, ls.y -ls.z + z1 - ls.z, z1 - ls.z / 2], r, [0, span / 2, z1 - ls.z / 2]], $fn = 32);
color(grey(20))
hull()