misc doc fixes and organization

beziers reorg
arc bug fix for endpoint=false and N=undef
This commit is contained in:
Adrian Mariano
2022-01-07 14:23:01 -05:00
parent 1df2d49e3c
commit d8aa4ced71
10 changed files with 777 additions and 868 deletions

View File

@@ -345,7 +345,7 @@ function _bezcorner(points, parm) =
points[1]+k*d*next,
points[1]+d*next
] : _smooth_bez_fill(points,parm),
N = max(3,$fn>0 ?$fn : ceil(bezier_segment_length(P)/$fs))
N = max(3,$fn>0 ?$fn : ceil(bezier_length(P)/$fs))
)
bezier_curve(P,N+1,endpoint=true);
@@ -450,7 +450,7 @@ function _rounding_offsets(edgespec,z_dir=1) =
// in which case the size parameter specifies the sum of the deviations of the two peaks of the curve. In 3-space
// the bezier curve may have three extrema: two maxima and one minimum. In this case the size specifies
// the sum of the maxima minus the minimum. At a given segment there is a maximum size: if your size
// value is too large it will be rounded down. See also path_to_bezier().
// value is too large it will be rounded down. See also path_to_bezpath().
// Arguments:
// path = path to smooth
// tangents = tangents constraining curve direction at each point. Default: computed automatically
@@ -503,9 +503,9 @@ module smooth_path(path, tangents, size, relsize, splinesteps=10, uniform=false,
function smooth_path(path, tangents, size, relsize, splinesteps=10, uniform=false, closed) =
is_1region(path) ? smooth_path(path[0], tangents, size, relsize, splinesteps, uniform, default(closed,true)) :
let (
bez = path_to_bezier(path, tangents=tangents, size=size, relsize=relsize, uniform=uniform, closed=default(closed,false))
bez = path_to_bezpath(path, tangents=tangents, size=size, relsize=relsize, uniform=uniform, closed=default(closed,false))
)
bezier_path(bez,splinesteps=splinesteps);
bezpath_curve(bez,splinesteps=splinesteps);
@@ -665,7 +665,7 @@ function _path_join(paths,joint,k=0.5,i=0,result=[],relocate=true,closed=false)
loop?"closing the path":str("adding path ",i+1)))
let(
bezpts = _smooth_bez_fill([firstcut[0], corner, nextcut[0]],k[i]),
N = max(3,$fn>0 ?$fn : ceil(bezier_segment_length(bezpts)/$fs)),
N = max(3,$fn>0 ?$fn : ceil(bezier_length(bezpts)/$fs)),
bezpath = approx(firstcut[0],corner) && approx(corner,nextcut[0])
? []
: bezier_curve(bezpts,N),