mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Bugfix for polygon_shift_to_closest_point()
This commit is contained in:
parent
24de174d6f
commit
969f17f4c6
2 changed files with 4 additions and 6 deletions
|
@ -978,11 +978,9 @@ function polygon_shift(poly, i) =
|
|||
function polygon_shift_to_closest_point(path, pt) =
|
||||
let(
|
||||
path = cleanup_path(path),
|
||||
closest = path_closest_point(path,pt),
|
||||
seg = select(path,closest[0],closest[0]+1),
|
||||
u = norm(closest[1]-seg[0]) / norm(seg[1]-seg[0]),
|
||||
segnum = closest[0] + (u>0.5? 1 : 0)
|
||||
) select(path,segnum,segnum+len(path)-1);
|
||||
dists = [for (p=path) norm(p-pt)],
|
||||
closest = min_index(dists)
|
||||
) select(path,closest,closest+len(path)-1);
|
||||
|
||||
|
||||
// Function: reindex_polygon()
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,54];
|
||||
BOSL_VERSION = [2,0,55];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
|
Loading…
Reference in a new issue