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: with:
node-version: '20' node-version: '20'
- name: Install dependencies - name: Setup Build Environment
run: npm install run: npm run setup
- name: Build Electron app - name: Build Electron app
env: env:

View file

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

View file

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