fix hex infill factor computation

This commit is contained in:
Stewart Allen 2021-04-23 21:43:37 -04:00
commit d693212ce5

View file

@ -38,7 +38,7 @@
function fillHex(target, full) { function fillHex(target, full) {
// compute segment lengths (vert/horiz and 45) // compute segment lengths (vert/horiz and 45)
let spacing = target.offset(); let spacing = target.offset();
let vhlen = (1 - target.density()) * 4 + spacing; let vhlen = (1 / target.density()) * (target.lineWidth() + spacing);
let anxlen = ROUND(Math.cos(30 * DEG2RAD) * vhlen, 7); let anxlen = ROUND(Math.cos(30 * DEG2RAD) * vhlen, 7);
let anylen = ROUND(Math.sin(30 * DEG2RAD) * vhlen, 7); let anylen = ROUND(Math.sin(30 * DEG2RAD) * vhlen, 7);
let bounds = target.bounds(); let bounds = target.bounds();