mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-04 03:09:45 +00:00
fix offset bug
This commit is contained in:
parent
3c6e9804a8
commit
43f37908df
1 changed files with 3 additions and 2 deletions
|
@ -763,7 +763,8 @@ function offset(
|
||||||
// Note if !closed the last corner doesn't matter, so exclude it
|
// Note if !closed the last corner doesn't matter, so exclude it
|
||||||
parallelcheck =
|
parallelcheck =
|
||||||
(len(sharpcorners)==2 && !closed) ||
|
(len(sharpcorners)==2 && !closed) ||
|
||||||
all_defined(closed? sharpcorners : list_tail(sharpcorners))
|
all_defined(closed? sharpcorners : select(sharpcorners, 1,-2)),
|
||||||
|
f=echo(sharpcorners=sharpcorners)
|
||||||
)
|
)
|
||||||
assert(parallelcheck, "Path contains sequential parallel segments (either 180 deg turn or 0 deg turn")
|
assert(parallelcheck, "Path contains sequential parallel segments (either 180 deg turn or 0 deg turn")
|
||||||
let(
|
let(
|
||||||
|
@ -775,7 +776,7 @@ function offset(
|
||||||
:
|
:
|
||||||
[for(i=[0:len(goodsegs)-1])
|
[for(i=[0:len(goodsegs)-1])
|
||||||
let(prevseg=select(goodsegs,i-1))
|
let(prevseg=select(goodsegs,i-1))
|
||||||
i==0 && !closed ? false // In open case first entry is bogus
|
(i==0 || i==len(goodsegs)-1) && !closed ? false // In open case first entry is bogus
|
||||||
:
|
:
|
||||||
(goodsegs[i][1]-goodsegs[i][0]) * (goodsegs[i][0]-sharpcorners[i]) > 0
|
(goodsegs[i][1]-goodsegs[i][0]) * (goodsegs[i][0]-sharpcorners[i]) > 0
|
||||||
&& (prevseg[1]-prevseg[0]) * (sharpcorners[i]-prevseg[1]) > 0
|
&& (prevseg[1]-prevseg[0]) * (sharpcorners[i]-prevseg[1]) > 0
|
||||||
|
|
Loading…
Reference in a new issue