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
c0baeb5db1
commit
5bb4802fc9
7 changed files with 10 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -11,3 +11,4 @@ node_modules
|
|||
package-lock.json
|
||||
three.js
|
||||
tmp
|
||||
pack
|
||||
|
|
@ -16,6 +16,7 @@ import { render } from '../kiri/render.js';
|
|||
import { wasm_ctrl } from '../geo/wasm.js';
|
||||
import { version } from '../moto/license.js';
|
||||
import { Widget, newWidget } from '../kiri/widget.js';
|
||||
import { load } from "../load/png.js";
|
||||
|
||||
import { CAM } from '../kiri-mode/cam/driver-be.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 { noop, utils } from '../kiri/utils.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';
|
||||
|
||||
let { parseOpt, o2js, js2o, ls2o } = utils,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { ajax, js2o } from './utils.js';
|
|||
import { base } from '../geo/base.js';
|
||||
import { load } from '../load/file.js';
|
||||
import { space } from '../moto/space.js';
|
||||
import { Widget } from './widget.js';
|
||||
import { Widget, newWidget } from './widget.js';
|
||||
import { Packer } from './pack.js';
|
||||
|
||||
import { COLOR, MODES } from './consts.js';
|
||||
|
|
@ -837,7 +837,7 @@ function platformLoadFiles(files, group) {
|
|||
api.function.parse(data.textDecode('utf-8'), 'gcode');
|
||||
load_dec();
|
||||
} else if (issvg) {
|
||||
loadSVGDialog(opt => {
|
||||
loadSVGDialog(opt => {
|
||||
group = group || [];
|
||||
let svg = load.SVG.parse(data.textDecode('utf-8'), opt);
|
||||
let ind = 0;
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function parseAsync(bin, opt) {
|
|||
* opt.base = base added thickness in mm
|
||||
*/
|
||||
function parse(bin, opt = {}) {
|
||||
let img = new png.PNG();
|
||||
let img = new PNG();
|
||||
let progress = opt.progress || noop;
|
||||
let ondone = opt.done || noop;
|
||||
img.parse(bin, (err, output) => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
|
||||
|
||||
import { newPolygon } from '../geo/polygon.js';
|
||||
import { newPoint } from '../geo/point.js';
|
||||
import { polygons } from '../geo/polygons.js';
|
||||
import { THREE } from '../ext/three.js';
|
||||
|
||||
|
|
@ -43,7 +44,7 @@ export function parse(text, opt = { }) {
|
|||
if (points.length < 3) {
|
||||
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 (type === 'polyline') poly.setOpen(true);
|
||||
poly._svg = { width, miter };
|
||||
|
|
|
|||
Loading…
Reference in a new issue