Merge pull request #461 from adrianVmariano/master

fix names for path_cut_segs which is broken
This commit is contained in:
Revar Desmera 2021-03-08 14:43:47 -08:00 committed by GitHub
commit ea4a787398
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 12 deletions

View file

@ -1334,11 +1334,11 @@ function _path_cuts_dir(path, cuts, closed=false, eps=1e-2) =
];
// Function: path_cut_segs()
// Function: path_cut()
// Topics: Paths
// See Also: path_cut_points()
// Usage:
// path_list = path_cut_segs(path, cutdist, <closed=>);
// path_list = path_cut(path, cutdist, <closed=>);
// Description:
// Given a list of distances in `cutdist`, cut the path into
// subpaths at those lengths, returning a list of paths.
@ -1352,15 +1352,15 @@ function _path_cuts_dir(path, cuts, closed=false, eps=1e-2) =
// closed = If true, treat the path as a closed polygon.
// Example(2D):
// path = circle(d=100);
// segs = path_cut_segs(path, [50, 200], closed=true);
// segs = path_cut(path, [50, 200], closed=true);
// rainbow(segs) stroke($item);
function path_cut_segs(path,cutdist,closed) =
is_num(cutdist) ? path_cut_segs(path,[cutdist],closed) :
function path_cut(path,cutdist,closed) =
is_num(cutdist) ? path_cut(path,[cutdist],closed) :
assert(is_vector(cutdist))
assert(select(cutdist,-1)<path_length(path,closed=closed),"Cut distances must be smaller than the path length")
assert(cutdist[0]>0, "Cut distances must be strictly positive")
let(
cutlist = path_cut(path,cutdist,closed=closed),
cutlist = path_cut_points(path,cutdist,closed=closed),
cuts = len(cutlist)
)
[

View file

@ -76,7 +76,7 @@ include <structs.scad>
// ignored. Note that $fn is interpreted as the number of points on the roundover curve, which is
// not equivalent to its meaning for rounding circles because roundovers are usually small fractions
// of a circular arc. When doing continuous curvature rounding be sure to use lots of segments or the effect
// will be hidden by the discretization. Note that if you use $fn then $fn with "smooth" then $fn points are added at each corner, even
// will be hidden by the discretization. Note that if you use $fn with "smooth" then $fn points are added at each corner, even
// if the "corner" is flat, with collinear points, so this guarantees a specific output length.
//
// Figure(2D,Med):

View file

@ -349,17 +349,18 @@ function up(z=0, p) = move([0,0,z],p=p);
// * `rot(30)` or `rot(a=30)` rotates 30 degrees around the Z axis.
// * `rot([20,30,40])` or `rot(a=[20,30,40])` rotates 20 degrees around the X axis, then 30 degrees around the Y axis, then 40 degrees around the Z axis.
// * `rot(30, [1,1,0])` or `rot(a=30, v=[1,1,0])` rotates 30 degrees around the axis vector `[1,1,0]`.
// * `rot(from=[0,0,1], to=[1,0,0])` rotates the top towards the right, similar to `rot(a=90,v=[0,1,0]`.
// * `rot(from=[0,0,1], to=[1,1,0], a=45)` rotates 45 degrees around the Z axis, then rotates the top towards the back-right. Similar to `rot(a=90,v=[-1,1,0])`
// If the `cp` centerpoint argument is given, then rotations are performed around that centerpoint.
// If the `reverse` argument is true, then the rotations performed will be exactly reversed.
// * `rot(from=[0,0,1], to=[1,0,0])` rotates the `from` vector to line up with the `to` vector, in this case the top to the right and hence equivalent to `rot(a=90,v=[0,1,0]`.
// * `rot(from=[0,1,1], to=[1,1,0], a=45)` rotates 45 degrees around the `from` vector ([0,1,1]) and then rotates the `from` vector to align with the `to` vector. Equivalent to `rot(from=[0,1,1],to=[1,1,0]) rot(a=45,v=[0,1,1])`. You can also regard `a` as as post-rotation around the `to` vector. For this form, `a` must be a scalar.
// * If the `cp` centerpoint argument is given, then rotations are performed around that centerpoint. So `rot(args...,cp=[1,2,3])` is equivalent to `move(-[1,2,3])rot(args...)move([1,2,3])`.
// * If the `reverse` argument is true, then the rotations performed will be exactly reversed.
// .
// The behavior and return value varies depending on how `rot()` is called:
// * Called as a module, rotates all children.
// * Called as a function with a `p` argument containing a point, returns the rotated point.
// * Called as a function with a `p` argument containing a list of points, returns the list of rotated points.
// * Called as a function with a [bezier patch](beziers.scad) in the `p` argument, returns the rotated patch.
// * Called as a function with a [VNF structure](vnf.scad) in the `p` argument, returns the rotated VNF.
// * Called as a function without a `p` argument, and `planar` is true, returns the affine2d rotational matrix. Requires that `a` is a finite scalar.
// * Called as a function without a `p` argument, and `planar` is true, returns the affine2d rotational matrix. The angle `a` must be a scalar.
// * Called as a function without a `p` argument, and `planar` is false, returns the affine3d rotational matrix.
//
// Arguments: