Squashed commit of the following:
commit 4712967dd807ce035f407acff9bcfbc6c320bbdc
Author: bakedpotatolord <jeffy9745@gmail.com>
Date: Tue Jul 8 09:26:33 2025 -0600
Reapply "add missing import"
This reverts commit f8ef936d8e.
This commit is contained in:
parent
1a5782a28a
commit
a67f841889
7 changed files with 10 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -11,3 +11,4 @@ node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
three.js
|
three.js
|
||||||
tmp
|
tmp
|
||||||
|
pack
|
||||||
|
|
@ -16,6 +16,7 @@ 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';
|
||||||
|
|
|
||||||
|
|
@ -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 } from './widget.js';
|
import { Widget, newWidget } 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,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { ajax, js2o } from './utils.js';
|
||||||
import { base } from '../geo/base.js';
|
import { base } from '../geo/base.js';
|
||||||
import { load } from '../load/file.js';
|
import { load } from '../load/file.js';
|
||||||
import { space } from '../moto/space.js';
|
import { space } from '../moto/space.js';
|
||||||
import { Widget } from './widget.js';
|
import { Widget, newWidget } from './widget.js';
|
||||||
import { Packer } from './pack.js';
|
import { Packer } from './pack.js';
|
||||||
|
|
||||||
import { COLOR, MODES } from './consts.js';
|
import { COLOR, MODES } from './consts.js';
|
||||||
|
|
|
||||||
|
|
@ -100,4 +100,6 @@ 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 };
|
||||||
|
|
|
||||||
|
|
@ -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.PNG();
|
let img = new 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) => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
/** 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';
|
||||||
|
|
||||||
|
|
@ -43,7 +44,7 @@ export function parse(text, opt = { }) {
|
||||||
if (points.length < 3) {
|
if (points.length < 3) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let poly = newPolygon().addPoints(points.map(p => newPolygon.newPoint(p.x, -p.y, 0)));
|
let poly = newPolygon().addPoints(points.map(p => 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 };
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue