mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-27 16:30:02 +02:00
Merge branch 'master' into revarbat_dev
This commit is contained in:
15
paths.scad
15
paths.scad
@@ -1227,12 +1227,15 @@ module path_spread(path, n, spacing, sp=undef, rotate_children=true, closed=fals
|
||||
function path_cut(path, dists, closed=false, direction=false) =
|
||||
let(long_enough = len(path) >= (closed ? 3 : 2))
|
||||
assert(long_enough,len(path)<2 ? "Two points needed to define a path" : "Closed path must include three points")
|
||||
!is_list(dists)? path_cut(path, [dists],closed, direction)[0] :
|
||||
let(cuts = _path_cut(path,dists,closed))
|
||||
!direction ? cuts : let(
|
||||
dir = _path_cuts_dir(path, cuts, closed),
|
||||
normals = _path_cuts_normals(path, cuts, dir, closed)
|
||||
) zip(cuts, array_group(dir,1), array_group(normals,1));
|
||||
!is_list(dists)? path_cut(path, [dists],closed, direction)[0]
|
||||
: let(cuts = _path_cut(path,dists,closed))
|
||||
!direction
|
||||
? cuts
|
||||
: let(
|
||||
dir = _path_cuts_dir(path, cuts, closed),
|
||||
normals = _path_cuts_normals(path, cuts, dir, closed)
|
||||
)
|
||||
hstack(cuts, array_group(dir,1), array_group(normals,1));
|
||||
|
||||
// Main recursive path cut function
|
||||
function _path_cut(path, dists, closed=false, pind=0, dtotal=0, dind=0, result=[]) =
|
||||
|
Reference in New Issue
Block a user