mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
e68ff5ff4c
5 changed files with 79 additions and 3 deletions
|
@ -2,6 +2,12 @@ DocsDirectory: BOSL2.wiki/
|
||||||
TargetProfile: githubwiki
|
TargetProfile: githubwiki
|
||||||
ProjectName: The Belfry OpenScad Library, v2. (BOSL2)
|
ProjectName: The Belfry OpenScad Library, v2. (BOSL2)
|
||||||
GenerateDocs: Files, TOC, Index, Topics, CheatSheet, Sidebar
|
GenerateDocs: Files, TOC, Index, Topics, CheatSheet, Sidebar
|
||||||
|
SidebarHeader:
|
||||||
|
## Indices
|
||||||
|
.
|
||||||
|
SidebarMiddle:
|
||||||
|
[Tutorials](Tutorials)
|
||||||
|
SidebarFooter:
|
||||||
UsePNGAnimations: Yes
|
UsePNGAnimations: Yes
|
||||||
IgnoreFiles:
|
IgnoreFiles:
|
||||||
affine.scad
|
affine.scad
|
||||||
|
|
|
@ -894,7 +894,7 @@ module arc(n, r, angle, d, cp, points, corner, width, thickness, start, wedge=fa
|
||||||
// stroke(catenary(100, droop=-30));
|
// stroke(catenary(100, droop=-30));
|
||||||
// Example(2D): Specifying Vertex Count
|
// Example(2D): Specifying Vertex Count
|
||||||
// stroke(catenary(100, angle=-85, n=11), dots="dot");
|
// 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 = xrot(90, p=path3d(catenary(100, droop=20, n=41)));
|
||||||
// path_sweep(circle(r=1.5, $fn=24), path);
|
// path_sweep(circle(r=1.5, $fn=24), path);
|
||||||
function catenary(width, droop, n=100, angle) =
|
function catenary(width, droop, n=100, angle) =
|
||||||
|
|
|
@ -45,7 +45,7 @@ function _inset_corner(corner, mask_angle, inset, excess, flat_top) =
|
||||||
// If called as a function, returns a 2D path of the outline of the mask shape.
|
// If called as a function, returns a 2D path of the outline of the mask shape.
|
||||||
// .
|
// .
|
||||||
// The roundover can be specified by radius, diameter, height, cut, or joint length.
|
// The roundover can be specified by radius, diameter, height, cut, or joint length.
|
||||||
// ![Types of Roundovers](images/rounding/section-types-of-roundovers_fig1.png)
|
// ![Types of Roundovers](images/rounding/figure_1_1.png)
|
||||||
// .
|
// .
|
||||||
// If you need roundings to agree on edges of different mask_angle, e.g. to round the base of a prismoid, then you need all of the
|
// If you need roundings to agree on edges of different mask_angle, e.g. to round the base of a prismoid, then you need all of the
|
||||||
// masks used to have the same height. (Note that it may appear that matching joint would also work, but it does not because the joint distances are measured
|
// masks used to have the same height. (Note that it may appear that matching joint would also work, but it does not because the joint distances are measured
|
||||||
|
@ -220,7 +220,7 @@ function mask2d_roundover(r, inset=0, mask_angle=90, excess=0.01, flat_top, quar
|
||||||
// If called as a function, returns a 2D path of the outline of the mask shape.
|
// If called as a function, returns a 2D path of the outline of the mask shape.
|
||||||
// This is particularly useful to make partially rounded bottoms, that don't need support to print.
|
// This is particularly useful to make partially rounded bottoms, that don't need support to print.
|
||||||
// The roundover can be specified by radius, diameter, height, cut, or joint length.
|
// The roundover can be specified by radius, diameter, height, cut, or joint length.
|
||||||
// ![Types of Roundovers](images/rounding/section-types-of-roundovers_fig1.png)
|
// ![Types of Roundovers](images/rounding/figure_1_1.png)
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// r = Radius of the rounding.
|
// r = Radius of the rounding.
|
||||||
// angle = The angle from vertical of the flat section. Must be between mask_angle-90 and 90 degrees. Default: 45.
|
// angle = The angle from vertical of the flat section. Must be between mask_angle-90 and 90 degrees. Default: 45.
|
||||||
|
|
|
@ -149,6 +149,7 @@ function path_merge_collinear(path, closed, eps=EPSILON) =
|
||||||
assert( is_path(path), "Invalid path in path_merge_collinear." )
|
assert( is_path(path), "Invalid path in path_merge_collinear." )
|
||||||
assert( is_undef(eps) || (is_finite(eps) && (eps>=0) ), "Invalid tolerance." )
|
assert( is_undef(eps) || (is_finite(eps) && (eps>=0) ), "Invalid tolerance." )
|
||||||
len(path)<=2 ? path :
|
len(path)<=2 ? path :
|
||||||
|
let(path = deduplicate(path, closed=closed))
|
||||||
[
|
[
|
||||||
if(!closed) path[0],
|
if(!closed) path[0],
|
||||||
for(triple=triplet(path,wrap=closed))
|
for(triple=triplet(path,wrap=closed))
|
||||||
|
|
69
walls.scad
69
walls.scad
|
@ -61,15 +61,84 @@ module sparse_wall(h=50, l=100, thick=4, maxang=30, strut=5, max_bridge=20, anch
|
||||||
hyp = zstep/2 / cos(maxang);
|
hyp = zstep/2 / cos(maxang);
|
||||||
maxy = min(2 * hyp * sin(maxang), max_bridge+strut);
|
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);
|
yreps = ceil(2*yoff/maxy);
|
||||||
ystep = 2*yoff / yreps;
|
ystep = 2*yoff / yreps;
|
||||||
|
|
||||||
ang = atan(ystep/zstep);
|
ang = atan(ystep/zstep);
|
||||||
len = zstep / cos(ang);
|
len = zstep / cos(ang);
|
||||||
|
<<<<<<< master
|
||||||
size = [thick, l, h];
|
size = [thick, l, h];
|
||||||
attachable(anchor,spin,orient, size=size) {
|
attachable(anchor,spin,orient, size=size) {
|
||||||
yrot(90)
|
yrot(90)
|
||||||
linear_extrude(height=thick, convexity=4*yreps, center=true) {
|
linear_extrude(height=thick, convexity=4*yreps, center=true) {
|
||||||
|
=======
|
||||||
|
|
||||||
|
attachable(anchor,spin, two_d=true, size=size) {
|
||||||
|
union() {
|
||||||
|
>>>>>>> master
|
||||||
difference() {
|
difference() {
|
||||||
square([h, l], center=true);
|
square([h, l], center=true);
|
||||||
square([h-2*strut, l-2*strut], center=true);
|
square([h-2*strut, l-2*strut], center=true);
|
||||||
|
|
Loading…
Reference in a new issue