Merge pull request #1181 from BelfrySCAD/revarbat_dev

All the SynTags.
This commit is contained in:
Revar Desmera 2023-05-30 00:06:55 -07:00 committed by GitHub
commit 17ff8b1f0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 402 additions and 238 deletions

View file

@ -73,6 +73,7 @@ DefineSynTags:
Path = Can return a Path.
PathList = Can return a list of Paths.
Region = Can return a Region.
RegList = Can return a list of Regions.
Trans = Can transform children.
VNF = Can return a VNF.

View file

@ -10,7 +10,7 @@ Requires OpenSCAD 2021.01 or later.
- **NOTE:** BOSL2 IS BETA CODE. THE CODE IS STILL BEING REORGANIZED.
- **NOTE2:** CODE WRITTEN FOR BOSLv1 PROBABLY WON'T WORK WITH BOSL2!
[![Join the chat at https://gitter.im/BelfrySCAD/BOSL2](https://badges.gitter.im/BelfrySCAD/BOSL2.svg)](https://gitter.im/BelfrySCAD/BOSL2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join the chat at https://gitter.im/revarbat/BOSL2](https://badges.gitter.im/revarbat/BOSL2.svg)](https://gitter.im/revarbat/BOSL2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Documentation

View file

@ -15,6 +15,7 @@ include <screws.scad>
// Module: knuckle_hinge()
// Synopsis: Creates a knuckle-hinge shape.
// SynTags: Geom
// Topics: Hinges, Parts
// See Also: living_hinge_mask(), snap_lock(), snap_socket()
// Usage:
@ -346,6 +347,7 @@ module _knuckle_hinge_profile(offset, arm_height, arm_angle=45, knuckle_diam=4,
// Module: living_hinge_mask()
// Synopsis: Creates a mask to make a folding "living" hinge.
// SynTags: Geom
// Topics: Hinges, Parts
// See Also: knuckle_hinge(), living_hinge_mask(), snap_lock(), snap_socket(), apply_folding_hinges_and_snaps()
// Usage:
@ -391,6 +393,7 @@ module folding_hinge_mask(l, thick, layerheight=0.2, foldangle=90, hingegap=unde
// Module: apply_folding_hinges_and_snaps()
// Synopsis: Adds snap shapes and removes living hinges from a child shape.
// SynTags: Geom
// Topics: Hinges, Parts
// See Also: knuckle_hinge(), living_hinge_mask(), snap_lock(), snap_socket()
// Usage:
@ -476,6 +479,7 @@ module apply_folding_hinges_and_snaps(thick, foldangle=90, hinges=[], snaps=[],
// Module: snap_lock()
// Synopsis: Creates a snap-lock shape.
// SynTags: Geom
// Topics: Hinges, Parts
// See Also: knuckle_hinge(), living_hinge_mask(), snap_lock(), snap_socket()
// Usage:
@ -515,6 +519,7 @@ module snap_lock(thick, snaplen=5, snapdiam=5, layerheight=0.2, foldangle=90, hi
// Module: snap_socket()
// Synopsis: Creates a snap-lock socket shape.
// SynTags: Geom
// Topics: Hinges, Parts
// See Also: knuckle_hinge(), living_hinge_mask(), snap_lock(), snap_socket()
// Usage:

View file

@ -17,6 +17,7 @@ include <rounding.scad>
// Function&Module: half_joiner_clear()
// Synopsis: Creates a mask to clear space for a {{half_joiner()}}.
// SynTags: Geom, VNF
// Topics: Joiners, Parts
// See Also: half_joiner_clear(), half_joiner(), half_joiner2(), joiner_clear(), joiner(), snap_pin(), rabbit_clip(), dovetail()
// Usage: As Module
@ -62,6 +63,7 @@ module half_joiner_clear(l=20, w=10, ang=30, clearance=0, overlap=0.01, anchor=C
// Function&Module: half_joiner()
// Synopsis: Creates a half-joiner shape to mate with a {{half_joiner2()}} shape..
// SynTags: Geom, VNF
// Topics: Joiners, Parts
// See Also: half_joiner_clear(), half_joiner(), half_joiner2(), joiner_clear(), joiner(), snap_pin(), rabbit_clip(), dovetail()
// Usage: As Module
@ -244,6 +246,7 @@ module half_joiner(l=20, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0
// Function&Module: half_joiner2()
// Synopsis: Creates a half_joiner2 shape to mate with a {{half_joiner()}} shape..
// SynTags: Geom, VNF
// Topics: Joiners, Parts
// See Also: half_joiner_clear(), half_joiner(), half_joiner2(), joiner_clear(), joiner(), snap_pin(), rabbit_clip(), dovetail()
// Usage: As Module
@ -459,6 +462,7 @@ module half_joiner2(l=20, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=
// Module: joiner_clear()
// Synopsis: Creates a mask to clear space for a {{joiner()}} shape.
// SynTags: Geom
// Topics: Joiners, Parts
// See Also: half_joiner_clear(), half_joiner(), half_joiner2(), joiner_clear(), joiner(), snap_pin(), rabbit_clip(), dovetail()
// Description:
@ -498,6 +502,7 @@ module joiner_clear(l=40, w=10, ang=30, clearance=0, overlap=0.01, anchor=CENTER
// Module: joiner()
// Synopsis: Creates a joiner shape that can mate with another rotated joiner shape.
// SynTags: Geom
// Topics: Joiners, Parts
// See Also: half_joiner_clear(), half_joiner(), half_joiner2(), joiner_clear(), joiner(), snap_pin(), rabbit_clip(), dovetail()
// Usage:
@ -549,6 +554,7 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori
// Module: dovetail()
// Synopsis: Creates a possibly tapered dovetail shape.
// SynTags: Geom
// Topics: Joiners, Parts
// See Also: joiner(), snap_pin(), rabbit_clip()
//
@ -819,6 +825,7 @@ function _pin_size(size) =
// Module: snap_pin()
// Synopsis: Creates a snap-pin that can slot into a {{snap_pin_socket()}} to join two parts.
// SynTags: Geom
// Topics: Joiners, Parts
// See Also: snap_pin_socket(), joiner(), dovetail(), snap_pin(), rabbit_clip()
// Usage:
@ -892,6 +899,7 @@ module snap_pin(size,r,radius,d,diameter, l,length, nub_depth, snap, thickness,
// Module: snap_pin_socket()
// Synopsis: Creates a snap-pin socket for a {{snap_pin()}} to slot into.
// SynTags: Geom
// Topics: Joiners, Parts
// See Also: snap_pin(), joiner(), dovetail(), snap_pin(), rabbit_clip()
// Usage:
@ -965,6 +973,7 @@ module snap_pin_socket(size, r, radius, l,length, d,diameter,nub_depth, snap, fi
// Module: rabbit_clip()
// Synopsis: Creates a rabbit-eared clip that can snap into a slot.
// SynTags: Geom
// Topics: Joiners, Parts
// See Also: snap_pin(), joiner(), dovetail(), snap_pin(), rabbit_clip()
// Usage:

View file

@ -31,10 +31,11 @@
// Section: Matrix testing and display
// Function: is_matrix()
// Synopsis: Check if input is a numeric matrix, optionally of specified size
// Topics: Matrices
// See Also: is_matrix_symmetric(), is_rotation()
// Usage:
// test = is_matrix(A, [m], [n], [square])
// Topics: Matrices
// Synopsis: Check if input is a numeric matrix, optionally of specified size
// Description:
// Returns true if A is a numeric matrix of height m and width n with finite entries. If m or n
// are omitted or set to undef then true is returned for any positive dimension.
@ -52,13 +53,14 @@ function is_matrix(A,m,n,square=false) =
// Function: is_matrix_symmetric()
// Synopsis: Checks if matrix is symmetric
// Topics: Matrices
// See Also: is_matrix(), is_rotation()
// Usage:
// b = is_matrix_symmetric(A, [eps])
// Topics: Matrices
// Description:
// Returns true if the input matrix is symmetric, meaning it approximately equals its transpose.
// The matrix can have arbitrary entries.
// Synopsis: Checks if matrix is symmetric
// Arguments:
// A = matrix to test
// eps = epsilon for comparing equality. Default: 1e-12
@ -67,15 +69,16 @@ function is_matrix_symmetric(A,eps=1e-12) =
// Function: is_rotation()
// Synopsis: Check if a transformation matrix represents a rotation.
// Topics: Affine, Matrices, Transforms
// See Also: is_matrix(), is_matrix_symmetric(), is_rotation()
// Usage:
// b = is_rotation(A, [dim], [centered])
// Topics: Affine, Matrices, Transforms
// Description:
// Returns true if the input matrix is a square affine matrix that is a rotation around any point,
// or around the origin if `centered` is true.
// The matrix must be 3x3 (representing a 2d transformation) or 4x4 (representing a 3d transformation).
// You can set `dim` to 2 to require a 2d transform (3x3 matrix) or to 3 to require a 3d transform (4x4 matrix).
// Synopsis: Check if a transformation matrix represents a rotation.
// Arguments:
// A = matrix to test
// dim = if set, specify dimension in which the transform operates (2 or 3)
@ -96,11 +99,12 @@ function is_rotation(A,dim,centered=false) =
// Function&Module: echo_matrix()
// Synopsis: Print a matrix neatly to the console.
// Topics: Matrices
// See Also: is_matrix(), is_matrix_symmetric(), is_rotation()
// Usage:
// echo_matrix(M, [description], [sig], [sep], [eps]);
// dummy = echo_matrix(M, [description], [sig], [sep], [eps]),
// Topics: Matrices
// Synopsis: Print a matrix neatly to the console.
// Description:
// Display a numerical matrix in a readable columnar format with `sig` significant
// digits. Values smaller than eps display as zero. If you give a description
@ -135,14 +139,14 @@ module echo_matrix(M,description,sig=4,sep=1,eps=1e-9)
// Section: Matrix indexing
// Function: column()
// Usage:
// list = column(M, i);
// Synopsis: Extract a column from a matrix.
// Topics: Matrices, List Handling, Arrays
// See Also: select(), slice()
// Usage:
// list = column(M, i);
// Description:
// Extracts entry `i` from each list in M, or equivalently column i from the matrix M, and returns it as a vector.
// This function will return `undef` at all entry positions indexed by i not found in M.
// Synopsis: Extract a column from a matrix.
// Arguments:
// M = The given list of lists.
// i = The index to fetch
@ -162,11 +166,11 @@ function column(M, i) =
// Function: submatrix()
// Usage:
// mat = submatrix(M, idx1, idx2);
// Synopsis: Extract a submatrix from a matrix
// Topics: Matrices, Arrays
// See Also: column(), block_matrix(), submatrix_set()
// Synopsis: Extract a submatrix from a matrix
// Usage:
// mat = submatrix(M, idx1, idx2);
// Description:
// The input must be a list of lists (a matrix or 2d array). Returns a submatrix by selecting the rows listed in idx1 and columns listed in idx2.
// Arguments:
@ -196,12 +200,13 @@ function submatrix(M,idx1,idx2) =
// Section: Matrix construction and modification
// Function: ident()
// Synopsis: Return identity matrix.
// Topics: Affine, Matrices, Transforms
// See Also: IDENT, submatrix(), column()
// Usage:
// mat = ident(n);
// Topics: Affine, Matrices, Transforms
// Description:
// Create an `n` by `n` square identity matrix.
// Synopsis: Return identity matrix.
// Arguments:
// n = The size of the identity matrix square, `n` by `n`.
// Example:
@ -229,15 +234,15 @@ function ident(n) = [
// Function: diagonal_matrix()
// Usage:
// mat = diagonal_matrix(diag, [offdiag]);
// Synopsis: Make a diagonal matrix.
// Topics: Affine, Matrices
// See Also: column(), submatrix()
// Usage:
// mat = diagonal_matrix(diag, [offdiag]);
// Description:
// Creates a square matrix with the items in the list `diag` on
// its diagonal. The off diagonal entries are set to offdiag,
// which is zero by default.
// Synopsis: Make a diagonal matrix.
// Arguments:
// diag = A list of items to put in the diagnal cells of the matrix.
// offdiag = Value to put in non-diagonal matrix cells.
@ -247,11 +252,11 @@ function diagonal_matrix(diag, offdiag=0) =
// Function: transpose()
// Synopsis: Transpose a matrix
// Topics: Linear Algebra, Matrices
// See Also: submatrix(), block_matrix(), hstack(), flatten()
// Usage:
// M = transpose(M, [reverse]);
// Topics: Linear Algebra, Matrices
// Synopsis: Transpose a matrix
// See Also: submatrix(), block_matrix(), hstack(), flatten()
// Description:
// Returns the transpose of the given input matrix. The input can be a matrix with arbitrary entries or
// a numerical vector. If you give a vector then transpose returns it unchanged.
@ -326,10 +331,11 @@ function transpose(M, reverse=false) =
// Function: outer_product()
// Synopsis: Compute the outer product of two vectors.
// Topics: Linear Algebra, Matrices
// See Also: submatrix(), determinant()
// Usage:
// x = outer_product(u,v);
// Topics: Linear Algebra, Matrices
// Synopsis: Compute the outer product of two vectors.
// Description:
// Compute the outer product of two vectors, which is a matrix.
// Usage:
@ -339,11 +345,11 @@ function outer_product(u,v) =
[for(ui=u) ui*v];
// Function: submatrix_set()
// Usage:
// mat = submatrix_set(M, A, [m], [n]);
// Synopsis: Takes a matrix as input and change values in a submatrix.
// Topics: Matrices, Arrays
// See Also: column(), submatrix()
// Synopsis: Takes a matrix as input and change values in a submatrix.
// Usage:
// mat = submatrix_set(M, A, [m], [n]);
// Description:
// Sets a submatrix of M equal to the matrix A. By default the top left corner of M is set to A, but
// you can specify offset coordinates m and n. If A (as adjusted by m and n) extends beyond the bounds
@ -368,13 +374,13 @@ function submatrix_set(M,A,m=0,n=0) =
// Function: hstack()
// Synopsis: Make a new matrix by stacking matrices horizontally.
// Topics: Matrices, Arrays
// See Also: column(), submatrix(), block_matrix()
// Usage:
// A = hstack(M1, M2)
// A = hstack(M1, M2, M3)
// A = hstack([M1, M2, M3, ...])
// Synopsis: Make a new matrix by stacking matrices horizontally.
// Topics: Matrices, Arrays
// See Also: column(), submatrix(), block_matrix()
// Description:
// Constructs a matrix by horizontally "stacking" together compatible matrices or vectors. Vectors are treated as columsn in the stack.
// This command is the inverse of `column`. Note: strings given in vectors are broken apart into lists of characters. Strings given
@ -423,11 +429,11 @@ function hstack(M1, M2, M3) =
// Function: block_matrix()
// Usage:
// bmat = block_matrix([[M11, M12,...],[M21, M22,...], ... ]);
// Synopsis: Make a new matrix from a block of matrices.
// Topics: Matrices, Arrays
// See Also: column(), submatrix()
// Synopsis: Make a new matrix from a block of matrices.
// Usage:
// bmat = block_matrix([[M11, M12,...],[M21, M22,...], ... ]);
// Description:
// Create a block matrix by supplying a matrix of matrices, which will
// be combined into one unified matrix. Every matrix in one row
@ -471,10 +477,11 @@ function block_matrix(M) =
// Section: Solving Linear Equations and Matrix Factorizations
// Function: linear_solve()
// Synopsis: Solve Ax=b or, for overdetermined case, solve the least square problem.
// Topics: Matrices, Linear Algebra
// See Also: linear_solve3(), matrix_inverse(), rot_inverse(), back_substitute(), cholesky()
// Usage:
// solv = linear_solve(A,b,[pivot])
// Topics: Matrices, Linear Algebra
// Synopsis: Solve Ax=b or, for overdetermined case, solve the least square problem.
// Description:
// Solves the linear system Ax=b. If `A` is square and non-singular the unique solution is returned. If `A` is overdetermined
// the least squares solution is returned. If `A` is underdetermined, the minimal norm solution is returned.
@ -509,10 +516,11 @@ function linear_solve(A,b,pivot=true) =
// Function: linear_solve3()
// Synopsis: Fast solution to Ax=b where A is 3x3.
// Topics: Matrices, Linear Algebra
// See Also: linear_solve(), matrix_inverse(), rot_inverse(), back_substitute(), cholesky()
// Usage:
// x = linear_solve3(A,b)
// Topics: Matrices, Linear Algebra
// Synopsis: Fast solution to Ax=b where A is 3x3.
// Description:
// Fast solution to a 3x3 linear system using Cramer's rule (which appears to be the fastest
// method in OpenSCAD). The input `A` must be a 3x3 matrix. Returns undef if `A` is singular.
@ -535,10 +543,11 @@ function linear_solve3(A,b) =
// Function: matrix_inverse()
// Synopsis: General matrix inverse.
// Topics: Matrices, Linear Algebra
// See Also: linear_solve(), linear_solve3(), matrix_inverse(), rot_inverse(), back_substitute(), cholesky()
// Usage:
// mat = matrix_inverse(A)
// Topics: Matrices, Linear Algebra
// Synopsis: General matrix inverse.
// Description:
// Compute the matrix inverse of the square matrix `A`. If `A` is singular, returns `undef`.
// Note that if you just want to solve a linear system of equations you should NOT use this function.
@ -550,10 +559,11 @@ function matrix_inverse(A) =
// Function: rot_inverse()
// Usage:
// B = rot_inverse(A)
// Synopsis: Invert 2d or 3d rotation transformations.
// Topics: Matrices, Linear Algebra, Affine
// See Also: linear_solve(), linear_solve3(), matrix_inverse(), rot_inverse(), back_substitute(), cholesky()
// Usage:
// B = rot_inverse(A)
// Description:
// Inverts a 2d (3x3) or 3d (4x4) rotation matrix. The matrix can be a rotation around any center,
// so it may include a translation. This is faster and likely to be more accurate than using `matrix_inverse()`.
@ -572,10 +582,11 @@ function rot_inverse(T) =
// Function: null_space()
// Synopsis: Return basis for the null space of A.
// Topics: Matrices, Linear Algebra
// See Also: linear_solve(), linear_solve3(), matrix_inverse(), rot_inverse(), back_substitute(), cholesky()
// Usage:
// x = null_space(A)
// Topics: Matrices, Linear Algebra
// Synopsis: Return basis for the null space of A.
// Description:
// Returns an orthonormal basis for the null space of `A`, namely the vectors {x} such that Ax=0.
// If the null space is just the origin then returns an empty list.
@ -590,10 +601,11 @@ function null_space(A,eps=1e-12) =
select(transpose(Q_R[0]), zrows);
// Function: qr_factor()
// Synopsis: Compute QR factorization of a matrix.
// Topics: Matrices, Linear Algebra
// See Also: linear_solve(), linear_solve3(), matrix_inverse(), rot_inverse(), back_substitute(), cholesky()
// Usage:
// qr = qr_factor(A,[pivot]);
// Topics: Matrices, Linear Algebra
// Synopsis: Compute QR factorization of a matrix.
// Description:
// Calculates the QR factorization of the input matrix A and returns it as the list [Q,R,P]. This factorization can be
// used to solve linear systems of equations. The factorization is `A = Q*R*transpose(P)`. If pivot is false (the default)
@ -642,10 +654,11 @@ function _swap_matrix(n,i,j) =
// Function: back_substitute()
// Synopsis: Solve an upper triangular system, Rx=b.
// Topics: Matrices, Linear Algebra
// See Also: linear_solve(), linear_solve3(), matrix_inverse(), rot_inverse(), back_substitute(), cholesky()
// Usage:
// x = back_substitute(R, b, [transpose]);
// Topics: Matrices, Linear Algebra
// Synopsis: Solve an upper triangular system, Rx=b.
// Description:
// Solves the problem Rx=b where R is an upper triangular square matrix. The lower triangular entries of R are
// ignored. If transpose==true then instead solve transpose(R)*x=b.
@ -675,10 +688,11 @@ function _back_substitute(R, b, x=[]) =
// Function: cholesky()
// Synopsis: Compute the Cholesky factorization of a matrix.
// Topics: Matrices, Linear Algebra
// See Also: linear_solve(), linear_solve3(), matrix_inverse(), rot_inverse(), back_substitute(), cholesky()
// Usage:
// L = cholesky(A);
// Topics: Matrices, Linear Algebra
// Synopsis: Compute the Cholesky factorization of a matrix.
// Description:
// Compute the cholesky factor, L, of the symmetric positive definite matrix A.
// The matrix L is lower triangular and `L * transpose(L) = A`. If the A is
@ -712,10 +726,11 @@ function _cholesky(A,L,n) =
// Section: Matrix Properties: Determinants, Norm, Trace
// Function: det2()
// Synopsis: Compute determinant of 2x2 matrix.
// Topics: Matrices, Linear Algebra
// See Also: det2(), det3(), det4(), determinant(), norm_fro(), matrix_trace()
// Usage:
// d = det2(M);
// Topics: Matrices, Linear Algebra
// Synopsis: Compute determinant of 2x2 matrix.
// Description:
// Rturns the determinant for the given 2x2 matrix.
// Arguments:
@ -729,10 +744,11 @@ function det2(M) =
// Function: det3()
// Synopsis: Compute determinant of 3x3 matrix.
// Topics: Matrices, Linear Algebra
// See Also: det2(), det3(), det4(), determinant(), norm_fro(), matrix_trace()
// Usage:
// d = det3(M);
// Topics: Matrices, Linear Algebra
// Synopsis: Compute determinant of 3x3 matrix.
// Description:
// Returns the determinant for the given 3x3 matrix.
// Arguments:
@ -747,10 +763,11 @@ function det3(M) =
M[2][0] * (M[0][1]*M[1][2]-M[1][1]*M[0][2]);
// Function: det4()
// Synopsis: Compute determinant of 4x4 matrix.
// Topics: Matrices, Linear Algebra
// See Also: det2(), det3(), det4(), determinant(), norm_fro(), matrix_trace()
// Usage:
// d = det4(M);
// Topics: Matrices, Linear Algebra
// Synopsis: Compute determinant of 4x4 matrix.
// Description:
// Returns the determinant for the given 4x4 matrix.
// Arguments:
@ -770,12 +787,13 @@ function det4(M) =
- M[0][3]*M[1][0]*M[2][1]*M[3][2] - M[0][3]*M[1][1]*M[2][2]*M[3][0] - M[0][3]*M[1][2]*M[2][0]*M[3][1];
// Function: determinant()
// Synopsis: compute determinant of an arbitrary square matrix.
// Topics: Matrices, Linear Algebra
// See Also: det2(), det3(), det4(), determinant(), norm_fro(), matrix_trace()
// Usage:
// d = determinant(M);
// Topics: Matrices, Linear Algebra
// Description:
// Returns the determinant for the given square matrix.
// Synopsis: compute determinant of an arbitrary square matrix.
// Arguments:
// M = The NxN square matrix to get the determinant of.
// Example:
@ -804,10 +822,11 @@ function determinant(M) =
// Function: norm_fro()
// Synopsis: Compute Frobenius norm of a matrix
// Topics: Matrices, Linear Algebra
// See Also: det2(), det3(), det4(), determinant(), norm_fro(), matrix_trace()
// Usage:
// norm_fro(A)
// Topics: Matrices, Linear Algebra
// Synopsis: Compute Frobenius norm of a matrix
// Description:
// Computes frobenius norm of input matrix. The frobenius norm is the square root of the sum of the
// squares of all of the entries of the matrix. On vectors it is the same as the usual 2-norm.
@ -818,10 +837,11 @@ function norm_fro(A) =
// Function: matrix_trace()
// Synopsis: Compute the trace of a square matrix.
// Topics: Matrices, Linear Algebra
// See Also: det2(), det3(), det4(), determinant(), norm_fro(), matrix_trace()
// Usage:
// matrix_trace(M)
// Topics: Matrices, Linear Algebra
// Synopsis: Compute the trace of a square matrix.
// Description:
// Computes the trace of a square matrix, the sum of the entries on the diagonal.
function matrix_trace(M) =

View file

@ -16,6 +16,7 @@ include <metric_screws.scad>
// Module: linear_bearing_housing()
// Synopsis: Creates a generic linear bearing mount clamp.
// SynTags: Geom
// Topics: Parts, Bearings
// See Also: linear_bearing(), lmXuu_info(), ball_bearing()
// Usage:
@ -82,6 +83,7 @@ module linear_bearing_housing(d=15, l=24, tab=7, gap=5, wall=3, tabwall=5, screw
// Module: linear_bearing()
// Synopsis: Creates a generic linear bearing cartridge.
// SynTags: Geom
// Topics: Parts, Bearings
// See Also: linear_bearing_housing(), lmXuu_info(), ball_bearing()
// Usage:
@ -116,6 +118,7 @@ module linear_bearing(l, od=15, id=8, length, anchor=CTR, spin=0, orient=UP) {
// Module: lmXuu_housing()
// Synopsis: Creates a standardized LM*UU linear bearing mount clamp.
// SynTags: Geom
// Topics: Parts, Bearings
// See Also: linear_bearing(), linear_bearing_housing(), lmXuu_info(), lmXuu_bearing(), lmXuu_housing(), ball_bearing()
// Usage:
@ -146,6 +149,7 @@ module lmXuu_housing(size=8, tab=7, gap=5, wall=3, tabwall=5, screwsize=3, ancho
// Module: lmXuu_bearing()
// Synopsis: Creates a standardized LM*UU linear bearing cartridge.
// SynTags: Geom
// Topics: Parts, Bearings
// See Also: linear_bearing(), linear_bearing_housing(), lmXuu_info(), lmXuu_bearing(), lmXuu_housing(), ball_bearing()
// Usage:

View file

@ -268,6 +268,7 @@ function slice(list,start=0,end=-1) =
)
[if (start<=end && end>=0 && start<=l) for (i=[max(start,0):1:min(end,l-1)]) list[i]];
// Function: last()
// Synopsis: Returns the last item of a list.
// Topics: List Handling

View file

@ -17,7 +17,7 @@
// Synopsis: Creates a shape to chamfer a 90° edge.
// SynTags: Geom
// Topics: Masking, Chamfers, Shapes (3D)
// See Also: chamfer_corner_mask()
// See Also: chamfer_corner_mask(), chamfer_cylinder_mask(), chamfer_edge_mask()
// Usage:
// chamfer_edge_mask(l|h=|length=|height=, chamfer, [excess]) [ATTACHMENTS];
// Description:
@ -59,7 +59,7 @@ module chamfer_edge_mask(l, chamfer=1, excess=0.1, h, length, height, anchor=CEN
// Synopsis: Creates a shape to chamfer a 90° corner.
// SynTags: Geom
// Topics: Masking, Chamfers, Shapes (3D)
// See Also: chamfer_edge_mask()
// See Also: chamfer_corner_mask(), chamfer_cylinder_mask(), chamfer_edge_mask()
// Usage:
// chamfer_corner_mask(chamfer) [ATTACHMENTS];
// Description:
@ -98,6 +98,7 @@ module chamfer_corner_mask(chamfer=1, anchor=CENTER, spin=0, orient=UP) {
// Synopsis: Creates a shape to chamfer the end of a cylinder.
// SynTags: Geom
// Topics: Masking, Chamfers, Cylinders
// See Also: chamfer_corner_mask(), chamfer_cylinder_mask(), chamfer_edge_mask()
// Usage:
// chamfer_cylinder_mask(r|d=, chamfer, [ang], [from_end]) [ATTACHMENTS];
// Description:
@ -419,7 +420,7 @@ module rounding_angled_corner_mask(r, ang=90, d, anchor=CENTER, spin=0, orient=U
// Synopsis: Creates a shape to round the end of a cylinder.
// SynTags: Geom
// Topics: Masking, Rounding, Cylinders
// See Also: rounding_hole_mask()
// See Also: rounding_hole_mask(), rounding_angled_edge_mask(), rounding_corner_mask(), rounding_angled_corner_mask()
// Usage:
// rounding_cylinder_mask(r|d=, rounding);
// Description:
@ -471,7 +472,7 @@ module rounding_cylinder_mask(r, rounding, d, anchor=CENTER, spin=0, orient=UP)
// Synopsis: Creates a shape to round the edge of a round hole.
// SynTags: Geom
// Topics: Masking, Rounding
// See Also: rounding_cylinder_mask()
// See Also: rounding_cylinder_mask(), rounding_hole_mask(), rounding_angled_edge_mask(), rounding_corner_mask(), rounding_angled_corner_mask()
// Usage:
// rounding_hole_mask(r|d, rounding, [excess]) [ATTACHMENTS];
// Description:
@ -524,7 +525,7 @@ module rounding_hole_mask(r, rounding, excess=0.1, d, anchor=CENTER, spin=0, ori
// Synopsis: Creates a shape to round a 90° edge but limit the angle of overhang.
// SynTags: Geom
// Topics: Masking, Rounding, Shapes (3D), FDM Optimized
// See Also: teardrop_corner_mask()
// See Also: teardrop_corner_mask(), teardrop_edge_mask()
// Usage:
// teardrop_edge_mask(l|h=|length=|height=, r|d=, [angle], [excess], [anchor], [spin], [orient]) [ATTACHMENTS];
// Description:
@ -567,7 +568,7 @@ module teardrop_edge_mask(l, r, angle=45, excess=0.1, d, anchor=CTR, spin=0, ori
// Synopsis: Creates a shape to round a 90° corner but limit the angle of overhang.
// SynTags: Geom
// Topics: Masking, Rounding, Shapes (3D), FDM Optimized
// See Also: teardrop_edge_mask()
// See Also: teardrop_corner_mask(), teardrop_edge_mask()
// Usage:
// teardrop_corner_mask(r|d=, [angle], [excess], [anchor], [spin], [orient]) [ATTACHMENTS];
// Description:

View file

@ -10,7 +10,7 @@
// Section: Modular Hose Parts
_small_end = [
_modhose_small_end = [
turtle([
"left", 90-38.5, // 1/4" hose
"arcsteps", 12,
@ -57,7 +57,7 @@ _small_end = [
];
_big_end = [
_modhose_big_end = [
turtle([ // 1/4" hose
"left", 90-22,
"move", 6.5,
@ -116,7 +116,7 @@ _big_end = [
];
_hose_waist = [1.7698, 1.8251, 3.95998];
_modhose_waist = [1.7698, 1.8251, 3.95998];
// Module: modular_hose()
@ -159,14 +159,14 @@ module modular_hose(size, type, clearance=0, waist_len, anchor=BOTTOM, spin=0,or
ind = search([size],[1/4, 1/2, 3/4])[0];
sbound =
assert(ind!=[], "Must specify size as 1/4, 1/2 or 3/4")
pointlist_bounds(_small_end[ind]);
bbound = pointlist_bounds(_big_end[ind]);
pointlist_bounds(_modhose_small_end[ind]);
bbound = pointlist_bounds(_modhose_big_end[ind]);
smallend =
assert(is_vector(clearance,2), "Clearance must be a scalar or length 2 vector")
move([-clearance[0],-sbound[0].y],p=_small_end[ind]);
bigend = move([clearance[1], -bbound[0].y], p=_big_end[ind]);
move([-clearance[0],-sbound[0].y],p=_modhose_small_end[ind]);
bigend = move([clearance[1], -bbound[0].y], p=_modhose_big_end[ind]);
midlength = first_defined([waist_len, _hose_waist[ind]]);
midlength = first_defined([waist_len, _modhose_waist[ind]]);
dummy = assert(midlength>=0,"midlength must be nonnegative");
goodtypes = ["small","big","segment","socket","ball"];
@ -221,8 +221,8 @@ function modular_hose_radius(size, outer=false) =
)
assert(ind!=[], "Must specify size as 1/4, 1/2 or 3/4")
let(
b = select(_big_end[ind], [0,-1]),
s = select(_small_end[ind], [0,-1])
b = select(_modhose_big_end[ind], [0,-1]),
s = select(_modhose_small_end[ind], [0,-1])
)
outer ? b[1][0] : b[0][0];

View file

@ -14,6 +14,7 @@
// Module: bounding_box()
// Synopsis: Creates the smallest bounding box that contains all the children.
// SynTags: Geom
// Topics: Mutators, Bounds, Bounding Boxes
// See Also: pointlist_bounds()
// Usage:
@ -109,6 +110,7 @@ module bounding_box(excess=0, planar=false) {
// Module: chain_hull()
// Synopsis: Performs the union of hull operations between consecutive pairs of children.
// SynTags: Geom
// Topics: Mutators
// See Also: hull()
// Usage:
@ -162,6 +164,7 @@ module chain_hull()
// Module: path_extrude2d()
// Synopsis: Extrudes 2D children along a 2D path.
// SynTags: Geom
// Topics: Mutators, Extrusion
// See Also: path_sweep(), path_extrude()
// Usage:
@ -284,6 +287,7 @@ module path_extrude2d(path, caps=false, closed=false, s, convexity=10) {
// Module: cylindrical_extrude()
// Synopsis: Extrudes 2D children outwards around a cylinder.
// SynTags: Geom
// Topics: Mutators, Extrusion, Rotation
// See Also: heightfield(), cylindrical_heightfield(), cyl()
// Usage:
@ -349,7 +353,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.
// Synopsis: Extrudes 2D children between two points in 3D space.
// SynTags: Geom
// Topics: Extrusion, Mutators
// See Also: path_sweep(), path_extrude2d()
// Usage:
@ -396,9 +401,11 @@ module extrude_from_to(pt1, pt2, convexity, twist, scale, slices) {
// Module: path_extrude()
// Synopsis: Extrudes 2D children along a 3D path.
// SynTags: Geom
// Topics: Paths, Extrusion, Mutators
// See Also: path_sweep(), path_extrude2d()
// Usage: path_extrude(path, [convexity], [clipsize]) 2D-CHILDREN;
// 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.
// Arguments:
@ -461,6 +468,7 @@ module path_extrude(path, convexity=10, clipsize=100) {
// Module: minkowski_difference()
// Synopsis: Removes diff shapes from base shape surface.
// SynTags: Geom
// Topics: Mutators
// See Also: offset3d()
// Usage:
@ -504,6 +512,7 @@ module minkowski_difference(planar=false) {
// Module: offset3d()
// Synopsis: Expands or contracts the surface of a 3D object.
// SynTags: Geom
// Topics: Mutators
// See Also: minkowski_difference(), round3d()
// Usage:
@ -550,6 +559,7 @@ module offset3d(r, size=100, convexity=10) {
// Module: round3d()
// Synopsis: Rounds arbitrary 3d objects.
// SynTags: Geom
// Topics: Rounding, Mutators
// See Also: offset3d(), minkowski_difference()
// Usage:

View file

@ -14,6 +14,7 @@
// Module: nema_stepper_motor()
// Synopsis: Creates a NEMA standard stepper motor model.
// SynTags: Geom
// Topics: Parts, Motors
// See Also: nema_stepper_motor(), nema_mount_mask()
// Usage:
@ -119,6 +120,7 @@ module nema_stepper_motor(size=17, h=24, shaft_len=20, details=true, atype="body
// Module: nema_mount_mask()
// Synopsis: Creates a standard NEMA mount holes mask.
// SynTags: Geom
// Topics: Parts, Motors
// See Also: nema_stepper_motor(), nema_mount_mask()
// Usage:

View file

@ -15,7 +15,7 @@
// Synopsis: Masks half of an object at a cut plane.
// SynTags: Geom, VNF, Path, Region
// Topics: Partitions, Masking
// See Also: back_half(), front_half(), left_half(), right_half(), top_half(), bottom_half()
// See Also: back_half(), front_half(), left_half(), right_half(), top_half(), bottom_half(), intersection()
//
// Usage: as module
// half_of(v, [cp], [s], [planar]) CHILDREN;
@ -23,12 +23,13 @@
// result = half_of(p,v,[cp]);
//
// Description:
// Slices an object at a cut plane, and masks away everything that is on one side. The v parameter is either a plane specification or
// a normal vector. The s parameter is needed for the module
// version to control the size of the masking cube. If s is too large then the preview display will flip around and display the
// wrong half, but if it is too small it won't fully mask your model.
// When called as a function, you must supply a vnf, path or region in p. If planar is set to true for the module version the operation
// is performed in 2D and UP and DOWN are treated as equivalent to BACK and FWD respectively.
// Slices an object at a cut plane, and masks away everything that is on one side. The v parameter
// is either a plane specification or a normal vector. The `s` parameter is needed for the module
// version to control the size of the masking cube. If `s` is too large then the preview display
// will flip around and display the wrong half, but if it is too small it won't fully mask your
// model. When called as a function, you must supply a vnf, path or region in p. If planar is set
// to true for the module version the operation is performed in 2D and UP and DOWN are treated as
// equivalent to BACK and FWD respectively.
//
// Arguments:
// p = path, region or VNF to slice. (Function version)
@ -125,7 +126,7 @@ function half_of(p, v=UP, cp) =
// Synopsis: Masks the right half of an object along the Y-Z plane, leaving the left half.
// SynTags: Geom, VNF, Path, Region
// Topics: Partitions, Masking
// See Also: back_half(), front_half(), right_half(), top_half(), bottom_half(), half_of()
// See Also: back_half(), front_half(), right_half(), top_half(), bottom_half(), half_of(), intersection()
//
// Usage: as module
// left_half([s], [x]) CHILDREN;
@ -135,9 +136,9 @@ function half_of(p, v=UP, cp) =
//
// Description:
// Slices an object at a vertical Y-Z cut plane, and masks away everything that is right of it.
// The s parameter is needed for the module
// version to control the size of the masking cube. If s is too large then the preview display will flip around and display the
// wrong half, but if it is too small it won't fully mask your model.
// The `s` parameter is needed for the module version to control the size of the masking cube.
// If `s` is too large then the preview display will flip around and display the wrong half,
// but if it is too small it won't fully mask your model.
//
// Arguments:
// p = VNF, region or path to slice (function version)
@ -172,7 +173,7 @@ function left_half(p,x=0) = half_of(p, LEFT, [x,0,0]);
// SynTags: Geom, VNF, Path, Region
// Synopsis: Masks the left half of an object along the Y-Z plane, leaving the right half.
// Topics: Partitions, Masking
// See Also: back_half(), front_half(), left_half(), top_half(), bottom_half(), half_of()
// See Also: back_half(), front_half(), left_half(), top_half(), bottom_half(), half_of(), intersection()
//
// Usage: as module
// right_half([s=], [x=]) CHILDREN;
@ -182,9 +183,9 @@ function left_half(p,x=0) = half_of(p, LEFT, [x,0,0]);
//
// Description:
// Slices an object at a vertical Y-Z cut plane, and masks away everything that is left of it.
// The s parameter is needed for the module
// version to control the size of the masking cube. If s is too large then the preview display will flip around and display the
// wrong half, but if it is too small it won't fully mask your model.
// The `s` parameter is needed for the module version to control the size of the masking cube.
// If `s` is too large then the preview display will flip around and display the wrong half,
// but if it is too small it won't fully mask your model.
// Arguments:
// p = VNF, region or path to slice (function version)
// s = Mask size to use. Use a number larger than twice your object's largest axis. If you make this too large, OpenSCAD's preview rendering may display the wrong half. (Module version) Default: 100
@ -217,7 +218,7 @@ function right_half(p,x=0) = half_of(p, RIGHT, [x,0,0]);
// Synopsis: Masks the back half of an object along the X-Z plane, leaving the front half.
// SynTags: Geom, VNF, Path, Region
// Topics: Partitions, Masking
// See Also: back_half(), left_half(), right_half(), top_half(), bottom_half(), half_of()
// See Also: back_half(), left_half(), right_half(), top_half(), bottom_half(), half_of(), intersection()
//
// Usage:
// front_half([s], [y]) CHILDREN;
@ -227,9 +228,9 @@ function right_half(p,x=0) = half_of(p, RIGHT, [x,0,0]);
//
// Description:
// Slices an object at a vertical X-Z cut plane, and masks away everything that is behind it.
// The s parameter is needed for the module
// version to control the size of the masking cube. If s is too large then the preview display will flip around and display the
// wrong half, but if it is too small it won't fully mask your model.
// The `s` parameter is needed for the module version to control the size of the masking cube.
// If `s` is too large then the preview display will flip around and display the wrong half,
// but if it is too small it won't fully mask your model.
// Arguments:
// p = VNF, region or path to slice (function version)
// s = Mask size to use. Use a number larger than twice your object's largest axis. If you make this too large, OpenSCAD's preview rendering may display the wrong half. (Module version) Default: 100
@ -263,7 +264,7 @@ function front_half(p,y=0) = half_of(p, FRONT, [0,y,0]);
// Synopsis: Masks the front half of an object along the X-Z plane, leaving the back half.
// SynTags: Geom, VNF, Path, Region
// Topics: Partitions, Masking
// See Also: front_half(), left_half(), right_half(), top_half(), bottom_half(), half_of()
// See Also: front_half(), left_half(), right_half(), top_half(), bottom_half(), half_of(), intersection()
//
// Usage:
// back_half([s], [y]) CHILDREN;
@ -273,9 +274,9 @@ function front_half(p,y=0) = half_of(p, FRONT, [0,y,0]);
//
// Description:
// Slices an object at a vertical X-Z cut plane, and masks away everything that is in front of it.
// The s parameter is needed for the module
// version to control the size of the masking cube. If s is too large then the preview display will flip around and display the
// wrong half, but if it is too small it won't fully mask your model.
// The `s` parameter is needed for the module version to control the size of the masking cube.
// If `s` is too large then the preview display will flip around and display the wrong half,
// but if it is too small it won't fully mask your model.
// Arguments:
// p = VNF, region or path to slice (function version)
// s = Mask size to use. Use a number larger than twice your object's largest axis. If you make this too large, OpenSCAD's preview rendering may display the wrong half. (Module version) Default: 100
@ -309,7 +310,7 @@ function back_half(p,y=0) = half_of(p, BACK, [0,y,0]);
// Synopsis: Masks the top half of an object along the X-Y plane, leaving the bottom half.
// SynTags: Geom, VNF, Path, Region
// Topics: Partitions, Masking
// See Also: back_half(), front_half(), left_half(), right_half(), top_half(), half_of()
// See Also: back_half(), front_half(), left_half(), right_half(), top_half(), half_of(), intersection()
//
// Usage:
// bottom_half([s], [z]) CHILDREN;
@ -318,9 +319,9 @@ function back_half(p,y=0) = half_of(p, BACK, [0,y,0]);
//
// Description:
// Slices an object at a horizontal X-Y cut plane, and masks away everything that is above it.
// The s parameter is needed for the module
// version to control the size of the masking cube. If s is too large then the preview display will flip around and display the
// wrong half, but if it is too small it won't fully mask your model.
// The `s` parameter is needed for the module version to control the size of the masking cube.
// If `s` is too large then the preview display will flip around and display the wrong half,
// but if it is too small it won't fully mask your model.
// Arguments:
// p = VNF, region or path to slice (function version)
// s = Mask size to use. Use a number larger than twice your object's largest axis. If you make this too large, OpenSCAD's preview rendering may display the wrong half. (Module version) Default: 100
@ -347,7 +348,7 @@ function bottom_half(p,z=0) = half_of(p,BOTTOM,[0,0,z]);
// Synopsis: Masks the bottom half of an object along the X-Y plane, leaving the top half.
// SynTags: Geom, VNF, Path, Region
// Topics: Partitions, Masking
// See Also: back_half(), front_half(), left_half(), right_half(), bottom_half(), half_of()
// See Also: back_half(), front_half(), left_half(), right_half(), bottom_half(), half_of(), intersection()
//
// Usage: as module
// top_half([s], [z]) CHILDREN;
@ -356,9 +357,9 @@ function bottom_half(p,z=0) = half_of(p,BOTTOM,[0,0,z]);
//
// Description:
// Slices an object at a horizontal X-Y cut plane, and masks away everything that is below it.
// The s parameter is needed for the module
// version to control the size of the masking cube. If s is too large then the preview display will flip around and display the
// wrong half, but if it is too small it won't fully mask your model.
// The `s` parameter is needed for the module version to control the size of the masking cube.
// If `s` is too large then the preview display will flip around and display the wrong half,
// but if it is too small it won't fully mask your model.
// Arguments:
// p = VNF, region or path to slice (function version)
// s = Mask size to use. Use a number larger than twice your object's largest axis. If you make this too large, OpenSCAD's preview rendering may display the wrong half. (Module version) Default: 100
@ -433,7 +434,8 @@ function _partition_cutpath(l, h, cutsize, cutpath, gap) =
// Usage:
// partition_mask(l, w, h, [cutsize], [cutpath], [gap], [inverse], [$slop=], [anchor=], [spin=], [orient=]) [ATTACHMENTS];
// Description:
// Creates a mask that you can use to difference or intersect with an object to remove half of it, leaving behind a side designed to allow assembly of the sub-parts.
// Creates a mask that you can use to difference or intersect with an object to remove half of it,
// leaving behind a side designed to allow assembly of the sub-parts.
// Arguments:
// l = The length of the cut axis.
// w = The width of the part to be masked, back from the cut plane.

View file

@ -78,14 +78,16 @@ function is_1region(path, name="path") =
// Function: force_path()
// Synopsis: Checks that path is a region with one component.
// SynTags: Path
// Topics: Paths, Regions
// See Also: is_1region()
// Usage:
// outpath = force_path(path, [name])
// Description:
// If `path` is a region with one component (a 1-region) then return that component as a path. If path is a region with more components
// then display an error message about the parameter `name` requiring a path or a single component region. If the input
// is not a region then return the input without any checks. This function helps path functions accept 1-regions.
// If `path` is a region with one component (a 1-region) then returns that component as a path.
// If path is a region with more components then displays an error message about the parameter
// `name` requiring a path or a single component region. If the input is not a region then
// returns the input without any checks. This function helps path functions accept 1-regions.
// Arguments:
// path = input to process
// name = name of parameter to use in error message. Default: "path"
@ -129,6 +131,7 @@ function _path_select(path, s1, u1, s2, u2, closed=false) =
// Function: path_merge_collinear()
// Synopsis: Removes unnecessary points from a path.
// SynTags: Path
// Topics: Paths, Regions
// Description:
// Takes a path and removes unnecessary sequential collinear points.
@ -316,6 +319,7 @@ function _sum_preserving_round(data, index=0) =
// Function: subdivide_path()
// Synopsis: Subdivides a path to produce a more finely sampled path.
// SynTags: Path
// Topics: Paths, Path Subdivision
// See Also: subdivide_and_slice(), resample_path(), jittered_poly()
// Usage:
@ -461,6 +465,7 @@ function subdivide_path(path, n, refine, maxlen, closed=true, exact, method) =
// Function: resample_path()
// Synopsis: Returns an equidistant set of points along a path.
// SynTags: Path
// Topics: Paths
// See Also: subdivide_path()
// Usage:
@ -730,6 +735,7 @@ function path_torsion(path, closed=false) =
// Function: path_cut()
// Synopsis: Cuts a path into subpaths at various points.
// SynTags: PathList
// Topics: Paths, Path Subdivision
// See Also: split_path_at_self_crossings(), path_cut_points()
// Usage:
@ -929,6 +935,7 @@ function _cut_to_seg_u_form(pathcut, path, closed) =
// Function: split_path_at_self_crossings()
// Synopsis: Split a 2D path wherever it crosses itself.
// SynTags: PathList
// Topics: Paths, Path Subdivision
// See Also: path_cut(), path_cut_points()
// Usage:
@ -999,6 +1006,7 @@ 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.
// SynTags: PathList
// Topics: Paths, Polygons
// See Also: split_path_at_self_crossings(), path_cut(), path_cut_points()
// Usage:

View file

@ -38,6 +38,7 @@ function _unique_groups(m) = [
// Module: regular_polyhedron()
// Synopsis: Creates a regular polyhedron with optional rounding.
// SynTags: Geom
// Topics: Polyhedra, Shapes, Parts
// See Also: regular_polyhedron_info()
// Usage: Selecting a polyhedron

View file

@ -248,6 +248,7 @@ function is_region_simple(region, eps=EPSILON) =
// Function: make_region()
// Synopsis: Converts lists of intersecting polygons into valid regions.
// SynTags: Region
// Topics: Regions, Paths, Polygons, List Handling
// See Also: force_region(), region()
//
@ -281,6 +282,7 @@ function make_region(polys,nonzero=false,eps=EPSILON) =
// Function: force_region()
// Synopsis: Given a polygon returns a region.
// SynTags: Region
// Topics: Regions, Paths, Polygons, List Handling
// See Also: make_region(), region()
// Usage:
@ -296,6 +298,7 @@ function force_region(poly) = is_path(poly) ? [poly] : poly;
// Module: region()
// Synopsis: Creates the 2D polygons described by the given region or list of polygons.
// SynTags: Geom
// Topics: Regions, Paths, Polygons, List Handling
// See Also: make_region(), region()
// Usage:
@ -576,6 +579,7 @@ function split_region_at_region_crossings(region1, region2, closed1=true, closed
// Function: region_parts()
// Synopsis: Splits a region into a list of regions.
// SynTags: RegList
// Topics: Regions, List Handling
// See Also: split_region_at_region_crossings()
// Usage:
@ -739,6 +743,7 @@ function _point_dist(path,pathseg_unit,pathseg_len,pt) =
// Function: offset()
// Synopsis: Takes a 2D path, polygon or region and returns a path offset by an amount.
// SynTags: Path, Region
// Topics: Paths, Polygons, Regions
// Usage:
// offsetpath = offset(path, [r=|delta=], [chamfer=], [closed=], [check_valid=], [quality=], [same_length=])
@ -1044,6 +1049,7 @@ function _list_three(a,b,c) =
// Function&Module: union()
// Synopsis: Performs a Boolean union operation.
// SynTags: Geom, Region
// Topics: Boolean Operations, Regions, Polygons, Shapes2D, Shapes3D
// See Also: difference(), intersection(), diff(), intersect(), exclusive_or()
// Usage:
@ -1077,6 +1083,7 @@ function union(regions=[],b=undef,c=undef,eps=EPSILON) =
// Function&Module: difference()
// Synopsis: Performs a Boolean difference operation.
// SynTags: Geom, Region
// Topics: Boolean Operations, Regions, Polygons, Shapes2D, Shapes3D
// See Also: union(), intersection(), diff(), intersect(), exclusive_or()
// Usage:
@ -1112,6 +1119,7 @@ function difference(regions=[],b=undef,c=undef,eps=EPSILON) =
// Function&Module: intersection()
// Synopsis: Performs a Boolean intersection operation.
// SynTags: Geom, Region
// Topics: Boolean Operations, Regions, Polygons, Shapes2D, Shapes3D
// See Also: difference(), union(), diff(), intersect(), exclusive_or()
// Usage:
@ -1146,6 +1154,7 @@ function intersection(regions=[],b=undef,c=undef,eps=EPSILON) =
// Function&Module: exclusive_or()
// Synopsis: Performs a Boolean exclusive-or operation.
// SynTags: Geom, Region
// Topics: Boolean Operations, Regions, Polygons, Shapes2D, Shapes3D
// See Also: union(), difference(), intersection(), diff(), intersect()
// Usage:

View file

@ -135,6 +135,7 @@ include <structs.scad>
// Function: round_corners()
// Synopsis: Round or chamfer the corners of a path (clipping them off).
// SynTags: Path
// Topics: Rounding, Paths
// See Also: round_corners(), smooth_path(), path_join(), offset_stroke()
// Usage:
@ -597,6 +598,7 @@ function _rounding_offsets(edgespec,z_dir=1) =
// Function: smooth_path()
// Synopsis: Create smoothed path that passes through all the points of a given path.
// SynTags: Path
// Topics: Rounding, Paths
// See Also: round_corners(), smooth_path(), path_join(), offset_stroke()
// Usage:
@ -695,6 +697,7 @@ function _scalar_to_vector(value,length,varname) =
// Function: path_join()
// Synopsis: Join paths end to end with optional rounding.
// SynTags: Path
// Topics: Rounding, Paths
// See Also: round_corners(), smooth_path(), path_join(), offset_stroke()
// Usage:
@ -883,6 +886,7 @@ function _path_join(paths,joint,k=0.5,i=0,result=[],relocate=true,closed=false)
// Function&Module: offset_stroke()
// Synopsis: Draws a line along a path with options to specify angles and roundings at the ends.
// SynTags: Path, Region
// Topics: Rounding, Paths
// See Also: round_corners(), smooth_path(), path_join(), offset_stroke()
// Usage: as module
@ -1263,10 +1267,11 @@ module offset_stroke(path, width=1, rounded=true, start, end, check_valid=true,
// Function&Module: offset_sweep()
// Synopsis: Make a solid from a polygon with offset that changes along its length.
// SynTags: Geom, VNF
// Topics: Rounding, Offsets
// See Also: offset_sweep(), convex_offset_extrude(), rounded_prism(), bent_cutout_mask(), join_prism()
// Usage: most common module arguments. See Arguments list below for more.
// offset_sweep(path, [height|length|h|l|], [bottom], [top], [offset=], [convexity=],...) [ATTACHMENTS];
// offset_sweep(path, [height|length|h|l|], [bottom], [top], [offset=], [convexity=],...) [ATTACHMENTS];
// Usage: most common function arguments. See Arguments list below for more.
// vnf = offset_sweep(path, [height|h|l|length], [bottom], [top], [offset=], ...);
// Description:
@ -1732,6 +1737,7 @@ function os_mask(mask, out=false, extra,check_valid, quality, offset) =
// Module: convex_offset_extrude()
// Synopsis: Make a solid from geometry where offset changes along the object's length.
// SynTags: Geom
// Topics: Rounding, Offsets
// See Also: offset_sweep(), convex_offset_extrude(), rounded_prism(), bent_cutout_mask(), join_prism()
// Usage: Basic usage. See below for full options
@ -1969,6 +1975,7 @@ function _rp_compute_patches(top, bot, rtop, rsides, ktop, ksides, concave) =
// Function&Module: rounded_prism()
// Synopsis: Make a rounded 3d object by connecting two polygons with the same vertex count.
// SynTags: Geom, VNF
// Topics: Rounding, Offsets
// See Also: offset_sweep(), convex_offset_extrude(), rounded_prism(), bent_cutout_mask(), join_prism()
// Usage: as a module
@ -2285,6 +2292,7 @@ function _circle_mask(r) =
// Module: bent_cutout_mask()
// Synopsis: Create a mask for making a round-edged cutout in a cylindrical shell.
// SynTags: Geom
// Topics: Rounding, Offsets
// See Also: offset_sweep(), convex_offset_extrude(), rounded_prism(), bent_cutout_mask(), join_prism()
// Usage:
@ -2513,6 +2521,7 @@ Access to the derivative smoothing parameter?
// Function&Module: join_prism()
// Synopsis: Join an arbitrary prism to a plane, sphere, cylinder or another arbitrary prism with a fillet.
// SynTags: Geom, VNF
// Topics: Rounding, Offsets
// See Also: offset_sweep(), convex_offset_extrude(), rounded_prism(), bent_cutout_mask(), join_prism()
// Usage: The two main forms with most common options

View file

@ -15,6 +15,7 @@ include <structs.scad>
// Module: phillips_mask()
// Synopsis: Creates a mask for a Philips screw drive.
// SynTags: Geom
// Topics: Screws, Masks
// See Also: hex_drive_mask(), phillips_depth(), phillips_diam(), torx_mask(), robertson_mask()
// Usage:
@ -139,6 +140,7 @@ function phillips_diam(size, depth) =
// Module: hex_drive_mask()
// Synopsis: Creates a mask for a hex drive recess.
// SynTags: Geom
// Topics: Screws, Masks
// See Also: phillips_mask(), hex_drive_mask(), torx_mask(), phillips_depth(), phillips_diam(), robertson_mask()
// Usage:
@ -161,6 +163,7 @@ function hex_drive_mask(size,length,l,h,height,anchor,spin,orient) = no_function
// Module: torx_mask()
// Synopsis: Creates a mask for a torx drive recess.
// SynTags: Geom
// Topics: Screws, Masks
// See Also: phillips_mask(), hex_drive_mask(), torx_mask(), phillips_depth(), phillips_diam(), robertson_mask()
// Usage:
@ -191,6 +194,7 @@ module torx_mask(size, l=5, center, anchor, spin=0, orient=UP) {
// Module: torx_mask2d()
// Synopsis: Creates the 2D cross section for a torx drive recess.
// SynTags: Geom
// Topics: Screws, Masks
// See Also: phillips_mask(), hex_drive_mask(), torx_mask(), phillips_depth(), phillips_diam(), torx_info(), robertson_mask()
// Usage:
@ -313,6 +317,7 @@ function torx_depth(size) = torx_info(size)[2];
// Module: robertson_mask()
// Synopsis: Creates a mask for a Robertson/Square drive recess.
// SynTags: Geom
// Topics: Screws, Masks
// See Also: phillips_mask(), hex_drive_mask(), torx_mask(), phillips_depth(), phillips_diam(), torx_info(), robertson_mask()
// Usage:

View file

@ -189,6 +189,7 @@ Torx values: https://www.stanleyengineeredfastening.com/-/media/web/sef/resourc
// Module: screw()
// Synopsis: Creates a standard screw with optional tolerances.
// SynTags: Geom
// Topics: Threading, Screws
// See Also: screw_hole(), shoulder_screw()
// Usage:
@ -720,6 +721,7 @@ module screw(spec, head, drive, thread, drive_size,
// Module: screw_hole()
// Synopsis: Creates a screw hole.
// SynTags: Geom
// Topics: Threading, Screws
// See Also: screw()
// Usage:
@ -977,6 +979,7 @@ module screw_hole(spec, head, thread, oversize, hole_oversize, head_oversize,
// Module: shoulder_screw()
// Synopsis: Creates a shoulder screw.
// SynTags: Geom
// Topics: Threading, Screws
// See Also: screw(), screw_hole()
// Usage:
@ -1390,6 +1393,7 @@ function _parse_drive(drive=undef, drive_size=undef) =
// Module: screw_head()
// Synopsis: Creates a screw head.
// SynTags: Geom
// Topics: Threading, Screws
// See Also: screw(), screw_hole()
// Usage:
@ -1493,6 +1497,7 @@ module screw_head(screw_info,details=false, counterbore=0,flat_height,teardrop=f
// Module: nut()
// Synopsis: Creates a standard nut.
// SynTags: Geom
// Topics: Threading, Screws
// See Also: screw(), screw_hole()
// Usage:
@ -1615,6 +1620,7 @@ module nut(spec, shape, thickness, nutwidth, thread, tolerance, hole_oversize,
// Module: nut_trap_side()
// Synopsis: Creates a side nut trap mask.
// SynTags: Geom
// Topics: Threading, Screws
// See Also: screw(), screw_hole()
// Usage:
@ -1705,6 +1711,7 @@ module nut_trap_side(trap_width, spec, shape, thickness, nutwidth, anchor=BOT, o
// Module: nut_trap_inline()
// Synopsis: Creates an inline nut trap mask.
// SynTags: Geom
// Topics: Threading, Screws
// See Also: screw(), screw_hole()
// Usage:

View file

@ -90,7 +90,7 @@ function cube(size=1, center, anchor, spin=0, orient=UP) =
// Module: cuboid()
// Synopsis: Creates a cube with chamfering and roundovers.
// SynTags: Geom, VNF
// SynTags: Geom
// Topics: Shapes (3D), Attachable, VNF Generators
// See Also: prismoid(), rounded_prism()
// Usage: Standard Cubes
@ -816,7 +816,7 @@ function octahedron(size=1, anchor=CENTER, spin=0, orient=UP) =
// Module: rect_tube()
// Synopsis: Creates a rectangular tube.
// SynTags: Geom, VNF
// SynTags: Geom
// Topics: Shapes (3D), Attachable, VNF Generators
// See Also: tube()
// Usage: Typical Rectangular Tubes
@ -1694,7 +1694,7 @@ module cyl(
// Module: xcyl()
// Synopsis: creates a cylinder oriented along the X axis.
// SynTags: Geom, VNF
// SynTags: Geom
// Topics: Cylinders, Textures, Rounding, Chamfers
// See Also: texture(), rotate_sweep(), cyl()
// Description:
@ -1777,7 +1777,7 @@ module xcyl(
// Module: ycyl()
// Synopsis: Creates a cylinder oriented along the y axis.
// SynTags: Geom, VNF
// SynTags: Geom
// Topics: Cylinders, Textures, Rounding, Chamfers
// See Also: texture(), rotate_sweep(), cyl()
// Description:
@ -1862,7 +1862,7 @@ module ycyl(
// Module: zcyl()
// Synopsis: Creates a cylinder oriented along the Z axis.
// SynTags: Geom, VNF
// SynTags: Geom
// Topics: Cylinders, Textures, Rounding, Chamfers
// See Also: texture(), rotate_sweep(), cyl()
// Description:
@ -1946,7 +1946,7 @@ module zcyl(
// Module: tube()
// Synopsis: Creates a cylindrical or conical tube.
// SynTags: Geom, VNF
// SynTags: Geom
// Topics: Shapes (3D), Attachable, VNF Generators
// See Also: rect_tube()
// Description:
@ -3248,10 +3248,10 @@ module path_text(path, text, font, size, thickness, lettersize, offset=0, revers
// Topics: Shapes (3D), Attachable
// Module: fillet()
// Synopsis: Creates a smooth fillet between two faces.
// SynTags: Geom, VNF
// Topics: Shapes (3D), Attachable
// See Also: mask2d_roundover()
// Description:
// Creates a shape that can be unioned into a concave joint between two faces, to fillet them.

View file

@ -14,6 +14,7 @@
// Module: slider()
// Synopsis: Creates a V-groove slider.
// SynTags: Geom
// Topics: Parts, Sliders
// See Also: rail()
// Usage:
@ -67,6 +68,7 @@ module slider(l=30, w=10, h=10, base=10, wall=5, ang=30, anchor=BOTTOM, spin=0,
// Module: rail()
// Synopsis: Creates a V-groove rail.
// SynTags: Geom
// Topics: Parts, Sliders
// See Also: slider()
// Usage:

View file

@ -74,6 +74,11 @@ _NO_ARG = [true,[123232345],false];
// Function&Module: move()
// Aliases: translate()
//
// Synopsis: Translates children in an arbitrary direction.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: left(), right(), fwd(), back(), down(), up(), spherical_to_xyz(), altaz_to_xyz(), cylindrical_to_xyz(), polar_to_xy()
//
// Usage: As Module
// move(v) CHILDREN;
// Usage: As a function to translate points, VNF, or Bezier patches
@ -82,11 +87,6 @@ _NO_ARG = [true,[123232345],false];
// Usage: Get Translation Matrix
// mat = move(v);
//
// Synopsis: Translates children in an arbitrary direction.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: left(), right(), fwd(), back(), down(), up(), spherical_to_xyz(), altaz_to_xyz(), cylindrical_to_xyz(), polar_to_xy()
//
// Description:
// Translates position by the given amount.
// * Called as a module, moves/translates all children.
@ -160,6 +160,11 @@ function translate(v=[0,0,0], p=_NO_ARG) = move(v=v, p=p);
// Function&Module: left()
//
// Synopsis: Translates children leftwards (X-).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), right(), fwd(), back(), down(), up()
//
// Usage: As Module
// left(x) CHILDREN;
// Usage: Translate Points
@ -167,11 +172,6 @@ function translate(v=[0,0,0], p=_NO_ARG) = move(v=v, p=p);
// Usage: Get Translation Matrix
// mat = left(x);
//
// Synopsis: Translates children leftwards (X-).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), right(), fwd(), back(), down(), up()
//
// Description:
// If called as a module, moves/translates all children left (in the X- direction) by the given amount.
// If called as a function with the `p` argument, returns the translated VNF, point or list of points.
@ -205,6 +205,11 @@ function left(x=0, p=_NO_ARG) =
// Function&Module: right()
// Aliases: xmove()
//
// Synopsis: Translates children rightwards (X+).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), left(), fwd(), back(), down(), up()
//
// Usage: As Module
// right(x) CHILDREN;
// Usage: Translate Points
@ -212,11 +217,6 @@ function left(x=0, p=_NO_ARG) =
// Usage: Get Translation Matrix
// mat = right(x);
//
// Synopsis: Translates children rightwards (X+).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), left(), fwd(), back(), down(), up()
//
// Description:
// If called as a module, moves/translates all children right (in the X+ direction) by the given amount.
// If called as a function with the `p` argument, returns the translated VNF point or list of points.
@ -260,6 +260,11 @@ function xmove(x=0, p=_NO_ARG) =
// Function&Module: fwd()
//
// Synopsis: Translates children forwards (Y-).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), left(), right(), back(), down(), up()
//
// Usage: As Module
// fwd(y) CHILDREN;
// Usage: Translate Points
@ -267,11 +272,6 @@ function xmove(x=0, p=_NO_ARG) =
// Usage: Get Translation Matrix
// mat = fwd(y);
//
// Synopsis: Translates children forwards (Y-).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), left(), right(), back(), down(), up()
//
// Description:
// If called as a module, moves/translates all children forward (in the Y- direction) by the given amount.
// If called as a function with the `p` argument, returns the translated VNF, point or list of points.
@ -305,6 +305,11 @@ function fwd(y=0, p=_NO_ARG) =
// Function&Module: back()
// Aliases: ymove()
//
// Synopsis: Translates children backwards (Y+).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), left(), right(), fwd(), down(), up()
//
// Usage: As Module
// back(y) CHILDREN;
// Usage: Translate Points
@ -312,11 +317,6 @@ function fwd(y=0, p=_NO_ARG) =
// Usage: Get Translation Matrix
// mat = back(y);
//
// Synopsis: Translates children backwards (Y+).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), left(), right(), fwd(), down(), up()
//
// Description:
// If called as a module, moves/translates all children back (in the Y+ direction) by the given amount.
// If called as a function with the `p` argument, returns the translated VNF, point or list of points.
@ -360,6 +360,11 @@ function ymove(y=0,p=_NO_ARG) =
// Function&Module: down()
//
// Synopsis: Translates children downwards (Z-).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), left(), right(), fwd(), back(), up()
//
// Usage: As Module
// down(z) CHILDREN;
// Usage: Translate Points
@ -367,11 +372,6 @@ function ymove(y=0,p=_NO_ARG) =
// Usage: Get Translation Matrix
// mat = down(z);
//
// Synopsis: Translates children downwards (Z-).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), left(), right(), fwd(), back(), up()
//
// Description:
// If called as a module, moves/translates all children down (in the Z- direction) by the given amount.
// If called as a function with the `p` argument, returns the translated VNF, point or list of points.
@ -403,6 +403,11 @@ function down(z=0, p=_NO_ARG) =
// Function&Module: up()
// Aliases: zmove()
//
// Synopsis: Translates children upwards (Z+).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), left(), right(), fwd(), back(), down()
//
// Usage: As Module
// up(z) CHILDREN;
// Usage: Translate Points
@ -410,11 +415,6 @@ function down(z=0, p=_NO_ARG) =
// Usage: Get Translation Matrix
// mat = up(z);
//
// Synopsis: Translates children upwards (Z+).
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Translation
// See Also: move(), left(), right(), fwd(), back(), down()
//
// Description:
// If called as a module, moves/translates all children up (in the Z+ direction) by the given amount.
// If called as a function with the `p` argument, returns the translated VNF, point or list of points.
@ -463,6 +463,11 @@ function zmove(z=0, p=_NO_ARG) =
// Function&Module: rot()
//
// Synopsis: Rotates children in various ways.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Rotation
// See Also: xrot(), yrot(), zrot()
//
// Usage: As a Module
// rot(a, [cp=], [reverse=]) CHILDREN;
// rot([X,Y,Z], [cp=], [reverse=]) CHILDREN;
@ -479,11 +484,6 @@ function zmove(z=0, p=_NO_ARG) =
// M = rot(a, v, [cp=], [reverse=]);
// M = rot(from=, to=, [a=], [reverse=]);
//
// Synopsis: Rotates children in various ways.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Rotation
// See Also: xrot(), yrot(), zrot()
//
// Description:
// This is a shorthand version of the built-in `rotate()`, and operates similarly, with a few additional capabilities.
// You can specify the rotation to perform in one of several ways:
@ -569,6 +569,11 @@ function rot(a=0, v, cp, from, to, reverse=false, p=_NO_ARG, _m) =
// Function&Module: xrot()
//
// Synopsis: Rotates children around the X axis using the right-hand rule.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Rotation
// See Also: rot(), yrot(), zrot()
//
// Usage: As Module
// xrot(a, [cp=]) CHILDREN;
// Usage: As a function to rotate points
@ -576,11 +581,6 @@ function rot(a=0, v, cp, from, to, reverse=false, p=_NO_ARG, _m) =
// Usage: As a function to return rotation matrix
// mat = xrot(a, [cp=]);
//
// Synopsis: Rotates children around the X axis using the right-hand rule.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Rotation
// See Also: rot(), yrot(), zrot()
//
// Description:
// Rotates around the X axis by the given number of degrees. If `cp` is given, rotations are performed around that centerpoint.
// * Called as a module, rotates all children.
@ -617,6 +617,11 @@ function xrot(a=0, p=_NO_ARG, cp) = rot([a,0,0], cp=cp, p=p);
// Function&Module: yrot()
//
// Synopsis: Rotates children around the Y axis using the right-hand rule.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Rotation
// See Also: rot(), xrot(), zrot()
//
// Usage: As Module
// yrot(a, [cp=]) CHILDREN;
// Usage: Rotate Points
@ -624,11 +629,6 @@ function xrot(a=0, p=_NO_ARG, cp) = rot([a,0,0], cp=cp, p=p);
// Usage: Get Rotation Matrix
// mat = yrot(a, [cp=]);
//
// Synopsis: Rotates children around the Y axis using the right-hand rule.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Rotation
// See Also: rot(), xrot(), zrot()
//
// Description:
// Rotates around the Y axis by the given number of degrees. If `cp` is given, rotations are performed around that centerpoint.
// * Called as a module, rotates all children.
@ -665,6 +665,11 @@ function yrot(a=0, p=_NO_ARG, cp) = rot([0,a,0], cp=cp, p=p);
// Function&Module: zrot()
//
// Synopsis: Rotates children around the Z axis using the right-hand rule.
// Topics: Affine, Matrices, Transforms, Rotation
// SynTags: Trans, Path, VNF, Mat
// See Also: rot(), xrot(), yrot()
//
// Usage: As Module
// zrot(a, [cp=]) CHILDREN;
// Usage: As Function to rotate points
@ -672,11 +677,6 @@ function yrot(a=0, p=_NO_ARG, cp) = rot([0,a,0], cp=cp, p=p);
// Usage: As Function to return rotation matrix
// mat = zrot(a, [cp=]);
//
// Synopsis: Rotates children around the Z axis using the right-hand rule.
// Topics: Affine, Matrices, Transforms, Rotation
// SynTags: Trans, Path, VNF, Mat
// See Also: rot(), xrot(), yrot()
//
// Description:
// Rotates around the Z axis by the given number of degrees. If `cp` is given, rotations are performed around that centerpoint.
// * Called as a module, rotates all children.
@ -718,6 +718,12 @@ function zrot(a=0, p=_NO_ARG, cp) = rot(a, cp=cp, p=p);
// Function&Module: scale()
//
// Synopsis: Scales children arbitrarily.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Scaling
// See Also: xscale(), yscale(), zscale()
//
// Usage: As Module
// scale(SCALAR) CHILDREN;
// scale([X,Y,Z]) CHILDREN;
@ -725,10 +731,7 @@ function zrot(a=0, p=_NO_ARG, cp) = rot(a, cp=cp, p=p);
// pts = scale(v, p, [cp=]);
// Usage: Get Scaling Matrix
// mat = scale(v, [cp=]);
// Synopsis: Scales children arbitrarily.
// Topics: Affine, Matrices, Transforms, Scaling
// SynTags: Trans, Path, VNF, Mat
// See Also: xscale(), yscale(), zscale()
//
// Description:
// Scales by the [X,Y,Z] scaling factors given in `v`. If `v` is given as a scalar number, all axes are scaled uniformly by that amount.
// * Called as the built-in module, scales all children.
@ -738,17 +741,20 @@ function zrot(a=0, p=_NO_ARG, cp) = rot(a, cp=cp, p=p);
// * Called as a function with a [VNF structure](vnf.scad) in the `p` argument, returns the scaled VNF.
// * Called as a function without a `p` argument, and a 2D list of scaling factors in `v`, returns an affine2d scaling matrix.
// * Called as a function without a `p` argument, and a 3D list of scaling factors in `v`, returns an affine3d scaling matrix.
//
// Arguments:
// v = Either a numeric uniform scaling factor, or a list of [X,Y,Z] scaling factors. Default: 1
// p = If called as a function, the point or list of points to scale.
// ---
// cp = If given, centers the scaling on the point `cp`.
//
// Example(NORENDER):
// pt1 = scale(3, p=[3,1,4]); // Returns: [9,3,12]
// pt2 = scale([2,3,4], p=[3,1,4]); // Returns: [6,3,16]
// pt3 = scale([2,3,4], p=[[1,2,3],[4,5,6]]); // Returns: [[2,6,12], [8,15,24]]
// mat2d = scale([2,3]); // Returns: [[2,0,0],[0,3,0],[0,0,1]]
// mat3d = scale([2,3,4]); // Returns: [[2,0,0,0],[0,3,0,0],[0,0,4,0],[0,0,0,1]]
//
// Example(2D):
// path = circle(d=50,$fn=12);
// #stroke(path,closed=true);
@ -770,6 +776,11 @@ function scale(v=1, p=_NO_ARG, cp=[0,0,0]) =
// Function&Module: xscale()
//
// Synopsis: Scales children along the X axis.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Scaling
// See Also: scale(), yscale(), zscale()
//
// Usage: As Module
// xscale(x, [cp=]) CHILDREN;
// Usage: Scale Points
@ -777,11 +788,6 @@ function scale(v=1, p=_NO_ARG, cp=[0,0,0]) =
// Usage: Get Affine Matrix
// mat = xscale(x, [cp=]);
//
// Synopsis: Scales children along the X axis.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Scaling
// See Also: scale(), yscale(), zscale()
//
// Description:
// Scales along the X axis by the scaling factor `x`.
// * Called as the built-in module, scales all children.
@ -826,6 +832,11 @@ function xscale(x=1, p=_NO_ARG, cp=0) =
// Function&Module: yscale()
//
// Synopsis: Scales children along the Y axis.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Scaling
// See Also: scale(), xscale(), zscale()
//
// Usage: As Module
// yscale(y, [cp=]) CHILDREN;
// Usage: Scale Points
@ -833,11 +844,6 @@ function xscale(x=1, p=_NO_ARG, cp=0) =
// Usage: Get Affine Matrix
// mat = yscale(y, [cp=]);
//
// Synopsis: Scales children along the Y axis.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Scaling
// See Also: scale(), xscale(), zscale()
//
// Description:
// Scales along the Y axis by the scaling factor `y`.
// * Called as the built-in module, scales all children.
@ -882,6 +888,11 @@ function yscale(y=1, p=_NO_ARG, cp=0) =
// Function&Module: zscale()
//
// Synopsis: Scales children along the Z axis.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Scaling
// See Also: scale(), xscale(), yscale()
//
// Usage: As Module
// zscale(z, [cp=]) CHILDREN;
// Usage: Scale Points
@ -889,11 +900,6 @@ function yscale(y=1, p=_NO_ARG, cp=0) =
// Usage: Get Affine Matrix
// mat = zscale(z, [cp=]);
//
// Synopsis: Scales children along the Z axis.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Scaling
// See Also: scale(), xscale(), yscale()
//
// Description:
// Scales along the Z axis by the scaling factor `z`.
// * Called as the built-in module, scales all children.
@ -941,16 +947,19 @@ function zscale(z=1, p=_NO_ARG, cp=0) =
//////////////////////////////////////////////////////////////////////
// Function&Module: mirror()
//
// Synopsis: Reflects children across an arbitrary plane.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Reflection, Mirroring
// See Also: xflip(), yflip(), zflip()
//
// Usage: As Module
// mirror(v) CHILDREN;
// Usage: As Function
// pt = mirror(v, p);
// Usage: Get Reflection/Mirror Matrix
// mat = mirror(v);
// Synopsis: Reflects children across an arbitrary plane.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Reflection, Mirroring
// See Also: xflip(), yflip(), zflip()
//
// Description:
// Mirrors/reflects across the plane or line whose normal vector is given in `v`.
// * Called as the built-in module, mirrors all children across the line/plane.
@ -960,9 +969,11 @@ function zscale(z=1, p=_NO_ARG, cp=0) =
// * Called as a function with a [VNF structure](vnf.scad) in the `p` argument, returns the mirrored VNF.
// * Called as a function without a `p` argument, and with a 2D normal vector `v`, returns the affine2d 3x3 mirror matrix.
// * Called as a function without a `p` argument, and with a 3D normal vector `v`, returns the affine3d 4x4 mirror matrix.
//
// Arguments:
// v = The normal vector of the line or plane to mirror across.
// p = If called as a function, the point or list of points to scale.
//
// Example:
// n = [1,0,0];
// module obj() right(20) rotate([0,15,-15]) cube([40,30,20]);
@ -972,6 +983,7 @@ function zscale(z=1, p=_NO_ARG, cp=0) =
// color("red") anchor_arrow(s=20, flag=false);
// color("#7777") cube([75,75,0.1], center=true);
// }
//
// Example:
// n = [1,1,0];
// module obj() right(20) rotate([0,15,-15]) cube([40,30,20]);
@ -981,6 +993,7 @@ function zscale(z=1, p=_NO_ARG, cp=0) =
// color("red") anchor_arrow(s=20, flag=false);
// color("#7777") cube([75,75,0.1], center=true);
// }
//
// Example:
// n = [1,1,1];
// module obj() right(20) rotate([0,15,-15]) cube([40,30,20]);
@ -990,6 +1003,7 @@ function zscale(z=1, p=_NO_ARG, cp=0) =
// color("red") anchor_arrow(s=20, flag=false);
// color("#7777") cube([75,75,0.1], center=true);
// }
//
// Example(2D):
// n = [0,1];
// path = rot(30, p=square([50,30]));
@ -997,6 +1011,7 @@ function zscale(z=1, p=_NO_ARG, cp=0) =
// color("red") stroke([[0,0],10*n],endcap2="arrow2");
// #stroke(path,closed=true);
// stroke(mirror(n, p=path),closed=true);
//
// Example(2D):
// n = [1,1];
// path = rot(30, p=square([50,30]));
@ -1004,6 +1019,7 @@ function zscale(z=1, p=_NO_ARG, cp=0) =
// color("red") stroke([[0,0],10*n],endcap2="arrow2");
// #stroke(path,closed=true);
// stroke(mirror(n, p=path),closed=true);
//
function mirror(v, p=_NO_ARG) =
assert(is_vector(v))
assert(p==_NO_ARG || is_list(p),"Invalid pointlist")
@ -1013,6 +1029,11 @@ function mirror(v, p=_NO_ARG) =
// Function&Module: xflip()
//
// Synopsis: Reflects children across the YZ plane.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Reflection, Mirroring
// See Also: mirror(), yflip(), zflip()
//
// Usage: As Module
// xflip([x=]) CHILDREN;
// Usage: As Function
@ -1020,11 +1041,6 @@ function mirror(v, p=_NO_ARG) =
// Usage: Get Affine Matrix
// mat = xflip([x=]);
//
// Synopsis: Reflects children across the YZ plane.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Reflection, Mirroring
// See Also: mirror(), yflip(), zflip()
//
// Description:
// Mirrors/reflects across the origin [0,0,0], along the X axis. If `x` is given, reflects across [x,0,0] instead.
// * Called as the built-in module, mirrors all children across the line/plane.
@ -1069,6 +1085,11 @@ function xflip(p=_NO_ARG, x=0) =
// Function&Module: yflip()
//
// Synopsis: Reflects children across the XZ plane.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Reflection, Mirroring
// See Also: mirror(), xflip(), zflip()
//
// Usage: As Module
// yflip([y=]) CHILDREN;
// Usage: As Function
@ -1076,11 +1097,6 @@ function xflip(p=_NO_ARG, x=0) =
// Usage: Get Affine Matrix
// mat = yflip([y=]);
//
// Synopsis: Reflects children across the XZ plane.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Reflection, Mirroring
// See Also: mirror(), xflip(), zflip()
//
// Description:
// Mirrors/reflects across the origin [0,0,0], along the Y axis. If `y` is given, reflects across [0,y,0] instead.
// * Called as the built-in module, mirrors all children across the line/plane.
@ -1125,6 +1141,11 @@ function yflip(p=_NO_ARG, y=0) =
// Function&Module: zflip()
//
// Synopsis: Reflects children across the XY plane.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Reflection, Mirroring
// See Also: mirror(), xflip(), yflip()
//
// Usage: As Module
// zflip([z=]) CHILDREN;
// Usage: As Function
@ -1132,11 +1153,6 @@ function yflip(p=_NO_ARG, y=0) =
// Usage: Get Affine Matrix
// mat = zflip([z=]);
//
// Synopsis: Reflects children across the XY plane.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Reflection, Mirroring
// See Also: mirror(), xflip(), yflip()
//
// Description:
// Mirrors/reflects across the origin [0,0,0], along the Z axis. If `z` is given, reflects across [0,0,z] instead.
// * Called as the built-in module, mirrors all children across the line/plane.
@ -1180,6 +1196,12 @@ function zflip(p=_NO_ARG, z=0) =
//////////////////////////////////////////////////////////////////////
// Function&Module: frame_map()
//
// Synopsis: Rotates and possibly skews children from one frame of reference to another.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Rotation
// See Also: rot(), xrot(), yrot(), zrot()
//
// Usage: As module
// frame_map(v1, v2, v3, [reverse=]) CHILDREN;
// Usage: As function to remap points
@ -1189,10 +1211,7 @@ function zflip(p=_NO_ARG, z=0) =
// map = frame_map(x=VECTOR1, y=VECTOR2, [reverse=]);
// map = frame_map(x=VECTOR1, z=VECTOR2, [reverse=]);
// map = frame_map(y=VECTOR1, z=VECTOR2, [reverse=]);
// Synopsis: Rotates and possibly skews children from one frame of reference to another.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Rotation
// See Also: rot(), xrot(), yrot(), zrot()
//
// Description:
// Maps one coordinate frame to another. You must specify two or
// three of `x`, `y`, and `z`. The specified axes are mapped to the vectors you supplied, so if you
@ -1204,19 +1223,24 @@ function zflip(p=_NO_ARG, z=0) =
// You cannot use the `reverse` option with non-orthogonal inputs. Note that only the direction
// of the specified vectors matters: the transformation will not apply scaling, though it can
// skew if your provide non-orthogonal axes.
//
// Arguments:
// x = Destination 3D vector for x axis.
// y = Destination 3D vector for y axis.
// z = Destination 3D vector for z axis.
// p = If given, the point, path, patch, or VNF to operate on. Function use only.
// reverse = reverse direction of the map for orthogonal inputs. Default: false
//
// Example: Remap axes after linear extrusion
// frame_map(x=[0,1,0], y=[0,0,1]) linear_extrude(height=10) square(3);
//
// Example: This map is just a rotation around the z axis
// mat = frame_map(x=[1,1,0], y=[-1,1,0]);
// multmatrix(mat) frame_ref();
//
// Example: This map is not a rotation because x and y aren't orthogonal
// frame_map(x=[1,0,0], y=[1,1,0]) cube(10);
//
// Example: This sends [1,1,0] to [0,1,1] and [-1,1,0] to [0,-1,1]. (Original directions shown in light shade, final directions shown dark.)
// mat = frame_map(x=[0,1,1], y=[0,-1,1]) * frame_map(x=[1,1,0], y=[-1,1,0],reverse=true);
// color("purple",alpha=.2) stroke([[0,0,0],10*[1,1,0]]);
@ -1225,6 +1249,7 @@ function zflip(p=_NO_ARG, z=0) =
// color("purple") stroke([[0,0,0],10*[1,1,0]]);
// color("green") stroke([[0,0,0],10*[-1,1,0]]);
// }
//
function frame_map(x,y,z, p=_NO_ARG, reverse=false) =
p != _NO_ARG
? apply(frame_map(x,y,z,reverse=reverse), p)
@ -1270,15 +1295,18 @@ module frame_map(x,y,z,p,reverse=false)
// Function&Module: skew()
//
// Synopsis: Skews children along various axes.
// SynTags: Trans, Path, VNF, Mat
// Topics: Affine, Matrices, Transforms, Skewing
// See Also: move(), rot(), scale()
//
// Usage: As Module
// skew([sxy=]|[axy=], [sxz=]|[axz=], [syx=]|[ayx=], [syz=]|[ayz=], [szx=]|[azx=], [szy=]|[azy=]) CHILDREN;
// Usage: As Function
// pts = skew(p, [sxy=]|[axy=], [sxz=]|[axz=], [syx=]|[ayx=], [syz=]|[ayz=], [szx=]|[azx=], [szy=]|[azy=]);
// Usage: Get Affine Matrix
// mat = skew([sxy=]|[axy=], [sxz=]|[axz=], [syx=]|[ayx=], [syz=]|[ayz=], [szx=]|[azx=], [szy=]|[azy=]);
// Topics: Affine, Matrices, Transforms, Skewing
// Synopsis: Skews children along various axes.
// SynTags: Trans, Path, VNF, Mat
//
// Description:
// Skews geometry by the given skew factors.
@ -1399,11 +1427,15 @@ function is_2d_transform(t) = // z-parameters are zero, except we allow t[2][
// Function: apply()
//
// Synopsis: Applies a transformation matrix to a point, list of points, array of points, or a VNF.
// SynTags: Path, VNF, Mat
// Topics: Affine, Matrices, Transforms
// See Also: move(), rot(), scale(), skew()
//
// Usage:
// pts = apply(transform, points);
// Topics: Affine, Matrices, Transforms
// Synopsis: Applies a transformation matrix to a point, list of points, array of points, or VNF.
// SynTags: Path, VNF, Mat
//
// Description:
// Applies the specified transformation matrix `transform` to a point, point list, bezier patch or VNF.
// When `points` contains 2D or 3D points the transform matrix may be a 4x4 affine matrix or a 3x4
@ -1418,27 +1450,32 @@ function is_2d_transform(t) = // z-parameters are zero, except we allow t[2][
// If the transform matrix is square then apply() checks the determinant and if it is negative, apply() reverses the face order so that
// the transformed VNF has faces with the same winding direction as the original VNF. This adjustment applies
// only to VNFs, not to beziers or point lists.
//
// Arguments:
// transform = The 2D (3x3 or 2x3) or 3D (4x4 or 3x4) transformation matrix to apply.
// points = The point, point list, bezier patch, or VNF to apply the transformation to.
//
// Example(3D):
// path1 = path3d(circle(r=40));
// tmat = xrot(45);
// path2 = apply(tmat, path1);
// #stroke(path1,closed=true);
// stroke(path2,closed=true);
//
// Example(2D):
// path1 = circle(r=40);
// tmat = translate([10,5]);
// path2 = apply(tmat, path1);
// #stroke(path1,closed=true);
// stroke(path2,closed=true);
//
// Example(2D):
// path1 = circle(r=40);
// tmat = rot(30) * back(15) * scale([1.5,0.5,1]);
// path2 = apply(tmat, path1);
// #stroke(path1,closed=true);
// stroke(path2,closed=true);
//
function apply(transform,points) =
points==[] ? []
: is_vector(points) ? _apply(transform, [points])[0] // point

View file

@ -11,7 +11,9 @@
// Module: manfrotto_rc2_plate()
// Synopsis: Creates a Manfrotto RC2 tripod quick release mount plate.
// SynTags: Geom
// Topics: Parts
// See Also: threaded_rod()
// Usage:
// manfrotto_rc2_plate([chamfer],[anchor],[orient],[spin]) [ATTACHMENTS];
// Description:

View file

@ -21,10 +21,13 @@ function _rotpart(T) = [for(i=[0:3]) [for(j=[0:3]) j<3 || i==3 ? T[i][j] : 0]];
// Function: turtle3d()
// Synopsis: Extends [turtle graphics](https://en.wikipedia.org/wiki/Turtle_graphics) to 3d. Generates a 3D path or returns a list of transforms.
// SynTags: MatList, Path
// Topics: Shapes (3D), Path Generators (3D), Mini-Language
// See Also: turtle()
// Usage:
// turtle3d(commands, [state], [transforms], [full_state], [repeat])
// path = turtle3d(commands, [state=], [repeat=]);
// mats = turtle3d(commands, transforms=true, [state=], [repeat=]);
// state = turtle3d(commands, full_state=true, [state=], [repeat=]);
// Description:
// Like the classic two dimensional turtle, the 3d turtle flies through space following a sequence
// of turtle graphics commands to generate either a sequence of transformations (suitable for input

View file

@ -73,10 +73,11 @@ function is_type(x,types) =
// Function: is_def()
// Usage:
// bool = is_def(x);
// Synopsis: Returns true if `x` is not `undef`.
// Topics: Type Checking
// See Also: typeof(), is_type(), is_str()
// Usage:
// bool = is_def(x);
// Description:
// Returns true if `x` is not `undef`. False if `x==undef`.
// Arguments:
@ -108,8 +109,8 @@ function is_str(x) = is_string(x);
// Function: is_int()
// Synopsis: Returns true if the argument is an integer.
// Alias: is_integer()
// Synopsis: Returns true if the argument is an integer.
// Topics: Type Checking
// See Also: typeof(), is_type(), is_str(), is_def()
// Usage:
@ -197,10 +198,10 @@ function is_finite(x) = is_num(x) && !is_nan(0*x);
// Function: is_range()
// Synopsis: Returns true if the argument is a range.
// Usage:
// bool = is_range(x);
// Topics: Type Checking
// See Also: typeof(), is_type(), is_str(), is_def(), is_int()
// Usage:
// bool = is_range(x);
// Description:
// Returns true if its argument is a range
// Arguments:
@ -768,6 +769,7 @@ function scalar_vec3(v, dflt) =
// Function: segs()
// Synopsis: Returns the number of sides for a circle given `$fn`, `$fa`, and `$fs`.
// Topics: Geometry
// See Also: circle(), cyl()
// Usage:
// sides = segs(r);
// Description:
@ -831,10 +833,10 @@ module req_children(count) {
// Function: no_function()
// Synopsis: Assert that the argument exists only as a module and not as a function.
// Usage:
// dummy = no_function(name)
// Topics: Error Checking
// See Also: no_children(), no_module()
// Usage:
// dummy = no_function(name)
// Description:
// Asserts that the function, "name", only exists as a module.
// Example:
@ -860,6 +862,8 @@ module no_module() {
// Module: deprecate()
// Synopsis: Display a console note that a module is deprecated and suggest a replacement.
// Topics: Error Checking
// See Also: no_function(), no_module()
// Usage:
// deprecate(new_name);
// Description:

View file

@ -339,7 +339,7 @@ function vector_bisect(v1,v2) =
let(
axis = vector_axis(v1,v2),
ang = vector_angle(v1,v2),
v3 = rot(ang/2, v=axis, p=v1)
v3 = unit(rot(ang/2, v=axis, p=v1))
) v3;

View file

@ -29,6 +29,7 @@ EMPTY_VNF = [[],[]]; // The standard empty VNF with no vertices or faces.
// Function: vnf_vertex_array()
// Synopsis: Returns a VNF structure from a rectangular vertex list.
// SynTags: VNF
// Topics: VNF Generators, Lists
// See Also: vnf_tri_array(), vnf_join(), vnf_from_polygons(), vnf_from_region()
// Usage:
@ -232,6 +233,7 @@ function vnf_vertex_array(
// Function: vnf_tri_array()
// Synopsis: Returns a VNF from an array of points.
// SynTags: VNF
// Topics: VNF Generators, Lists
// See Also: vnf_vertex_array(), vnf_join(), vnf_from_polygons(), vnf_from_region()
// Usage:
@ -327,6 +329,7 @@ function vnf_tri_array(points, row_wrap=false, reverse=false) =
// Function: vnf_join()
// Synopsis: Returns a single VNF structure from a list of VNF structures.
// SynTags: VNF
// Topics: VNF Generators, Lists
// See Also: vnf_tri_array(), vnf_vertex_array(), vnf_from_polygons(), vnf_from_region()
// Usage:
@ -413,6 +416,7 @@ function vnf_join(vnfs) =
// Function: vnf_from_polygons()
// Synopsis: Returns a VNF from a list of 3D polygons.
// SynTags: VNF
// Topics: VNF Generators, Lists
// See Also: vnf_tri_array(), vnf_join(), vnf_vertex_array(), vnf_from_region()
// Usage:
@ -579,8 +583,9 @@ function _bridge(pt, outer,eps) =
// Function: vnf_from_region()
// Topics: VNF Generators, Lists
// Synopsis: Returns a 3D VNF given a 2D region.
// SynTags: VNF
// Topics: VNF Generators, Lists
// See Also: vnf_vertex_array(), vnf_tri_array(), vnf_join(), vnf_from_polygons()
// Usage:
// vnf = vnf_from_region(region, [transform], [reverse]);
@ -672,6 +677,7 @@ function vnf_faces(vnf) = vnf[1];
// Function: vnf_reverse_faces()
// Synopsis: Reverses the faces of a VNF.
// SynTags: VNF
// Topics: VNF Manipulation
// See Also: vnf_quantize(), vnf_merge_points(), vnf_drop_unused_points(), vnf_triangulate(), vnf_slice()
// Usage:
@ -684,6 +690,7 @@ function vnf_reverse_faces(vnf) =
// Function: vnf_quantize()
// Synopsis: Quantizes the vertex coordinates of a VNF.
// SynTags: VNF
// Topics: VNF Manipulation
// See Also: vnf_reverse_faces(), vnf_merge_points(), vnf_drop_unused_points(), vnf_triangulate(), vnf_slice()
// Usage:
@ -699,7 +706,8 @@ function vnf_quantize(vnf,q=pow(2,-12)) =
// Function: vnf_merge_points()
// Synopsis: COnsolidates duplicate vertices of a VNF.
// Synopsis: Consolidates duplicate vertices of a VNF.
// SynTags: VNF
// Topics: VNF Manipulation
// See Also: vnf_reverse_faces(), vnf_quantize(), vnf_drop_unused_points(), vnf_triangulate(), vnf_slice()
// Usage:
@ -735,6 +743,7 @@ function vnf_merge_points(vnf,eps=EPSILON) =
// Function: vnf_drop_unused_points()
// Synopsis: Removes unreferenced vertices from a VNF.
// SynTags: VNF
// Topics: VNF Manipulation
// See Also: vnf_reverse_faces(), vnf_quantize(), vnf_merge_points(), vnf_triangulate(), vnf_slice()
// Usage:
@ -766,6 +775,7 @@ function _link_indicator(l,imin,imax) =
// Function: vnf_triangulate()
// Synopsis: Triangulates the faces of a VNF.
// SynTags: VNF
// Topics: VNF Manipulation
// See Also: vnf_reverse_faces(), vnf_quantize(), vnf_merge_points(), vnf_drop_unused_points(), vnf_slice()
// Usage:
@ -809,6 +819,7 @@ function _vnf_sort_vertices(vnf, idx=[2,1,0]) =
// Function: vnf_slice()
// Synopsis: Slice the faces of a VNF along an axis.
// SynTags: VNF
// Topics: VNF Manipulation
// See Also: vnf_reverse_faces(), vnf_quantize(), vnf_merge_points(), vnf_drop_unused_points(), vnf_triangulate()
// Usage:
@ -937,6 +948,7 @@ function _slice_3dpolygons(polys, dir, cuts) =
// Module: vnf_polyhedron()
// Synopsis: Returns a polyhedron from a VNF or list of VNFs.
// SynTags: Geom
// Topics: VNF Manipulation
// See Also: vnf_wireframe()
// Usage:
@ -970,6 +982,7 @@ module vnf_polyhedron(vnf, convexity=2, extent=true, cp="centroid", anchor="orig
// Module: vnf_wireframe()
// Synopsis: Creates a wireframe model from a VNF.
// SynTags: VNF
// Topics: VNF Manipulation
// See Also: vnf_polyhedron()
// Usage:
@ -1082,9 +1095,9 @@ function _vnf_centroid(vnf,eps=EPSILON) =
// Function: vnf_halfspace()
// Synopsis: Returns the intersection of the vnf with a half space.
// SynTags: VNF
// Topics: VNF Manipulation
// See Also: vnf_volume(), vnf_area(), vnf_bend()
// Usage:
// newvnf = vnf_halfspace(plane, vnf, [closed], [boundary]);
// Description:
@ -1286,6 +1299,7 @@ function _triangulate_planar_convex_polygons(polys) =
// Function: vnf_bend()
// Synopsis: Bends a VNF around an axis.
// SynTags: VNF
// Topics: VNF Manipulation
// See Also: vnf_volume(), vnf_area(), vnf_halfspace()
// Usage:
@ -1495,6 +1509,7 @@ module _show_faces(vertices, faces, size=1, filter) {
// Module: debug_vnf()
// Synopsis: A replacement for `vnf_polyhedron()` to help with debugging.
// SynTags: VNF
// Topics: VNF Manipulation, Debugging
// See Also: vnf_validate()
// Usage:
@ -1538,6 +1553,7 @@ module debug_vnf(vnf, faces=true, vertices=true, opacity=0.5, size=1, convexity=
// Module: vnf_validate()
// Synopsis: Echos non-manifold VNF errors to the console.
// SynTags: VNF
// Topics: VNF Manipulation, Debugging
// See Also: debug_vnf()
//

View file

@ -14,6 +14,7 @@
// Module: sparse_wall()
// 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()
//
@ -88,6 +89,7 @@ module sparse_wall(h=50, l=100, thick=4, maxang=30, strut=5, max_bridge=20, anch
// Module: corrugated_wall()
// Synopsis: Makes a corrugated rectangular wall.
// SynTags: Geom
// Topics: FDM Optimized, Walls
// See Also: sparse_wall(), corrugated_wall(), thinning_wall(), thinning_triangle(), narrowing_strut()
//
@ -147,6 +149,7 @@ module corrugated_wall(h=50, l=100, thick=5, strut=5, wall=2, anchor=CENTER, spi
// Module: thinning_wall()
// Synopsis: Makes a rectangular wall with a thin middle.
// SynTags: Geom
// Topics: FDM Optimized, Walls
// See Also: sparse_wall(), corrugated_wall(), thinning_wall(), thinning_triangle(), narrowing_strut()
//
@ -331,6 +334,7 @@ module thinning_wall(h=50, l=100, thick=5, ang=30, braces=false, strut, wall, an
// Module: thinning_triangle()
// Synopsis: Makes a triangular wall with a thin middle.
// SynTags: Geom
// Topics: FDM Optimized, Walls
// See Also: sparse_wall(), corrugated_wall(), thinning_wall(), thinning_triangle(), narrowing_strut()
//
@ -399,6 +403,7 @@ module thinning_triangle(h=50, l=100, thick=5, ang=30, strut=5, wall=3, diagonly
// Module: narrowing_strut()
// Synopsis: Makes a strut like an extruded baseball home plate.
// SynTags: Geom
// Topics: FDM Optimized
// See Also: sparse_wall(), corrugated_wall(), thinning_wall(), thinning_triangle(), narrowing_strut()
//

View file

@ -55,6 +55,7 @@ function _hex_offsets(n, d, lev=0, arr=[]) =
// Module: wire_bundle()
// Synopsis: Creates a wire bundle for a given number of wires.
// SynTags: Geom
// Topics: Wiring
// See Also: path_sweep(), path_sweep2d()
// Usage: