add missing import

Revert "add missing import"
Revert "add missing import"
Revert "add other file exports to file.js"
Revert "fix png imports"
Revert "ignore pack folder"
This commit is contained in:
bakedpotatolord 2025-07-08 09:02:48 -06:00 • committed by Stewart Allen
commit c0baeb5db1
6 changed files with 3 additions and 8 deletions

1
.gitignore vendored
View file

@ -11,4 +11,3 @@ node_modules
package-lock.json package-lock.json
three.js three.js
tmp tmp
pack

View file

@ -16,7 +16,6 @@ import { render } from '../kiri/render.js';
import { wasm_ctrl } from '../geo/wasm.js'; import { wasm_ctrl } from '../geo/wasm.js';
import { version } from '../moto/license.js'; import { version } from '../moto/license.js';
import { Widget, newWidget } from '../kiri/widget.js'; import { Widget, newWidget } from '../kiri/widget.js';
import { load } from "../load/png.js";
import { CAM } from '../kiri-mode/cam/driver-be.js'; import { CAM } from '../kiri-mode/cam/driver-be.js';
import { DRAG } from '../kiri-mode/drag/driver.js'; import { DRAG } from '../kiri-mode/drag/driver.js';

View file

@ -18,7 +18,7 @@ import { space as SPACE } from '../moto/space.js';
import { stats } from '../kiri/stats.js'; import { stats } from '../kiri/stats.js';
import { noop, utils } from '../kiri/utils.js'; import { noop, utils } from '../kiri/utils.js';
import { version } from '../moto/license.js'; import { version } from '../moto/license.js';
import { Widget, newWidget } from './widget.js'; import { Widget } from './widget.js';
import { showTools } from '../kiri-mode/cam/tools.js'; import { showTools } from '../kiri-mode/cam/tools.js';
let { parseOpt, o2js, js2o, ls2o } = utils, let { parseOpt, o2js, js2o, ls2o } = utils,

View file

@ -100,6 +100,4 @@ function load_file(file, opt) {
}); });
} }
Object.assign(load_file, { SVG, OBJ, STL, TMF, GBR, PNG: pngLoad.PNG });
export { types, as_buffer, load_data, load_file, load_file as load }; export { types, as_buffer, load_data, load_file, load_file as load };

View file

@ -28,7 +28,7 @@ function parseAsync(bin, opt) {
* opt.base = base added thickness in mm * opt.base = base added thickness in mm
*/ */
function parse(bin, opt = {}) { function parse(bin, opt = {}) {
let img = new PNG(); let img = new png.PNG();
let progress = opt.progress || noop; let progress = opt.progress || noop;
let ondone = opt.done || noop; let ondone = opt.done || noop;
img.parse(bin, (err, output) => { img.parse(bin, (err, output) => {

View file

@ -1,7 +1,6 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */ /** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
import { newPolygon } from '../geo/polygon.js'; import { newPolygon } from '../geo/polygon.js';
import { newPoint } from '../geo/point.js';
import { polygons } from '../geo/polygons.js'; import { polygons } from '../geo/polygons.js';
import { THREE } from '../ext/three.js'; import { THREE } from '../ext/three.js';
@ -44,7 +43,7 @@ export function parse(text, opt = { }) {
if (points.length < 3) { if (points.length < 3) {
continue; continue;
} }
let poly = newPolygon().addPoints(points.map(p => newPoint(p.x, -p.y, 0))); let poly = newPolygon().addPoints(points.map(p => newPolygon.newPoint(p.x, -p.y, 0)));
if (poly.appearsClosed()) poly.points.pop(); if (poly.appearsClosed()) poly.points.pop();
if (type === 'polyline') poly.setOpen(true); if (type === 'polyline') poly.setOpen(true);
poly._svg = { width, miter }; poly._svg = { width, miter };