mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
commit
11a1c48c15
5 changed files with 95 additions and 20 deletions
12
masks2d.scad
12
masks2d.scad
|
@ -79,7 +79,7 @@ function mask2d_roundover(r, inset=0, excess=0.01, d, anchor=CENTER,spin=0) =
|
|||
|
||||
|
||||
// Function&Module: mask2d_cove()
|
||||
// Synopsis: Creates a 2d cove (quarter-round) mask shape.
|
||||
// Synopsis: Creates a 2D cove (quarter-round) mask shape.
|
||||
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable, Masks (2D)
|
||||
// See Also: corner_profile(), edge_profile(), face_profile()
|
||||
// Usage: As module
|
||||
|
@ -280,8 +280,8 @@ function mask2d_rabbet(size, excess=0.01, anchor=CENTER,spin=0) =
|
|||
|
||||
|
||||
// Function&Module: mask2d_dovetail()
|
||||
// Creates a 2d dovetail mask shape.
|
||||
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable, Masks (2D)
|
||||
// Synopsis: Creates a 2D dovetail mask shape.
|
||||
// Topics: Masks (2D), Shapes (2D), Paths (2D), Path Generators, Attachable
|
||||
// See Also: corner_profile(), edge_profile(), face_profile()
|
||||
// Usage: As Module
|
||||
// mask2d_dovetail(edge, [angle], [inset], [shelf], [excess], ...) [ATTACHMENTS];
|
||||
|
@ -358,8 +358,8 @@ function mask2d_dovetail(edge, angle=30, inset=0, shelf=0, excess=0.01, x, y, an
|
|||
|
||||
|
||||
// Function&Module: mask2d_teardrop()
|
||||
// Synopsis: Creates a 2d teardrop mask shape with a controllable maximum angle from vertical.
|
||||
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable, Masks (2D)
|
||||
// Synopsis: Creates a 2D teardrop mask shape with a controllable maximum angle from vertical.
|
||||
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable, Masks (2D), FDM Optimized
|
||||
// See Also: corner_profile(), edge_profile(), face_profile()
|
||||
// Usage: As Module
|
||||
// mask2d_teardrop(r|d=, [angle], [excess]) [ATTACHMENTS];
|
||||
|
@ -422,7 +422,7 @@ module mask2d_teardrop(r, angle=45, excess=0.01, d, anchor=CENTER, spin=0) {
|
|||
}
|
||||
|
||||
// Function&Module: mask2d_ogee()
|
||||
// Synopsis: Creates a 2d ogee mask shape.
|
||||
// Synopsis: Creates a 2D ogee mask shape.
|
||||
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable, Masks (2D)
|
||||
// See Also: corner_profile(), edge_profile(), face_profile()
|
||||
// Usage: As Module
|
||||
|
|
43
masks3d.scad
43
masks3d.scad
|
@ -14,10 +14,13 @@
|
|||
|
||||
|
||||
// Module: chamfer_edge_mask()
|
||||
// Synopsis: Creates a shape to chamfer a 90° edge.
|
||||
// Topics: Masking, Chamfers, Shapes (3D)
|
||||
// See Also: chamfer_corner_mask()
|
||||
// Usage:
|
||||
// chamfer_edge_mask(l|h=|length=|height=, chamfer, [excess]) [ATTACHMENTS];
|
||||
// Description:
|
||||
// Creates a shape that can be used to chamfer a 90 degree edge.
|
||||
// Creates a shape that can be used to chamfer a 90° edge.
|
||||
// Difference it from the object to be chamfered. The center of
|
||||
// the mask object should align exactly with the edge to be chamfered.
|
||||
// Arguments:
|
||||
|
@ -52,10 +55,13 @@ module chamfer_edge_mask(l, chamfer=1, excess=0.1, h, length, height, anchor=CEN
|
|||
|
||||
|
||||
// Module: chamfer_corner_mask()
|
||||
// Synopsis: Creates a shape to chamfer a 90° corner.
|
||||
// Topics: Masking, Chamfers, Shapes (3D)
|
||||
// See Also: chamfer_edge_mask()
|
||||
// Usage:
|
||||
// chamfer_corner_mask(chamfer) [ATTACHMENTS];
|
||||
// Description:
|
||||
// Creates a shape that can be used to chamfer a 90 degree corner.
|
||||
// Creates a shape that can be used to chamfer a 90° corner.
|
||||
// Difference it from the object to be chamfered. The center of
|
||||
// the mask object should align exactly with the corner to be chamfered.
|
||||
// Arguments:
|
||||
|
@ -87,6 +93,9 @@ module chamfer_corner_mask(chamfer=1, anchor=CENTER, spin=0, orient=UP) {
|
|||
|
||||
|
||||
// Module: chamfer_cylinder_mask()
|
||||
// Synopsis: Creates a shape to chamfer the end of a cylinder.
|
||||
// Topics: Masking, Chamfers, Cylinders
|
||||
|
||||
// Usage:
|
||||
// chamfer_cylinder_mask(r|d=, chamfer, [ang], [from_end]) [ATTACHMENTS];
|
||||
// Description:
|
||||
|
@ -149,11 +158,14 @@ module chamfer_cylinder_mask(r, chamfer, d, ang=45, from_end=false, anchor=CENTE
|
|||
// Section: Rounding Masks
|
||||
|
||||
// Module: rounding_edge_mask()
|
||||
// Synopsis: Creates a shape to round a 90° edge.
|
||||
// Topics: Masks, Rounding, Shapes (3D)
|
||||
// See Also: rounding_angled_edge_mask(), rounding_corner_mask(), rounding_angled_corner_mask()
|
||||
// Usage:
|
||||
// rounding_edge_mask(l|h=|length=|height=, r|d=, [excess=]) [ATTACHMENTS];
|
||||
// rounding_edge_mask(l|h=|length=|height=, r1=|d1=, r2=|d2=, [excess=]) [ATTACHMENTS];
|
||||
// Description:
|
||||
// Creates a shape that can be used to round a vertical 90 degree edge.
|
||||
// Creates a shape that can be used to round a vertical 90° edge.
|
||||
// Difference it from the object to be rounded. The center of the mask
|
||||
// object should align exactly with the edge to be rounded.
|
||||
// Arguments:
|
||||
|
@ -225,10 +237,13 @@ module rounding_edge_mask(l, r, r1, r2, d, d1, d2, excess=0.1, anchor=CENTER, sp
|
|||
|
||||
|
||||
// Module: rounding_corner_mask()
|
||||
// Synopsis: Creates a shape to round 90° corners.
|
||||
// Topics: Masking, Rounding, Shapes (3D)
|
||||
// See Also: rounding_angled_corner_mask(), rounding_edge_mask(), rounding_angled_edge_mask()
|
||||
// Usage:
|
||||
// rounding_corner_mask(r|d, [excess=], [style=]) [ATTACHMENTS];
|
||||
// Description:
|
||||
// Creates a shape that you can use to round 90 degree corners.
|
||||
// Creates a shape that you can use to round 90° corners.
|
||||
// Difference it from the object to be rounded. The center of the mask
|
||||
// object should align exactly with the corner to be rounded.
|
||||
// Arguments:
|
||||
|
@ -275,6 +290,9 @@ module rounding_corner_mask(r, d, style="octa", excess=0.1, anchor=CENTER, spin=
|
|||
|
||||
|
||||
// Module: rounding_angled_edge_mask()
|
||||
// Creates a shape to round edges of any angle.
|
||||
// Topics: Masks, Rounding
|
||||
// See Also: rounding_angled_corner_mask(), rounding_edge_mask(), rounding_corner_mask()
|
||||
// Usage:
|
||||
// rounding_angled_edge_mask(h|l=|length=|height=, r|d=, [ang=]) [ATTACHMENTS];
|
||||
// rounding_angled_edge_mask(h|l=|length=|height=, r1=|d1=, r2=|d2=, [ang=]) [ATTACHMENTS];
|
||||
|
@ -341,6 +359,9 @@ module rounding_angled_edge_mask(h, r, r1, r2, d, d1, d2, ang=90, anchor=CENTER,
|
|||
|
||||
|
||||
// Module: rounding_angled_corner_mask()
|
||||
// Synopsis: Creates a shape to round the corner of an arbitrary angle.
|
||||
// Topics: Masks, Rounding, Shapes (3D)
|
||||
// See Also: rounding_angled_edge_mask(), rounding_corner_mask(), rounding_edge_mask()
|
||||
// Usage:
|
||||
// rounding_angled_corner_mask(r|d=, [ang]) [ATTACHMENTS];
|
||||
// Description:
|
||||
|
@ -389,6 +410,9 @@ module rounding_angled_corner_mask(r, ang=90, d, anchor=CENTER, spin=0, orient=U
|
|||
|
||||
|
||||
// Module: rounding_cylinder_mask()
|
||||
// Synopsis: Creates a shape to round the end of a cylinder.
|
||||
// Topics: Masking, Rounding, Cylinders
|
||||
// See Also: rounding_hole_mask()
|
||||
// Usage:
|
||||
// rounding_cylinder_mask(r|d=, rounding);
|
||||
// Description:
|
||||
|
@ -437,6 +461,9 @@ module rounding_cylinder_mask(r, rounding, d, anchor=CENTER, spin=0, orient=UP)
|
|||
|
||||
|
||||
// Module: rounding_hole_mask()
|
||||
// Synopsis: Creates a shape to round the edge of a round hole.
|
||||
// Topics: Masking, Rounding
|
||||
// See Also: rounding_cylinder_mask()
|
||||
// Usage:
|
||||
// rounding_hole_mask(r|d, rounding, [excess]) [ATTACHMENTS];
|
||||
// Description:
|
||||
|
@ -486,10 +513,13 @@ module rounding_hole_mask(r, rounding, excess=0.1, d, anchor=CENTER, spin=0, ori
|
|||
// Section: Teardrop Masking
|
||||
|
||||
// Module: teardrop_edge_mask()
|
||||
// Synopsis: Creates a shape to round a 90° edge but limit the angle of overhang.
|
||||
// Topics: Masking, Rounding, Shapes (3D), FDM Optimized
|
||||
// See Also: teardrop_corner_mask()
|
||||
// Usage:
|
||||
// teardrop_edge_mask(l|h=|length=|height=, r|d=, [angle], [excess], [anchor], [spin], [orient]) [ATTACHMENTS];
|
||||
// Description:
|
||||
// Makes an apropriate 3D corner rounding mask that keeps within `angle` degrees of vertical.
|
||||
// Makes an apropriate 3D edge rounding mask that keeps within `angle` degrees of vertical.
|
||||
// Arguments:
|
||||
// l/h/length/height = length of mask
|
||||
// r = Radius of the mask rounding.
|
||||
|
@ -525,6 +555,9 @@ module teardrop_edge_mask(l, r, angle=45, excess=0.1, d, anchor=CTR, spin=0, ori
|
|||
|
||||
|
||||
// Module: teardrop_corner_mask()
|
||||
// Synopsis: Creates a shape to round a 90° corner but limit the angle of overhang.
|
||||
// Topics: Masking, Rounding, Shapes (3D), FDM Optimized
|
||||
// See Also: teardrop_edge_mask()
|
||||
// Usage:
|
||||
// teardrop_corner_mask(r|d=, [angle], [excess], [anchor], [spin], [orient]) [ATTACHMENTS];
|
||||
// Description:
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Module: bounding_box()
|
||||
// Synopsis: Creates the smallest bounding box that contains all the children.
|
||||
// Topics: Mutators, Bounds, Bounding Boxes
|
||||
// Usage:
|
||||
// bounding_box([excess],[planar]) CHILDREN;
|
||||
// Description:
|
||||
|
@ -101,7 +103,8 @@ module bounding_box(excess=0, planar=false) {
|
|||
|
||||
|
||||
// Module: chain_hull()
|
||||
//
|
||||
// Synopsis: Performs the union of hull operations between consecutive pairs of children.
|
||||
// Topics: Mutators
|
||||
// Usage:
|
||||
// chain_hull() CHILDREN;
|
||||
//
|
||||
|
@ -149,6 +152,9 @@ module chain_hull()
|
|||
|
||||
|
||||
// Module: path_extrude2d()
|
||||
// Synopsis: Extrudes 2D children along a 2D path.
|
||||
// Topics: Mutators, Extrusion
|
||||
// See Also: path_sweep(), path_extrude()
|
||||
// Usage:
|
||||
// path_extrude2d(path, [caps=], [closed=], [s=], [convexity=]) 2D-CHILDREN;
|
||||
// Description:
|
||||
|
@ -262,6 +268,8 @@ module path_extrude2d(path, caps=false, closed=false, s, convexity=10) {
|
|||
|
||||
|
||||
// Module: cylindrical_extrude()
|
||||
// Synopsis: Extrudes 2D children outwards around a cylinder.
|
||||
// Topics: Mutators, Extrusion, Rotation
|
||||
// Usage:
|
||||
// cylindrical_extrude(ir|id=, or|od=, [size=], [convexity=], [spin=], [orient=]) 2D-CHILDREN;
|
||||
// Description:
|
||||
|
@ -321,6 +329,8 @@ module cylindrical_extrude(ir, or, od, id, size=1000, convexity=10, spin=0, orie
|
|||
|
||||
|
||||
// Module: extrude_from_to()
|
||||
// Extrudes 2D children between two points in 3D space.
|
||||
// Topics: Extrusion, Mutators
|
||||
// Usage:
|
||||
// extrude_from_to(pt1, pt2, [convexity=], [twist=], [scale=], [slices=]) 2D-CHILDREN;
|
||||
// Description:
|
||||
|
@ -359,10 +369,12 @@ module extrude_from_to(pt1, pt2, convexity, twist, scale, slices) {
|
|||
|
||||
|
||||
// Module: path_extrude()
|
||||
// Synopsis: Extrudes 2D children along a 3D path.
|
||||
// Topics: Paths, Extrusion, Mutators
|
||||
// See Also: path_sweep(), path_extrude2d()
|
||||
// Usage: path_extrude(path, [convexity], [clipsize]) 2D-CHILDREN;
|
||||
// Description:
|
||||
// Extrudes 2D children along a 3D path. This may be slow and can have problems with twisting.
|
||||
// See Also: path_sweep()
|
||||
// Arguments:
|
||||
// path = Array of points for the bezier path to extrude along.
|
||||
// convexity = Maximum number of walls a ray can pass through.
|
||||
|
@ -418,6 +430,9 @@ module path_extrude(path, convexity=10, clipsize=100) {
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Module: minkowski_difference()
|
||||
// Synopsis: Removes diff shapes from base shape surface.
|
||||
// Topics: Mutators
|
||||
// See Also: offset3d()
|
||||
// Usage:
|
||||
// minkowski_difference() { BASE; DIFF1; DIFF2; ... }
|
||||
// Description:
|
||||
|
@ -454,6 +469,9 @@ module minkowski_difference(planar=false) {
|
|||
|
||||
|
||||
// Module: offset3d()
|
||||
// Synopsis: Expands or contracts the surface of a 3D object.
|
||||
// Topics: Mutators
|
||||
// See Also: minkowski_difference()
|
||||
// Usage:
|
||||
// offset3d(r, [size], [convexity]) CHILDREN;
|
||||
// Description:
|
||||
|
@ -493,6 +511,8 @@ module offset3d(r, size=100, convexity=10) {
|
|||
|
||||
|
||||
// Module: round3d()
|
||||
// Synopsis: Rounds arbitrary 3d objects.
|
||||
// Topics: Rounding, Mutators
|
||||
// Usage:
|
||||
// round3d(r) CHILDREN;
|
||||
// round3d(or) CHILDREN;
|
||||
|
|
29
paths.scad
29
paths.scad
|
@ -18,6 +18,8 @@
|
|||
// Section: Utility Functions
|
||||
|
||||
// Function: is_path()
|
||||
// Synopsis: Returns True if 'list' is a path.
|
||||
// Topics: Paths
|
||||
// Usage:
|
||||
// is_path(list, [dim], [fast])
|
||||
// Description:
|
||||
|
@ -55,6 +57,9 @@ function is_path(list, dim=[2,3], fast=false) =
|
|||
&& (is_undef(dim) || in_list(len(list[0]), force_list(dim)));
|
||||
|
||||
// Function: is_1region()
|
||||
// Synopsis: Returns true if path is a region with one component.
|
||||
// Topics: Paths, Regions
|
||||
// See Also: force_path()
|
||||
// Usage:
|
||||
// bool = is_1region(path, [name])
|
||||
// Description:
|
||||
|
@ -71,6 +76,9 @@ function is_1region(path, name="path") =
|
|||
|
||||
|
||||
// Function: force_path()
|
||||
// Synopsis: Checks that path is a region with one component.
|
||||
// Topics: Paths, Regions
|
||||
// See Also: is_1region()
|
||||
// Usage:
|
||||
// outpath = force_path(path, [name])
|
||||
// Description:
|
||||
|
@ -119,6 +127,8 @@ function _path_select(path, s1, u1, s2, u2, closed=false) =
|
|||
|
||||
|
||||
// Function: path_merge_collinear()
|
||||
// Synopsis: Removes unnecessary points from a path.
|
||||
// Topics: Paths, Regions
|
||||
// Description:
|
||||
// Takes a path and removes unnecessary sequential collinear points.
|
||||
// Usage:
|
||||
|
@ -149,6 +159,9 @@ function path_merge_collinear(path, closed, eps=EPSILON) =
|
|||
|
||||
|
||||
// Function: path_length()
|
||||
// Synopsis: Returns the path length.
|
||||
// Topics: Paths
|
||||
// See Also: path_segment_lengths(), path_length_fractions()
|
||||
// Usage:
|
||||
// path_length(path,[closed])
|
||||
// Description:
|
||||
|
@ -169,6 +182,9 @@ function path_length(path,closed) =
|
|||
|
||||
|
||||
// Function: path_segment_lengths()
|
||||
// Synopsis: Returns a list of the lengths of segments in a path.
|
||||
// Topics: Paths
|
||||
// See Also: path_length(), path_length_fractions()
|
||||
// Usage:
|
||||
// path_segment_lengths(path,[closed])
|
||||
// Description:
|
||||
|
@ -274,7 +290,7 @@ function _path_self_intersections(path, closed=true, eps=EPSILON) =
|
|||
[isect[0], i, isect[1], j, isect[2]]
|
||||
];
|
||||
|
||||
// Section: Resampling—changing the number of points in a path
|
||||
// Section: Resampling - changing the number of points in a path
|
||||
|
||||
|
||||
// Input `data` is a list that sums to an integer.
|
||||
|
@ -295,6 +311,8 @@ function _sum_preserving_round(data, index=0) =
|
|||
|
||||
|
||||
// Function: subdivide_path()
|
||||
// Synopsis: Subdivides a path to produce a more finely sampled path.
|
||||
// Topics: Paths, Path Subdivision
|
||||
// See Also: subdivide_and_slice(), resample_path(), jittered_poly()
|
||||
// Usage:
|
||||
// newpath = subdivide_path(path, n|refine=|maxlen=, [method=], [closed=], [exact=]);
|
||||
|
@ -686,7 +704,7 @@ function path_torsion(path, closed=false) =
|
|||
|
||||
|
||||
// Function: path_cut()
|
||||
// Topics: Paths
|
||||
// Topics: Paths, Path Subdivision
|
||||
// See Also: split_path_at_self_crossings()
|
||||
// Usage:
|
||||
// path_list = path_cut(path, cutdist, [closed]);
|
||||
|
@ -746,7 +764,8 @@ function _path_cut_getpaths(path, cutlist, closed) =
|
|||
|
||||
|
||||
// Function: path_cut_points()
|
||||
//
|
||||
// Synopsis: Returns a list of cut points at a list of distances from the first point in a path.
|
||||
// Topics: Paths, Path Subdivision
|
||||
// Usage:
|
||||
// cuts = path_cut_points(path, cutdist, [closed=], [direction=]);
|
||||
//
|
||||
|
@ -882,6 +901,8 @@ function _cut_to_seg_u_form(pathcut, path, closed) =
|
|||
|
||||
|
||||
// Function: split_path_at_self_crossings()
|
||||
// Synopsis: Split a 2D path wherever it crosses itself.
|
||||
// Topics: Paths, Path Subdivision
|
||||
// Usage:
|
||||
// paths = split_path_at_self_crossings(path, [closed], [eps]);
|
||||
// Description:
|
||||
|
@ -949,6 +970,8 @@ function _tag_self_crossing_subpaths(path, nonzero, closed=true, eps=EPSILON) =
|
|||
|
||||
|
||||
// Function: polygon_parts()
|
||||
// Synopsis: Parses a self-intersecting polygon into a list of non-intersecting polygons.
|
||||
// Topics: Paths, Polygons
|
||||
// Usage:
|
||||
// splitpolys = polygon_parts(poly, [nonzero], [eps]);
|
||||
// Description:
|
||||
|
|
|
@ -1087,7 +1087,6 @@ function rect_tube(
|
|||
// Synopsis: Creates a 3d triangular wedge, or returns a vnf.
|
||||
// Topics: Shapes (3D), Attachable, VNF Generators
|
||||
// See also: prismoid(), rounded_prism(), pie_slice()
|
||||
//
|
||||
// Usage: As Module
|
||||
// wedge(size, [center], ...) [ATTACHMENTS];
|
||||
// Usage: As Function
|
||||
|
@ -2612,7 +2611,7 @@ function torus(
|
|||
|
||||
// Function&Module: teardrop()
|
||||
// Synopsis: Creates a teardrop shape, or returns a vnf.
|
||||
// Topics: Shapes (3D), Attachable, VNF Generators
|
||||
// Topics: Shapes (3D), Attachable, VNF Generators, FDM Optimized
|
||||
// See Also: onion(), teardrop2d()
|
||||
// Description:
|
||||
// Makes a teardrop shape in the XZ plane. Useful for 3D printable holes.
|
||||
|
@ -2753,7 +2752,7 @@ function teardrop(h, r, ang=45, cap_h, r1, r2, d, d1, d2, cap_h1, cap_h2, chamf
|
|||
|
||||
// Function&Module: onion()
|
||||
// Synopsis: Creates an attachable onion-like shape, or returns a vnf.
|
||||
// Topics: Shapes (3D), Attachable, VNF Generators
|
||||
// Topics: Shapes (3D), Attachable, VNF Generators, FDM Optimized
|
||||
// See Also: teardrop(), teardrop2d()
|
||||
// Description:
|
||||
// Creates a sphere with a conical hat, to make a 3D teardrop.
|
||||
|
@ -3550,7 +3549,7 @@ module cylindrical_heightfield(
|
|||
|
||||
// Module: ruler()
|
||||
// Synopsis: Creates a ruler.
|
||||
//
|
||||
// Topics: Distance
|
||||
// Usage:
|
||||
// ruler(length, width, [thickness=], [depth=], [labels=], [pipscale=], [maxscale=], [colors=], [alpha=], [unit=], [inch=]) [ATTACHMENTS];
|
||||
// Description:
|
||||
|
|
Loading…
Reference in a new issue