weight poly2poly movements by polygon area

This commit is contained in:
Stewart Allen 2020-02-08 13:09:54 -05:00
commit 9f819e8398
2 changed files with 3 additions and 2 deletions

View file

@ -872,8 +872,9 @@ var gs_kiri_print = exports;
} }
return; return;
} }
let area = poly.area();
poly.forEachPoint(function(point, index) { poly.forEachPoint(function(point, index) {
dist = startPoint.distTo3D(point); dist = startPoint.distTo3D(point) * area * area;
if (dist < mindist) { if (dist < mindist) {
found = {poly:poly, index:index, point:point}; found = {poly:poly, index:index, point:point};
mindist = dist; mindist = dist;

View file

@ -1,7 +1,7 @@
var exports = { var exports = {
COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen <sa@grid.space> - All Rights Reserved", COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen <sa@grid.space> - All Rights Reserved",
LICENSE:"See the license.md file included with the source distribution", LICENSE:"See the license.md file included with the source distribution",
VERSION:"1.5.4" VERSION:"1.5.5"
}; };
if (!module) var module = {}; if (!module) var module = {};
module.exports = exports; module.exports = exports;