Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop: (62 commits)

    New rectangular prism project box maker.
    Add parameter dilate to support ball bearing tunnel return scaling.
    Handle one, two, and mixed-dimensional scaling in extrude_linear_*
    New linear extrusion function: extrude_linear_uss()
    New extrude rotate function with scaling: extrude_rotate_ts()
    Documentation update.
  • Loading branch information
royasutton committed Oct 17, 2024
2 parents 9f21d0e + 930173b commit 680f362
Show file tree
Hide file tree
Showing 31 changed files with 2,149 additions and 296 deletions.
8 changes: 4 additions & 4 deletions common/validation.scad
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ validation_skip = [number_min, number_max, number_inf];
/***************************************************************************//**
\param d <string> A description.
\param cv \<value> A computed value to validate.
\param t <string|boolean> The validation type.
\param t <string | boolean> The validation type.
\param ev \<value> The expected good value.
\param p <number> A numerical precision for approximate comparisons.
\param pf <boolean> Report result as pass or fail boolean value.
\returns <string|boolean> Validation result indicating if the test
\returns <string | boolean> Validation result indicating if the test
passed or failed.
\details
Expand Down Expand Up @@ -270,7 +270,7 @@ module table_validate_start( db, verbose=false )
\param fn <string> The function name.
\param argc <integer> The number of arguments to retrieve from \p db.
\param fr <value> The value returned from the tested function.
\param t <string|boolean> The validation type.
\param t <string | boolean> The validation type.
\param p <number> A numerical precision for approximate comparisons.
\details
Expand Down Expand Up @@ -447,7 +447,7 @@ module map_validate_start( db, verbose=false )
\param id <string> The test identifier.
\param argc <integer> The number of arguments to retrieve from \p db.
\param fr <value> The value returned from the tested function.
\param t <string|boolean> The validation type.
\param t <string | boolean> The validation type.
\param p <number> A numerical precision for approximate comparisons.
\details
Expand Down
34 changes: 17 additions & 17 deletions datatypes/euclidean.scad
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

//! Test if a value defines a point.
/***************************************************************************//**
\param v <list-2d|list-3d> A 2d or 3d list of numbers.
\param v <list-2d | list-3d> A 2d or 3d list of numbers.
\returns (1) <boolean> \b true when the \p v can be interpreted as a
point and \b false otherwise.
Expand All @@ -83,7 +83,7 @@ function is_point

//! Test if a value defines a Euclidean vector.
/***************************************************************************//**
\param v <list-2d|list-3d> A 2d or 3d list of numbers.
\param v <list-2d | list-3d> A 2d or 3d list of numbers.
\returns (1) <boolean> \b true when the \p v can be interpreted as a
Euclidean vector and \b false otherwise.
Expand All @@ -102,7 +102,7 @@ function is_vector

//! Test if a value defines a line.
/***************************************************************************//**
\param v <list-2d|list-3d> A 2d or 3d list of numbers.
\param v <list-2d | list-3d> A 2d or 3d list of numbers.
\returns (1) <boolean> \b true when the \p v can be interpreted as a
line and \b false otherwise.
Expand All @@ -123,7 +123,7 @@ function is_line

//! Test if a value defines a vector or a line.
/***************************************************************************//**
\param v <list-2d|list-3d> A 2d or 3d list of numbers.
\param v <list-2d | list-3d> A 2d or 3d list of numbers.
\returns (1) <boolean> \b true when the \p v can be interpreted as a
vector or a line and \b false otherwise.
Expand All @@ -141,7 +141,7 @@ function is_vol

//! Test if a value defines a plane.
/***************************************************************************//**
\param v <list-2d|list-3d> A 2d or 3d list of numbers.
\param v <list-2d | list-3d> A 2d or 3d list of numbers.
\returns (1) <boolean> \b true when the \p v can be interpreted as a
plane and \b false otherwise.
Expand Down Expand Up @@ -333,7 +333,7 @@ function point_closest_pn

//! Return 3d point unchanged or add a zeroed third dimension to 2d point.
/***************************************************************************//**
\param p <point-3d|point-2d> A point.
\param p <point-3d | point-2d> A point.
\returns (1) <point-3d> The 3d point or the 2d point converted to 3d
with its third dimension assigned zero.
Expand Down Expand Up @@ -665,8 +665,8 @@ function vol_to_point

//! Compute the dot product of two lines or vectors in a 3d or 2d-space.
/***************************************************************************//**
\param l1 <line-3d|line-2d> A 3d or 2d line or vector 1.
\param l2 <line-3d|line-2d> A 3d or 2d line or vector 2.
\param l1 <line-3d | line-2d> A 3d or 2d line or vector 1.
\param l2 <line-3d | line-2d> A 3d or 2d line or vector 2.
\returns (1) <decimal> The dot product of \p l1 with \p l2.
(2) Returns \b undef when \p l1 or \p l2 is not a line or
Expand Down Expand Up @@ -694,10 +694,10 @@ function dot_ll

//! Compute the cross product of two lines or vectors in a 3d or 2d-space.
/***************************************************************************//**
\param l1 <line-3d|line-2d> A 3d or 2d line or vector 1.
\param l2 <line-3d|line-2d> A 3d or 2d line or vector 2.
\param l1 <line-3d | line-2d> A 3d or 2d line or vector 1.
\param l2 <line-3d | line-2d> A 3d or 2d line or vector 2.
\returns (1) <decimal|vector-2d> The cross product of \p l1 with
\returns (1) <decimal | vector-2d> The cross product of \p l1 with
\p l2.
(2) Returns \b undef when \p l1 or \p l2 is not a line or
vector or have different dimensions.
Expand Down Expand Up @@ -727,11 +727,11 @@ function cross_ll

//! Compute the scalar triple product of three lines or vectors in a 3d or 2d-space.
/***************************************************************************//**
\param l1 <line-3d|line-2d> A 3d or 2d line or vector 1.
\param l2 <line-3d|line-2d> A 3d or 2d line or vector 2.
\param l3 <line-3d|line-2d> A 3d or 2d line or vector 3.
\param l1 <line-3d | line-2d> A 3d or 2d line or vector 1.
\param l2 <line-3d | line-2d> A 3d or 2d line or vector 2.
\param l3 <line-3d | line-2d> A 3d or 2d line or vector 3.
\returns (1) <decimal|vector-2d> The scalar triple product.
\returns (1) <decimal | vector-2d> The scalar triple product.
(2) Returns \b undef when \p l1, \p l2, or \p l3 is not a
line or vector or have different dimensions,
Expand Down Expand Up @@ -764,8 +764,8 @@ function striple_lll

//! Compute the angle between two lines or vectors in a 3d or 2d-space.
/***************************************************************************//**
\param l1 <line-3d|line-2d> A 3d or 2d line or vector 1.
\param l2 <line-3d|line-2d> A 3d or 2d line or vector 2.
\param l1 <line-3d | line-2d> A 3d or 2d line or vector 1.
\param l2 <line-3d | line-2d> A 3d or 2d line or vector 2.
\param s <boolean> Return the 2d signed angle.
\returns (1) <decimal> The angle between the two lines or vectors in
Expand Down
8 changes: 4 additions & 4 deletions datatypes/list_operate.scad
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,13 @@ function limit

//! Compute the sum of a list of numbers.
/***************************************************************************//**
\param v <number-list|range> A list of numerical values or a range.
\param v <number-list | range> A list of numerical values or a range.
\param i1 <integer> The list element index at which to begin
summation (first when not specified).
\param i2 <integer> The list element index at which to end
summation (last when not specified).
\returns (1) <number|number-list> The sum or list of sums over the
\returns (1) <number | number-list> The sum or list of sums over the
index range.
(2) Returns \b undef when list is empty, non-numeric, when
an index is specified and does not exists in the list
Expand Down Expand Up @@ -423,9 +423,9 @@ function sum

//! Compute the mean/average of a list of numbers.
/***************************************************************************//**
\param v <number-list|range> A list of numerical values or a range.
\param v <number-list | range> A list of numerical values or a range.
\returns (1) <number|number-list> The sum divided by the number of
\returns (1) <number | number-list> The sum divided by the number of
elements.
(2) Returns \b undef when list is empty or is non-numeric.
Expand Down
4 changes: 2 additions & 2 deletions datatypes/table.scad
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ module table_dump
\param c <map> The table column matrix (2 x C-columns).
\param tr <string> The table data matrix variable name.
\param tc <string> The table column matrix variable name.
\param ri <string|value> The row identifier variable name or value.
\param ci <string|value> The column identifier variable name or value.
\param ri <string | value> The row identifier variable name or value.
\param ci <string | value> The column identifier variable name or value.
\param vri <boolean> The row identifier \p ri is a value.
\param vci <boolean> The column identifier \p ci is a value.
\param name <string> The getter function name.
Expand Down
2 changes: 1 addition & 1 deletion docs_start.scad
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ BEGIN_SCOPE logo;
cone( h=s*2, r=s, vr=2/10*s );
rotate([0, 0, 360/20])
repeat_radial( n=5, angle=true )
extrude_linear_uls( h=s )
extrude_linear_mss( h=s )
translate(triangle_centroid(ft) + [-15,2]/s)
difference()
{
Expand Down
6 changes: 3 additions & 3 deletions math/linear_algebra.scad
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ function translate_p

//! Rotate all coordinates about one or more axes in 2D or 3D.
/***************************************************************************//**
\param c <coords-3d|coords-2d> A list of 3d or 2d coordinate points.
\param a <decimal-list-3|decimal> The axis rotation angle.
\param c <coords-3d | coords-2d> A list of 3d or 2d coordinate points.
\param a <decimal-list-3 | decimal> The axis rotation angle.
A list [ax, ay, az] or a single decimal to specify az only.
\param v <vector-3d> An arbitrary axis for the rotation. When
specified, the rotation angle will be \p a or az about the
line \p v that passes through point \p o.
\param o <point-3d> A 3d point origin for the rotation.
Ignored when \p v is not specified.
\returns <coords-3d|coords-2d> A list of 3d or 2d rotated coordinates.
\returns <coords-3d | coords-2d> A list of 3d or 2d rotated coordinates.
Rotation order is rz, ry, rx.
\details
Expand Down
26 changes: 13 additions & 13 deletions math/polygon.scad
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ function polygon_regular_p
\param p2 <point-2d> The line terminal coordinate [x, y].
\param l <line-2d> The line or vector.
\param x <decimal-list|decimal> A list of \p x coordinates
\param x <decimal-list | decimal> A list of \p x coordinates
[\p x1, \p x2, ...] or a single \p x coordinate at which to
interpolate along the line.
\param y <decimal-list|decimal> A list of \p y coordinates
\param y <decimal-list | decimal> A list of \p y coordinates
[\p y1, \p y2, ...] or a single \p y coordinate at which to
interpolate along the line.
\param r <decimal-list|decimal> A list of ratios
\param r <decimal-list | decimal> A list of ratios
[\p r1, \p r2, ...] or a single ratio \p r. The position
ratio along line \p p1 (\p r=\b 0) to \p p2 (\p r=\b 1).
Expand Down Expand Up @@ -210,9 +210,9 @@ function polygon_line_p
/***************************************************************************//**
\param r <decimal> The arc radius.
\param c <point-2d> The arc center coordinate [x, y].
\param v1 <line-2d|decimal> The arc start angle.
\param v1 <line-2d | decimal> The arc start angle.
A 2d line, vector, or decimal angle 1.
\param v2 <line-2d|decimal> The arc end angle.
\param v2 <line-2d | decimal> The arc end angle.
A 2d line, vector, or decimal angle 2.
\param fn <integer> The number of [facets].
\param cw <boolean> Sweep clockwise along arc from the head of
Expand Down Expand Up @@ -267,12 +267,12 @@ function polygon_arc_p

//! Compute coordinates for an elliptical sector in 2D.
/***************************************************************************//**
\param r <decimal-list-2|decimal> The elliptical radius. A list
\param r <decimal-list-2 | decimal> The elliptical radius. A list
[rx, ry] of decimals or a single decimal for (rx=ry).
\param c <point-2d> The center coordinate [x, y].
\param v1 <line-2d|decimal> The sector angle 1.
\param v1 <line-2d | decimal> The sector angle 1.
A 2d line, vector, or decimal.
\param v2 <line-2d|decimal> The sector angle 2.
\param v2 <line-2d | decimal> The sector angle 2.
A 2d line, vector, or decimal.
\param s <boolean> Use signed vector angle conversions. When
\b false, positive angle conversion will be used.
Expand Down Expand Up @@ -329,7 +329,7 @@ function polygon_elliptical_sector_p

//! Compute the coordinates for a rounded trapezoid in 2D space.
/***************************************************************************//**
\param b <decimal-list-2|decimal> The base lengths. A list [b1, b2]
\param b <decimal-list-2 | decimal> The base lengths. A list [b1, b2]
of 2 decimals or a single decimal for (b1=b2).
\param h <decimal> The perpendicular height between bases.
\param l <decimal> The left side leg length.
Expand Down Expand Up @@ -906,9 +906,9 @@ function polygon_linear_extrude_pf
\param r <decimal> The round radius.
\param m <integer> The round mode.
\param c <point-2d> The round center coordinate [x, y].
\param v1 <line-2d|decimal> The round start angle.
\param v1 <line-2d | decimal> The round start angle.
A 2d line, vector, or decimal angle 1.
\param v2 <line-2d|decimal> The round end angle.
\param v2 <line-2d | decimal> The round end angle.
A 2d line, vector, or decimal angle 2.
\param fn <integer> The number of [facets].
\param cw <boolean> The coordinate point ordering.
Expand Down Expand Up @@ -979,11 +979,11 @@ function polygon_round_eve_p
/***************************************************************************//**
\param c <coords-2d> A list of \em n 2d cartesian coordinates
[[x1, y1], [x2, y2], ..., [xn, yn]].
\param vr <decimal-list-n|decimal> The vertices rounding radius.
\param vr <decimal-list-n | decimal> The vertices rounding radius.
A list [v1r, v2r, v3r, ... vnr] of \em n decimals or a
single decimal for (v1r=v2r=v3r= ... =vnr). Undefined
vertices are not rounded.
\param vrm <integer-list-n|integer> The vertices rounding mode.
\param vrm <integer-list-n | integer> The vertices rounding mode.
A list [v1rm, v2rm, v3rm, ... vnrm] of \em n integers or a
single integer for (v1rm=v2rm=v3rm= ... =vnrm). Undefined
vertices are not rounded.
Expand Down
Loading

0 comments on commit 680f362

Please sign in to comment.