MeshLib
 
Loading...
Searching...
No Matches
Overview

MeshLib

MeshLib is 3D geometry library that allows you to make your applications based on it or perform some 3D operations using it as application or library with c++ or python

Build with VS2019 or VS2022 on Windows

$ git clone https://github.com/MeshInspector/MeshLib.git
$ cd MeshLib
$ git submodule update --init --recursive
$ cd ..

Note: following below steps will take about 40Gb of your disk space.

Preparing Third Parties
Some third parties are taken from vcpkg, while others (missing in vcpkg) are configured as git submodules.

Cuda: Please install CUDA (v12.0|v11.4)(Visual Studio 2022|2019) from official site

Vcpkg:

  1. Please install vcpkg, and integrate it into Visual Studio (note that vcpkg requires English language pack in Visual Studio, and vcpkg cannot be installed on FAT volumes, only on NTFS):
    $ git clone https://github.com/Microsoft/vcpkg.git
    $ cd vcpkg
    $ git checkout 2024.06.15
    $ .\bootstrap-vcpkg.bat
    $ .\vcpkg integrate install (with admin rights)
    $ cd ..
    More details here: vcpkg
  2. Execute install.bat
    $ cd MeshLib/thirdparty
    $ install.bat
  3. Open solution file MeshInspector/source/MeshLib.sln in Visual Studio. Build it and run.

Build with CMake on Linux

This installation was checked on Ubuntu 20.04.4 with cmake 3.19.3 and gcc 9.3.0.
Installation process is automated, but takes ~40 minutes if no required packages are already installed..
Install/Build dependencies. Build project. Run Test Application Run the following in terminal:

$ git clone https://github.com/MeshInspector/MeshLib.git
$ cd MeshLib
$ ./scripts/install_requirements.sh
$ ./scripts/build.sh
$ ./scripts/install_MR.sh #optional
$ ./build/Release/bin/MRTest
Note
./scripts/install*.sh scripts required root access sometimes during installation. However, it's not recommended to run the whole script with sudo.
Note
You could specify build type to Debug by export MESHLIB_BUILD_TYPE=Debug , Release is default.

Build with Emscripten on Linux

This installation was checked on Ubuntu 20.04.4 with emscripten 3.1.23.

  1. Install Emscripten (find more on emscripten official page)
    $ git clone https://github.com/emscripten-core/emsdk.git
    $ cd emsdk
    $ git pull # optional
    $ ./emsdk install 3.1.23 # (or enother version / latest)
    $ ./emsdk activate 3.1.23
    $ source ./emsdk_env.sh
  2. Build
    cd ~/MeshInspectorCode
    $ ./scripts/build_thirdparty.sh # select emscripten in the corresponding question
    $ ./scripts/build_sorces.sh # select emscripten in the corresponding question
  3. Run
    $ python3 ./scripts/local_server.py
    $ open in browser 127.0.0.1:8000

Python integration

Although MeshLib is written in C++, all functions are exposed to Python as well. Python code can be executed both from within a MeshLib-based C++ application (embedded mode) and from python interpreter directly, which imports MeshLib modules.
Moreover, MeshLib can be easily installed as a Python 3.8 - 3.12 package using pip install:

  • On Windows via
    py -3 -m pip install --upgrade pip
    py -3 -m pip install --upgrade meshlib
  • On Linuxes supporting manylinux_2_31+, including Ubuntu 20+ and Fedora 32+ via
    sudo apt install python3-pip
    python3 -m pip install --upgrade pip
    python3 -m pip install --upgrade meshlib
  • On macOS 12.0+ via
    pip install --upgrade pip
    pip install --upgrade meshlib

Find more: