From 3b24ebe0d9dbb315d24cfe317f4d4c6f287f63ba Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sat, 14 Jun 2025 11:49:20 -0400 Subject: [PATCH] update manifold. fix selection to sketch --- package.json | 2 +- src2/geo/csg.js | 3 --- src2/main/mesh.js | 6 ++++-- src2/mesh/api.js | 2 +- src2/mesh/build.js | 2 +- src2/mesh/edges.js | 2 +- src2/mesh/work.js | 3 ++- web2/README.md | 31 ------------------------------- web2/serve.json | 17 ----------------- 9 files changed, 10 insertions(+), 58 deletions(-) delete mode 100644 web2/README.md delete mode 100644 web2/serve.json diff --git a/package.json b/package.json index dc4bf168..0170fe6a 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "earcut": "^2.2.3", "express-useragent": "^1.0.13", "jszip": "^3.7.1", - "manifold-3d": "^2.5.1", + "manifold-3d": "^3.1.1", "moment": "^2.29.4", "serve-static": "^1.14.1", "three": "^0.174.0", diff --git a/src2/geo/csg.js b/src2/geo/csg.js index 94ea78a4..0aec7c09 100644 --- a/src2/geo/csg.js +++ b/src2/geo/csg.js @@ -2,12 +2,9 @@ "use strict"; -import { base } from './base.js'; import { THREE } from '../ext/three.js'; import manifold from '../ext/manifold.js'; -const { Mesh, BufferGeometry, Vector3 } = THREE; -const debug = true; const precision = 0.001; const factor = 1/precision; diff --git a/src2/main/mesh.js b/src2/main/mesh.js index 1a75109e..a546a852 100644 --- a/src2/main/mesh.js +++ b/src2/main/mesh.js @@ -6,6 +6,7 @@ import '../add/array.js'; import '../add/class.js'; import '../add/three.js'; import '../mesh/build.js'; + import { client as motoClient } from '../moto/client.js'; import { broker as motoBroker } from '../moto/broker.js'; import { space as motoSpace } from '../moto/space.js'; @@ -18,12 +19,13 @@ import { load as fileLoad } from '../load/file.js'; import { $, $d, h, estop } from '../moto/webui.js'; import { THREE } from '../ext/three.js'; -const { Quaternion } = THREE; -const version = '1.5.6'; +const version = '1.5.7'; const api = meshApi; const call = motoBroker.send; const dbindex = [ "admin", "space" ]; +const { Quaternion } = THREE; + function log() { return meshApi.log.emit(...arguments); } diff --git a/src2/mesh/api.js b/src2/mesh/api.js index 76d14277..c8d9ee90 100644 --- a/src2/mesh/api.js +++ b/src2/mesh/api.js @@ -1115,7 +1115,7 @@ const tool = { }, toSketch() { - for (let m of selection.models()) { + for (let m of api.model.list()) { m.selectionToSketch(); } }, diff --git a/src2/mesh/build.js b/src2/mesh/build.js index d474dc8b..f1545531 100644 --- a/src2/mesh/build.js +++ b/src2/mesh/build.js @@ -1,7 +1,7 @@ /** Copyright Stewart Allen -- All Rights Reserved */ import { broker } from '../moto/broker.js'; -import { $, h } from '../moto/webui.js'; +import { $, h, estop } from '../moto/webui.js'; import { api } from './api.js'; import { util } from './util.js'; import { space } from '../moto/space.js'; diff --git a/src2/mesh/edges.js b/src2/mesh/edges.js index 7cf72c3a..9fc5ced0 100644 --- a/src2/mesh/edges.js +++ b/src2/mesh/edges.js @@ -1,7 +1,7 @@ /** Copyright Stewart Allen -- All Rights Reserved */ /** - * facet edge selecetor. allows for creating new facets + * facet edge selector. allows for creating new facets * when two connected edges share a single point. */ diff --git a/src2/mesh/work.js b/src2/mesh/work.js index 663aa7e4..696b1e1c 100644 --- a/src2/mesh/work.js +++ b/src2/mesh/work.js @@ -4,6 +4,7 @@ import "../ext/earcut.js"; import '../add/array.js'; import '../add/class.js'; import '../add/three.js'; + import { version } from '../moto/license.js'; import { client as motoClient } from '../moto/client.js'; import { worker } from '../moto/worker.js'; @@ -26,7 +27,7 @@ const work = { cache }; motoClient.start(`/v2/lib/mesh/pool.js?${version}`, motoClient.max() * 0); function log(msg) { - return motoWorker.publish("mesh.log", msg); + return worker.publish("mesh.log", msg); } function cacheUpdate(id, data) { diff --git a/web2/README.md b/web2/README.md deleted file mode 100644 index 2d743520..00000000 --- a/web2/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Mesh:Tool Development Server - -This is the development server setup for Mesh:Tool, a browser-based 3D mesh editor. - -## Running the Development Server - -1. Make sure you have Node.js installed -2. Install serve globally (optional): - ```bash - npm install -g serve - ``` -3. Run the development server: - ```bash - npx serve -l 5432 - ``` -4. Open your browser to http://localhost:5432/mesh - -## Development Notes - -- The server is configured to handle symlinks and path mappings through `serve.json` -- CORS headers are set to allow WebAssembly modules to load properly -- Static assets are served from the `lib` directory -- Source code is served from the `src2` directory -- Fonts are served from `/font` and `/fon2` directories - -## Troubleshooting - -If you encounter CORS or WebAssembly loading issues: -1. Make sure you're using a modern browser that supports SharedArrayBuffer -2. Check that the CORS headers are being applied correctly -3. Verify that all paths in index.html are correct for your setup \ No newline at end of file diff --git a/web2/serve.json b/web2/serve.json deleted file mode 100644 index 68cef946..00000000 --- a/web2/serve.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "headers": [ - { - "source": "**/*", - "headers": [ - { - "key": "Cross-Origin-Embedder-Policy", - "value": "require-corp" - }, - { - "key": "Cross-Origin-Opener-Policy", - "value": "same-origin" - } - ] - } - ] -} \ No newline at end of file