mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-10 00:46:55 +02:00
Bugfix for polygon_shift_to_closest_point()
This commit is contained in:
@@ -978,11 +978,9 @@ function polygon_shift(poly, i) =
|
|||||||
function polygon_shift_to_closest_point(path, pt) =
|
function polygon_shift_to_closest_point(path, pt) =
|
||||||
let(
|
let(
|
||||||
path = cleanup_path(path),
|
path = cleanup_path(path),
|
||||||
closest = path_closest_point(path,pt),
|
dists = [for (p=path) norm(p-pt)],
|
||||||
seg = select(path,closest[0],closest[0]+1),
|
closest = min_index(dists)
|
||||||
u = norm(closest[1]-seg[0]) / norm(seg[1]-seg[0]),
|
) select(path,closest,closest+len(path)-1);
|
||||||
segnum = closest[0] + (u>0.5? 1 : 0)
|
|
||||||
) select(path,segnum,segnum+len(path)-1);
|
|
||||||
|
|
||||||
|
|
||||||
// Function: reindex_polygon()
|
// Function: reindex_polygon()
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,54];
|
BOSL_VERSION = [2,0,55];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
Reference in New Issue
Block a user