move src2 -> src, web2 -> web, remove old module system, fix deps

This commit is contained in:
Stewart Allen 2025-07-06 23:44:33 -04:00
commit ce4f5d6e78
488 changed files with 26179 additions and 26609 deletions

View file

@ -1,26 +1,18 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
"use strict";
import { base } from '../../geo/base.js';
import { polygons as POLY, fillArea } from '../../geo/polygons.js';
import { getRangeParameters } from './driver.js';
import { slicer } from '../../geo/slicer.js';
// dep: geo.base
// dep: geo.polygons
// dep: kiri-mode.fdm.driver
gapp.register("kiri-mode.fdm.post", [], (root, exports) => {
const { base, kiri } = root;
const { driver } = kiri;
const { polygons } = base;
const { fillArea } = polygons;
const { FDM } = driver;
const POLY = polygons;
slicer.slicePost.FDM = slicePost;
/**
* may run in minion or worker context. do not create objects
* that will not quickly encode in threaded mode. add to existing
* data object. return is ignored.
*/
base.slicePost.FDM = function(data, options) {
export function slicePost(data, options) {
const { z, lines, groups } = data;
const { useAssembly, post_args, zIndexes } = options;
const { process, isSynth, vaseMode } = post_args;
@ -40,7 +32,7 @@ base.slicePost.FDM = function(data, options) {
return;
}
const index = zIndexes.indexOf(z);
const range = FDM.getRangeParameters(process, index);
const range = getRangeParameters(process, index);
// calculate fractional shells
let shellFrac = (range.sliceShells - (range.sliceShells | 0));
let sliceShells = range.sliceShells | 0;
@ -62,7 +54,7 @@ base.slicePost.FDM = function(data, options) {
const nutops = [];
// co-locate shell processing with top generation in slicer
for (let top of data.tops) {
nutops.push(FDM.doTopShells(z, top, count, offset/2, offset, fillOff, {
nutops.push(doTopShells(z, top, count, offset/2, offset, fillOff, {
thinType,
vaseMode,
useAssembly
@ -193,7 +185,7 @@ function thin_type_3(params) {
* may run in minion or worker context. performs shell offsetting
* including thin wall detection when enabled
*/
FDM.doTopShells = function(z, top, count, offset1, offsetN, fillOffset, opt = {}) {
export function doTopShells(z, top, count, offset1, offsetN, fillOffset, opt = {}) {
// pretend we're a top object in minions
if (!top.poly) {
top = { poly: top };
@ -319,5 +311,3 @@ function cullIntersections() {
}
return good.length > 2 ? good : [];
}
});