Merge pull request #655 from adrianVmariano/master

path cut bugfix
This commit is contained in:
Revar Desmera 2021-09-18 21:19:31 -07:00 committed by GitHub
commit b4ad1eb5bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -244,6 +244,7 @@ module stroke(
]);
assert(is_num(trim2));
if (len(path) == 1) {
if (len(path[0]) == 2) {
translate(path[0]) circle(d=width[0]);
@ -255,7 +256,6 @@ module stroke(
pathcut_su = _cut_to_seg_u_form(pathcut,path);
path2 = _path_cut_getpaths(path, pathcut, closed=false)[1];
widths = _path_select(width, pathcut_su[0][0], pathcut_su[0][1], pathcut_su[1][0], pathcut_su[1][1]);
start_vec = path[0] - path[1];
end_vec = last(path) - select(path,-2);

View file

@ -908,7 +908,7 @@ function _path_cut_getpaths(path, cutlist, closed) =
if (!approx(cutlist[0][0], path[cutlist[0][1]-1])) cutlist[0][0]
],
for(i=[0:1:cuts-2])
cutlist[i][0]==cutlist[i+1][0] ? []
cutlist[i][0]==cutlist[i+1][0] && cutlist[i][1]==cutlist[i+1][1] ? []
:
[ if (!approx(cutlist[i][0], select(path,cutlist[i][1]))) cutlist[i][0],
each slice(path, cutlist[i][1], cutlist[i+1][1]-1),