@splinetool/modelling-wasm 0.9.93 → 0.9.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,62 +1 @@
1
1
  # modelling-wasm
2
-
3
- ## Description
4
-
5
- This sub-repo contains all of the code for the subdivision surface modeling tools. It is largely comprised of C++ code that is compiled to WebAssembly. The `web` folder is for prototyping / testing in an isolated environment.
6
-
7
- A subdivision surface is represented by the `spl::SubdivisionSurface` class. Internally, this class actually maintains two different, interlinked data structures. The first is a customized version of the `pmp::Surface_mesh` class. This class serves as the low-level, halfedge mesh representation. Any topological changes / edits are made on this data structure and then propagated to the second data structure, which is an `OpenSubdiv::Far::TopologyRefiner`. This is necessary because internally, OpenSubdiv uses its own custom representation to accelerate the mesh refinement process.
8
-
9
- While all of this "back-and-forth" cross-talk between different representations might seem like a lot of work (read: slow), it is actually quite optimized. We follow a similar procedure to the one titled "custom factory for direct conversion," outlined in the [OpenSubdiv documentation](https://graphics.pixar.com/opensubdiv/docs/far_overview.html). Basically, there is a custom "conversion" class in `conversion.h` that is specifically designed to convert a `pmp::Surface_mesh` instance into the equivalent OpenSubdiv data structure.
10
-
11
- ## References
12
-
13
- - [Emscripten and Ninja](https://github.com/emscripten-core/emscripten/issues/10412)
14
- - [Emscripten and C++ Starter CMake Project](https://gist.github.com/WesThorburn/00c47b267a0e8c8431e06b14997778e4)
15
- - [OpenSubdiv Documentation](https://graphics.pixar.com/opensubdiv/docs/intro.html)
16
-
17
- ## Dependencies
18
-
19
- Right now, this project has the following dependencies:
20
-
21
- - OpenSubdiv (C++)
22
- - PMP (C++)
23
-
24
- And for the prototype web app:
25
-
26
- - Three.js
27
- - OrbitControls (part of the Three.js `examples` folder)
28
- - BufferGeometryUtils (same as above)
29
- - TransformControls (same as above)
30
-
31
- OpenSubdiv and PMP are both submodules that must be initialized after cloning this repository (see notes below).
32
-
33
- ## Installation
34
-
35
- Install the git submodules needed for this repo with: `git submodule update --init --recursive`. The only submodules at the moment are PMP and OpenSubdiv.
36
-
37
- #### MacOS
38
-
39
- You need to install Emscripten, cmake and Ninja build system:
40
-
41
- ```sh
42
- brew install emscripten cmake ninja
43
- ```
44
-
45
- #### Windows
46
-
47
- First, install Emscripten. Open the Emscripten command prompt (or `cmd` and run `emsdk_env.bat` to set up the necessary environment variables).
48
-
49
- Install Ninja (build system). Ensure that `ninja.exe` is in your `PATH`
50
-
51
- ## Build
52
-
53
- Run `yarn build` or:
54
-
55
- - Create a folder called `build` inside this repository - navigate into this directory: `mkdir build && cd build`
56
- - Inside `build` run `emcmake cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..`
57
- - Next, run `cmake --build .` - this will generate a pair of `.wasm` + `.js` files in the `web` directory
58
- - Navigate into the `web` directory and start up an HTTP server: `python3 -m http.server`
59
- - Open your browser: `localhost:8000`
60
- - For convenience: if you already built the binary once and but changed something and want to quickly build again, you can from `packages/modelling-wasm/build` run `cd .. && rm -rf build && mkdir build && cd build && emcmake cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. && cmake --build . -jXX` where XX is should be less than the 2\*number of cores in your CPU.
61
-
62
- Note: for code completion in VS Code, make sure you install the "CMake" and "CMake Integration" addons.
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splinetool/modelling-wasm",
3
- "version": "0.9.93",
3
+ "version": "0.9.98",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "./build/process.js",
@@ -19,4 +19,4 @@
19
19
  "rimraf": "^3.0.2",
20
20
  "serve": "^12.0.1"
21
21
  }
22
- }
22
+ }