Skip to content

Commit

Permalink
refactor(wasm/examples): support export models without web worker (#822)
Browse files Browse the repository at this point in the history
* refactor(wasm/examples): support `evaluateCADToModel` without web worker

* test: copy test

* chore: update vitest

* chore: revert some

* chore: revert more

* refactor: simplify worker-wrapper.ts

* chore: revert format

* test: fix cleanup

* refactor: single module

* chore: format

* chore: revert .vscode/settings.json

* chore: format

* test: tweak

* chore: format

* chore: rename

* refactor: minor

* chore: remove wrong lock file

* added resetToCircularDefaults

* cleanup

* added headers

* removed vitest/web-worker

---------

Co-authored-by: Emmett Lalish <[email protected]>
  • Loading branch information
hi-ogawa and elalish authored May 28, 2024
1 parent 376d317 commit 4fb3520
Show file tree
Hide file tree
Showing 11 changed files with 1,715 additions and 414 deletions.
2 changes: 2 additions & 0 deletions bindings/wasm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
manifold.js
manifold.wasm
1 change: 1 addition & 0 deletions bindings/wasm/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,5 @@ EMSCRIPTEN_BINDINGS(whatever) {
function("setMinCircularEdgeLength", &Quality::SetMinCircularEdgeLength);
function("setCircularSegments", &Quality::SetCircularSegments);
function("getCircularSegments", &Quality::GetCircularSegments);
function("resetToCircularDefaults", &Quality::ResetToDefaults);
}
3 changes: 2 additions & 1 deletion bindings/wasm/examples/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import ManifoldWorker from './worker?worker';
import ManifoldWorker from './worker-wrapper?worker';

const CODE_START = '<code>';
// Loaded globally by examples.js
Expand Down Expand Up @@ -276,6 +276,7 @@ declare interface ManifoldToplevel {
setMinCircularEdgeLength: typeof T.setMinCircularEdgeLength;
setCircularSegments: typeof T.setCircularSegments;
getCircularSegments: typeof T.getCircularSegments;
resetToCircularDefaults: typeof T.resetToCircularDefaults;
setup: () => void;
}
declare const module: ManifoldToplevel;
Expand Down
Loading

0 comments on commit 4fb3520

Please sign in to comment.