Added dashed_stroke(). path_cut() -> path_cut_points().

This commit is contained in:
Garth Minette
2021-03-06 02:26:39 -08:00
parent 1ee6e3a2e7
commit 3682f7b27c
5 changed files with 405 additions and 167 deletions

View File

@@ -640,8 +640,8 @@ function _path_join(paths,joint,k=0.5,i=0,result=[],relocate=true,closed=false)
)
assert(d_first>=0 && d_next>=0, str("Joint value negative when adding path ",i+1))
let(
firstcut = path_cut(revresult, d_first, direction=true),
nextcut = path_cut(nextpath, d_next, direction=true)
firstcut = path_cut_points(revresult, d_first, direction=true),
nextcut = path_cut_points(nextpath, d_next, direction=true)
)
assert(is_def(firstcut),str("Path ",i," is too short for specified cut distance ",d_first))
assert(is_def(nextcut),str("Path ",i+1," is too short for specified cut distance ",d_next))
@@ -1589,8 +1589,8 @@ function _stroke_end(width,left, right, spec) =
90-vector_angle([newright[1],newright[0],newleft[0]])/2,
jointleft = 8*cutleft/cos(leftangle)/(1+4*bez_k),
jointright = 8*cutright/cos(rightangle)/(1+4*bez_k),
pathcutleft = path_cut(newleft,abs(jointleft)),
pathcutright = path_cut(newright,abs(jointright)),
pathcutleft = path_cut_points(newleft,abs(jointleft)),
pathcutright = path_cut_points(newright,abs(jointright)),
leftdelete = intright? pathcutleft[1] : pathcutleft[1] + pathclip[1] -1,
rightdelete = intright? pathcutright[1] + pathclip[1] -1 : pathcutright[1],
leftcorner = line_intersection([pathcutleft[0], newleft[pathcutleft[1]]], [newright[0],newleft[0]]),