Comments (11)
You should execute build scripts from MeshLib root directory, like this
Lines 196 to 220 in d64b98a
The problem has been resolved, thanks to this excellent library and your outstanding contributions.
from meshlib.
Hello! MeshLib can be built with emscripten, and run in browser. You can have a look at https://app.meshinspector.com/ that is powered by MeshLib!
from meshlib.
Hello! MeshLib can be built with emscripten, and run in browser. You can have a look at https://app.meshinspector.com/ that is powered by MeshLib!
I noticed, that is great! I wonder how to build meshlib with emscripten and i need to use some of these features. Do I compile the meshlib library through emscripten first, and then convert it to a wasm file through emcmake?
from meshlib.
If you want to use meshlib in your wasm project you need to compile it with emscripten and link with your project, so there will be only one wasm file.
Otherwise if you want to use meshlib wasm function in your js: first you need to expose needed functions with cpp code like this
MeshLib/source/MRViewer/MRViewer.cpp
Lines 57 to 101 in c924dfb
than compile meshlib with your cpp files (that expose needed functions). Than use this functions in your project.
You can find more information about emscripten on thier official page https://emscripten.org/ (we use emsdk 3.1.23
)
from meshlib.
If you want to use meshlib in your wasm project you need to compile it with emscripten and link with your project, so there will be only one wasm file. Otherwise if you want to use meshlib wasm function in your js: first you need to expose needed functions with cpp code like this
MeshLib/source/MRViewer/MRViewer.cpp
Lines 57 to 101 in c924dfb
than compile meshlib with your cpp files (that expose needed functions). Than use this functions in your project. You can find more information about emscripten on thier official page https://emscripten.org/ (we use emsdk
3.1.23
)
Thanks, I'll give it a try.
from meshlib.
If you want to use meshlib in your wasm project you need to compile it with emscripten and link with your project, so there will be only one wasm file. Otherwise if you want to use meshlib wasm function in your js: first you need to expose needed functions with cpp code like this
MeshLib/source/MRViewer/MRViewer.cpp
Lines 57 to 101 in c924dfb
than compile meshlib with your cpp files (that expose needed functions). Than use this functions in your project. You can find more information about emscripten on thier official page https://emscripten.org/ (we use emsdk
3.1.23
)Thanks, I'll give it a try.
I also need to convert my project to wasm for browser call, how to do it with Emscripten, thank you very much!
from meshlib.
If you want your project to run in browesr you need to compile it with emsdk you can have a look at our cmake files and build scripts for example
https://github.com/MeshInspector/MeshLib/blob/master/CMakeLists.txt
https://github.com/MeshInspector/MeshLib/blob/master/scripts/build_thirdparty.sh
https://github.com/MeshInspector/MeshLib/blob/master/scripts/build_source.sh
https://github.com/MeshInspector/MeshLib/blob/master/docker/emscriptenDockerfile
also you can compile MeshLib
Lines 196 to 220 in d64b98a
from meshlib.
Hello! MeshLib can be built with emscripten, and run in browser. You can have a look at https://app.meshinspector.com/ that is powered by MeshLib!
For example, I currently have this main.cpp file๏ผ examples/cmake-example/main.cpp , and I'd like to compile it into wasm for JavaScript usage. I've already executed commands like cd MeshLib
, ./scripts/build_thirdparty.sh
, and ./scripts/build_sources.sh
inside a container built from an EmscriptenDockerfile. My project is located under the /example
. What should I do next to compile /example/main.cpp
into wasm? I would greatly appreciate it if you could provide specific instructions.
from meshlib.
This exapmle is not meant for wasm, thanks for pointing on it! We will work on enother one.
Simpliest way for you now is to modify code here
https://github.com/MeshInspector/MeshLib/blob/master/source/MRViewerApp
https://github.com/MeshInspector/MeshLib/blob/master/source/MRViewerApp/MRViewerApp.cpp
and use our scripts.
More complex solution is to create your own project folder and include it as subdirectory to our main cmake.
Hope it helps!
from meshlib.
This exapmle is not meant for wasm, thanks for pointing on it! We will work on enother one. Simpliest way for you now is to modify code here https://github.com/MeshInspector/MeshLib/blob/master/source/MRViewerApp https://github.com/MeshInspector/MeshLib/blob/master/source/MRViewerApp/MRViewerApp.cpp and use our scripts. More complex solution is to create your own project folder and include it as subdirectory to our main cmake.
Hope it helps!
Thank you very much for your response. Here are the steps I followed:
cd MeshLib/source/MRViewerApp
mkdir build
cd build
emcmake cmake ..
However, it's reporting the following errors. Should I specify the paths for ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
and ${MR_RESOURCES_DIR}
? If so, how should I set them?
CMake Error at CMakeLists.txt:10 (file):
file COPY given no DESTINATION
CMake Error at CMakeLists.txt:33 (install):
install FILES given no DESTINATION!
from meshlib.
You should execute build scripts from MeshLib root directory, like this
Lines 196 to 220 in d64b98a
from meshlib.
Related Issues (20)
- Expose RelaxKeepVolume HOT 5
- VSCode Autocompletion of `.so` files HOT 6
- line self-intersection HOT 2
- Local setup HOT 5
- Error while showing numpad keys in F1 menu
- Negative offsetting in offsetMesh HOT 1
- Negative offset in thickenMesh results in incorrect filling of mesh HOT 3
- Readme installation steps are incorrect for Linux HOT 4
- Installation on Linux when sudo privileges are not available HOT 1
- Python Meshlib DistanceMap Interpolation Issue HOT 2
- meshlib.mrmeshpy.uniteCloseVertices does not exist in Python HOT 4
- Plane cut HOT 2
- Minkowski Sum in python HOT 2
- Problems in refine in cylinder mesh HOT 1
- add possibility to support rectangular planes
- setup z scale as ( ScaleX + ScaleY ) / 2 for plane feature HOT 1
- Creating grid meshes based on arbitrary shape input HOT 29
- Create a 3D Mesh from a list of vertices and faces. HOT 3
- Hole & Boundary edge length in Python HOT 5
- The Angle between two vectors is 0 to pi, why not 0-2pi HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meshlib.