fix gyroid. attempted to fix gh build workflow

This commit is contained in:
Stewart Allen 2025-07-07 22:43:23 -04:00
commit fda9701050
3 changed files with 8 additions and 9 deletions

View file

@ -22,8 +22,8 @@ jobs:
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Setup Build Environment
run: npm run setup
- name: Build Electron app
env:

View file

@ -200,10 +200,8 @@ export function filter(poly, inc) {
export function distTo(a, b, dir) {
let dx = a.x - b.x;
let dy = a.y - b.y;
if (dir === 'lr') {
return Math.abs(dx);
} else if (dir === 'td') {
return Math.abs(dy);
}
// bias distance by prevailing direction of discovery to join stragglers
if (dir === 'lr') dx = dx / 2;
if (dir === 'td') dy = dy / 2;
return Math.sqrt(dx * dx + dy * dy);
}

View file

@ -1,6 +1,7 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
import { base, util } from '../../geo/base.js';
import { newPolygon } from '../../geo/polygon.js';
import { slice as gyroid_slice } from '../../geo/gyroid.js';
export const fill_fixed = {
@ -119,7 +120,7 @@ function fillGyroid(target) {
z: 0
}
});
polys.push(base.newPolygon().setOpen(true).addObj(points));
polys.push(newPolygon().setOpen(true).addObj(points));
}
}
polys = connectOpenPolys(polys);
@ -136,7 +137,7 @@ function fillGyroid(target) {
z: 0
}
});
polys.push(base.newPolygon().setOpen(true).addObj(points));
polys.push(newPolygon().setOpen(true).addObj(points));
}
}
polys = connectOpenPolys(polys);