From 6b39b2e3b44e29a28d57374a389f229c0b809157 Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Mon, 22 Apr 2024 14:37:11 -0700 Subject: [PATCH 1/4] Added Sidebar docs tweaks. --- .openscad_docsgen_rc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.openscad_docsgen_rc b/.openscad_docsgen_rc index ca85511..cb22087 100644 --- a/.openscad_docsgen_rc +++ b/.openscad_docsgen_rc @@ -2,6 +2,12 @@ DocsDirectory: BOSL2.wiki/ TargetProfile: githubwiki ProjectName: The Belfry OpenScad Library, v2. (BOSL2) GenerateDocs: Files, TOC, Index, Topics, CheatSheet, Sidebar +SidebarHeader: + ## Indices + . +SidebarMiddle: + [Tutorials](Tutorials) +SidebarFooter: UsePNGAnimations: Yes IgnoreFiles: affine.scad From d5a01a151de8cc33305f4f02734ebd3151a8ae77 Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Mon, 22 Apr 2024 14:37:55 -0700 Subject: [PATCH 2/4] Fixed docs image generation of a catenary example. --- drawing.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drawing.scad b/drawing.scad index 2503d35..1a2b579 100644 --- a/drawing.scad +++ b/drawing.scad @@ -894,7 +894,7 @@ module arc(n, r, angle, d, cp, points, corner, width, thickness, start, wedge=fa // stroke(catenary(100, droop=-30)); // Example(2D): Specifying Vertex Count // stroke(catenary(100, angle=-85, n=11), dots="dot"); -// Example: Sweeping a Catenary Path +// Example(3D): Sweeping a Catenary Path // path = xrot(90, p=path3d(catenary(100, droop=20, n=41))); // path_sweep(circle(r=1.5, $fn=24), path); function catenary(width, droop, n=100, angle) = From e6c1afcece53033170015285f66c8e38fc332281 Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Mon, 22 Apr 2024 14:39:12 -0700 Subject: [PATCH 3/4] Fixed bug in path_merge_collinear() --- paths.scad | 1 + 1 file changed, 1 insertion(+) diff --git a/paths.scad b/paths.scad index 5742a00..a439819 100644 --- a/paths.scad +++ b/paths.scad @@ -149,6 +149,7 @@ function path_merge_collinear(path, closed, eps=EPSILON) = assert( is_path(path), "Invalid path in path_merge_collinear." ) assert( is_undef(eps) || (is_finite(eps) && (eps>=0) ), "Invalid tolerance." ) len(path)<=2 ? path : + let(path = deduplicate(path, closed=closed)) [ if(!closed) path[0], for(triple=triplet(path,wrap=closed)) From bb6f5812370d1e068dab78d0ec1b5df44364d6fc Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Mon, 22 Apr 2024 14:41:29 -0700 Subject: [PATCH 4/4] Added 2D variant of sparse wall, for extrusion. --- walls.scad | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/walls.scad b/walls.scad index a188a9c..1122559 100644 --- a/walls.scad +++ b/walls.scad @@ -61,16 +61,77 @@ module sparse_wall(h=50, l=100, thick=4, maxang=30, strut=5, max_bridge=20, anch hyp = zstep/2 / cos(maxang); maxy = min(2 * hyp * sin(maxang), max_bridge+strut); + yreps = ceil(2*yoff/maxy); + + size = [thick, l, h]; + attachable(anchor,spin,orient, size=size) { + yrot(90) { + linear_extrude(height=thick, convexity=4*yreps, center=true) { + sparse_wall2d([h,l], maxang=maxang, strut=strut, max_bridge=max_bridge); + } + } + children(); + } +} + + +// Module: sparse_wall2d() +// Synopsis: Makes an open cross-braced rectangular wall. +// SynTags: Geom +// Topics: FDM Optimized, Walls +// See Also: sparse_wall(), corrugated_wall(), thinning_wall(), thinning_triangle(), narrowing_strut() +// +// Usage: +// sparse_wall2d(size, [maxang=], [strut=], [max_bridge=]) [ATTACHMENTS]; +// +// Description: +// Makes a 2D open rectangular square with X-shaped cross-bracing, designed to be extruded, to make a strut that reduces +// the need for support material in 3D printing. +// +// Arguments: +// size = The `[X,Y]` size of the outer rectangle. +// --- +// maxang = maximum overhang angle of cross-braces. +// strut = the width of the cross-braces. +// max_bridge = maximum bridging distance between cross-braces. +// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER` +// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0` +// +// See Also: corrugated_wall(), thinning_wall() +// +// Example: Typical Shape +// sparse_wall2d(size=[40,100]); +// Example: Thinner Strut +// sparse_wall2d(size=[40,100], strut=2); +// Example: Larger maxang +// sparse_wall2d(size=[40,100], strut=2, maxang=45); +// Example: Longer max_bridge +// sparse_wall2d(size=[40,100], strut=2, maxang=45, max_bridge=30); +module sparse_wall2d(size=[50,100], maxang=30, strut=5, max_bridge=20, anchor=CENTER, spin=0) +{ + h = size.x; + l = size.y; + + zoff = h/2 - strut/2; + yoff = l/2 - strut/2; + + maxhyp = 1.5 * (max_bridge+strut)/2 / sin(maxang); + maxz = 2 * maxhyp * cos(maxang); + + zreps = ceil(2*zoff/maxz); + zstep = 2*zoff / zreps; + + hyp = zstep/2 / cos(maxang); + maxy = min(2 * hyp * sin(maxang), max_bridge+strut); + yreps = ceil(2*yoff/maxy); ystep = 2*yoff / yreps; ang = atan(ystep/zstep); len = zstep / cos(ang); - size = [thick, l, h]; - attachable(anchor,spin,orient, size=size) { - yrot(90) - linear_extrude(height=thick, convexity=4*yreps, center=true) { + attachable(anchor,spin, two_d=true, size=size) { + union() { difference() { square([h, l], center=true); square([h-2*strut, l-2*strut], center=true);