diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index bae9026e7283..b6017c78f9bc 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -34,6 +34,7 @@ jobs: uses: actions/checkout@v7 with: repository: 'MeshInspector/MeshInspector.github.io' + ref: 'feature/md' path: 'MeshInspector.github.io/' token: ${{ secrets.MESHINSPECTOR_BOT_TOKEN }} submodules: recursive @@ -105,4 +106,5 @@ jobs: git config user.name "meshinspector-bot" git add -A git commit --allow-empty -m "Auto update docs" -a - git push + # feature/md carries the Markdown-era Doxyfile until it merges; master serves the site + git push origin HEAD:master diff --git a/docs/third_party_licenses.md b/docs/third_party_licenses.md index e73113d9599b..d20580305588 100644 --- a/docs/third_party_licenses.md +++ b/docs/third_party_licenses.md @@ -19,7 +19,7 @@ to** MeshLib's own top-level `LICENSE`, which covers only MeshLib itself. the modules that bundle it, the SPDX-ish license id, the upstream, and the **version the text was curated against**. -The inclusion list is `doxygen/general_pages/ThirdpartyList.dox`, reconciled against +The inclusion list is `doxygen/general_pages/ThirdpartyList.md`, reconciled against `.gitmodules` and `thirdparty/vcpkg/vcpkg.json`. Build- and test-only submodules (googletest, mrbind) are not shipped and are excluded (see `EXCLUDED_SUBMODULES` in the checker). diff --git a/doxygen/common_files/CommonDistributionProperties.dox b/doxygen/common_files/CommonDistributionProperties.dox deleted file mode 100644 index 9d3a63cefc7b..000000000000 --- a/doxygen/common_files/CommonDistributionProperties.dox +++ /dev/null @@ -1,16 +0,0 @@ - - Debug only: - - **Debug Configuration: C/C++ → Preprocessor → Preprocessor Definitions**: - \n Add: `_ITERATOR_DEBUG_LEVEL=0;MR_ITERATOR_DEBUG_LEVEL=0` — for the per-Visual-Studio archives (`MeshLibDistVS19`, `MeshLibDistVS22`, `MeshLibDistVS26`, `MeshLibDistVS26-arm64`). - \n For the `MeshLibDist-IteratorDebug` archive add `_ITERATOR_DEBUG_LEVEL=2;MR_ITERATOR_DEBUG_LEVEL=2` instead. Both defines must carry the same value: MeshLib stops compilation with `#error _ITERATOR_DEBUG_LEVEL is inconsistent with MeshLib` when they disagree. - \n Check whether your archive contains `install/include/MRMesh/config_dist.h`. If it does, that header already declares `MR_ITERATOR_DEBUG_LEVEL` for you, so only `_ITERATOR_DEBUG_LEVEL` is yours to set — and `IteratorDebug` then needs no define at all, MSVC's Debug default already being `2`. Setting `MR_ITERATOR_DEBUG_LEVEL` anyway is harmless as long as it matches the archive; a value that contradicts it is rejected at compile time. - - For all configurations: - - **Solution Platform**: - \n Set: `x64` - - **General Properties -> C++ Language Standard**: - \n Set: `/std:c++20` or later - - **C/C++ → General → Additional Include Directories**: - \n Add: `C:\meshlib-built\install\include` - - **C/C++ → All Options → Additional Options**: - \n Add: `/bigobj /utf-8` - - **Linker → Input → Additional Dependencies**: - \n Add: `C:\meshlib-built\install\lib\$(Configuration)\*.lib` \ No newline at end of file diff --git a/doxygen/common_files/CommonDistributionProperties.md b/doxygen/common_files/CommonDistributionProperties.md new file mode 100644 index 000000000000..7bead17201a5 --- /dev/null +++ b/doxygen/common_files/CommonDistributionProperties.md @@ -0,0 +1,16 @@ + - Debug only: + - **Debug Configuration: C/C++ → Preprocessor → Preprocessor Definitions**: +
Add: `_ITERATOR_DEBUG_LEVEL=0;MR_ITERATOR_DEBUG_LEVEL=0` — for the per-Visual-Studio archives (`MeshLibDistVS19`, `MeshLibDistVS22`, `MeshLibDistVS26`, `MeshLibDistVS26-arm64`). +
For the `MeshLibDist-IteratorDebug` archive add `_ITERATOR_DEBUG_LEVEL=2;MR_ITERATOR_DEBUG_LEVEL=2` instead. Both defines must carry the same value: MeshLib stops compilation with `#error _ITERATOR_DEBUG_LEVEL is inconsistent with MeshLib` when they disagree. +
Check whether your archive contains `install/include/MRMesh/config_dist.h`. If it does, that header already declares `MR_ITERATOR_DEBUG_LEVEL` for you, so only `_ITERATOR_DEBUG_LEVEL` is yours to set — and `IteratorDebug` then needs no define at all, MSVC's Debug default already being `2`. Setting `MR_ITERATOR_DEBUG_LEVEL` anyway is harmless as long as it matches the archive; a value that contradicts it is rejected at compile time. + - For all configurations: + - **Solution Platform**: +
Set: `x64` + - **General Properties -> C++ Language Standard**: +
Set: `/std:c++20` or later + - **C/C++ → General → Additional Include Directories**: +
Add: `C:\meshlib-built\install\include` + - **C/C++ → All Options → Additional Options**: +
Add: `/bigobj /utf-8` + - **Linker → Input → Additional Dependencies**: +
Add: `C:\meshlib-built\install\lib\$(Configuration)\*.lib` \ No newline at end of file diff --git a/doxygen/common_files/JsUsingNote.dox b/doxygen/common_files/JsUsingNote.dox deleted file mode 100644 index 856affa6790f..000000000000 --- a/doxygen/common_files/JsUsingNote.dox +++ /dev/null @@ -1 +0,0 @@ -\note The `using` declaration requires Node.js 24+ or a modern browser. On older runtimes, call `.delete()` on each object instead (see \ref JsMemoryManagement "Memory Management" in the JavaScript Setup Guide). diff --git a/doxygen/common_files/JsUsingNote.md b/doxygen/common_files/JsUsingNote.md new file mode 100644 index 000000000000..56247a1bd4c8 --- /dev/null +++ b/doxygen/common_files/JsUsingNote.md @@ -0,0 +1,2 @@ +> [!NOTE] +> The `using` declaration requires Node.js 24+ or a modern browser. On older runtimes, call `.delete()` on each object instead (see [Memory Management](\ref JsMemoryManagement) in the JavaScript Setup Guide). diff --git a/doxygen/examples/BasedApplication.dox b/doxygen/examples/BasedApplication.md similarity index 77% rename from doxygen/examples/BasedApplication.dox rename to doxygen/examples/BasedApplication.md index 30719ef2d49a..b347557a108b 100644 --- a/doxygen/examples/BasedApplication.dox +++ b/doxygen/examples/BasedApplication.md @@ -1,5 +1,4 @@ -/** - \page BasedApplication Basing your application on MeshLib +# Basing your application on MeshLib {#BasedApplication}
@@ -9,6 +8,3 @@ First of all you should make `main` function like this Then you should make your plugins, to find how have a look at \ref StatePluginsHelp page
- - */ - \ No newline at end of file diff --git a/doxygen/examples/Collision.dox b/doxygen/examples/Collision.md similarity index 81% rename from doxygen/examples/Collision.dox rename to doxygen/examples/Collision.md index 8d0526da7f2e..cc48bb871d76 100644 --- a/doxygen/examples/Collision.dox +++ b/doxygen/examples/Collision.md @@ -1,5 +1,4 @@ -/** - \page ExampleDetectCollisions Detect collisions of two meshes +# Detect collisions of two meshes {#ExampleDetectCollisions} Following code presents example of finding collision triangles of two meshes @@ -9,20 +8,18 @@ Following code presents example of finding collision triangles of two meshes - C++ \include Collision.dox.cpp - + - Python \include Collision.dox.py - + - C \include Collision.dox.c - + - C# \include Collision.dox.cs - + - JavaScript \include Collision.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md - - */ diff --git a/doxygen/examples/CollisionPrecise.dox b/doxygen/examples/CollisionPrecise.md similarity index 81% rename from doxygen/examples/CollisionPrecise.dox rename to doxygen/examples/CollisionPrecise.md index 539b4e0e9579..eb4e917d7ff3 100644 --- a/doxygen/examples/CollisionPrecise.dox +++ b/doxygen/examples/CollisionPrecise.md @@ -1,5 +1,4 @@ -/** - \page ExampleDetectCollisionsPrecise Precise detect collisions of two meshes +# Precise detect collisions of two meshes {#ExampleDetectCollisionsPrecise} Following code presents example of finding preceise collision triangles and edges of two meshes @@ -9,20 +8,18 @@ Following code presents example of finding preceise collision triangles and edge - C++ \include CollisionPrecise.dox.cpp - + - Python \include CollisionPrecise.dox.py - + - C \include CollisionPrecise.dox.c - + - C# \include CollisionPrecise.dox.cs - + - JavaScript \include CollisionPrecise.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md - - */ diff --git a/doxygen/examples/CollisionSelf.dox b/doxygen/examples/CollisionSelf.md similarity index 76% rename from doxygen/examples/CollisionSelf.dox rename to doxygen/examples/CollisionSelf.md index c52f71a1ab98..e9d1ea300c98 100644 --- a/doxygen/examples/CollisionSelf.dox +++ b/doxygen/examples/CollisionSelf.md @@ -1,5 +1,4 @@ -/** - \page ExampleDetectSelfIntersections Find self-intersecting triangles of single mesh +# Find self-intersecting triangles of single mesh {#ExampleDetectSelfIntersections} Following code presents example of finding self-intersecting triangles of single mesh @@ -7,20 +6,18 @@ Following code presents example of finding self-intersecting triangles of single - C++ \include CollisionSelf.dox.cpp - + - Python \include CollisionSelf.dox.py - + - C \include CollisionSelf.dox.c - + - C# \include CollisionSelf.dox.cs - + - JavaScript \include CollisionSelf.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md - - */ diff --git a/doxygen/examples/CudaOffset.dox b/doxygen/examples/CudaOffset.md similarity index 86% rename from doxygen/examples/CudaOffset.dox rename to doxygen/examples/CudaOffset.md index 7c4dac141f06..a613964f0639 100644 --- a/doxygen/examples/CudaOffset.dox +++ b/doxygen/examples/CudaOffset.md @@ -1,14 +1,11 @@ -/** - \page ExampleCudaOffset Offset with Cuda +# Offset with Cuda {#ExampleCudaOffset} Example of Python usage of Cuda to offset mesh
- + - Python You can use CUDA-driven offset for faster healing mesh with holes, example healing script can be found [here](https://github.com/MeshInspector/MeshLib/blob/master/python_scripts/healer.py) \include CudaOffset.dox.py
- - */ \ No newline at end of file diff --git a/doxygen/examples/ExampleContourTriangulation.dox b/doxygen/examples/ExampleContourTriangulation.md similarity index 78% rename from doxygen/examples/ExampleContourTriangulation.dox rename to doxygen/examples/ExampleContourTriangulation.md index 8c64ea03f110..72ea9149ad68 100644 --- a/doxygen/examples/ExampleContourTriangulation.dox +++ b/doxygen/examples/ExampleContourTriangulation.md @@ -1,20 +1,16 @@ -/** - \page ExampleContourTriangulation Contour Triangulation Example +# Contour Triangulation Example {#ExampleContourTriangulation} Example of generating a triangulation from a contour.
- + - C++ \include ContourTriangulation.dox.cpp - + - Python \include ContourTriangulation.dox.py - + - C \include ContourTriangulation.dox.c
- - */ - \ No newline at end of file diff --git a/doxygen/examples/ExampleFusion.dox b/doxygen/examples/ExampleFusion.md similarity index 77% rename from doxygen/examples/ExampleFusion.dox rename to doxygen/examples/ExampleFusion.md index c3266ffe4a27..85aaa5e2cedd 100644 --- a/doxygen/examples/ExampleFusion.dox +++ b/doxygen/examples/ExampleFusion.md @@ -1,24 +1,20 @@ -/** - \page ExampleFusion Fusion Example +# Fusion Example {#ExampleFusion} Example of Fusion.
- + - C++ \include Fusion.dox.cpp - + - Python \include Fusion.dox.py - + - C \include Fusion.dox.c - + - JavaScript \include Fusion.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ - \ No newline at end of file diff --git a/doxygen/examples/ExamplePointsToMesh.dox b/doxygen/examples/ExamplePointsToMesh.md similarity index 78% rename from doxygen/examples/ExamplePointsToMesh.dox rename to doxygen/examples/ExamplePointsToMesh.md index 333df6928d6d..0b81c23d1626 100644 --- a/doxygen/examples/ExamplePointsToMesh.dox +++ b/doxygen/examples/ExamplePointsToMesh.md @@ -1,24 +1,20 @@ -/** - \page ExamplePointsToMesh Points to Mesh Example +# Points to Mesh Example {#ExamplePointsToMesh} Example of generating a triangulation from a pointcloud.
- + - C++ \include PointsToMesh.dox.cpp - + - Python \include PointsToMesh.dox.py - + - C \include PointsToMesh.dox.c - + - JavaScript \include PointsToMesh.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ - \ No newline at end of file diff --git a/doxygen/examples/ExampleTerrainTriangulation.dox b/doxygen/examples/ExampleTerrainTriangulation.md similarity index 80% rename from doxygen/examples/ExampleTerrainTriangulation.dox rename to doxygen/examples/ExampleTerrainTriangulation.md index be1fbc73a0a6..b06f769b26ee 100644 --- a/doxygen/examples/ExampleTerrainTriangulation.dox +++ b/doxygen/examples/ExampleTerrainTriangulation.md @@ -1,20 +1,16 @@ -/** - \page ExampleTerrainTriangulation Terrain Triangulation Example +# Terrain Triangulation Example {#ExampleTerrainTriangulation} Example of generating a triangulation from a terrain scan (specific pointcloud).
- + - C++ \include TerrainTriangulation.dox.cpp - + - Python \include TerrainTriangulation.dox.py - + - C \include TerrainTriangulation.dox.c
- - */ - \ No newline at end of file diff --git a/doxygen/examples/Examples.dox b/doxygen/examples/Examples.md similarity index 83% rename from doxygen/examples/Examples.dox rename to doxygen/examples/Examples.md index 81034c2d09fe..41ccee6c0be4 100644 --- a/doxygen/examples/Examples.dox +++ b/doxygen/examples/Examples.md @@ -1,6 +1,4 @@ -/** - -\page Examples MeshLib Code Samples +# MeshLib Code Samples {#Examples} # Code Samples for MeshLib @@ -8,11 +6,11 @@ This page contains some examples of using MeshLib A number of these operations also run interactively in the browser: see the [live demo](https://demo.meshlib.io/). -\subsection CppApplication C++ Application Based on MeshLib +## C++ Application Based on MeshLib {#CppApplication} - \ref BasedApplication -\subsection GeneralExamples General Samples +## General Samples {#GeneralExamples} - \ref ExampleMeshLoadSave - \ref ExampleMeshExport @@ -40,13 +38,13 @@ A number of these operations also run interactively in the browser: see the [liv - \ref ExampleFusion - \ref ExampleMeshFromText -\subsection Collisions Collisions +## Collisions {#Collisions} - \ref ExampleDetectCollisions - \ref ExampleDetectCollisionsPrecise - \ref ExampleDetectSelfIntersections -\subsection PythonSpecificExamples Python Specific Samples +## Python Specific Samples {#PythonSpecificExamples} - \ref ExampleViewer - \ref ExampleViewerVolumeRender @@ -55,5 +53,3 @@ A number of these operations also run interactively in the browser: see the [liv - \ref ExampleNumpyTriangulation - \ref ExampleCudaOffset - \ref ExampleDicomFiles - -*/ \ No newline at end of file diff --git a/doxygen/examples/FreeFormDeformation.dox b/doxygen/examples/FreeFormDeformation.md similarity index 78% rename from doxygen/examples/FreeFormDeformation.dox rename to doxygen/examples/FreeFormDeformation.md index 594b5041d9e6..1f0baafa744e 100644 --- a/doxygen/examples/FreeFormDeformation.dox +++ b/doxygen/examples/FreeFormDeformation.md @@ -1,30 +1,28 @@ -/** - \page ExampleFreeForm Free Form Deformation Example +# Free Form Deformation Example {#ExampleFreeForm} Example of using Free Form deformation of the mesh ▶ [See it live in the browser](https://demo.meshlib.io/#deform)
- + - C++ \include FreeFormDeformation.dox.cpp - + - Python -\note Python API version 3 and later - +> [!NOTE] +> Python API version 3 and later + \include FreeFormDeformation.dox.py - + - C \include FreeFormDeformation.dox.c - + - C# \include FreeFormDeformation.dox.cs - + - JavaScript \include FreeFormDeformation.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ \ No newline at end of file diff --git a/doxygen/examples/GlobalRegistration.dox b/doxygen/examples/GlobalRegistration.md similarity index 83% rename from doxygen/examples/GlobalRegistration.dox rename to doxygen/examples/GlobalRegistration.md index 2488313c3f2b..3184d6a371a2 100644 --- a/doxygen/examples/GlobalRegistration.dox +++ b/doxygen/examples/GlobalRegistration.md @@ -1,12 +1,11 @@ -/** - \page ExampleGlobalRegistration Global Registration +# Global Registration {#ExampleGlobalRegistration} Example of Global Registration ▶ [See it live in the browser](https://demo.meshlib.io/#registration)
- + - C++ \include GlobalRegistration.dox.cpp - Python @@ -17,8 +16,6 @@ Example of Global Registration \include GlobalRegistration.dox.cs - JavaScript \include GlobalRegistration.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ \ No newline at end of file diff --git a/doxygen/examples/LaplacianExample.dox b/doxygen/examples/LaplacianExample.md similarity index 71% rename from doxygen/examples/LaplacianExample.dox rename to doxygen/examples/LaplacianExample.md index efb50fb8dd74..aeddc2a90a90 100644 --- a/doxygen/examples/LaplacianExample.dox +++ b/doxygen/examples/LaplacianExample.md @@ -1,25 +1,23 @@ -/** - \page ExampleLaplacian Laplacian deformation Example +# Laplacian deformation Example {#ExampleLaplacian} Example of using Laplacian deformer
- + - C++ \include LaplacianDeformation.dox.cpp - + - Python -\note Python API version 3 and later - +> [!NOTE] +> Python API version 3 and later + \include LaplacianExample.dox.py - + - C \include LaplacianDeformation.dox.c - + - JavaScript \include LaplacianDeformation.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ \ No newline at end of file diff --git a/doxygen/examples/MeshBoolean.dox b/doxygen/examples/MeshBoolean.md similarity index 78% rename from doxygen/examples/MeshBoolean.dox rename to doxygen/examples/MeshBoolean.md index d7eb81d8223d..df9024c3fd20 100644 --- a/doxygen/examples/MeshBoolean.dox +++ b/doxygen/examples/MeshBoolean.md @@ -1,11 +1,10 @@ -/** - \page ExampleMeshBoolean Mesh Boolean +# Mesh Boolean {#ExampleMeshBoolean} Example of boolean operation -The optional \ref MR::BooleanResultMapper "BooleanResultMapper" passed to the operation maps faces, +The optional [BooleanResultMapper](\ref MR::BooleanResultMapper) passed to the operation maps faces, vertices and edges of the input meshes to the primitives of the result mesh, and its -\ref MR::BooleanResultMapper::getNew2OldFaceMap "getNew2OldFaceMap" maps the faces back. +[getNew2OldFaceMap](\ref MR::BooleanResultMapper::getNew2OldFaceMap) maps the faces back. ▶ [See it live in the browser](https://demo.meshlib.io/#boolean) @@ -17,36 +16,34 @@ Source meshes \image html boolean_before.png Boolean intersection \image html boolean_after.png - + - Python \include MeshBoolean.dox.py Source meshes \image html boolean_before.png Boolean intersection \image html boolean_after.png - + - C \include MeshBoolean.dox.c Source meshes \image html boolean_before.png Boolean intersection \image html boolean_after.png - + - C# \include MeshBoolean.dox.cs Source meshes \image html boolean_before.png Boolean intersection \image html boolean_after.png - + - JavaScript \include MeshBoolean.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md Source meshes \image html boolean_before.png Boolean intersection \image html boolean_after.png - - */ \ No newline at end of file diff --git a/doxygen/examples/MeshDecimate.dox b/doxygen/examples/MeshDecimate.md similarity index 91% rename from doxygen/examples/MeshDecimate.dox rename to doxygen/examples/MeshDecimate.md index 868cd5364be5..5a4e3dcc79a6 100644 --- a/doxygen/examples/MeshDecimate.dox +++ b/doxygen/examples/MeshDecimate.md @@ -1,5 +1,4 @@ -/** - \page ExampleMeshDecimate Mesh Decimation +# Mesh Decimation {#ExampleMeshDecimate} Example of mesh decimation @@ -13,36 +12,34 @@ Source mesh \image html decimate_before.png After decimate \image html decimate_after.png - + - Python \include MeshDecimate.dox.py Source mesh \image html decimate_before.png After decimate \image html decimate_after.png - + - C \include MeshDecimate.dox.c Source mesh \image html decimate_before.png After decimate \image html decimate_after.png - + - C# \include MeshDecimate.dox.cs Source mesh \image html decimate_before.png After decimate \image html decimate_after.png - + - JavaScript \include MeshDecimate.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md Source mesh \image html decimate_before.png After decimate \image html decimate_after.png - - */ \ No newline at end of file diff --git a/doxygen/examples/MeshExport.dox b/doxygen/examples/MeshExport.md similarity index 74% rename from doxygen/examples/MeshExport.dox rename to doxygen/examples/MeshExport.md index 1ad0a7b93a96..b064426296ae 100644 --- a/doxygen/examples/MeshExport.dox +++ b/doxygen/examples/MeshExport.md @@ -1,5 +1,4 @@ -/** - \page ExampleMeshExport Mesh export +# Mesh export {#ExampleMeshExport} Export example of points and triangles from mesh (e.g. for rendering) @@ -7,20 +6,18 @@ Export example of points and triangles from mesh (e.g. for rendering) - C++ \include MeshExport.dox.cpp - + - Python -See a more relevant example \ref ExampleNumpy - +See a more relevant example: \ref ExampleNumpy + - C \include MeshExport.dox.c - + - C# \include MeshExport.dox.cs - + - JavaScript \include MeshExport.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md - - */ \ No newline at end of file diff --git a/doxygen/examples/MeshExtrude.dox b/doxygen/examples/MeshExtrude.md similarity index 80% rename from doxygen/examples/MeshExtrude.dox rename to doxygen/examples/MeshExtrude.md index b98205f4f508..a9b47b2ab2f8 100644 --- a/doxygen/examples/MeshExtrude.dox +++ b/doxygen/examples/MeshExtrude.md @@ -1,5 +1,4 @@ -/** - \page ExampleMeshExtrude Mesh extrude +# Mesh extrude {#ExampleMeshExtrude} Example of extrude faces on mesh @@ -13,8 +12,6 @@ Example of extrude faces on mesh \include MeshExtrude.dox.c - JavaScript \include MeshExtrude.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md - - */ \ No newline at end of file diff --git a/doxygen/examples/MeshFillHole.dox b/doxygen/examples/MeshFillHole.md similarity index 84% rename from doxygen/examples/MeshFillHole.dox rename to doxygen/examples/MeshFillHole.md index d821a6b7dde7..da32937375e7 100644 --- a/doxygen/examples/MeshFillHole.dox +++ b/doxygen/examples/MeshFillHole.md @@ -1,5 +1,4 @@ -/** - \page ExampleMeshFillHole Filling Holes +# Filling Holes {#ExampleMeshFillHole} Example of filling holes @@ -17,8 +16,6 @@ Example of filling holes \include MeshFillHole.dox.cs - JavaScript \include MeshFillHole.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md - - */ \ No newline at end of file diff --git a/doxygen/examples/MeshFromText.dox b/doxygen/examples/MeshFromText.md similarity index 83% rename from doxygen/examples/MeshFromText.dox rename to doxygen/examples/MeshFromText.md index 7b17573df4de..3180e25e1878 100644 --- a/doxygen/examples/MeshFromText.dox +++ b/doxygen/examples/MeshFromText.md @@ -1,5 +1,4 @@ -/** - \page ExampleMeshFromText Convert text to mesh +# Convert text to mesh {#ExampleMeshFromText} Following code presents example of converting text to mesh @@ -8,13 +7,11 @@ Following code presents example of converting text to mesh - C++ \include MeshFromText.dox.cpp \sa \ref MR::createSymbolsMesh - + - Python \include MeshFromText.dox.py - + - C \include MeshFromText.dox.c - - */ diff --git a/doxygen/examples/MeshICP.dox b/doxygen/examples/MeshICP.md similarity index 86% rename from doxygen/examples/MeshICP.dox rename to doxygen/examples/MeshICP.md index 65b46bb8d6e9..9923f1760906 100644 --- a/doxygen/examples/MeshICP.dox +++ b/doxygen/examples/MeshICP.md @@ -1,5 +1,4 @@ -/** - \page ExampleMeshICP Mesh ICP +# Mesh ICP {#ExampleMeshICP} Example of mesh ICP (finding transformation to match objects) @@ -17,8 +16,6 @@ Example of mesh ICP (finding transformation to match objects) \include MeshICP.dox.cs - JavaScript \include MeshICP.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md - - */ \ No newline at end of file diff --git a/doxygen/examples/MeshLoadSave.dox b/doxygen/examples/MeshLoadSave.md similarity index 83% rename from doxygen/examples/MeshLoadSave.dox rename to doxygen/examples/MeshLoadSave.md index 7ebc7a1842af..6399be9bb249 100644 --- a/doxygen/examples/MeshLoadSave.dox +++ b/doxygen/examples/MeshLoadSave.md @@ -1,5 +1,4 @@ -/** - \page ExampleMeshLoadSave Loading and saving mesh files +# Loading and saving mesh files {#ExampleMeshLoadSave} Following code presents example of loading and saving mesh file @@ -10,20 +9,18 @@ Following code presents example of loading and saving mesh file Further examples won't check return values for sake of clarity \sa \ref MR::MeshLoad \sa \ref MR::MeshSave - + - Python \include MeshLoadSave.dox.py - + - C \include MeshLoadSave.dox.c - + - C# \include MeshLoadSave.dox.cs - + - JavaScript \include MeshLoadSave.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md - - */ \ No newline at end of file diff --git a/doxygen/examples/MeshModification.dox b/doxygen/examples/MeshModification.md similarity index 80% rename from doxygen/examples/MeshModification.dox rename to doxygen/examples/MeshModification.md index e831a3b9bc7f..0f2da15e40ce 100644 --- a/doxygen/examples/MeshModification.dox +++ b/doxygen/examples/MeshModification.md @@ -1,5 +1,4 @@ -/** - \page ExampleMeshModification Mesh modification +# Mesh modification {#ExampleMeshModification} Some examples of mesh modification are presented here @@ -13,8 +12,6 @@ Some examples of mesh modification are presented here \include MeshModification.dox.c - JavaScript \include MeshModification.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md - - */ \ No newline at end of file diff --git a/doxygen/examples/MeshOffset.dox b/doxygen/examples/MeshOffset.md similarity index 91% rename from doxygen/examples/MeshOffset.dox rename to doxygen/examples/MeshOffset.md index 5cb9038178b3..90f801faf777 100644 --- a/doxygen/examples/MeshOffset.dox +++ b/doxygen/examples/MeshOffset.md @@ -1,5 +1,4 @@ -/** - \page ExampleMeshOffset Mesh Offset +# Mesh Offset {#ExampleMeshOffset} Example of mesh offset @@ -13,36 +12,34 @@ Source mesh \image html offset_before.png After offset \image html offset_after.png - + - Python \include MeshOffset.dox.py Source mesh \image html offset_before.png After offset \image html offset_after.png - + - C \include MeshOffset.dox.c Source mesh \image html offset_before.png After offset \image html offset_after.png - + - C# \include MeshOffset.dox.cs Source mesh \image html offset_before.png After offset \image html offset_after.png - + - JavaScript \include MeshOffset.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md Source mesh \image html offset_before.png After offset \image html offset_after.png - - */ \ No newline at end of file diff --git a/doxygen/examples/MeshOffsetWeighted.dox b/doxygen/examples/MeshOffsetWeighted.md similarity index 77% rename from doxygen/examples/MeshOffsetWeighted.dox rename to doxygen/examples/MeshOffsetWeighted.md index c0f48b1fbd69..1d98565b288f 100644 --- a/doxygen/examples/MeshOffsetWeighted.dox +++ b/doxygen/examples/MeshOffsetWeighted.md @@ -1,23 +1,20 @@ -/** - \page ExampleMeshOffsetWeighted Mesh Weighted Offset +# Mesh Weighted Offset {#ExampleMeshOffsetWeighted} Example of mesh weighted offset
- + - C++ \include MeshOffsetWeighted.dox.cpp - + - Python \include MeshOffsetWeighted.dox.py - + - C \include MeshOffsetWeighted.dox.c - + - JavaScript \include MeshOffsetWeighted.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ \ No newline at end of file diff --git a/doxygen/examples/MeshResolveDegenerations.dox b/doxygen/examples/MeshResolveDegenerations.md similarity index 80% rename from doxygen/examples/MeshResolveDegenerations.dox rename to doxygen/examples/MeshResolveDegenerations.md index f76a6429ffa3..b9727756b4fc 100644 --- a/doxygen/examples/MeshResolveDegenerations.dox +++ b/doxygen/examples/MeshResolveDegenerations.md @@ -1,10 +1,9 @@ -/** - \page ExampleMeshFixDegeneracies Fixing Mesh Degeneracies +# Fixing Mesh Degeneracies {#ExampleMeshFixDegeneracies} Example of fixing degenerated faces
- + - C++ \include MeshFixDegeneracies.dox.cpp - Python @@ -15,8 +14,6 @@ Example of fixing degenerated faces \include MeshFixDegeneracies.dox.cs - JavaScript \include MeshFixDegeneracies.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ \ No newline at end of file diff --git a/doxygen/examples/MeshStitchHole.dox b/doxygen/examples/MeshStitchHole.md similarity index 80% rename from doxygen/examples/MeshStitchHole.dox rename to doxygen/examples/MeshStitchHole.md index 9a6d4f6c6d5e..3f535b7e6548 100644 --- a/doxygen/examples/MeshStitchHole.dox +++ b/doxygen/examples/MeshStitchHole.md @@ -1,5 +1,4 @@ -/** - \page ExampleMeshStitchHole Stitching holes +# Stitching holes {#ExampleMeshStitchHole} Example of stitching holes (connect two holes with a cylinder) @@ -13,8 +12,6 @@ Example of stitching holes (connect two holes with a cylinder) \include MeshStitchHole.dox.c - JavaScript \include MeshStitchHole.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md - - */ \ No newline at end of file diff --git a/doxygen/examples/NoiseDenoiseExample.dox b/doxygen/examples/NoiseDenoiseExample.md similarity index 66% rename from doxygen/examples/NoiseDenoiseExample.dox rename to doxygen/examples/NoiseDenoiseExample.md index e64678ee2a0c..a2042b8ea98d 100644 --- a/doxygen/examples/NoiseDenoiseExample.dox +++ b/doxygen/examples/NoiseDenoiseExample.md @@ -1,25 +1,23 @@ -/** - \page ExampleNoiseDenoise Adding and removing noise Example +# Adding and removing noise Example {#ExampleNoiseDenoise}
- + - C++ \include NoiseDenoise.dox.cpp - + - Python -\note Python API version 3 and later - +> [!NOTE] +> Python API version 3 and later + \include NoiseDenoiseExample.dox.py - + - C \include NoiseDenoise.dox.c - + - JavaScript \include NoiseDenoise.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ \ No newline at end of file diff --git a/doxygen/examples/Numpy.dox b/doxygen/examples/Numpy.md similarity index 76% rename from doxygen/examples/Numpy.dox rename to doxygen/examples/Numpy.md index 3bb0e324a683..a09867c6b047 100644 --- a/doxygen/examples/Numpy.dox +++ b/doxygen/examples/Numpy.md @@ -1,13 +1,10 @@ -/** - \page ExampleNumpy Numpy support +# Numpy support {#ExampleNumpy} Using numpy to create mesh and get back its primitives
- + - Python \include Numpy.dox.py
- - */ \ No newline at end of file diff --git a/doxygen/examples/NumpyTriangulation.dox b/doxygen/examples/NumpyTriangulation.md similarity index 62% rename from doxygen/examples/NumpyTriangulation.dox rename to doxygen/examples/NumpyTriangulation.md index b7563b172909..d545a43190f1 100644 --- a/doxygen/examples/NumpyTriangulation.dox +++ b/doxygen/examples/NumpyTriangulation.md @@ -1,13 +1,10 @@ -/** - \page ExampleNumpyTriangulation Triangulation of a regular Numpy grid +# Triangulation of a regular Numpy grid {#ExampleNumpyTriangulation} Triangulation of regular numpy grid
- + - Python \include NumpyTriangulation.dox.py
- - */ \ No newline at end of file diff --git a/doxygen/examples/OpenDicomFiles.dox b/doxygen/examples/OpenDicomFiles.md similarity index 71% rename from doxygen/examples/OpenDicomFiles.dox rename to doxygen/examples/OpenDicomFiles.md index 46090c8f5b1e..dfa6fa43ae90 100644 --- a/doxygen/examples/OpenDicomFiles.dox +++ b/doxygen/examples/OpenDicomFiles.md @@ -1,13 +1,10 @@ -/** - \page ExampleDicomFiles Open Dicom Files +# Open Dicom Files {#ExampleDicomFiles} Example of opening Dicom files
- + - Python \include OpenDicomFiles.dox.py
- - */ \ No newline at end of file diff --git a/doxygen/examples/Plotly.dox b/doxygen/examples/Plotly.md similarity index 79% rename from doxygen/examples/Plotly.dox rename to doxygen/examples/Plotly.md index cacba15a6fea..d7d47995e188 100644 --- a/doxygen/examples/Plotly.dox +++ b/doxygen/examples/Plotly.md @@ -1,14 +1,11 @@ -/** - \page ExamplePlotly Plotly visualization +# Plotly visualization {#ExamplePlotly} Using plotly to visualize mesh
- + - Python \include Plotly.dox.py \image html plotly_visualization.png "Plotly visualization" width = 300cm
- - */ \ No newline at end of file diff --git a/doxygen/examples/SignedDistance.dox b/doxygen/examples/SignedDistance.md similarity index 68% rename from doxygen/examples/SignedDistance.dox rename to doxygen/examples/SignedDistance.md index 64087a536ae8..e960533f1cba 100644 --- a/doxygen/examples/SignedDistance.dox +++ b/doxygen/examples/SignedDistance.md @@ -1,27 +1,25 @@ -/** - \page ExampleSignedDistance Signed Distance +# Signed Distance {#ExampleSignedDistance} Example of usage to get signed distance from mesh to mesh ▶ [See it live in the browser](https://demo.meshlib.io/#closest-points) -\note Please note that unlike findSignedDistances, this function return minimal distance between two meshes +> [!NOTE] +> Please note that unlike findSignedDistances, this function return minimal distance between two meshes
- + - C++ \include SignedDistance.dox.cpp - + - Python \include SignedDistance.dox.py - + - C \include SignedDistance.dox.c - + - JavaScript \include SignedDistance.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ \ No newline at end of file diff --git a/doxygen/examples/SignedDistancePointToMesh.dox b/doxygen/examples/SignedDistancePointToMesh.md similarity index 80% rename from doxygen/examples/SignedDistancePointToMesh.dox rename to doxygen/examples/SignedDistancePointToMesh.md index cc13be5c4aeb..743712091056 100644 --- a/doxygen/examples/SignedDistancePointToMesh.dox +++ b/doxygen/examples/SignedDistancePointToMesh.md @@ -1,25 +1,22 @@ -/** - \page ExampleSignedDistancePointToMesh Signed Distance Point To Mesh +# Signed Distance Point To Mesh {#ExampleSignedDistancePointToMesh} Example of usage to get signed distance from point to mesh ▶ [See it live in the browser](https://demo.meshlib.io/#closest-points)
- + - C++ \include SignedDistancePointToMesh.dox.cpp - + - Python \include SignedDistancePointToMesh.dox.py - + - C \include SignedDistancePointToMesh.dox.c - + - JavaScript \include SignedDistancePointToMesh.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ \ No newline at end of file diff --git a/doxygen/examples/SignedDistances.dox b/doxygen/examples/SignedDistances.md similarity index 70% rename from doxygen/examples/SignedDistances.dox rename to doxygen/examples/SignedDistances.md index 92b6810433f1..ef659bf4b260 100644 --- a/doxygen/examples/SignedDistances.dox +++ b/doxygen/examples/SignedDistances.md @@ -1,27 +1,25 @@ -/** - \page ExampleSignedDistances Signed Distances +# Signed Distances {#ExampleSignedDistances} Example of usage to get signed distances from points of mesh to another reference mesh ▶ [See it live in the browser](https://demo.meshlib.io/#deviation) -\note Please note that unlike findSignedDistance, this function return distances for each valid points +> [!NOTE] +> Please note that unlike findSignedDistance, this function return distances for each valid points
- + - C++ \include SignedDistances.dox.cpp - + - Python \include SignedDistances.dox.py - + - C \include SignedDistances.dox.c - + - JavaScript \include SignedDistances.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ \ No newline at end of file diff --git a/doxygen/examples/Triangulation.dox b/doxygen/examples/Triangulation.md similarity index 75% rename from doxygen/examples/Triangulation.dox rename to doxygen/examples/Triangulation.md index 01b86a4a05e0..c67ee84aa470 100644 --- a/doxygen/examples/Triangulation.dox +++ b/doxygen/examples/Triangulation.md @@ -1,26 +1,24 @@ -/** - \page ExampleTriangulation Simple triangulation +# Simple triangulation {#ExampleTriangulation} Simple triangulation
- + - C++ \include Triangulation.dox.cpp - Python API v2 \include Triangulation_v2.dox.py - Python API v3 -\note Python API version 3 and later - +> [!NOTE] +> Python API version 3 and later + \include Triangulation_v3.dox.py - + - C \include Triangulation.dox.c - + - JavaScript \include Triangulation.dox.js -\include{doc} JsUsingNote.dox +\include{doc} JsUsingNote.md
- - */ \ No newline at end of file diff --git a/doxygen/examples/ViewerExample.dox b/doxygen/examples/ViewerExample.dox deleted file mode 100644 index d863614785a1..000000000000 --- a/doxygen/examples/ViewerExample.dox +++ /dev/null @@ -1,20 +0,0 @@ -/** - \page ExampleViewer Viewer Example - -Example of using Viewer - -
- -- Python -\note Python API version 3 and later - -\include Viewer.dox.py -Viewer with scene tree -\image html Viewer_with_scene_tree.png -Viewer without scene tree -\image html Viewer_without_scene_tree.png -\note This example does not work on macOS: `mv.launch()` raises `RuntimeError: MeshLib Viewer is not supported on macOS yet`. In releases before 3.1.3.566 it terminated the Python process instead (SIGTRAP, exit code 133, no exception raised). - -
- - */ \ No newline at end of file diff --git a/doxygen/examples/ViewerExample.md b/doxygen/examples/ViewerExample.md new file mode 100644 index 000000000000..5ad69736ede9 --- /dev/null +++ b/doxygen/examples/ViewerExample.md @@ -0,0 +1,19 @@ +# Viewer Example {#ExampleViewer} + +Example of using Viewer + +
+ +- Python +> [!NOTE] +> Python API version 3 and later + +\include Viewer.dox.py +Viewer with scene tree +\image html Viewer_with_scene_tree.png +Viewer without scene tree +\image html Viewer_without_scene_tree.png +> [!NOTE] +> This example does not work on macOS: `mv.launch()` raises `RuntimeError: MeshLib Viewer is not supported on macOS yet`. In releases before 3.1.3.566 it terminated the Python process instead (SIGTRAP, exit code 133, no exception raised). + +
diff --git a/doxygen/examples/ViewerExampleVolumeRender.dox b/doxygen/examples/ViewerExampleVolumeRender.dox deleted file mode 100644 index 60308d463f3b..000000000000 --- a/doxygen/examples/ViewerExampleVolumeRender.dox +++ /dev/null @@ -1,17 +0,0 @@ -/** - \page ExampleViewerVolumeRender Viewer Example Volume Rendering - -Example of using Viewer for Volume Rendering - -
- -- Python -\note Python API version 3 and later - -\include ViewerVolumeRender.dox.py -\image html Volume_rendering.png -\note This example does not work on macOS: `mv.launch()` raises `RuntimeError: MeshLib Viewer is not supported on macOS yet`. In releases before 3.1.3.566 it terminated the Python process instead (SIGTRAP, exit code 133, no exception raised). - -
- - */ diff --git a/doxygen/examples/ViewerExampleVolumeRender.md b/doxygen/examples/ViewerExampleVolumeRender.md new file mode 100644 index 000000000000..cb57fad42c93 --- /dev/null +++ b/doxygen/examples/ViewerExampleVolumeRender.md @@ -0,0 +1,16 @@ +# Viewer Example Volume Rendering {#ExampleViewerVolumeRender} + +Example of using Viewer for Volume Rendering + +
+ +- Python +> [!NOTE] +> Python API version 3 and later + +\include ViewerVolumeRender.dox.py +\image html Volume_rendering.png +> [!NOTE] +> This example does not work on macOS: `mv.launch()` raises `RuntimeError: MeshLib Viewer is not supported on macOS yet`. In releases before 3.1.3.566 it terminated the Python process instead (SIGTRAP, exit code 133, no exception raised). + +
diff --git a/doxygen/general_pages/APIPage.dox b/doxygen/general_pages/APIPage.md similarity index 86% rename from doxygen/general_pages/APIPage.dox rename to doxygen/general_pages/APIPage.md index 360482dabc0b..d3987270e3bf 100644 --- a/doxygen/general_pages/APIPage.dox +++ b/doxygen/general_pages/APIPage.md @@ -1,10 +1,7 @@ -/** -\page APIPage API +# API {#APIPage} - [C++](Cpp/APICppPage.html) - [Python](Py/APIPyPage.html) - [C](C/APICPage.html) - [C#](Csharp/APICsharpPage.html) - [JavaScript](Js/APIJsPage.html) - -*/ \ No newline at end of file diff --git a/doxygen/general_pages/About.dox b/doxygen/general_pages/About.dox deleted file mode 100644 index abee884b564f..000000000000 --- a/doxygen/general_pages/About.dox +++ /dev/null @@ -1,64 +0,0 @@ -/** - -\mainpage About - -\tableofcontents - -## Welcome to MeshLib’s documentation! -The MeshLib SDK is an open-source 3D geometry processing library designed to provide developers with a comprehensive toolkit for building robust 3D applications. -Whether you are working in C++, Python, C#, or C, MeshLib offers a versatile, cross-platform solution available on Windows, macOS, and Linux, enabling the development of cutting-edge solutions with ease and precision. - -## Key Features - - - \b 3D \b Data \b Handling: Supports meshes, voxels, and point clouds for creation, modification, and conversion. - - \b Boolean \b Operations: Fast, highly optimized mesh and voxel-based approaches. - - \b Mesh \b Fixing: Includes removing self-intersections, filling holes, and component separation. - - \b Simplification \b & \b Subdivision: Optimize mesh complexity with decimation, remeshing, and subdivision. - - \b Offsets: Multiple modes for precise surface thickness control, ideal for 3D printing and machining. - - \b Triangulation: Accurate, fast conversion of point clouds to meshes with normal creation. - - \b ICP: Precise mesh alignment using point-to-point and point-to-plane transformations. - - \b Segmentation: Semi-automatic segmentation based on curvature for meshes and voxels. - - \b Deformations: Supports Laplacian, freeform, and relax smoothing for fine mesh adjustments. - - \b Distance \b Maps \b & \b Polylines: Generate distance maps, iso-lines, and perform projection and intersection. - -Features illustration is available in [the features section](https://meshlib.io/features/) or in the sections of this documentation. - -## Modern Applications - - - \b Automation, \b AI, \b and \b Robotics. Essential for 3D scanning in robotics, AI, and autonomous systems, MeshLib enables real-time mesh processing for environment mapping, object detection, and path planning. Mesh repair tools prepare models by fixing holes and intersections, ideal for automated systems handling large datasets. - - \b Manufacturing \b and \b 3D \b Printing. MeshLib's Boolean operations and mesh offsetting ensure accuracy and manufacturability for 3D prints, optimizing models with decimation for industrial-scale applications. - - \b Dental \b Applications. MeshLib provides specialized tools for dental workflows, offering precise mesh repair and customization for dental prosthetics, aligners, and implants. These capabilities ensure accurate, patient-specific designs ready for manufacturing. - - \b Game \b Development \b and \b VR. Optimized for real-time rendering, MeshLib's simplification tools maintain visual quality, and Boolean operations allow dynamic model manipulation. - - \b Scientific \b Visualization \b and \b Medical \b Imaging. MeshLib supports large datasets, crucial for scientific and medical visualization, with mesh repair and simplification for detailed, real-time models in fields like geophysics and medical planning. - - See more [application examples](https://meshlib.io/applications/). - -## Getting Started - -Before installing anything, you can try MeshLib in your browser: the [live demo](https://demo.meshlib.io/) runs boolean operations, hole filling, decimation, and ICP registration. - -MeshLib SDK offers a simple installation process and extensive documentation to get you up and running quickly. Choose your preferred language, explore the available tutorials, and start creating with MeshLib! - -For Python users, install MeshLib via pip: -\code{.sh} -pip install meshlib -\endcode - -For headless environments — servers, docker, CI — `pip install meshlib-core` provides everything -except the interactive viewer at a about 30% smaller download. - -For C++, C#, and C developers, head to our \ref InstallationGuide "Installation Guide" for more details on integrating MeshLib into your environment. - -## Tutorials -Explore \ref Tutorials "MeshLib's tutorials" and \ref Examples "code samples" to get started quickly and master advanced features. - -## License -MeshLib offers Non-Commercial Free License with a Commercial License Requirement. -Learn more on [the MeshLib License page](https://meshlib.io/license). - -## Join the Community -MeshLib thrives on contributions from developers like you! Explore our GitHub repository, submit pull requests, and be a part of shaping the future of 3D geometry development. - -[Visit GitHub](https://github.com/MeshInspector/MeshLib/discussions) - -*/ diff --git a/doxygen/general_pages/About.md b/doxygen/general_pages/About.md new file mode 100644 index 000000000000..74c61e17cc9f --- /dev/null +++ b/doxygen/general_pages/About.md @@ -0,0 +1,60 @@ +# About {#mainpage} + +[TOC] + +## Welcome to MeshLib’s documentation! +The MeshLib SDK is an open-source 3D geometry processing library designed to provide developers with a comprehensive toolkit for building robust 3D applications. +Whether you are working in C++, Python, C#, or C, MeshLib offers a versatile, cross-platform solution available on Windows, macOS, and Linux, enabling the development of cutting-edge solutions with ease and precision. + +## Key Features + + - **3D Data Handling:** Supports meshes, voxels, and point clouds for creation, modification, and conversion. + - **Boolean Operations:** Fast, highly optimized mesh and voxel-based approaches. + - **Mesh Fixing:** Includes removing self-intersections, filling holes, and component separation. + - **Simplification & Subdivision:** Optimize mesh complexity with decimation, remeshing, and subdivision. + - **Offsets:** Multiple modes for precise surface thickness control, ideal for 3D printing and machining. + - **Triangulation:** Accurate, fast conversion of point clouds to meshes with normal creation. + - **ICP:** Precise mesh alignment using point-to-point and point-to-plane transformations. + - **Segmentation:** Semi-automatic segmentation based on curvature for meshes and voxels. + - **Deformations:** Supports Laplacian, freeform, and relax smoothing for fine mesh adjustments. + - **Distance Maps & Polylines:** Generate distance maps, iso-lines, and perform projection and intersection. + +Features illustration is available in [the features section](https://meshlib.io/features/) or in the sections of this documentation. + +## Modern Applications + + - **Automation, AI, and Robotics.** Essential for 3D scanning in robotics, AI, and autonomous systems, MeshLib enables real-time mesh processing for environment mapping, object detection, and path planning. Mesh repair tools prepare models by fixing holes and intersections, ideal for automated systems handling large datasets. + - **Manufacturing and 3D Printing.** MeshLib's Boolean operations and mesh offsetting ensure accuracy and manufacturability for 3D prints, optimizing models with decimation for industrial-scale applications. + - **Dental Applications.** MeshLib provides specialized tools for dental workflows, offering precise mesh repair and customization for dental prosthetics, aligners, and implants. These capabilities ensure accurate, patient-specific designs ready for manufacturing. + - **Game Development and VR.** Optimized for real-time rendering, MeshLib's simplification tools maintain visual quality, and Boolean operations allow dynamic model manipulation. + - **Scientific Visualization and Medical Imaging.** MeshLib supports large datasets, crucial for scientific and medical visualization, with mesh repair and simplification for detailed, real-time models in fields like geophysics and medical planning. + + See more [application examples](https://meshlib.io/applications/). + +## Getting Started + +Before installing anything, you can try MeshLib in your browser: the [live demo](https://demo.meshlib.io/) runs boolean operations, hole filling, decimation, and ICP registration. + +MeshLib SDK offers a simple installation process and extensive documentation to get you up and running quickly. Choose your preferred language, explore the available tutorials, and start creating with MeshLib! + +For Python users, install MeshLib via pip: +```sh +pip install meshlib +``` + +For headless environments — servers, docker, CI — `pip install meshlib-core` provides everything +except the interactive viewer at a about 30% smaller download. + +For C++, C#, and C developers, head to our [Installation Guide](\ref InstallationGuide) for more details on integrating MeshLib into your environment. + +## Tutorials +Explore [MeshLib's tutorials](\ref Tutorials) and [code samples](\ref Examples) to get started quickly and master advanced features. + +## License +MeshLib offers Non-Commercial Free License with a Commercial License Requirement. +Learn more on [the MeshLib License page](https://meshlib.io/license). + +## Join the Community +MeshLib thrives on contributions from developers like you! Explore our GitHub repository, submit pull requests, and be a part of shaping the future of 3D geometry development. + +[Visit GitHub](https://github.com/MeshInspector/MeshLib/discussions) diff --git a/doxygen/general_pages/BasicMathTypesOverview.dox b/doxygen/general_pages/BasicMathTypesOverview.md similarity index 98% rename from doxygen/general_pages/BasicMathTypesOverview.dox rename to doxygen/general_pages/BasicMathTypesOverview.md index 2eefb70047f6..184678b32c51 100644 --- a/doxygen/general_pages/BasicMathTypesOverview.dox +++ b/doxygen/general_pages/BasicMathTypesOverview.md @@ -1,8 +1,6 @@ -/** +# Basic Math Types Overview {#BasicMathTypesOverview} -\page BasicMathTypesOverview Basic Math Types Overview - -\tableofcontents +[TOC] # Vectors, matrices, and transformations @@ -168,5 +166,3 @@ MeshLib supports some other types not documented here: * Symmetric matrices — `MR::SymMatrix[2,3,4]f` defined in ``. Consult the respective headers for details. - -*/ \ No newline at end of file diff --git a/doxygen/general_pages/CSetupGuide.dox b/doxygen/general_pages/CSetupGuide.md similarity index 59% rename from doxygen/general_pages/CSetupGuide.dox rename to doxygen/general_pages/CSetupGuide.md index 3a979824ec70..3f1539b7fd21 100644 --- a/doxygen/general_pages/CSetupGuide.dox +++ b/doxygen/general_pages/CSetupGuide.md @@ -1,17 +1,16 @@ -/** -\page MeshLibCSetupGuide MeshLib C Setup Guide +# MeshLib C Setup Guide {#MeshLibCSetupGuide} # Setting Up MeshLib for C Development -\tableofcontents +[TOC] -\parblock -\note The C API library is called `MeshLibC2`, and its headers are in the `MRC*` directories (`MRCMesh`/etc, as opposed to `MRMesh`/etc for C++ API). -\endparblock +> [!NOTE] +> The C API library is called `MeshLibC2`, and its headers are in the `MRC*` directories (`MRCMesh`/etc, as opposed to `MRMesh`/etc for C++ API). -\parblock -\note The recommended way of installing the C API is from the [binary releases](https://github.com/MeshInspector/MeshLib/releases) of MeshLib. It's also possible to build [from source](#CppBuildCBindingsFromSource). -\endparblock +

+ +> [!NOTE] +> The recommended way of installing the C API is from the [binary releases](https://github.com/MeshInspector/MeshLib/releases) of MeshLib. It's also possible to build [from source](#CppBuildCBindingsFromSource). ## Prerequisites {#CSetupPrerequisites} @@ -23,85 +22,86 @@ Compile your own code as C11 or newer: ### CMake -Integrating MeshLib with CMake needs CMake 3.18 or newer. See \ref MeshLibCmakeSetupGuide "the CMake Setup Guide". +Integrating MeshLib with CMake needs CMake 3.18 or newer. See [the CMake Setup Guide](\ref MeshLibCmakeSetupGuide). ## Installing binary releases of MeshLib -The installation process is \ref MeshLibCppSetupGuide "same as for C++", and is also explained below. +The installation process is [same as for C++](\ref MeshLibCppSetupGuide), and is also explained below. The release archives include the C headers (in the directory called `MRCMesh` and several other `MRC...` directories), and a compiled library named `MeshLibC2` (`MeshLibC2.dll` on Windows, `libMeshLibC2.so` on Linux, etc). This library links against our C++ libraries (`MRMesh` and others) and provides C wrappers for them. ### Windows -\note MeshLib for Windows is distributed for x64 only. Make sure you're not targeting x32. +> [!NOTE] +> MeshLib for Windows is distributed for x64 only. Make sure you're not targeting x32. Every release publishes one Windows distributive per Visual Studio toolset, plus one for Debug builds that keep MSVC's iterator debugging on. -The \ref CppSetupWindows "C++ guide's archive table" names all four and says which one to take, including the binary-compatibility rule that lets an older toolset's archive serve a newer Visual Studio. It applies to C unchanged, except for its `_ITERATOR_DEBUG_LEVEL` column: +The [C++ guide's archive table](\ref CppSetupWindows) names all four and says which one to take, including the binary-compatibility rule that lets an older toolset's archive serve a newer Visual Studio. It applies to C unchanged, except for its `_ITERATOR_DEBUG_LEVEL` column: a pure-C consumer needs no `_ITERATOR_DEBUG_LEVEL` define, whichever archive it picks, because C code passes no standard containers across the DLL boundary, so the mismatch that define guards against cannot arise. A project that also compiles C++ translation units against MeshLib's C++ headers does need it, at the value in that column. 1. **Download and Extract the Built Version** - Visit the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases). - - Download the archive for your Visual Studio toolset from \ref CppSetupWindows "the C++ guide's table". + - Download the archive for your Visual Studio toolset from [the C++ guide's table](\ref CppSetupWindows). - Extract it to a directory, e.g., `C:\meshlib-built\`. - \n **Directory Structure After Extraction** -\code{.cmd} +
**Directory Structure After Extraction** +```cmd install/ ├── include/ # Header files ├── lib/ # Static and shared libraries ├── app/ # Executables example_plugin/ # example solution for creating MeshLib/MeshInspector plugins -\endcode +``` 2. **Configure and integrate with Visual Studio** - **Solution Platform**: - \n Set: `x64` +
Set: `x64` - **C/C++ → Language → C Language Standard**: - \n Set: `/std:c11` or later +
Set: `/std:c11` or later - **C/C++ → General → Additional Include Directories**: - \n Add: `C:\meshlib-built\install\include` +
Add: `C:\meshlib-built\install\include` - **C/C++ → All Options → Additional Options**: - \n Add: `/bigobj /utf-8` +
Add: `/bigobj /utf-8` - **Linker → Input → Additional Dependencies**: - \n Add: `C:\meshlib-built\install\lib\$(Configuration)\*.lib` +
Add: `C:\meshlib-built\install\lib\$(Configuration)\*.lib` - **Copy DLLs**: - \n Copy all `.dll` files from: `C:\meshlib-built\install\app\$(Configuration)` to your project’s output directory: `$(TargetDir)` -\code{.cmd} +
Copy all `.dll` files from: `C:\meshlib-built\install\app\$(Configuration)` to your project’s output directory: `$(TargetDir)` +```cmd xcopy C:\meshlib-built\install\app\$(Configuration)\*.dll $(TargetDir) -\endcode +``` ### Linux 1. **Download the Package for Your Distribution and CPU** - \n Open the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases) page: the release description links a `.deb` for every supported Ubuntu release and architecture. Take the one matching `lsb_release -rs` and `uname -m`. - \n On any other distribution use the portable **Linux vcpkg** build instead. It bundles its own dependencies and is not installed system-wide: unpack it and use the resulting directory as the MeshLib installation prefix, then skip to step 3. -\code{.sh} +
Open the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases) page: the release description links a `.deb` for every supported Ubuntu release and architecture. Take the one matching `lsb_release -rs` and `uname -m`. +
On any other distribution use the portable **Linux vcpkg** build instead. It bundles its own dependencies and is not installed system-wide: unpack it and use the resulting directory as the MeshLib installation prefix, then skip to step 3. +```sh mkdir path_to_install && tar -xf .tar.xz -C path_to_install -\endcode +``` 2. **Install the Package** - \n `apt` refuses a package built for another CPU, but nothing tells the Ubuntu releases apart: the builds all declare the same dependencies and the `preinst` carries no release check, so installing the Ubuntu 22 build on Ubuntu 24 succeeds silently. Check the release in the file name first. -\code{.sh} +
`apt` refuses a package built for another CPU, but nothing tells the Ubuntu releases apart: the builds all declare the same dependencies and the `preinst` carries no release check, so installing the Ubuntu 22 build on Ubuntu 24 succeeds silently. Check the release in the file name first. +```sh sudo apt install ./.deb -\endcode +``` 3. [**Integrate Using CMake**](\ref MeshLibCmakeSetupGuide) - \n Add the following to your `CMakeLists.txt`: -\code{.cmake} +
Add the following to your `CMakeLists.txt`: +```cmake target_link_libraries(your_project_name PUBLIC MeshLib::MeshLibC2) -\endcode +``` ### macOS 1. **Download the Installer** - \n Open the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases) page: the release description links one `.pkg` installer for macOS Arm (Apple silicon) and one for macOS x64 (Intel). Take the one matching `uname -m` (`arm64` or `x86_64`). +
Open the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases) page: the release description links one `.pkg` installer for macOS Arm (Apple silicon) and one for macOS x64 (Intel). Take the one matching `uname -m` (`arm64` or `x86_64`). 2. **Install** - Double-click the downloaded `.pkg` and follow the installer. The release asset is the installer itself, so there is nothing to unpack first. - The framework is installed into `/Library/Frameworks/MeshLib.framework`, or into `~/Library/Frameworks/MeshLib.framework` if you choose to install for the current user only. - **Install Dependencies via Homebrew** - \n The `.pkg` does not pull in the Homebrew formulae MeshLib links against, so install them yourself. Skip this step if your project enables only the C language. This needs [Homebrew](https://brew.sh/) — install it first if you do not have it. Open Terminal and run the following command: -\code{.sh} +
The `.pkg` does not pull in the Homebrew formulae MeshLib links against, so install them yourself. Skip this step if your project enables only the C language. This needs [Homebrew](https://brew.sh/) — install it first if you do not have it. Open Terminal and run the following command: +```sh xargs brew install < /Library/Frameworks/MeshLib.framework/Versions/Current/requirements/macos.txt -\endcode +``` - If you installed for the current user only, prefix the path with `~`: `~/Library/Frameworks/MeshLib.framework/Versions/Current/requirements/macos.txt`. 3. [**Integrate Using CMake**](\ref MeshLibCmakeSetupGuide) - \n Add the following to your `CMakeLists.txt`: -\code{.cmake} +
Add the following to your `CMakeLists.txt`: +```cmake target_link_libraries(your_project_name PUBLIC MeshLib::MeshLibC2) -\endcode +``` ## Try MeshLib with C Examples @@ -124,5 +124,3 @@ Additionally, if you want Cuda support, similarly extract `MeshLibC2Cuda/{includ If you **don't** want Cuda support, you instead have to copy Cuda stubs from `scripts/mrbind/cuda_placeholder_generated_c/{include,src}` to `source/MeshLibC2Cuda`. This is the only option on Wasm. Lastly, build MeshLib with C API enabled by adding `-DMESHLIB_BUILD_GENERATED_C_BINDINGS=ON` to CMake flags. We recommend using CMake for this, but VS project files are also available in `source/MeshLibC2` and `source/MeshLibC2Cuda`, but they aren't included in the VS solution by default. - -*/ diff --git a/doxygen/general_pages/CSharpSetupGuide.dox b/doxygen/general_pages/CSharpSetupGuide.md similarity index 78% rename from doxygen/general_pages/CSharpSetupGuide.dox rename to doxygen/general_pages/CSharpSetupGuide.md index 758301ef781b..d70437eb73ca 100644 --- a/doxygen/general_pages/CSharpSetupGuide.dox +++ b/doxygen/general_pages/CSharpSetupGuide.md @@ -1,15 +1,18 @@ -/** -\page MeshLibCSharpSetupGuide Integrating MeshLib with C# +Integrating MeshLib with C# {#MeshLibCSharpSetupGuide} +====================================================== -\section UsingMeshLibwithCSharp Using MeshLib with C# +Using MeshLib with C# {#UsingMeshLibwithCSharp} +=============================================== -\tableofcontents +[TOC] This instruction will guide you through integrating MeshLib into your C# project using NuGet or the .NET Command-Line Interface. -\note MeshLib C# bindings are fully generated from the C++ codebase and expose the complete public API, with the exception of the `MR.Viewer` module. The C# API is fully compatible with Unity — see \ref MeshLibCSharpUnity "Using MeshLib with Unity". +> [!NOTE] +> MeshLib C# bindings are fully generated from the C++ codebase and expose the complete public API, with the exception of the `MR.Viewer` module. The C# API is fully compatible with Unity — see [Using MeshLib with Unity](\ref MeshLibCSharpUnity). -\note The C# bindings are production-ready. The full, stable C# API reference and comprehensive code samples are available and maintained. C# support is provided consistently across all \ref MeshLibCSharpPlatforms "supported platforms", ensuring feature parity with the native C++ API. +> [!NOTE] +> The C# bindings are production-ready. The full, stable C# API reference and comprehensive code samples are available and maintained. C# support is provided consistently across all [supported platforms](\ref MeshLibCSharpPlatforms), ensuring feature parity with the native C++ API. ## Prerequisites @@ -25,16 +28,17 @@ The NuGet package ships prebuilt native libraries, so your OS and CPU architectu | macOS | Arm64 (Apple silicon) | macOS 14 | | macOS | x64 (Intel) | macOS 15 | -\note On Windows on Arm, .NET 5 and newer resolve `win-arm64` by themselves. A \b .NET \b Framework -project instead gets the runtime named by its `PlatformTarget`, so set `ARM64` -to run natively; any other value gives it the `win-x64` libraries and the x64 emulation. Native Arm64 -.NET Framework requires 4.8.1, i.e. Windows 11. +> [!NOTE] +> On Windows on Arm, .NET 5 and newer resolve `win-arm64` by themselves. A **.NET Framework** +> project instead gets the runtime named by its `PlatformTarget`, so set `ARM64` +> to run natively; any other value gives it the `win-x64` libraries and the x64 emulation. Native Arm64 +> .NET Framework requires 4.8.1, i.e. Windows 11. -On \b Linux no extra system packages are required: beyond the C and C++ runtimes the libraries need only +On **Linux** no extra system packages are required: beyond the C and C++ runtimes the libraries need only `libexpat1` and `zlib1g`, which a standard desktop or server install already provides. Every other dependency is bundled in the package. -On \b macOS the floor differs by architecture: part of the file-format libraries in the x64 runtime are built +On **macOS** the floor differs by architecture: part of the file-format libraries in the x64 runtime are built against a newer SDK, so on an Intel Mac running macOS 14 the core API loads but the extra formats (E57, LAZ, CTM) fail. @@ -42,9 +46,9 @@ CTM) fail. - Install the latest version of the [.NET SDK](https://dotnet.microsoft.com/download) from the .NET website. MeshLib targets `netstandard2.0`, so it sets no upper bound on your .NET version: it is compatible with .NET Framework 4.7 and higher, and with .NET 5.0 and every later version. - Verify your installation by running: -\code{.cmd} +```cmd dotnet --version -\endcode +``` ### Visual Studio If you're using Visual Studio, make sure to install the **.NET desktop development** workload. @@ -67,7 +71,7 @@ To install MeshLib via Visual Studio, follow these steps: - Click "Install" and follow any prompts to complete the installation. 5. **Start Using MeshLib**: - You should now have access to the static class `MR` and its members. - - Confirm the native libraries actually load: \ref MeshLibCSharpVerify "Verify Your Installation". + - Confirm the native libraries actually load: [Verify Your Installation](\ref MeshLibCSharpVerify). ### Using JetBrains Rider Rider runs on Windows, macOS, and Linux; the steps are the same on all three: @@ -96,7 +100,8 @@ VS Code runs on Windows, macOS, and Linux; the steps are the same on all three: 5. **Start Using MeshLib**: - You should now have access to the static class `MR` and its members. -\note Using another editor, or no editor at all? The \ref MeshLibCSharpDotnetCli ".NET Command-Line Interface" works the same way on Windows, macOS, and Linux, and needs nothing but the .NET SDK. +> [!NOTE] +> Using another editor, or no editor at all? The [.NET Command-Line Interface](\ref MeshLibCSharpDotnetCli) works the same way on Windows, macOS, and Linux, and needs nothing but the .NET SDK. ## Installation from a Downloaded NuGet Package If you prefer to download the MeshLib package directly from the NuGet website, follow these steps: @@ -107,69 +112,69 @@ If you prefer to download the MeshLib package directly from the NuGet website, f 2. **Create a Local Directory for NuGet Packages**: - Choose or create a directory on your system where you will store the `.nupkg` file. For example: - **Windows (Command Prompt)**: -\code{.cmd} +```cmd mkdir %USERPROFILE%\LocalNuGetPackages -\endcode +``` - **Linux / macOS**: -\code{.sh} +```sh mkdir ~/LocalNuGetPackages -\endcode +``` - Move the downloaded package to that directory **keeping its `meshlib..nupkg` file name**. 3. **Install the MeshLib Package Locally**: - Use the command below to install the package: - **Windows (Command Prompt)**: -\code{.cmd} +```cmd dotnet add package MeshLib --source %USERPROFILE%\LocalNuGetPackages -\endcode +``` - **Linux / macOS**: -\code{.sh} +```sh dotnet add package MeshLib --source ~/LocalNuGetPackages -\endcode +``` 4. **Alternative: Configure Local Source Globally**: - Add the local directory as a source using: - **Windows (Command Prompt)**: -\code{.cmd} +```cmd dotnet nuget add source %USERPROFILE%\LocalNuGetPackages --name LocalPackages -\endcode +``` - **Linux / macOS**: -\code{.sh} +```sh dotnet nuget add source ~/LocalNuGetPackages --name LocalPackages -\endcode +``` - After this, you can install the package normally without specifying `--source`. 5. **Build and Run Your Project**: -\code{.cmd} +```cmd dotnet build dotnet run -\endcode +``` - An untouched project prints only its template output, which says nothing about MeshLib. Continue with - \ref MeshLibCSharpVerify "Verify Your Installation". + [Verify Your Installation](\ref MeshLibCSharpVerify). ## Installation via .NET Command-Line Interface {#MeshLibCSharpDotnetCli} To install MeshLib via the .NET CLI, follow these steps: 1. **Create a New Project Directory**: - \n Run the following commands to create a new directory for your project and navigate into it: -\code{.cmd} +
Run the following commands to create a new directory for your project and navigate into it: +```cmd mkdir TestProject cd TestProject -\endcode +``` 2. **Create a New .NET Console Project**: - \n Inside the new directory, initialize a .NET console project by running: -\code{.cmd} +
Inside the new directory, initialize a .NET console project by running: +```cmd dotnet new console -\endcode +``` 3. **Install the MeshLib Package**: - \n Use the following command to add MeshLib to your project: -\code{.cmd} +
Use the following command to add MeshLib to your project: +```cmd dotnet add package MeshLib -\endcode +``` 4. **Build and Run Your Project**: - \n After installing MeshLib, you can build and run your project using: -\code{.cmd} +
After installing MeshLib, you can build and run your project using: +```cmd dotnet run -\endcode +``` 5. **Verify MeshLib Works**: - \n `dotnet new console` writes no MeshLib code, so the output above is the same whether MeshLib loaded or not. - Continue with \ref MeshLibCSharpVerify "Verify Your Installation". +
`dotnet new console` writes no MeshLib code, so the output above is the same whether MeshLib loaded or not. + Continue with [Verify Your Installation](\ref MeshLibCSharpVerify). By following these steps, you can integrate MeshLib into your project, giving you more control over the setup process. @@ -178,24 +183,24 @@ By following these steps, you can integrate MeshLib into your project, giving yo Adding the package and building the project succeed even when the native libraries cannot be loaded, so the setup is only proven by a real MeshLib call. Replace the contents of `Program.cs` with: -\code{.cs} +```cs var mesh = MR.makeCube(); Console.WriteLine($"MeshLib OK: cube has {mesh.points.size()} points, " + $"{mesh.topology.numValidFaces()} faces"); MR.MeshSave.toAnySupportedFormat(mesh, "cube.stl"); Console.WriteLine("Wrote cube.stl"); -\endcode +``` Then run: -\code{.cmd} +```cmd dotnet run -\endcode +``` The expected output is exactly: -\code{.txt} +```unparsed MeshLib OK: cube has 8 points, 12 faces Wrote cube.stl -\endcode +``` and a `cube.stl` of about 700 bytes appears in the working directory. @@ -205,9 +210,9 @@ and a `cube.stl` of about 700 bytes appears in the working directory. The NuGet package carries prebuilt native libraries for **all six** supported platforms, so it is large: 200+ MB Nuget download, 700+ MB copied to the build directory by default. For deployment, you might wish to publish for a single RID (single platform), which omits the unnecessary libraries for other platforms, e.g.: -\code{.cmd} +```cmd dotnet publish -r linux-x64 --self-contained false -\endcode +``` This copies only about 180 MB of libraries to the output directory, as opposed to 700+ MB. @@ -219,9 +224,9 @@ Supported platform IDs are: `win-x64`, `win-arm64`, `linux-x64`, `linux-arm64`, Unity projects consume the same NuGet package via [NuGetForUnity](https://github.com/GlitchEnzo/NuGetForUnity); this setup is continuously tested with Unity 6 on Windows, Linux, and macOS. To install MeshLib into a Unity project: 1. **Install NuGetForUnity**: - In the Unity editor, open **Window → Package Manager**, click **+**, select "Install package from git URL...", and enter: -\code{.cmd} +```cmd https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity -\endcode +``` 2. **Install MeshLib**: - Open **NuGet → Manage NuGet Packages**, switch to the "Online" tab, search for "MeshLib", and click "Install". @@ -231,34 +236,34 @@ https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity The C# assembly is a thin managed wrapper over MeshLib's native libraries, so setup problems typically surface not when the package is installed or the project is built, but as one of the following exceptions on the first call into MeshLib. ### DllNotFoundException -\code{.txt} +```unparsed System.DllNotFoundException: Unable to load DLL 'MeshLibC2' or one of its dependencies: The specified module could not be found. -\endcode -(on Linux and macOS: `Unable to load shared library 'MeshLibC2' or one of its dependencies`) +``` +(on Linux and macOS: ``Unable to load shared library 'MeshLibC2' or one of its dependencies``) The native libraries were not found at run time: - - Check that your platform is \ref MeshLibCSharpPlatforms "supported". - - Check that the native libraries reached your build output: on .NET they are placed under `runtimes//native/` in the output directory (see \ref MeshLibCSharpPackageSize "Package Size and Native Runtimes"), on .NET Framework next to the executable (`MeshLibC2.dll` and its dependencies on Windows). + - Check that your platform is [supported](\ref MeshLibCSharpPlatforms). + - Check that the native libraries reached your build output: on .NET they are placed under `runtimes//native/` in the output directory (see [Package Size and Native Runtimes](\ref MeshLibCSharpPackageSize)), on .NET Framework next to the executable (`MeshLibC2.dll` and its dependencies on Windows). ### BadImageFormatException -\code{.txt} +```unparsed System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) -\endcode +``` MeshLib's native libraries are 64-bit only, and this exception means your application runs as a 32-bit process. .NET Framework projects are prone to this: with the default `AnyCPU` platform and **Prefer 32-bit** checked, the application runs 32-bit even on 64-bit Windows. In the project properties (**Build** tab) set **Platform target** to `x64` or uncheck **Prefer 32-bit** — in the `.csproj` terms: -\code{.xml} +```xml x64 false -\endcode +``` On Windows on Arm use `ARM64` rather than `x64` there: for .NET Framework projects that value also selects which of the package's native runtimes gets copied. ### A rebuilt local package is ignored When installing from a local directory, NuGet extracts the package into its global cache and keeps serving the cached copy for the same version number, ignoring a rebuilt `.nupkg`. Delete the cached copy and restore again: -\code{.sh} +```sh rm -rf ~/.nuget/packages/meshlib -\endcode +``` On Windows, delete `%USERPROFILE%\.nuget\packages\meshlib`. @@ -277,4 +282,3 @@ Shows how to perform boolean operations like union, intersection, and subtractio Illustrates how to reduce mesh complexity through decimation, preserving overall shape with fewer polygons. These samples are a great starting point for integrating MeshLib into C# or .NET-based workflow. -*/ diff --git a/doxygen/general_pages/Citation.dox b/doxygen/general_pages/Citation.md similarity index 91% rename from doxygen/general_pages/Citation.dox rename to doxygen/general_pages/Citation.md index d1abfd270b5e..94cba9f8ae8b 100644 --- a/doxygen/general_pages/Citation.dox +++ b/doxygen/general_pages/Citation.md @@ -1,9 +1,8 @@ -/** -\page Citation Citation +# Citation {#Citation} If MeshLib supports your research, please cite it, including the exact version you used. -\code{.txt} +```unparsed @software{meshlib, author = {{MeshLib Development Team}}, title = {{MeshLib}: 3D Mesh Processing Library}, @@ -13,8 +12,7 @@ If MeshLib supports your research, please cite it, including the exact version y url = {https://meshlib.io}, note = {Please cite the exact version used in your work} } -\endcode +``` For APA, IEEE and Chicago forms, and for citing a specific algorithm, [see the citation guide](https://meshlib.io/citation-guide/). -*/ diff --git a/doxygen/general_pages/CmakeSetupGuide.dox b/doxygen/general_pages/CmakeSetupGuide.md similarity index 66% rename from doxygen/general_pages/CmakeSetupGuide.dox rename to doxygen/general_pages/CmakeSetupGuide.md index 08435b3b08db..ccd41e363520 100644 --- a/doxygen/general_pages/CmakeSetupGuide.dox +++ b/doxygen/general_pages/CmakeSetupGuide.md @@ -1,57 +1,56 @@ -/** -\page MeshLibCmakeSetupGuide MeshLib CMake Setup Guide +# MeshLib CMake Setup Guide {#MeshLibCmakeSetupGuide} # How to Use MeshLib with CMake -\tableofcontents +[TOC] ## Quick Integration Guide {#CmakeQuickIntegration} -MeshLib provides native CMake integration support for \b Linux and \b macOS; for \b Windows see the \ref CmakeWindowsIntegration "Windows Integration Guide" below. +MeshLib provides native CMake integration support for **Linux** and **macOS**; for **Windows** see the [Windows Integration Guide](\ref CmakeWindowsIntegration) below. Example CMake configuration files are available to demonstrate how to link against the pre-built libraries. You can find these examples in the [examples directory](https://github.com/MeshInspector/MeshLib/blob/master/examples/cpp-examples/CMakeLists.txt). MeshLib requires CMake 3.18 or newer. -If configuration or the build fails, see \ref CppSetupTroubleshooting "Troubleshooting" in the C++ Setup Guide. +If configuration or the build fails, see [Troubleshooting](\ref CppSetupTroubleshooting) in the C++ Setup Guide. ### Find MeshLib CMake Configuration Files For a start, find the MeshLib package: -\code{.cmake} +```cmake find_package(MeshLib CONFIG REQUIRED) -\endcode +``` The Ubuntu `.deb` and the macOS `.pkg` install the package where CMake searches by default. For the portable Linux vcpkg build, pass the directory it was unpacked to: -\code{.sh} +```sh cmake -S . -B build -DCMAKE_FIND_ROOT_PATH=path_to_install -\endcode +``` `MeshLib_DIR` alone is not sufficient, since the bundled third-party libraries are looked up in the same directory. ### Include the MeshLib Headers -Add \b both include directories from the installed MeshLib package to your project. In your CMake configuration (`CMakeLists.txt`): -\code{.cmake} +Add **both** include directories from the installed MeshLib package to your project. In your CMake configuration (`CMakeLists.txt`): +```cmake include_directories(${MESHLIB_INCLUDE_DIR} ${MESHLIB_THIRDPARTY_INCLUDE_DIR}) # or target_include_directories(your_project_name PUBLIC ${MESHLIB_INCLUDE_DIR} ${MESHLIB_THIRDPARTY_INCLUDE_DIR}) -\endcode +``` `MESHLIB_THIRDPARTY_INCLUDE_DIR` is required, not optional: MeshLib's public headers include third-party headers directly — `MRMesh/MRMeshFwd.h`, pulled in by essentially every MeshLib header, includes ``. Without it even a hello-world fails to compile. ### Link the MeshLib Libraries Specify which MeshLib libraries to link with your project: -\code{.cmake} +```cmake target_link_libraries(your_project_name PUBLIC MeshLib::MRMesh) # if you want to use viewer libraries target_link_libraries(your_project_name PUBLIC MeshLib::MRMesh MeshLib::MRViewer) -\endcode +``` Or if you use the C API, instead link `MeshLib::MeshLibC2`: -\code{.cmake} +```cmake target_link_libraries(your_project_name PUBLIC MeshLib::MeshLibC2) -\endcode +``` The package defines the following targets, each guarded by the variable in parentheses. A distribution sets it to `ON` for every module it ships, and only those targets exist. - `MeshLib::MRMesh`: core data structures and algorithms, needed by every C++ project. @@ -66,7 +65,7 @@ The package defines the following targets, each guarded by the variable in paren Putting the steps above together, this is a complete `CMakeLists.txt` that compiles, links and runs a program including ``. The **Linking Additional Third-Party Libraries** section below is not needed for it: -\code{.cmake} +```cmake cmake_minimum_required(VERSION 3.18) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -77,13 +76,13 @@ find_package(MeshLib CONFIG REQUIRED) add_executable(hello main.cpp) target_include_directories(hello PUBLIC ${MESHLIB_INCLUDE_DIR} ${MESHLIB_THIRDPARTY_INCLUDE_DIR}) target_link_libraries(hello PUBLIC MeshLib::MRMesh) -\endcode +``` -For the `main.cpp` this expects, see \ref CppSetupVerify "Verify your setup" in the C++ Setup Guide: a self-contained program that builds a mesh, checks it, saves it and returns non-zero on failure. +For the `main.cpp` this expects, see [Verify your setup](\ref CppSetupVerify) in the C++ Setup Guide: a self-contained program that builds a mesh, checks it, saves it and returns non-zero on failure. A C project is the same shape, linking `MeshLib::MeshLibC2` instead. Note that it needs only `MESHLIB_INCLUDE_DIR` as the `MRC*` headers include no third-party header. -\code{.cmake} +```cmake cmake_minimum_required(VERSION 3.18) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) @@ -94,36 +93,36 @@ find_package(MeshLib CONFIG REQUIRED) add_executable(hello main.c) target_include_directories(hello PUBLIC ${MESHLIB_INCLUDE_DIR}) target_link_libraries(hello PUBLIC MeshLib::MeshLibC2) -\endcode +``` -For the `main.c`, take one of the [C code samples](\ref Examples); \ref ExampleMeshLoadSave "Load and Save Meshes" is the shortest. +For the `main.c`, take one of the [C code samples](\ref Examples); [Load and Save Meshes](\ref ExampleMeshLoadSave) is the shortest. ### Linking Additional Third-Party Libraries -Only if \b your \b own code links a third-party library bundled with MeshLib (rather than just using MeshLib's API), add the directory those libraries live in: +Only if **your own** code links a third-party library bundled with MeshLib (rather than just using MeshLib's API), add the directory those libraries live in: -\code{.cmake} +```cmake target_link_directories(your_project_name PUBLIC ${MESHLIB_THIRDPARTY_LIB_DIR}) -\endcode +``` -The `MeshLib::*` imported targets already carry the paths of the third-party libraries \b they need, so this line is not required by the example above. +The `MeshLib::*` imported targets already carry the paths of the third-party libraries **they** need, so this line is not required by the example above. See the `CMakeLists.txt` in the [examples directory](https://github.com/MeshInspector/MeshLib/blob/master/examples/cpp-examples/CMakeLists.txt) for a working configuration. ## Windows Integration Guide {#CmakeWindowsIntegration} -MeshLib supports \b Windows via CMake, including integration with **Visual Studio**: ensure the **CMake component** is installed in your Visual Studio setup. +MeshLib supports **Windows** via CMake, including integration with **Visual Studio**: ensure the **CMake component** is installed in your Visual Studio setup. ### Prebuilt archive from GitHub Releases -The `MeshLibDistVS*.zip` archives contain no CMake config files, so `find_package(MeshLib CONFIG REQUIRED)` fails at \b configure time. Point CMake at the extracted tree instead — assuming the archive was extracted to `C:/meshlib-built` as described in the \ref MeshLibCppSetupGuide "C++ Setup Guide": +The `MeshLibDistVS*.zip` archives contain no CMake config files, so `find_package(MeshLib CONFIG REQUIRED)` fails at **configure** time. Point CMake at the extracted tree instead — assuming the archive was extracted to `C:/meshlib-built` as described in the [C++ Setup Guide](\ref MeshLibCppSetupGuide): -\code{.cmd} +```cmd cmake -S . -B build -A x64 ^ -D MESHLIB_INCLUDE_DIRS=C:/meshlib-built/install/include ^ -D MESHLIB_LIB_DIRS=C:/meshlib-built/install/lib/Release -\endcode +``` -\code{.cmake} +```cmake target_include_directories(your_project_name PUBLIC ${MESHLIB_INCLUDE_DIRS}) target_link_directories(your_project_name PUBLIC ${MESHLIB_LIB_DIRS}) target_link_libraries(your_project_name PRIVATE MRMesh) @@ -131,36 +130,36 @@ target_link_libraries(your_project_name PRIVATE MRMesh) target_link_libraries(your_project_name PRIVATE MRViewer) # or, if you use the C API target_link_libraries(your_project_name PRIVATE MeshLibC2) -\endcode +``` -Finally, copy the runtime libraries next to your executable, as described in the \ref MeshLibCppSetupGuide "C++ Setup Guide". +Finally, copy the runtime libraries next to your executable, as described in the [C++ Setup Guide](\ref MeshLibCppSetupGuide). ### Iterator debug level Building with a non-zero iterator debug level needs a different archive (`MeshLibDist_*-IteratorDebug.zip`), and the level your project compiles with has to agree with the one the archive was built with, or the build stops with `fatal error C1189: _ITERATOR_DEBUG_LEVEL is inconsistent with MeshLib`. An archive shipping `install/include/MRMesh/config_dist.h` declares its own level, so a Debug build against `IteratorDebug` needs no flags at all; the form below also covers older archives, where `MR_ITERATOR_DEBUG_LEVEL` has to be named explicitly: -\code{.cmd} +```cmd cmake -S . -B build -A x64 ^ -D MESHLIB_INCLUDE_DIRS=C:/meshlib-built/install/include ^ -D MESHLIB_LIB_DIRS=C:/meshlib-built/install/lib/Debug ^ -D CMAKE_CXX_FLAGS="/D_ITERATOR_DEBUG_LEVEL=2 /DMR_ITERATOR_DEBUG_LEVEL=2" -\endcode +``` ### Building MeshLib from source with vcpkg -To build MeshLib \b itself from source, install its dependencies with \b vcpkg as described in \ref CppSetupWindowsLocalBuild "Installing the local build" in the C++ Setup Guide, then configure from the repository root: +To build MeshLib **itself** from source, install its dependencies with **vcpkg** as described in [Installing the local build](\ref CppSetupWindowsLocalBuild) in the C++ Setup Guide, then configure from the repository root: -\code{.cmd} +```cmd cmake -S . -B build ^ -DCMAKE_TOOLCHAIN_FILE=C:\path\to\vcpkg\scripts\buildsystems\vcpkg.cmake ^ -DVCPKG_TARGET_TRIPLET=x64-windows-meshlib -\endcode +``` -The triplet must be the one the dependencies were actually installed with. `x64-windows-meshlib` is `install.bat`'s default, so it is the right value for **Visual Studio 2026**; on **Visual Studio 2019 or 2022**, step 4 of \ref CppSetupWindowsLocalBuild "Installing the local build" has you set `VCPKG_DEFAULT_TRIPLET` to `x64-windows-vs2019-meshlib` or `x64-windows-vs2022-meshlib`, so pass that same value here. +The triplet must be the one the dependencies were actually installed with. `x64-windows-meshlib` is `install.bat`'s default, so it is the right value for **Visual Studio 2026**; on **Visual Studio 2019 or 2022**, step 4 of [Installing the local build](\ref CppSetupWindowsLocalBuild) has you set `VCPKG_DEFAULT_TRIPLET` to `x64-windows-vs2019-meshlib` or `x64-windows-vs2022-meshlib`, so pass that same value here. -\warning Do not fall back to `x64-windows-meshlib` on an older toolset because it pins no `VCPKG_PLATFORM_TOOLSET` — that only governs what vcpkg builds itself. With the AWS CLI installed (step 3 of the same list), `install.bat` instead restores prebuilt packages from our public S3 cache at `s3://vcpkg-export///`, keyed on the triplet \b name, not on your compiler. CI fills the `x64-windows-meshlib` folder from `msvc-2026` builds only, and the triplets set `VCPKG_DISABLE_COMPILER_TRACKING`, so vcpkg accepts those Visual Studio 2026 binaries on v142/v143 instead of rebuilding, and the link fails. +> [!WARNING] +> Do not fall back to `x64-windows-meshlib` on an older toolset because it pins no `VCPKG_PLATFORM_TOOLSET` — that only governs what vcpkg builds itself. With the AWS CLI installed (step 3 of the same list), `install.bat` instead restores prebuilt packages from our public S3 cache at `s3://vcpkg-export///`, keyed on the triplet **name**, not on your compiler. CI fills the `x64-windows-meshlib` folder from `msvc-2026` builds only, and the triplets set `VCPKG_DISABLE_COMPILER_TRACKING`, so vcpkg accepts those Visual Studio 2026 binaries on v142/v143 instead of rebuilding, and the link fails. -\note This builds MeshLib from source (~40 GB) and does install the CMake config files, so the \ref CmakeQuickIntegration "Quick Integration Guide" above applies to the result. To consume a \b pre-built MeshLib in your own project instead, use *Prebuilt archive from GitHub Releases* above. - -*/ +> [!NOTE] +> This builds MeshLib from source (~40 GB) and does install the CMake config files, so the [Quick Integration Guide](\ref CmakeQuickIntegration) above applies to the result. To consume a **pre-built** MeshLib in your own project instead, use *Prebuilt archive from GitHub Releases* above. diff --git a/doxygen/general_pages/CppSetupGuide.dox b/doxygen/general_pages/CppSetupGuide.md similarity index 66% rename from doxygen/general_pages/CppSetupGuide.dox rename to doxygen/general_pages/CppSetupGuide.md index f3bbd2ee298b..9e8d887acddc 100644 --- a/doxygen/general_pages/CppSetupGuide.dox +++ b/doxygen/general_pages/CppSetupGuide.md @@ -1,17 +1,16 @@ -/** -\page MeshLibCppSetupGuide MeshLib C++ Setup Guide +# MeshLib C++ Setup Guide {#MeshLibCppSetupGuide} # Setting Up MeshLib for C++ Development -\tableofcontents +[TOC] -This guide explains how to set up MeshLib for C++ development on \ref CppSetupWindows "Windows", \ref CppSetupLinux "Linux", and \ref CppSetupMacOS "macOS", -and also shows how to \ref CppSetupWASM "build WebAssembly" modules using MeshLib with Emscripten. +This guide explains how to set up MeshLib for C++ development on [Windows](\ref CppSetupWindows), [Linux](\ref CppSetupLinux), and [macOS](\ref CppSetupMacOS), +and also shows how to [build WebAssembly](\ref CppSetupWASM) modules using MeshLib with Emscripten. It covers all the prerequisites and setup steps for each platform, making it easy to get started. -When you are done, confirm the result with \ref CppSetupVerify "Verify your setup" — two of its three checks need no graphical session and report failure through their exit status. -If a step fails, see \ref CppSetupTroubleshooting "Troubleshooting" at the end of this page. +When you are done, confirm the result with [Verify your setup](\ref CppSetupVerify) — two of its three checks need no graphical session and report failure through their exit status. +If a step fails, see [Troubleshooting](\ref CppSetupTroubleshooting) at the end of this page. -\subsection CppSetupPrerequisites Prerequisites +## Prerequisites {#CppSetupPrerequisites} ### Compiler and language standard @@ -22,15 +21,16 @@ MeshLib uses C++20 standard and is tested to be compiled with: ### CMake -Integrating MeshLib with CMake needs CMake 3.18 or newer. See \ref MeshLibCmakeSetupGuide "the CMake Setup Guide" for the full `CMakeLists.txt`. +Integrating MeshLib with CMake needs CMake 3.18 or newer. See [the CMake Setup Guide](\ref MeshLibCmakeSetupGuide) for the full `CMakeLists.txt`. -\subsection CppSetupWindows Windows -\note MeshLib for Windows is distributed for **x64** and **Arm64**: set the platform of your project to `x64` or `ARM64`. -A 32-bit (`Win32`) build is not supported and fails while compiling `MRMesh/MRId.h` with -`C2535: member function already defined or declared` and `C2995: function template has already been defined` -(on 32-bit MSVC `size_t` and `unsigned int` are the same type, so two `MR::Id` constructors collapse into one). -Visual Studio 2019 still defaults new C++ console projects to `Win32`. -On Windows on Arm, take the `-arm64` archive; it is built with Visual Studio 2026 and ships no `MRCuda`, there being no CUDA toolkit for that platform. +## Windows {#CppSetupWindows} +> [!NOTE] +> MeshLib for Windows is distributed for **x64** and **Arm64**: set the platform of your project to `x64` or `ARM64`. +> A 32-bit (`Win32`) build is not supported and fails while compiling `MRMesh/MRId.h` with +> `C2535: member function already defined or declared` and `C2995: function template has already been defined` +> (on 32-bit MSVC `size_t` and `unsigned int` are the same type, so two `MR::Id` constructors collapse into one). +> Visual Studio 2019 still defaults new C++ console projects to `Win32`. +> On Windows on Arm, take the `-arm64` archive; it is built with Visual Studio 2026 and ships no `MRCuda`, there being no CUDA toolkit for that platform. There are two options: Download and Install release build or compile from sources: ### Installing the release build @@ -59,22 +59,22 @@ They are needed for symbolized call stacks only: without them the archive still - Visit the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases). - Download the archive for your Visual Studio toolset from the table above. - Extract it to a directory, e.g., `C:\meshlib-built\`. - \n **Directory Structure After Extraction** -\code{.cmd} +
**Directory Structure After Extraction** +```cmd install/ ├── include/ # Header files ├── lib/ # Static and shared libraries ├── app/ # Executables example_plugin/ # example solution for creating MeshLib/MeshInspector plugins -\endcode - 2. **Configure and integrate with Visual Studio** \include{doc} CommonDistributionProperties.dox +``` + 2. **Configure and integrate with Visual Studio** \include{doc} CommonDistributionProperties.md - **Copy DLLs**: - \n Copy all `.dll` files from: `C:\meshlib-built\install\app\$(Configuration)` to your project’s output directory: `$(TargetDir)` -\code{.cmd} +
Copy all `.dll` files from: `C:\meshlib-built\install\app\$(Configuration)` to your project’s output directory: `$(TargetDir)` +```cmd xcopy C:\meshlib-built\install\app\$(Configuration)\*.dll $(TargetDir) -\endcode +``` 3. **Verify the installation** - \n Run the checks in \ref CppSetupVerify "Verify your setup": `C:\meshlib-built\install\app\Release\meshconv.exe --help` needs no display and its exit status is the signal, while `C:\meshlib-built\install\app\Release\MeshViewer.exe` is the interactive check. +
Run the checks in [Verify your setup](\ref CppSetupVerify): `C:\meshlib-built\install\app\Release\meshconv.exe --help` needs no display and its exit status is the signal, while `C:\meshlib-built\install\app\Release\MeshViewer.exe` is the interactive check. ### Compile Locally #### Prerequisites @@ -97,48 +97,49 @@ xcopy C:\meshlib-built\install\app\$(Configuration)\*.dll $(TargetDir) - To install `vcpkg`, follow these steps: 1. **Open a command prompt (CMD) or PowerShell window**. 2. **Navigate to a directory where you want to install** `vcpkg` (please avoid using directories with special characters like `!` in full path): -\code{.cmd} +```cmd cd C:\path\to\your\desired\directory -\endcode +``` 3. **Clone the** `vcpkg` **repository**: -\code{.cmd} +```cmd git clone https://github.com/microsoft/vcpkg.git -\endcode +``` 4. **Navigate to the** `vcpkg` **directory**: -\code{.cmd} +```cmd cd vcpkg git checkout 2026.07.29 -\endcode +``` 5. **Run the bootstrap script to build the** `vcpkg` **executable**: -\code{.cmd} +```cmd bootstrap-vcpkg.bat -\endcode +``` 6. **Integrate** `vcpkg` **with Visual Studio (requires Administrator access)**: -\code{.cmd} +```cmd vcpkg integrate install -\endcode +``` [Learn more about](https://github.com/Microsoft/vcpkg) `vcpkg` #### Installing the local build {#CppSetupWindowsLocalBuild} -\note The following steps will require approximately 40 GB of disk space. +> [!NOTE] +> The following steps will require approximately 40 GB of disk space. 1. **Clone the MeshLib Repository**: -\code{.cmd} +```cmd git clone https://github.com/MeshInspector/MeshLib.git -\endcode +``` 2. **Clone submodules**: - \n Run `scripts/clone_submodules_windows.ps1` to clone submodules. It has the same effect as `git submodules update --recursive --init`, except that it skips submodules that are not needed on Windows. - 3. \b (Optional) **Speed Up with AWS CLI** +
Run `scripts/clone_submodules_windows.ps1` to clone submodules. It has the same effect as `git submodules update --recursive --init`, except that it skips submodules that are not needed on Windows. + 3. **(Optional) Speed Up with AWS CLI** - Optionally, [install AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) to speed up the process before using the MeshLib Installation Script. Restart your terminal after installation. - - It also changes \b how the dependencies arrive: with the CLI on `PATH` the script restores prebuilt packages from our public S3 cache (`s3://vcpkg-export///`, no credentials needed) instead of compiling them locally. That cache is keyed on the triplet \b name, not on your compiler, and the `x64-windows-meshlib` folder is written by Visual Studio 2026 builds only. + - It also changes **how** the dependencies arrive: with the CLI on `PATH` the script restores prebuilt packages from our public S3 cache (`s3://vcpkg-export///`, no credentials needed) instead of compiling them locally. That cache is keyed on the triplet **name**, not on your compiler, and the `x64-windows-meshlib` folder is written by Visual Studio 2026 builds only. - So with the AWS CLI installed, the `VCPKG_DEFAULT_TRIPLET` of step 4 is what selects the toolset your dependencies were built with, not just their port overlays: on **Visual Studio 2019 or 2022** it is mandatory, or you link v145 binaries into a v142/v143 project and the link fails. Without the CLI the cache is off and every package is compiled with your own toolset. 4. **Install MeshLib [Third-Party Dependencies](\ref ThirdParty)** - Execute the following commands to run the MeshLib third-party installation script: -\code{.cmd} +```cmd cd vcpkg ..\MeshLib\thirdparty\install.bat -\endcode +``` - This script automates the installation of necessary [Third-Party Dependencies](\ref ThirdParty). - If you build with **Visual Studio 2019**, set `VCPKG_DEFAULT_TRIPLET=x64-windows-vs2019-meshlib` in the environment before running the script, so the v142 triplet and its port overlays are used. - If you build with **Visual Studio 2022**, set `VCPKG_DEFAULT_TRIPLET=x64-windows-vs2022-meshlib` the same way to get the v143 triplet. @@ -154,29 +155,29 @@ cd vcpkg - Open `MeshLib/CMakeLists.txt` in Visual Studio (File - Open - CMake). - Build the project and run the application. 7. **Verify the build** - - Run the checks in \ref CppSetupVerify "Verify your setup": `install\app\Release\meshconv.exe --help` (headless, exit status is the signal) and `install\app\Release\MeshViewer.exe` (interactive). + - Run the checks in [Verify your setup](\ref CppSetupVerify): `install\app\Release\meshconv.exe --help` (headless, exit status is the signal) and `install\app\Release\MeshViewer.exe` (interactive). -\subsection CppSetupLinux Linux +## Linux {#CppSetupLinux} ### Installing the release build 1. **Download the Package for Your Distribution and CPU** - \n Open the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases) page: the release description links a `.deb` for every supported Ubuntu release and architecture. Take the one matching `lsb_release -rs` and `uname -m`. - \n On any other distribution use the portable **Linux vcpkg** build instead. It bundles its own dependencies and is not installed system-wide: unpack it and use the resulting directory as the MeshLib installation prefix, then skip to step 4. -\code{.sh} +
Open the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases) page: the release description links a `.deb` for every supported Ubuntu release and architecture. Take the one matching `lsb_release -rs` and `uname -m`. +
On any other distribution use the portable **Linux vcpkg** build instead. It bundles its own dependencies and is not installed system-wide: unpack it and use the resulting directory as the MeshLib installation prefix, then skip to step 4. +```sh mkdir path_to_install && tar -xf .tar.xz -C path_to_install -\endcode +``` 2. **Install the Package** - \n `apt` pulls in the remaining system dependencies itself. The leading `./` is required: without it `apt` looks for a repository package by that name. - \n `apt` refuses a package built for another CPU, but nothing tells the Ubuntu releases apart: the builds all declare the same dependencies and the `preinst` carries no release check, so installing the Ubuntu 22 build on Ubuntu 24 succeeds silently. Check the release in the file name first. -\code{.sh} +
`apt` pulls in the remaining system dependencies itself. The leading `./` is required: without it `apt` looks for a repository package by that name. +
`apt` refuses a package built for another CPU, but nothing tells the Ubuntu releases apart: the builds all declare the same dependencies and the `preinst` carries no release check, so installing the Ubuntu 22 build on Ubuntu 24 succeeds silently. Check the release in the file name first. +```sh sudo apt install ./.deb -\endcode +``` 3. **Verify the installation** - \n Run the checks in \ref CppSetupVerify "Verify your setup". The `meshconv` one needs no graphical session and reports failure through its exit status: -\code{.sh} +
Run the checks in [Verify your setup](\ref CppSetupVerify). The `meshconv` one needs no graphical session and reports failure through its exit status: +```sh meshconv --help # headless, non-zero exit if the installation is incomplete MeshViewer # interactive, requires a graphical session -\endcode +``` 4. [**Integrate Using CMake**](\ref MeshLibCmakeSetupGuide) ### Compile Locally @@ -187,221 +188,228 @@ MeshViewer # interactive, requires a graphical session - Ensure [CMake](https://cmake.org/download/#latest) is installed for managing the build process. 3. **CUDA Toolkit** - Install [CUDA v12.6](https://developer.nvidia.com/cuda-12-6-3-download-archive) from the official website. Follow the Linux installation instructions provided on the CUDA page. -\note You might need to execute `export PATH=$(echo $PATH | tr ':' '\n' | grep -v '/mnt' | tr '\n' ':' | sed 's/:$//')` if you are on WSL to prevent interfearing with host machine CUDA Toolkit (this command will filter host machine paths from PATH enviroment) +> [!NOTE] +> You might need to execute ``export PATH=$(echo $PATH | tr ':' '\n' | grep -v '/mnt' | tr '\n' ':' | sed 's/:$//')`` if you are on WSL to prevent interfearing with host machine CUDA Toolkit (this command will filter host machine paths from PATH enviroment) #### Installing the local build 1. **Clone the MeshLib Repository**: -\code{.sh} +```sh git clone https://github.com/MeshInspector/MeshLib.git cd MeshLib -\endcode +``` 2. **Clone submodules**: - \n Run `scripts/clone_submodules_linux.sh` to clone submodules. It has the same effect as `git submodules update --recursive --init`, except that it skips submodules that are not needed on Linux. +
Run `scripts/clone_submodules_linux.sh` to clone submodules. It has the same effect as `git submodules update --recursive --init`, except that it skips submodules that are not needed on Linux. 3. **Install/Build [Dependencies](\ref ThirdParty) and Compile**: -\code{.sh} +```sh ./scripts/build_thirdparty.sh # Do not select emscripten in the corresponding question ./scripts/build_source.sh # Do not select emscripten in the corresponding question -\endcode -You may also run the scripts in the non-interactive mode (see \ref CppSetupWASM "Building WebAssembly with MeshLib Using Emscripten" for more info): -\code{.sh} +``` +You may also run the scripts in the non-interactive mode (see [Building WebAssembly with MeshLib Using Emscripten](\ref CppSetupWASM) for more info): +```sh MR_EMSCRIPTEN=OFF ./scripts/build_thirdparty.sh MR_EMSCRIPTEN=OFF ./scripts/build_source.sh -\endcode -\note Dependencies are installed automatically on Ubuntu only. Elsewhere `build_thirdparty.sh` prints *"Unsupported system. Installing dependencies is your responsibility."*, so install the equivalents of [`requirements/ubuntu.txt`](https://github.com/MeshInspector/MeshLib/blob/master/requirements/ubuntu.txt) yourself first. +``` +> [!NOTE] +> Dependencies are installed automatically on Ubuntu only. Elsewhere `build_thirdparty.sh` prints *"Unsupported system. Installing dependencies is your responsibility."*, so install the equivalents of [`requirements/ubuntu.txt`](https://github.com/MeshInspector/MeshLib/blob/master/requirements/ubuntu.txt) yourself first. 4. **Create and Install Package**: - \n This step will create distribution package and install it to the system -\code{.sh} +
This step will create distribution package and install it to the system +```sh ./scripts/distribution.sh sudo apt install ./distr/meshlib-dev.deb -\endcode -\note `distribution.sh` builds a `.deb`, so this step is Ubuntu/Debian-only. On other distributions skip it and use the locally built binaries directly, as in the next step. +``` +> [!NOTE] +> `distribution.sh` builds a `.deb`, so this step is Ubuntu/Debian-only. On other distributions skip it and use the locally built binaries directly, as in the next step. 5. **Verify the build** - \n Run the checks in \ref CppSetupVerify "Verify your setup". The headless one, whose exit status is the signal: +
Run the checks in [Verify your setup](\ref CppSetupVerify). The headless one, whose exit status is the signal: - if you installed the package in the previous step: -\code{.sh} +```sh meshconv --help -\endcode +``` - or the locally built binary: -\code{.sh} +```sh ./build/Release/bin/meshconv --help -\endcode - \n `MeshViewer` (`./build/Release/bin/MeshViewer`) is the interactive check and requires a graphical session. +``` +
`MeshViewer` (`./build/Release/bin/MeshViewer`) is the interactive check and requires a graphical session. 6. [**Integrate Using CMake**](\ref MeshLibCmakeSetupGuide) - \n Examples of integration with CMake can be found in the [examples directory](https://github.com/MeshInspector/MeshLib/blob/master/examples/cpp-examples/CMakeLists.txt) on GitHub. +
Examples of integration with CMake can be found in the [examples directory](https://github.com/MeshInspector/MeshLib/blob/master/examples/cpp-examples/CMakeLists.txt) on GitHub. -\subsection CppSetupMacOS macOS +## macOS {#CppSetupMacOS} ### Installing the release build 1. **Download the Installer** - \n Open the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases) page: the release description links one `.pkg` installer for macOS Arm (Apple silicon) and one for macOS x64 (Intel). Take the one matching `uname -m` (`arm64` or `x86_64`). +
Open the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases) page: the release description links one `.pkg` installer for macOS Arm (Apple silicon) and one for macOS x64 (Intel). Take the one matching `uname -m` (`arm64` or `x86_64`). 2. **Install** - Double-click the downloaded `.pkg` and follow the installer. The release asset is the installer itself, so there is nothing to unpack first. - The framework is installed into `/Library/Frameworks/MeshLib.framework`, or into `~/Library/Frameworks/MeshLib.framework` if you choose to install for the current user only. - **Install Dependencies via Homebrew** - \n The `.pkg` does not pull in the Homebrew formulae MeshLib links against, so install them yourself. Skip this step if your project enables only the C language. This needs Homebrew — if you do not have it, install it first as described under \ref CppSetupMacOSPrereq "Prerequisites". Open Terminal and run the following command: -\code{.sh} +
The `.pkg` does not pull in the Homebrew formulae MeshLib links against, so install them yourself. Skip this step if your project enables only the C language. This needs Homebrew — if you do not have it, install it first as described under [Prerequisites](\ref CppSetupMacOSPrereq). Open Terminal and run the following command: +```sh xargs brew install < /Library/Frameworks/MeshLib.framework/Versions/Current/requirements/macos.txt -\endcode +``` - If you installed for the current user only, prefix the path with `~`: `~/Library/Frameworks/MeshLib.framework/Versions/Current/requirements/macos.txt`. 3. **Verify the installation** - \n Run the checks in \ref CppSetupVerify "Verify your setup". `meshconv` is not on `PATH`; it lives in the framework and needs no graphical session: -\code{.sh} +
Run the checks in [Verify your setup](\ref CppSetupVerify). `meshconv` is not on `PATH`; it lives in the framework and needs no graphical session: +```sh /Library/Frameworks/MeshLib.framework/Versions/Current/bin/meshconv --help -\endcode +``` 4. [**Integrate Using CMake**](\ref MeshLibCmakeSetupGuide) - \n Examples of integration with CMake can be found in the [examples directory](https://github.com/MeshInspector/MeshLib/blob/master/examples/cpp-examples/CMakeLists.txt) on GitHub. +
Examples of integration with CMake can be found in the [examples directory](https://github.com/MeshInspector/MeshLib/blob/master/examples/cpp-examples/CMakeLists.txt) on GitHub. ### Compile Locally #### Prerequisites {#CppSetupMacOSPrereq} 1. **Install Homebrew** - Run the following command in your terminal to install Homebrew: -\code{.sh} +```sh /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -\endcode +``` - [Install Homebrew](https://brew.sh/) 2. **Update Homebrew** - Make sure Homebrew is up to date: -\code{.sh} +```sh brew update -\endcode +``` 3. **Install Git Using Homebrew** - Once Homebrew is installed and added to your PATH, you can proceed to install Git: -\code{.sh} +```sh brew install git -\endcode +``` - [Learn more about Git](https://git-scm.com/) #### Installing the local build 1. **Clone the MeshLib Repository**: -\code{.sh} +```sh git clone https://github.com/MeshInspector/MeshLib.git cd MeshLib -\endcode +``` 2. **Clone submodules**: - \n Run `scripts/clone_submodules_macos.sh` to clone submodules. It has the same effect as `git submodules update --recursive --init`, except that it skips submodules that are not needed on MacOS. +
Run `scripts/clone_submodules_macos.sh` to clone submodules. It has the same effect as `git submodules update --recursive --init`, except that it skips submodules that are not needed on MacOS. 3. **Install/Build [Dependencies](\ref ThirdParty) and Compile**: -\code{.sh} +```sh ./scripts/build_thirdparty.sh ./scripts/build_source.sh -\endcode +``` 4. **Verify the build** - \n Run the checks in \ref CppSetupVerify "Verify your setup" — `./build/Release/bin/meshconv --help` needs no graphical session and its exit status is the signal. +
Run the checks in [Verify your setup](\ref CppSetupVerify) — `./build/Release/bin/meshconv --help` needs no graphical session and its exit status is the signal. 5. **Run example** We suggest starting with the [**mesh loading and saving example**](\ref ExampleMeshLoadSave), which demonstrates how to work with mesh files programmatically. 6. [**Integrate Using CMake**](\ref MeshLibCmakeSetupGuide) -\subsection CppSetupWASM Building WebAssembly with MeshLib Using Emscripten +## Building WebAssembly with MeshLib Using Emscripten {#CppSetupWASM} This guide will help you build WebAssembly (WASM) using MeshLib and Emscripten. Please follow the instructions step by step. -\note Only web and worker environments (i.e. web browsers) are officially supported. +> [!NOTE] +> Only web and worker environments (i.e. web browsers) are officially supported. ### Install Emscripten Emscripten is required to compile C++ code into WebAssembly. You can install Emscripten by following the steps below. For more details, refer to the [Emscripten official page](https://emscripten.org/docs/getting_started/downloads.html). - Clone the Emscripten SDK Repository - \n Run the following command on **all platforms**: -\code{.sh} +
Run the following command on **all platforms**: +```sh git clone https://github.com/emscripten-core/emsdk.git -\endcode +``` - Navigate to the Emscripten SDK Directory -\code{.sh} +```sh cd emsdk -\endcode +``` - Update the SDK (Optional) - \n This step ensures you have the latest updates: -\code{.sh} +
This step ensures you have the latest updates: +```sh git pull origin -\endcode +``` - Install a Specific Version of Emscripten -\code{.sh} +```sh ./emsdk install 4.0.19 -\endcode +``` - Activate the Installed Version -\code{.sh} +```sh ./emsdk activate 4.0.19 -\endcode +``` - Set Up Environment Variables - **macOS and Linux**: -\code{.sh} +```sh source ./emsdk_env.sh -\endcode +``` -\note **For Windows Users:** -\n Make sure you are using Git Bash, WSL, or another Unix-like environment if you want to follow the exact same steps as on Linux/macOS. +> [!NOTE] +> **For Windows Users:** +>
Make sure you are using Git Bash, WSL, or another Unix-like environment if you want to follow the exact same steps as on Linux/macOS. ### Installing the release build 1. **Download the Built Version** - \n Open the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases) page and download the Emscripten archive whose threading mode and pointer width match the build that will consume MeshLib: the release description links a multi-thread, a single-thread and a multi-thread Wasm64 variant. - \n These are the same three modes that \ref CppSetupWASMLocalBuild "Compile locally" selects with `MR_EMSCRIPTEN` / `MR_EMSCRIPTEN_SINGLETHREAD` / `MR_EMSCRIPTEN_WASM64`. The archive has to match your own build: an Emscripten target links only against libraries built with the same `-pthread` and `MEMORY64` settings. +
Open the [MeshLib GitHub Releases](https://github.com/MeshInspector/MeshLib/releases) page and download the Emscripten archive whose threading mode and pointer width match the build that will consume MeshLib: the release description links a multi-thread, a single-thread and a multi-thread Wasm64 variant. +
These are the same three modes that [Compile locally](\ref CppSetupWASMLocalBuild) selects with `MR_EMSCRIPTEN` / `MR_EMSCRIPTEN_SINGLETHREAD` / `MR_EMSCRIPTEN_WASM64`. The archive has to match your own build: an Emscripten target links only against libraries built with the same `-pthread` and `MEMORY64` settings. 2. **Extract the Package** - \n Extract the package using an archiving tool or with the unzip command: -\code{.sh} +
Extract the package using an archiving tool or with the unzip command: +```sh unzip -d path_to_install .zip -\endcode +``` 3. [**Integrate Using CMake**](\ref MeshLibCmakeSetupGuide) - \n Specify the path to the extracted files with the `CMAKE_FIND_ROOT_PATH` option: -\code{.sh} +
Specify the path to the extracted files with the `CMAKE_FIND_ROOT_PATH` option: +```sh emcmake cmake -S . -B build -DCMAKE_FIND_ROOT_PATH=path_to_install -\endcode - \n Examples of integration with CMake can be found in the [examples directory](https://github.com/MeshInspector/MeshLib/blob/master/examples/cpp-examples/CMakeLists.txt) on GitHub. +``` +
Examples of integration with CMake can be found in the [examples directory](https://github.com/MeshInspector/MeshLib/blob/master/examples/cpp-examples/CMakeLists.txt) on GitHub. ### Compile locally {#CppSetupWASMLocalBuild} - Navigate to the MeshLib directory: -\code{.sh} +```sh cd ~/MeshLib -\endcode - - Run the script to build [Third-Party Dependencies](\ref ThirdParty). When prompted, select \b Emscripten as the build target: +``` + - Run the script to build [Third-Party Dependencies](\ref ThirdParty). When prompted, select **Emscripten** as the build target: - `y` - Emscripten, multi-threaded - `s` - Emscripten, single-threaded - `l` - Emscripten, multi-threaded 64-bit (wasm64) - any other key, or no keypress within 5 seconds - native, non-Emscripten build -\code{.sh} +```sh ./scripts/build_thirdparty.sh -\endcode +``` - Build the MeshLib source code. Make sure to select the same Emscripten option you used in the `build_thirdparty.sh` script: -\code{.sh} +```sh ./scripts/build_source.sh -\endcode - -\note **Non-interactive builds.** You may pre-set the environment variables to skip the prompt: -\code{.sh} -export MR_EMSCRIPTEN=ON # same as 'y': multi-threaded -#export MR_EMSCRIPTEN_SINGLETHREAD=1 # ...plus this for 's': single-threaded -#export MR_EMSCRIPTEN_WASM64=1 # ...plus this for 'l': multi-threaded 64-bit -./scripts/build_thirdparty.sh -./scripts/build_source.sh -\endcode - -\note **For Windows Users:** -\n You may encounter compatibility issues if building directly on Windows. Consider using WSL (Windows Subsystem for Linux) to follow Linux-like instructions. +``` + +> [!NOTE] +> **Non-interactive builds.** You may pre-set the environment variables to skip the prompt: +> ```sh +> export MR_EMSCRIPTEN=ON # same as 'y': multi-threaded +> #export MR_EMSCRIPTEN_SINGLETHREAD=1 # ...plus this for 's': single-threaded +> #export MR_EMSCRIPTEN_WASM64=1 # ...plus this for 'l': multi-threaded 64-bit +> ./scripts/build_thirdparty.sh +> ./scripts/build_source.sh +> ``` + +> [!NOTE] +> **For Windows Users:** +>
You may encounter compatibility issues if building directly on Windows. Consider using WSL (Windows Subsystem for Linux) to follow Linux-like instructions. #### Running the WebAssembly Build {#CppSetupWASMRun} After building MeshLib for WebAssembly, follow these steps to run it: - Setting Up a Local HTTP Server - Navigate to the build directory: -\code{.sh} +```sh cd ~/MeshLib/build -\endcode +``` - Start a local server: - - \b Windows -\code{.sh} + - **Windows** +```sh python -m http.server -\endcode +``` - **macOS/Linux:** -\code{.sh} +```sh python3 -m http.server -\endcode +``` - Configuring COEP and COOP for Multithreading - \n If using multithreading, set these headers: +
If using multithreading, set these headers: - **Cross-Origin Embedder Policy** (COEP): `require-corp` - **Cross-Origin Opener Policy** (COOP): `same-origin` For Python servers, you can use this custom script (`server.py`): -\code{.py} +```py #!/usr/bin/env python from http import server @@ -419,45 +427,45 @@ class MyHTTPRequestHandler(server.SimpleHTTPRequestHandler): if __name__ == '__main__': server.test(HandlerClass=MyHTTPRequestHandler) -\endcode +``` - Access and Test - Open your browser and go to: `http://127.0.0.1:8000` - Ensure headers are set correctly for multithreading. Check the browser console for errors if needed. -\subsection CppSetupVerify Verify your setup +## Verify your setup {#CppSetupVerify} Two of the three checks below need no graphical session and report failure through their exit status — use those on a server, in a container, in CI or from a coding agent. **1. Run `meshconv`.** It ships in every package and needs no display. It exits `0` only if the binary and all of its shared libraries load, so a non-zero status means the installation is incomplete: -\code{.sh} +```sh meshconv --help # Linux: on PATH from /usr/local/bin /Library/Frameworks/MeshLib.framework/Versions/Current/bin/meshconv --help # macOS: not on PATH -\endcode -\code{.cmd} +``` +```cmd install\app\Release\meshconv.exe --help -\endcode +``` A broken installation fails loudly here, e.g. `error while loading shared libraries: libMRIOExtras.so` with exit `127`. -**2. Build and run a program against MeshLib.** The strongest check: it verifies the headers, the libraries and linking, which running a prebuilt binary does not. Take the complete `CMakeLists.txt` from \ref MeshLibCmakeSetupGuide "the CMake Setup Guide" and use this as `main.cpp`: +**2. Build and run a program against MeshLib.** The strongest check: it verifies the headers, the libraries and linking, which running a prebuilt binary does not. Take the complete `CMakeLists.txt` from [the CMake Setup Guide](\ref MeshLibCmakeSetupGuide) and use this as `main.cpp`: \include VerifySetup.dox.cpp It prints `verts=8 faces=12`, writes a 684-byte `cube.stl` next to the executable, and returns non-zero on any mismatch or save error. MeshLib CI compiles it on every supported platform as `examples/cpp-examples/VerifySetup.dox.cpp`. **3. Open `MeshViewer`** — the interactive check, and the only one that **requires a graphical session**. Without one it logs `X11: The DISPLAY environment variable is missing` and `glfwInit failed`. Its exit status is not a dependable success signal (`1` on the Ubuntu package, reported as `0` on other builds), so never gate an automated check on it — use check 1 or 2 for that. -\subsection CppSetupTroubleshooting Troubleshooting +## Troubleshooting {#CppSetupTroubleshooting} Failures most often hit while following the steps above, with the message each one actually produces. | Path | Symptom | Cause | Fix | |------|---------|-------|-----| -| Windows, prebuilt | Compilation of any file including MeshLib stops with `#error _ITERATOR_DEBUG_LEVEL is inconsistent with MeshLib`. This is a **compile** error raised by MeshLib itself, not a linker error. | The archive was built for a different iterator-debug setting than your project uses. `MR_ITERATOR_DEBUG_LEVEL` is the level MeshLib's own binaries were built with — taken from `install/include/MRMesh/config_dist.h` when the archive ships one, otherwise defaulting to `0` — and MeshLib refuses to compile when your `_ITERATOR_DEBUG_LEVEL` differs from it. A Debug configuration implies `_ITERATOR_DEBUG_LEVEL=2`, which is why an unconfigured Debug build hits this against the per-Visual-Studio archives. | Take the archive matching your toolset and iterator-debug setting from the table in \ref CppSetupWindows "Windows", then define `_ITERATOR_DEBUG_LEVEL` to that row's value, plus `MR_ITERATOR_DEBUG_LEVEL` to the same value if the archive has no `config_dist.h`. | -| Windows, from source | `thirdparty\install.bat` finishes, but the Visual Studio solution stops with `fatal error C1083: Cannot open include file` on a third-party header. Hits **Visual Studio 2019 and 2022** builds, i.e. the ones step 4 of \ref CppSetupWindowsLocalBuild "Installing the local build" has set `VCPKG_DEFAULT_TRIPLET` for. | The solution and vcpkg disagree on the triplet. `source/common.props` takes `VcpkgTriplet` from `VCPKG_DEFAULT_TRIPLET` and reads `\installed\$(VcpkgTriplet)`, so this needs the variable to have reached `install.bat` but not the build: set with `set` in the one terminal that ran the script, or set after Visual Studio was started, so the build fell back to the `x64-windows-meshlib` default while the packages are in `installed\x64-windows-vs2019-meshlib`. A stale `CustomMRProps.props` above `source\` naming a third triplet does the same. Rerunning the script cannot help. | Name the triplet vcpkg actually installed — check which folder exists under `\installed\` — and do not edit `common.props`. For the IDE, `setx VCPKG_DEFAULT_TRIPLET x64-windows-vs2022-meshlib` and restart Visual Studio; from the command line, `msbuild -m source\MeshLib.sln -p:Configuration=Release -p:VcpkgTriplet=x64-windows-vs2022-meshlib`, which overrides the environment. Both are step 5 of the same list. | +| Windows, prebuilt | Compilation of any file including MeshLib stops with `#error _ITERATOR_DEBUG_LEVEL is inconsistent with MeshLib`. This is a **compile** error raised by MeshLib itself, not a linker error. | The archive was built for a different iterator-debug setting than your project uses. `MR_ITERATOR_DEBUG_LEVEL` is the level MeshLib's own binaries were built with — taken from `install/include/MRMesh/config_dist.h` when the archive ships one, otherwise defaulting to `0` — and MeshLib refuses to compile when your `_ITERATOR_DEBUG_LEVEL` differs from it. A Debug configuration implies `_ITERATOR_DEBUG_LEVEL=2`, which is why an unconfigured Debug build hits this against the per-Visual-Studio archives. | Take the archive matching your toolset and iterator-debug setting from the table in [Windows](\ref CppSetupWindows), then define `_ITERATOR_DEBUG_LEVEL` to that row's value, plus `MR_ITERATOR_DEBUG_LEVEL` to the same value if the archive has no `config_dist.h`. | +| Windows, from source | `thirdparty\install.bat` finishes, but the Visual Studio solution stops with `fatal error C1083: Cannot open include file` on a third-party header. Hits **Visual Studio 2019 and 2022** builds, i.e. the ones step 4 of [Installing the local build](\ref CppSetupWindowsLocalBuild) has set `VCPKG_DEFAULT_TRIPLET` for. | The solution and vcpkg disagree on the triplet. `source/common.props` takes `VcpkgTriplet` from `VCPKG_DEFAULT_TRIPLET` and reads `\installed\$(VcpkgTriplet)`, so this needs the variable to have reached `install.bat` but not the build: set with `set` in the one terminal that ran the script, or set after Visual Studio was started, so the build fell back to the `x64-windows-meshlib` default while the packages are in `installed\x64-windows-vs2019-meshlib`. A stale `CustomMRProps.props` above `source\` naming a third triplet does the same. Rerunning the script cannot help. | Name the triplet vcpkg actually installed — check which folder exists under `\installed\` — and do not edit `common.props`. For the IDE, `setx VCPKG_DEFAULT_TRIPLET x64-windows-vs2022-meshlib` and restart Visual Studio; from the command line, `msbuild -m source\MeshLib.sln -p:Configuration=Release -p:VcpkgTriplet=x64-windows-vs2022-meshlib`, which overrides the environment. Both are step 5 of the same list. | | Linux, macOS, WASM (consuming an installed MeshLib) | `MRMeshFwd.h:70:10: fatal error: parallel_hashmap/phmap_fwd_decl.h: No such file or directory` | MeshLib's public headers include third-party headers, and `${MESHLIB_THIRDPARTY_INCLUDE_DIR}` is missing from your target's include directories. | Add it next to `${MESHLIB_INCLUDE_DIR}`: `target_include_directories(${TARGET} PUBLIC ${MESHLIB_INCLUDE_DIR} ${MESHLIB_THIRDPARTY_INCLUDE_DIR})`. See \ref MeshLibCmakeSetupGuide and [examples/cpp-examples/CMakeLists.txt](https://github.com/MeshInspector/MeshLib/blob/master/examples/cpp-examples/CMakeLists.txt). | | Linux, macOS (consuming an installed MeshLib) | CMake configuration stops with `Target "..." links to: MeshLib::MeshLibC2 but the target was not found`, suggesting a typo. | `meshlib-config.cmake` defines the C API target only when the project has the C language enabled. | Add `C` to the languages of your `project()` call. | | macOS | CMake configuration fails inside `MRMeshConfig.cmake` with `find_dependency`: `Could NOT find Boost (missing: Boost_INCLUDE_DIR)` (Boost is just the first of several such dependencies). | The Homebrew requirements were never installed — the `.pkg` installer does not pull them in. | `xargs brew install < /Library/Frameworks/MeshLib.framework/Versions/Current/requirements/macos.txt` (for a current-user-only install, prefix the path with `~`). | | WASM | `build_thirdparty.sh` or `build_source.sh` silently produces a native build although Emscripten was selected. | The prompt is a `read -t 5`: with no keypress within five seconds it falls back to `OFF`. Each script asks separately, so the two can disagree. | Skip the prompt entirely — `export MR_EMSCRIPTEN=ON` once, before running **both** scripts. Each script prints its resolved mode (`Emscripten ON …`); check that line before waiting on a long build. | -| WASM, runtime | `SharedArrayBuffer is not defined` in the browser console. | The page is served without the cross-origin isolation headers that the multithreaded build needs for shared memory. | Serve with `Cross-Origin-Embedder-Policy: require-corp` and `Cross-Origin-Opener-Policy: same-origin` — see \ref CppSetupWASMRun "Running the WebAssembly Build". | -| Any, runtime | `glfw_error_callback: X11: The DISPLAY environment variable is missing`, then `glfwInit failed`. | `MeshViewer` was started without a graphical session. Expected over plain SSH or on a headless server — not a broken installation. Its exit status is not a dependable success signal (`1` on the Ubuntu package, reported as `0` on other builds), so do not gate an automated check on it. | Open a desktop session, or run under a virtual display the way MeshLib CI does: `xvfb-run -a MeshViewer -hidden -noEventLoop -unloadPluginsAtEnd`. To check an installation without a display, use \ref CppSetupVerify "Verify your setup" instead. | +| WASM, runtime | `SharedArrayBuffer is not defined` in the browser console. | The page is served without the cross-origin isolation headers that the multithreaded build needs for shared memory. | Serve with `Cross-Origin-Embedder-Policy: require-corp` and `Cross-Origin-Opener-Policy: same-origin` — see [Running the WebAssembly Build](\ref CppSetupWASMRun). | +| Any, runtime | `glfw_error_callback: X11: The DISPLAY environment variable is missing`, then `glfwInit failed`. | `MeshViewer` was started without a graphical session. Expected over plain SSH or on a headless server — not a broken installation. Its exit status is not a dependable success signal (`1` on the Ubuntu package, reported as `0` on other builds), so do not gate an automated check on it. | Open a desktop session, or run under a virtual display the way MeshLib CI does: `xvfb-run -a MeshViewer -hidden -noEventLoop -unloadPluginsAtEnd`. To check an installation without a display, use [Verify your setup](\ref CppSetupVerify) instead. | | Windows, runtime | `MeshViewer.exe` logs `icons path …\app\Release\resource\logos\X1 is not directory` (and `X3`). | Benign: those logo directories are not part of the release archive. The viewer still starts, creates its window and renders. | Nothing to fix — this is not an installation problem. | ### Where the logs are @@ -466,5 +474,3 @@ Failures most often hit while following the steps above, with the message each o - **Third-party build.** `scripts/build_thirdparty.sh` writes `install_thirdparty_.log` in the current directory and announces it on its second line of output (`You could find output in …`). The console shows only a fraction of the output; the failing compiler invocation is in that file. Anything not listed here: please open an issue at [MeshLib Issues](https://github.com/MeshInspector/MeshLib/issues), attaching the relevant log above. - -*/ diff --git a/doxygen/general_pages/DataModel.dox b/doxygen/general_pages/DataModel.md similarity index 96% rename from doxygen/general_pages/DataModel.dox rename to doxygen/general_pages/DataModel.md index 02b51401880a..354074d0ec28 100644 --- a/doxygen/general_pages/DataModel.dox +++ b/doxygen/general_pages/DataModel.md @@ -1,6 +1,4 @@ -namespace MR { - -/** \page DataModel Data Model Class Hierarchy +# Data Model Class Hierarchy {#DataModel} All data in MeshLib are stored in objects. Each object can have it own type derived from Object: @@ -29,7 +27,7 @@ Objects inherit parameters from scene parent, for example transform and visibili ## Serialization To serialize object tree one needs to call -\code +```cpp // saves object subtree in given scene file (zip/mru) // format specification: // children are saved under folder with name of their parent object @@ -38,10 +36,10 @@ To serialize object tree one needs to call // saving is controlled with Object::serializeModel_ and Object::serializeFields_ MRMESH_API tl::expected serializeObjectTree( const Object& object, const std::filesystem::path& path, ProgressCallback progress = {} ); -\endcode +``` And to deserialize object tree: -\code +```cpp // loads objects tree from given scene file (zip/mru) // format specification: // children are saved under folder with name of their parent object @@ -49,7 +47,7 @@ And to deserialize object tree: // // loading is controlled with Object::deserializeModel_ and Object::deserializeFields_ MRMESH_API tl::expected deserializeObjectTree(const std::filesystem::path& path); -\endcode +``` ## Inheritance To create your own object type you need to make class derived from one of base class: @@ -60,11 +58,11 @@ To create your own object type you need to make class derived from one of base c To be able to use serialization and deserialization you have to do: 1. Register new data model unit in class factory by adding -\code +```cpp MR_ADD_CLASS_FACTORY( MyCustomObject ); -\endcode +``` 2. Override following functions -\code +```cpp // Creates future to save object model (e.g. mesh) in given file MRMESH_API virtual tl::expected, std::string> serializeModel_( const std::filesystem::path& path ) const; @@ -78,7 +76,4 @@ MR_ADD_CLASS_FACTORY( MyCustomObject ); // Reads parameters from json value // if you override this method, please call Base::deserializeFields_(root) in the beginning MRMESH_API virtual void deserializeFields_( const Json::Value& root ); -\endcode -*/ - -} +``` diff --git a/doxygen/general_pages/ExamplePluginOverview.dox b/doxygen/general_pages/ExamplePluginOverview.md similarity index 72% rename from doxygen/general_pages/ExamplePluginOverview.dox rename to doxygen/general_pages/ExamplePluginOverview.md index d7ca3ee1166e..52436d83ed0e 100644 --- a/doxygen/general_pages/ExamplePluginOverview.dox +++ b/doxygen/general_pages/ExamplePluginOverview.md @@ -1,14 +1,13 @@ -/** +# C++ Example Plugin Overview {#ExamplePluginOverview} -\page ExamplePluginOverview C++ Example Plugin Overview - -\tableofcontents +[TOC] # C++ Distribution Example Plugin ## Introduction This page describes what is present in `example_plugin` directory of the Windows and WebAssembly distribution archive and how to use it. -\note Please have a look at [MeshLib С++ setup guide](\ref CppSetupWindows) first. +> [!NOTE] +> Please have a look at [MeshLib С++ setup guide](\ref CppSetupWindows) first. ## Content This example contains several files: @@ -28,10 +27,10 @@ Lets have a closer look at each of these points: `example_plugin.sln` - This can be used to build an example with Visual Studio, it only includes `example_plugin.vcxproj` in it. ### Visual Studio Project File -`example_plugin.vcxproj` - This file is configured so project can work with MeshLib distribuiton \include{doc} CommonDistributionProperties.dox +`example_plugin.vcxproj` - This file is configured so project can work with MeshLib distribuiton \include{doc} CommonDistributionProperties.md - Define `IMGUI_DISABLE_OBSOLETE_FUNCTIONS` - Copy other files to target directory: -\code{.xml} +```xml Document @@ -43,18 +42,18 @@ Lets have a closer look at each of these points: PreserveNewest -\endcode +``` ### Tools Configuration File `MyPlugin.items.json` - this file contains information about each tool that is present in the plugin: - - \b "Name" - name of the tool, should be same as in the code - - \b "Tooltip" - tooltip that is shown when user hover tool in UI - - \b "Icon" - unicode symbol from [Fontawesome](https://fontawesome.com), it is shown in UI for the tool if there is no actual icon present in `resource` folder - - \b "Caption" - optional: label that is displayed instead of name in UI, if not present "Name" is used intead - - \b "HelpLink" - optional: link to web page that will be opened if "Help" button is pressed in UI - - \b "DropList" - optional: array with other tools that will be available in this tool drop list (see "List" in next section) - -\code{.json} + - **"Name"** - name of the tool, should be same as in the code + - **"Tooltip"** - tooltip that is shown when user hover tool in UI + - **"Icon"** - unicode symbol from [Fontawesome](https://fontawesome.com), it is shown in UI for the tool if there is no actual icon present in `resource` folder + - **"Caption"** - optional: label that is displayed instead of name in UI, if not present "Name" is used intead + - **"HelpLink"** - optional: link to web page that will be opened if "Help" button is pressed in UI + - **"DropList"** - optional: array with other tools that will be available in this tool drop list (see "List" in next section) + +```json { "Items": [ { @@ -69,21 +68,21 @@ Lets have a closer look at each of these points: } ] } -\endcode +``` ### Tools Visualization Order File `MyPlugin.ui.json` - this file has information about order of the plugin loading, and UI schema for present tools: - - \b "Order" - order of loading dll produced by this plugin, it can be used to determine constuction of tools in diferent plugins - - \b "LibName" - name of the dll that contains provided tools (in this case it is same dll) - - \b "Tabs" - tabs where tools are located in UI, could be new tabs or existing ones (specified plugins with less "Order" number) - - \b "Name" - name of the tab - - \b "Priority" - optional: tabs are ordered by this number - - \b "Groups" - specify groups of tools in single tab, could be new groups or existing ones (specified plugins with less "Order" number) - - \b "Name" - name of the group (it is not used now) - - \b "List" - list of the tools in this group - - \b "Name" - name of the tool, should be same as in the code and in the `items.json` file - -\code{.json} + - **"Order"** - order of loading dll produced by this plugin, it can be used to determine constuction of tools in diferent plugins + - **"LibName"** - name of the dll that contains provided tools (in this case it is same dll) + - **"Tabs"** - tabs where tools are located in UI, could be new tabs or existing ones (specified plugins with less "Order" number) + - **"Name"** - name of the tab + - **"Priority"** - optional: tabs are ordered by this number + - **"Groups"** - specify groups of tools in single tab, could be new groups or existing ones (specified plugins with less "Order" number) + - **"Name"** - name of the group (it is not used now) + - **"List"** - list of the tools in this group + - **"Name"** - name of the tool, should be same as in the code and in the `items.json` file + +```json { "Order": 999, "LibName": "example_plugin", @@ -107,7 +106,7 @@ Lets have a closer look at each of these points: } ] } -\endcode +``` ### Resoure Directory `resource` - directory with icons that is used in UI, it should have same structure as in example: @@ -118,7 +117,8 @@ Lets have a closer look at each of these points: - X1 (32x32 px) - X3 (96x96 px) -\note Icons should have same name as tool in the code, in `items.json` file and in `ui.json` file +> [!NOTE] +> Icons should have same name as tool in the code, in `items.json` file and in `ui.json` file ### Source Code File `MyPlugin.cpp` - this file contains two simple tools: @@ -139,24 +139,25 @@ For more information have a look at [State Plugin Page](\ref StatePluginsHelp) 3. Copy content of just appeared `x64\Release\` folder to MeshLib or MeshInspector app folder - MeshLib: `install\app\Release` - MeshInspector: `C:\Program Files\MeshInspector\MeshInspector`, please note that you should use same version of MeshLib that is used in MeshInspector to avoid unexpected errors -\note take `x64\Debug\` if you want to test it in MeshLib debug app folder: `install\app\Debug` +> [!NOTE] +> take `x64\Debug\` if you want to test it in MeshLib debug app folder: `install\app\Debug` ### Linux 1. Install MeshLib (`apt install meshlib`) or unpack the SDK archive next to your plugin source. 2. Build: -\code{.sh} +```sh cmake -S example_plugin -B example_plugin_build -D CMAKE_BUILD_TYPE=Release \ -D MeshLib_DIR=/usr/lib/cmake/meshlib # adjust to your install cmake --build example_plugin_build -j -\endcode +``` 3. Deploy: -\code{.sh} +```sh sudo cp example_plugin_build/libMyPlugin.so /usr/lib/MeshInspector/ sudo cp example_plugin/MyPlugin.items.json /usr/share/MeshInspector/ sudo cp example_plugin/MyPlugin.ui.json /usr/share/MeshInspector/ sudo cp -R example_plugin/resource /usr/share/MeshInspector/ -\endcode +``` ### macOS (arm64 / Intel) @@ -164,12 +165,12 @@ The MeshLib SDK ships as a framework at `/Library/Frameworks/MeshLib.framework`. 1. Install MeshLib SDK. 2. Build: -\code{.sh} +```sh cmake -S example_plugin -B example_plugin_build -D CMAKE_BUILD_TYPE=Release cmake --build example_plugin_build -j -\endcode +``` 4. Deploy. **Recommended (safer):** install into a writable clone of the host app — does not touch the system bundle and does not break its code signature. -\code{.sh} +```sh mkdir -p ~/Apps cp -R /Applications/MeshInspector.app ~/Apps/MI-MyPlugin # NB: drop the .app suffix @@ -177,20 +178,21 @@ cp example_plugin_build/libMyPlugin.dylib ~/Apps/MI-MyPlugin/Contents cp example_plugin/MyPlugin.items.json ~/Apps/MI-MyPlugin/Contents/Resources/ cp example_plugin/MyPlugin.ui.json ~/Apps/MI-MyPlugin/Contents/Resources/ cp -R example_plugin/resource ~/Apps/MI-MyPlugin/Contents/Resources/ -\endcode +``` -The system-wide alternative (writes into the notarized `MeshInspector.app` bundle) is documented under \ref HowtoAddPluginOverview "How to Add Plugin" → macOS option B, including the signature trade-off. +The system-wide alternative (writes into the notarized `MeshInspector.app` bundle) is documented under [How to Add Plugin](\ref HowtoAddPluginOverview) → macOS option B, including the signature trade-off. ### WebAssembly 1. [Install and activate Emscripten SDK](https://emscripten.org/docs/tools_reference/emsdk.html#emsdk-howto) 2. [Download and unpack MeshLib SDK](https://github.com/MeshInspector/MeshLib/releases) 3. Configure and build the project using CMake and emcmake: -\code{.sh} +```sh emcmake cmake -S example_plugin -B example_plugin_build -D CMAKE_FIND_ROOT_PATH=/path/to/meshlib/sdk/ cmake --build example_plugin_build --config Release -\endcode +``` 4. Copy the result files from the `example_plugin_build/html` directory to your web server location. -\note Make sure your web server enables [cross-origin isolation](https://web.dev/articles/coop-coep) for these files. +> [!NOTE] +> Make sure your web server enables [cross-origin isolation](https://web.dev/articles/coop-coep) for these files. ## After install — quick sanity check @@ -200,16 +202,14 @@ Restart the host app and look at the log: - macOS: `$TMPDIR/MeshInspector/Logs/MRLog_*.txt` You should see two lines per plugin: -\code{.unparsed} +```unparsed [info] Loading library MyPlugin with priority 999 [info] Load library MyPlugin was successful -\endcode +``` If instead you get: -\code{.unparsed} +```unparsed [error] dlopen(...): Library not loaded: ... [warning] Ribbon item "My Tool" is not registered -\endcode -the plugin's transitive dependencies didn't resolve from the host bundle (so the dylib never loaded, and therefore no items got registered). See \ref HowtoAddPluginOverview "How to Add Plugin" → "Verifying the install" for fix paths. - -*/ \ No newline at end of file +``` +the plugin's transitive dependencies didn't resolve from the host bundle (so the dylib never loaded, and therefore no items got registered). See [How to Add Plugin](\ref HowtoAddPluginOverview) → "Verifying the install" for fix paths. diff --git a/doxygen/general_pages/FileFormatSupport.dox b/doxygen/general_pages/FileFormatSupport.md similarity index 93% rename from doxygen/general_pages/FileFormatSupport.dox rename to doxygen/general_pages/FileFormatSupport.md index 9a0f79b982ec..f23edf17f8b1 100644 --- a/doxygen/general_pages/FileFormatSupport.dox +++ b/doxygen/general_pages/FileFormatSupport.md @@ -1,8 +1,6 @@ -/** +# File Format Support {#FileFormatSupport} -\page FileFormatSupport File Format Support - -\tableofcontents +[TOC] # File Formats: Input and Output in MeshLib @@ -28,7 +26,8 @@ The tables below categorize MeshLib's supported file formats based on their type | **PLY** | Yes | No | Yes | Yes | | **GLTF** | Yes | Yes | Yes | Yes | -\note STEP (.STP) files are converted into mesh representations within MeshLib. +> [!NOTE] +> STEP (.STP) files are converted into mesh representations within MeshLib. ### Point Cloud Formats @@ -77,5 +76,3 @@ The tables below categorize MeshLib's supported file formats based on their type | **NC** | Yes | No | With MeshLib’s flexible file format support, users can seamlessly integrate 3D models into various workflows for further processing and analysis. - -*/ diff --git a/doxygen/general_pages/FirstPluginTutorial.dox b/doxygen/general_pages/FirstPluginTutorial.md similarity index 87% rename from doxygen/general_pages/FirstPluginTutorial.dox rename to doxygen/general_pages/FirstPluginTutorial.md index e1255c934a95..e041df515a84 100644 --- a/doxygen/general_pages/FirstPluginTutorial.dox +++ b/doxygen/general_pages/FirstPluginTutorial.md @@ -1,5 +1,4 @@ -/** -\page FirstPluginTutorial How to create a first plugin using MeshLib C++ on Windows +# How to create a first plugin using MeshLib C++ on Windows {#FirstPluginTutorial} In just a few minutes, you'll have a fully functional plugin, setting the stage for advanced plugin development. @@ -14,36 +13,36 @@ This documentation guides you through the process of creating your first MeshLib To begin, open Visual Studio and navigate to the directory containing MeshLib. Within the MeshLib folder, locate the 'Source' directory and open the 'MeshLib.sln' solution file. -\image html first_plugin/FirstPlugin_0.png +![](first_plugin/FirstPlugin_0.png) Upon opening the MeshLib solution, set the 'MRViewerApp' application as the Startup project. This ensures that when the solution is executed, the MRViewerApp launches by default. -\image html first_plugin/FirstPlugin_1.png +![](first_plugin/FirstPlugin_1.png) Before proceeding further, it's recommended to build the MeshLib solution to verify that all dependencies are properly installed and configured. Note that this step may take approximately 5 to 10 minutes. Once the solution is built, compile a build to confirm that it functions as expected. -\image html first_plugin/FirstPlugin_2.png +![](first_plugin/FirstPlugin_2.png) In the MeshLib files, you'll find a preconfigured sample project located in the 'Source' directory. Open it to explore its structure and content. -\image html first_plugin/FirstPlugin_3.png +![](first_plugin/FirstPlugin_3.png) Upon opening the sample project, you'll notice both project and JSON files. The items and UI JSON files are responsible for visualizing the plugin in the menu. You may rename these files if needed. If you rename the project, ensure to update the project name in the UI JSON file as well. -\image html first_plugin/FirstPlugin_4.png +![](first_plugin/FirstPlugin_4.png) Next, navigate to the 'Hello World' plugin project and briefly review its content. The plugin includes minimal parameters such as the name, dialog box parameters, and a create function. A more detailed explanation of these parameters will be provided in our upcoming tutorial, 'Writing Advanced Plugins using the MeshLib SDK. -\image html first_plugin/FirstPlugin_5.png +![](first_plugin/FirstPlugin_5.png) If you intend to rename the plugin, ensure to update the name in the corresponding JSON files as well. Now, proceed to build the project to observe its functionality in action. -\image html first_plugin/FirstPlugin_6.png +![](first_plugin/FirstPlugin_6.png) Excellent! The project has been successfully built and launched, with the plugin functioning as expected. @@ -52,5 +51,3 @@ Congratulations! You've created your first 'Hello World' plugin. In our next tutorial, 'Writing Advanced Plugins using the MeshLib SDK,' we'll delve deeper into plugin development. Stay tuned for more insightful tutorials! - -*/ \ No newline at end of file diff --git a/doxygen/general_pages/FloatVSDouble.dox b/doxygen/general_pages/FloatVSDouble.md similarity index 96% rename from doxygen/general_pages/FloatVSDouble.dox rename to doxygen/general_pages/FloatVSDouble.md index b5d3cac13947..05bad0117e30 100644 --- a/doxygen/general_pages/FloatVSDouble.dox +++ b/doxygen/general_pages/FloatVSDouble.md @@ -1,8 +1,6 @@ -/** +# Float vs Double {#FloatVSDouble} -\page FloatVSDouble Float vs Double - -\tableofcontents +[TOC] # Float vs Double: A Design Choice for Precision and Performance in C++ @@ -65,7 +63,8 @@ And although the computation of the predicates can be inaccurate in float-arithm And if input to Boolean operations is degenerate like exactly coinciding triangles, both float and double computations will have the same issues. That is why **MeshLib utilizes intermediate conversion of point coordinates into integers**, and performs evaluation of predicates in integer numbers as well, **where no inaccuracies are possible**. On top of that, **Simulation-of-Simplicity (SoS)** approach is utilized to avoid numerous corner-cases, otherwise extremely hard to tackle correctly. -\note In the example of a triangle and a segment, SoS ensures that they can either intersect or not-intersect, but never just touch one another. +> [!NOTE] +> In the example of a triangle and a segment, SoS ensures that they can either intersect or not-intersect, but never just touch one another. ## Conclusion The decision between float and double depends on the specific requirements of the application. @@ -76,5 +75,3 @@ MeshLib adopts a balanced strategy: - **Doubles** are selectively employed for precision-critical algorithms, ensuring accuracy where needed without compromising the overall system's efficiency. This design allows MeshLib to meet diverse application requirements while maintaining a high standard of performance and usability. - -*/ \ No newline at end of file diff --git a/doxygen/general_pages/GettingStarted.dox b/doxygen/general_pages/GettingStarted.dox deleted file mode 100644 index 26ef589a905d..000000000000 --- a/doxygen/general_pages/GettingStarted.dox +++ /dev/null @@ -1,35 +0,0 @@ -/** - -\page InstallationGuide Getting Started with MeshLib SDK - -MeshLib is a powerful, open-source 3D geometry library designed for developers across multiple platforms and programming languages. -Whether you're working in C++, Python, C#, C, or JavaScript, MeshLib offers robust tools for creating, manipulating, and analyzing 3D data, e.g. meshes, voxels, point clouds. -This guide will help you get started with setting up MeshLib for your preferred development environment. - -MeshLib also runs in the browser: the [live demo](https://demo.meshlib.io/) needs no installation. - -## Choose Your Setup Guide - -1. \ref MeshLibPythonSetupGuide "\b MeshLib \b Python \b Setup \b Guide" -\n Follow this guide to set up MeshLib for Python on Windows, macOS, and Linux. It includes details on supported Python versions, installation via pip, and usage examples. - -2. \ref MeshLibCppSetupGuide "\b MeshLib \b C++ \b Setup \b Guide" -\n Learn how to install and configure MeshLib for C++ development on Windows, Linux, and macOS. -This guide covers prerequisites, dependency management, and building the library from source. - -3. \ref MeshLibCSharpSetupGuide "\b MeshLib \b C# \b Setup \b Guide" -\n This guide provides instructions for integrating MeshLib into C# projects via the NuGet package — from nuget.org, or from a locally downloaded package file. -It covers the .NET CLI on Windows, macOS, and Linux, and the NuGet package manager in Visual Studio, JetBrains Rider, and Visual Studio Code. - -4. \ref MeshLibCSetupGuide "\b MeshLib \b C \b Setup \b Guide" -\n Learn how to install and configure MeshLib for C development on Windows, Linux, and macOS. - -5. \ref MeshLibJsSetupGuide "\b MeshLib \b JavaScript \b Setup \b Guide" -\n Set up MeshLib for JavaScript and TypeScript in Node.js or the browser. - -6. \ref MeshLibCmakeSetupGuide "\b MeshLib \b CMake \b Setup \b Guide" -\n Simple way of integrating MeshLib to your project via CMake. - -Each of these setup guides is tailored to help you quickly and efficiently integrate MeshLib into your development environment. -Choose the guide that matches your preferred language and platform, and start building sophisticated 3D applications with MeshLib. -*/ diff --git a/doxygen/general_pages/GettingStarted.md b/doxygen/general_pages/GettingStarted.md new file mode 100644 index 000000000000..3e3db0a73b5a --- /dev/null +++ b/doxygen/general_pages/GettingStarted.md @@ -0,0 +1,32 @@ +# Getting Started with MeshLib SDK {#InstallationGuide} + +MeshLib is a powerful, open-source 3D geometry library designed for developers across multiple platforms and programming languages. +Whether you're working in C++, Python, C#, C, or JavaScript, MeshLib offers robust tools for creating, manipulating, and analyzing 3D data, e.g. meshes, voxels, point clouds. +This guide will help you get started with setting up MeshLib for your preferred development environment. + +MeshLib also runs in the browser: the [live demo](https://demo.meshlib.io/) needs no installation. + +## Choose Your Setup Guide + +1. [**MeshLib Python Setup Guide**](\ref MeshLibPythonSetupGuide) +
Follow this guide to set up MeshLib for Python on Windows, macOS, and Linux. It includes details on supported Python versions, installation via pip, and usage examples. + +2. [**MeshLib C++ Setup Guide**](\ref MeshLibCppSetupGuide) +
Learn how to install and configure MeshLib for C++ development on Windows, Linux, and macOS. +This guide covers prerequisites, dependency management, and building the library from source. + +3. [**MeshLib C# Setup Guide**](\ref MeshLibCSharpSetupGuide) +
This guide provides instructions for integrating MeshLib into C# projects via the NuGet package — from nuget.org, or from a locally downloaded package file. +It covers the .NET CLI on Windows, macOS, and Linux, and the NuGet package manager in Visual Studio, JetBrains Rider, and Visual Studio Code. + +4. [**MeshLib C Setup Guide**](\ref MeshLibCSetupGuide) +
Learn how to install and configure MeshLib for C development on Windows, Linux, and macOS. + +5. [**MeshLib JavaScript Setup Guide**](\ref MeshLibJsSetupGuide) +
Set up MeshLib for JavaScript and TypeScript in Node.js or the browser. + +6. [**MeshLib CMake Setup Guide**](\ref MeshLibCmakeSetupGuide) +
Simple way of integrating MeshLib to your project via CMake. + +Each of these setup guides is tailored to help you quickly and efficiently integrate MeshLib into your development environment. +Choose the guide that matches your preferred language and platform, and start building sophisticated 3D applications with MeshLib. diff --git a/doxygen/general_pages/HowtoAddPluginOverview.dox b/doxygen/general_pages/HowtoAddPluginOverview.md similarity index 73% rename from doxygen/general_pages/HowtoAddPluginOverview.dox rename to doxygen/general_pages/HowtoAddPluginOverview.md index dbd48a5ff04b..0c68a8fdc95a 100644 --- a/doxygen/general_pages/HowtoAddPluginOverview.dox +++ b/doxygen/general_pages/HowtoAddPluginOverview.md @@ -1,8 +1,6 @@ -/** +# How to Add Plugin {#HowtoAddPluginOverview} -\page HowtoAddPluginOverview How to Add Plugin - -\tableofcontents +[TOC] # Add Your Own Plugin to MeshInspector / MeshLib @@ -17,17 +15,18 @@ A plugin is a separately compiled module that extends the functionality of MeshL ### Prerequisites and pointers -Before deploying anything, make sure your build matches the host you are deploying to — see \ref HowtoAddPluginOverview_VersionCompatibility "Version compatibility" at the end of this page. +Before deploying anything, make sure your build matches the host you are deploying to — see [Version compatibility](\ref HowtoAddPluginOverview_VersionCompatibility) at the end of this page. To actually build a plugin, see: - \ref FirstPluginTutorial — step-by-step Visual Studio walkthrough for your first "Hello World" plugin. - \ref ExamplePluginOverview — a fully-fledged C++ sample with CMake, source, JSON and icons. -\section HowtoAddPluginOverview_TrustModel Trust & safety +# Trust & safety {#HowtoAddPluginOverview_TrustModel} A plugin is **native code** that is dynamically loaded into the host process and runs with the **same privileges as MeshInspector itself**: it can read and write the user's files, open network connections, access cameras and microphones, and call any system API. There is no sandbox. -\warning Treat plugin binaries the way you treat any other executable from the internet. +> [!WARNING] +> Treat plugin binaries the way you treat any other executable from the internet. - Install only plugins from sources you trust. - For binaries from third parties, prefer those distributed with source code or signed by a known developer. - Verify checksums when offered; refuse zip files that contain unexpected extra binaries. @@ -43,44 +42,49 @@ Whether you built the plugin yourself or received it as an archive, it must cont 2. **Two JSON descriptors**: `*.items.json` (ribbon item definitions — name, tooltip, icon glyph) and `*.ui.json` (where items appear in the ribbon — tab/group, plus the host-relative load `Order`). 3. *Optionally* a `resource/icons/{X0_5,X0_75,X1,X3}/` folder with PNG icons in four sizes. If absent, the host falls back to the FontAwesome glyph specified in `items.json`. -If a colleague handed you a zip, expect that exact layout. If you compiled it yourself, see \ref ExamplePluginOverview "C++ Example Plugin Overview" for what the build output should look like and how to wire `*.items.json` / `*.ui.json` to the source. +If a colleague handed you a zip, expect that exact layout. If you compiled it yourself, see [C++ Example Plugin Overview](\ref ExamplePluginOverview) for what the build output should look like and how to wire `*.items.json` / `*.ui.json` to the source. ## How to install the plugin -\warning Quit the host application before copying. Running processes hold the dylibs open; the copy will fail or — worse — appear to succeed but be silently ignored until next restart anyway. +> [!WARNING] +> Quit the host application before copying. Running processes hold the dylibs open; the copy will fail or — worse — appear to succeed but be silently ignored until next restart anyway. The exact target locations differ per platform. ### Windows -\note On Windows, dropping files into `C:\Program Files\` requires Administrator. Open `cmd.exe` or PowerShell with **Run as administrator** (right-click the icon → "Run as administrator"), then run `copy` from there. Alternatively, use Explorer — it will pop a UAC prompt for the same purpose. +> [!NOTE] +> On Windows, dropping files into `C:\Program Files\` requires Administrator. Open `cmd.exe` or PowerShell with **Run as administrator** (right-click the icon → "Run as administrator"), then run `copy` from there. Alternatively, use Explorer — it will pop a UAC prompt for the same purpose. For an installed MeshInspector: -\code{.bat} +```bat copy MyPlugin.dll "C:\Program Files\MeshInspector\MeshInspector\" copy MyPlugin.items.json "C:\Program Files\MeshInspector\MeshInspector\" copy MyPlugin.ui.json "C:\Program Files\MeshInspector\MeshInspector\" xcopy /E /I resource "C:\Program Files\MeshInspector\MeshInspector\resource" -\endcode +``` For the MeshLib SDK archive, copy the same files into `install\app\Release` (or `install\app\Debug`). -\warning On Windows, mismatching CRT (Debug-built plugin against Release-installed app, or vice versa) crashes on load. Build with the same configuration as the host you target. If the host is the official MeshInspector installer, that is **Release**. +> [!WARNING] +> On Windows, mismatching CRT (Debug-built plugin against Release-installed app, or vice versa) crashes on load. Build with the same configuration as the host you target. If the host is the official MeshInspector installer, that is **Release**. -\note **Antivirus / SmartScreen**: a freshly written `.dll` in `C:\Program Files\` may be flagged or quarantined. If your plugin disappears immediately after copying, check the Windows Security → Protection History and add an exception, or sign the dylib with a developer certificate. +> [!NOTE] +> **Antivirus / SmartScreen**: a freshly written `.dll` in `C:\Program Files\` may be flagged or quarantined. If your plugin disappears immediately after copying, check the Windows Security → Protection History and add an exception, or sign the dylib with a developer certificate. ### Linux For the official `.deb` of MeshInspector, plugin libraries live next to the other shared libraries and JSON descriptors next to other resources: -\code{.sh} +```sh sudo cp libMyPlugin.so /usr/lib/MeshInspector/ sudo cp MyPlugin.items.json MyPlugin.ui.json /usr/share/MeshInspector/ sudo cp -R resource /usr/share/MeshInspector/ -\endcode +``` -\note If you installed MeshInspector via a different channel (tarball, AppImage, source build), the directory layout differs. -For an SDK archive build, copy into `install/app/Release/` — same layout as Windows. +> [!NOTE] +> If you installed MeshInspector via a different channel (tarball, AppImage, source build), the directory layout differs. +> For an SDK archive build, copy into `install/app/Release/` — same layout as Windows. ### macOS (arm64 / Intel) @@ -90,7 +94,7 @@ There are two paths on macOS. The **first one is safer**: it does not modify the Copy the host application to a writable folder, deploy the plugin there, and launch from the clone: -\code{.sh} +```sh mkdir -p ~/Apps cp -R /Applications/MeshInspector.app ~/Apps/MI-MyPlugin # NB: drop the .app suffix @@ -100,33 +104,36 @@ cp -R resource ~/Apps/MI-MyPlugin/Contents/Resources/ # Launch: ~/Apps/MI-MyPlugin/Contents/MacOS/MeshInspector -\endcode +``` -\note Why drop the `.app` suffix? macOS App Bundle Protection blocks writes inside any `.app` directory — even when you own it — unless the call comes from `sudo`. A directory without the `.app` extension is treated as a regular folder and is freely writable. +> [!NOTE] +> Why drop the `.app` suffix? macOS App Bundle Protection blocks writes inside any `.app` directory — even when you own it — unless the call comes from `sudo`. A directory without the `.app` extension is treated as a regular folder and is freely writable. -\note **Gatekeeper warning on first launch.** macOS may attach `com.apple.quarantine` to files copied via `cp -R`. Launching the binary from the clone may show a "developer cannot be verified" prompt the first time, which goes away after you accept it. To suppress in advance: -\code{.sh} -xattr -dr com.apple.quarantine ~/Apps/MI-MyPlugin -\endcode +> [!NOTE] +> **Gatekeeper warning on first launch.** macOS may attach `com.apple.quarantine` to files copied via `cp -R`. Launching the binary from the clone may show a "developer cannot be verified" prompt the first time, which goes away after you accept it. To suppress in advance: +> ```sh +> xattr -dr com.apple.quarantine ~/Apps/MI-MyPlugin +> ``` #### macOS — option B: install into the system MeshInspector.app (advanced) This writes directly into the notarized app bundle. **It is system-wide and breaks the bundle's code signature** — Gatekeeper may block subsequent launches or warn that the app is "damaged", and the auto-updater (Sparkle) may overwrite your plugin on the next MeshInspector update. Use this only if you understand the trade-off. -\code{.sh} +```sh sudo cp libMyPlugin.dylib /Applications/MeshInspector.app/Contents/Frameworks/ sudo cp MyPlugin.items.json MyPlugin.ui.json /Applications/MeshInspector.app/Contents/Resources/ sudo cp -R resource /Applications/MeshInspector.app/Contents/Resources/ -\endcode +``` If Gatekeeper subsequently refuses to launch the app, re-sign the bundle with an ad-hoc signature: -\code{.sh} +```sh sudo codesign --force --deep --sign - /Applications/MeshInspector.app -\endcode +``` -\warning Only do this with a plugin from a source you trust. A malicious `.dylib` placed in `/Applications/MeshInspector.app/Contents/Frameworks/` runs every time anyone on the machine launches MeshInspector. +> [!WARNING] +> Only do this with a plugin from a source you trust. A malicious `.dylib` placed in `/Applications/MeshInspector.app/Contents/Frameworks/` runs every time anyone on the machine launches MeshInspector. -\section HowtoAddPluginOverview_VerifyInstall Verifying the install +# Verifying the install {#HowtoAddPluginOverview_VerifyInstall} Launch the host application and inspect the log file: @@ -137,10 +144,10 @@ Launch the host application and inspect the log file: | macOS | `$TMPDIR/MeshInspector/Logs/MRLog_*.txt` (resolves under `/var/folders/.../`; `ls -t $TMPDIR/MeshInspector/Logs/MRLog_*.txt | head -1` shows the latest) | A successful install shows two lines per plugin: -\code{.unparsed} +```unparsed [info] Loading library MyPlugin with priority 999 [info] Load library MyPlugin was successful -\endcode +``` #### Common failure modes @@ -150,22 +157,22 @@ A successful install shows two lines per plugin: **Plugin loads but no items show** — your `LibName` in `*.ui.json` does not match the produced library file name (without the `lib` prefix and `.dylib`/`.so`/`.dll` suffix). For `libMyPlugin.dylib`, `LibName` must be `MyPlugin`. -\section HowtoAddPluginOverview_Uninstall Uninstall +# Uninstall {#HowtoAddPluginOverview_Uninstall} Quit the host, then delete the three sets of files you copied during install. Example for the macOS user-clone case: -\code{.sh} +```sh rm ~/Apps/MI-MyPlugin/Contents/Frameworks/libMyPlugin.dylib rm ~/Apps/MI-MyPlugin/Contents/Resources/MyPlugin.items.json rm ~/Apps/MI-MyPlugin/Contents/Resources/MyPlugin.ui.json rm -rf ~/Apps/MI-MyPlugin/Contents/Resources/resource # only if you copied it -\endcode +``` For the macOS option B install, the same three `rm` commands prefixed with `sudo` and pointing at `/Applications/MeshInspector.app/Contents/...`. For Windows and Linux, delete the same three sets of files from the install directory you copied them to. -\section HowtoAddPluginOverview_VersionCompatibility Version compatibility +# Version compatibility {#HowtoAddPluginOverview_VersionCompatibility} A plugin is ABI-coupled to the MeshLib version it was compiled against. Mismatched versions typically manifest as either an immediate `dlopen`/`LoadLibrary` failure or a crash inside the plugin on first call. @@ -177,5 +184,3 @@ To check which version you have installed: To check what version your plugin was built against, look at the MeshLib include headers your CMake/MSBuild project resolved against — they are tagged with the same SDK version. If the two do not match, either rebuild the plugin against the matching SDK or upgrade/downgrade the host. Always prefer the latest version of both for the smallest gap with documentation and the largest set of fixed bugs. - -*/ diff --git a/doxygen/general_pages/I18nGuide.dox b/doxygen/general_pages/I18nGuide.md similarity index 92% rename from doxygen/general_pages/I18nGuide.dox rename to doxygen/general_pages/I18nGuide.md index 5e3c75b4fc08..8c9f62470e4e 100644 --- a/doxygen/general_pages/I18nGuide.dox +++ b/doxygen/general_pages/I18nGuide.md @@ -1,8 +1,6 @@ -/** +# Internationalization Guide {#I18nGuide} -\page I18nGuide Internationalization Guide - -\tableofcontents +[TOC] MeshLib uses a gettext-compatible localization system backed by Boost.Locale. @@ -21,7 +19,7 @@ The gettext toolchain uses three file types: Source translations live under a `locale/` directory at the project root: -\code +```unparsed locale/ MyPlugin.pot <- template (all extractable strings) MRRibbonMyMenu.pot <- template for ribbon JSON strings @@ -31,17 +29,18 @@ locale/ fr/ MyPlugin.po <- French translations MRRibbonMyMenu.po -\endcode +``` At build time, `.po` files are compiled to `.mo` and placed in the output directory: -\code +```unparsed /locale//LC_MESSAGES/.mo -\endcode +``` For example: `build/Release/bin/locale/de/LC_MESSAGES/MyPlugin.mo`. -\note The domain name is always derived from the filename stem: `MyPlugin.po` belongs to domain `"MyPlugin"`. +> [!NOTE] +> The domain name is always derived from the filename stem: `MyPlugin.po` belongs to domain `"MyPlugin"`. # Gettext utilities and helper scripts {#I18nTooling} @@ -61,29 +60,29 @@ All scripts are in `scripts/gettext/`: ### Extracting C++ strings -\code{.sh} +```sh python3 scripts/gettext/update_translations.py \ locale/MyPlugin.pot \ source/MyPlugin/ -\endcode +``` This scans all `.cpp`, `.h`, and `.hpp` files and extracts strings marked by the recognized macros. ### Extracting JSON strings -\code{.sh} +```sh python3 scripts/gettext/update_json_translations.py \ locale/MRRibbonMyMenu.pot \ source/MyPlugin/MRRibbonMyMenu.items.json -\endcode +``` ### Compiling translations -\code{.sh} +```sh python3 scripts/gettext/compile_translations.py \ locale/ \ build/Release/bin/locale/ -\endcode +``` This produces `build/Release/bin/locale//LC_MESSAGES/.mo` for every `.po` found. @@ -91,7 +90,7 @@ This produces `build/Release/bin/locale//LC_MESSAGES/.mo` for ever `cmake/Modules/I18nHelpers.cmake` provides the `mr_add_translations()` function: -\code{.cmake} +```cmake include(I18nHelpers) mr_add_translations(myplugin_translations @@ -104,7 +103,7 @@ mr_add_translations(myplugin_translations if(TARGET myplugin_translations) add_dependencies(MyApp myplugin_translations) endif() -\endcode +``` The function: 1. Finds `msgfmt` (respects `GETTEXT_ROOT` / `$ENV{GETTEXT_ROOT}`). @@ -120,7 +119,7 @@ If `msgfmt` is not found, the function silently does nothing and no target is cr `source/CompileTranslations.targets` provides an equivalent build-time `.po` → `.mo` compilation step for Visual Studio projects. Import the targets file and declare one or more `TranslationLocaleDir` items pointing at your `locale/` root directories: -\code{.xml} +```xml @@ -129,7 +128,7 @@ Import the targets file and declare one or more `TranslationLocaleDir` items poi -\endcode +``` MeshLib's own `common.props` already adds `$(MeshLibDir)\locale` to `TranslationLocaleDir`, so projects that import `common.props` inherit MeshLib's translations automatically. @@ -155,13 +154,13 @@ The initial locale is `"en"` (i.e. no translations applied). Call `addDomain()` once and use a returned value from `findDomain()`, before any translations from that domain are needed: -\code{.cpp} +```cpp #include MR::Locale::addDomain( "MyPlugin" ); static const int kMyDomainId = MR::Locale::findDomain( "MyPlugin" ); -\endcode +``` The returned integer is stable for the process lifetime. You can pass it to `translate()` via `MR::Locale::Domain{ kMyDomainId }`. @@ -169,39 +168,39 @@ The returned integer is stable for the process lifetime. You can pass it to `tra If your plugin stores `.mo` files outside the standard resources directory, register the path before any UI is shown: -\code{.cpp} +```cpp MR::Locale::addCatalogPath( myPlugin.resourceDir() / "locale" ); -\endcode +``` Paths are deduplicated. Every call to `addCatalogPath` or `addDomain` regenerates the active locale object, so new catalogs are available immediately. ## Switching locale at runtime -\code{.cpp} +```cpp MR::Locale::set( "ko" ); // switch to Korean MR::Locale::set( "en" ); // back to English -\endcode +``` `set()` fires the `onChanged` signal synchronously before returning. ## Reacting to locale changes -\code{.cpp} +```cpp boost::signals2::connection conn = MR::Locale::onChanged( [&]( const std::string& localeName ) { // rebuild cached translated strings, tooltips, etc. rebuildUI(); } ); -\endcode +``` ## Defining human-readable locale names Many common languages and regions already have a pre-loaded human-readable name provided by CLDR. If your locale is not in the list, you can add it in runtime. -\code{.cpp} +```cpp MR::Locale::setDisplayName( "my_variant", "My Language (Special)" ); -\endcode +``` # Translation functions and macros {#I18nAPI} @@ -214,9 +213,10 @@ All macros are defined in `MRViewer/MRI18n.h`, except `_t`, which is in `MRMesh/ - `f_tr("text {}")` - Format strings for `fmt::format()`. - `_t("text")` - Marking strings for extraction in contexts where the original value must be returned (see an example below). -\warning `_tr()` returns a pointer into a **temporary** `std::string` that is destroyed at the end of the full expression. Always consume `_tr()` in the same expression, or use `s_tr()` / `MR::Locale::translate()` to store the result. +> [!WARNING] +> `_tr()` returns a pointer into a **temporary** `std::string` that is destroyed at the end of the full expression. Always consume `_tr()` in the same expression, or use `s_tr()` / `MR::Locale::translate()` to store the result. -\code{.cpp} +```cpp // CORRECT: consumed in the same expression UI::button( _tr( "Save" ), size ); ImGui::Text( "%s", _tr( "Label" ) ); @@ -228,13 +228,13 @@ UI::button( label, size ); // undefined behavior // CORRECT: store as std::string const auto label = s_tr( "Save" ); UI::button( label.c_str(), size ); -\endcode +``` ## Direct translate functions `MR::Locale::translate()` accepts an optional `Domain` parameter: -\code{.cpp} +```cpp // simple message (default MeshLib domain) std::string t = MR::Locale::translate( "Open" ); @@ -250,13 +250,13 @@ std::string t = MR::Locale::translate( "%d item", "%d items", count ); // batch translation for combo lists auto items = MR::Locale::translateAll( kModeNames ); auto items = MR::Locale::translateAll( "context", kModeNames ); -\endcode +``` ## Static arrays and deferred translation Mark strings with `_t()` at declaration time so `xgettext` extracts them, then translate at display time: -\code{.cpp} +```cpp // declaration: _t() is a no-op, strings are stored untranslated static const std::vector kModeNames { _t( "Append" ), @@ -265,25 +265,25 @@ static const std::vector kModeNames { // display: translate on every frame UI::combo( _tr( "Mode" ), &idx, MR::Locale::translateAll( kModeNames ) ); -\endcode +``` ## Context disambiguation When the same English string has different meanings, use the context overload: -\code{.cpp} +```cpp // "View" as a noun (saved camera view) vs. verb (to view something) ImGui::Text( "%s", _tr( "Camera", "View" ) ); ImGui::Text( "%s", _tr( "Action", "View" ) ); -\endcode +``` In the `.po` file these appear as separate entries with different `msgctxt` values. ## Plural forms -\code{.cpp} +```cpp auto label = MR::Locale::translate( "%d item", "%d items", count ); -\endcode +``` The correct form is selected by Boost.Locale based on the `Plural-Forms:` rule in the `.po` header. @@ -292,10 +292,10 @@ The correct form is selected by Boost.Locale based on the `Plural-Forms:` rule i Place a `// TRANSLATORS:` comment on the line immediately before a translatable string to give translators context. `xgettext` picks these up and includes them as `#.` comment lines in the `.pot` file: -\code{.cpp} +```cpp // TRANSLATORS: Shown when the mesh has no faces after repair ImGui::Text( "%s", _tr( "Empty result" ) ); -\endcode +``` ## Custom header file for your domain {#I18nCustomHeader} @@ -313,7 +313,8 @@ To use this header in your plugin: 2. Register the domain at startup: `MR::Locale::addDomain( MY_PLUGIN_I18N_DOMAIN );` 3. All `_tr()`, `s_tr()`, and `f_tr()` calls will now use your domain. -\note `findDomain()` performs a cache lookup by pointer address for `const char*` literals, so the runtime cost is minimal. +> [!NOTE] +> `findDomain()` performs a cache lookup by pointer address for `const char*` literals, so the runtime cost is minimal. # Translating JSON menu files {#I18nJSON} @@ -326,7 +327,7 @@ Each entry in the `"Items"` array may contain: - **"Caption"** - the display label (falls back to **"Name"** if absent). - **"Tooltip"** - the tooltip text. -\code{.json} +```json { "Items": [ { @@ -336,7 +337,7 @@ Each entry in the `"Items"` array may contain: } ] } -\endcode +``` See \ref ExamplePluginOverview for a complete plugin JSON example. @@ -344,7 +345,7 @@ See \ref ExamplePluginOverview for a complete plugin JSON example. Tab names in the `"Tabs"` array are extracted with the context `"Tab name"`: -\code{.json} +```json { "Order": 10, "LibName": "MyPlugin", @@ -355,7 +356,7 @@ Tab names in the `"Tabs"` array are extracted with the context `"Tab name"`: } ] } -\endcode +``` ## Domain auto-registration @@ -369,13 +370,11 @@ This means ribbon menu strings are translated from their own domain catalog, sep Run `update_json_translations.py` for each JSON pair: -\code{.sh} +```sh python3 scripts/gettext/update_json_translations.py \ locale/MRRibbonMyMenu.pot \ source/MyPlugin/MRRibbonMyMenu.items.json -\endcode +``` The script extracts `"Caption"` (or `"Name"`) and `"Tooltip"` from `.items.json`, and tab `"Name"` fields (with context `"Tab name"`) from the matching `.ui.json`. - -*/ diff --git a/doxygen/general_pages/JsSetupGuide.dox b/doxygen/general_pages/JsSetupGuide.md similarity index 90% rename from doxygen/general_pages/JsSetupGuide.dox rename to doxygen/general_pages/JsSetupGuide.md index 6b8aea7500a9..742abec0cf93 100644 --- a/doxygen/general_pages/JsSetupGuide.dox +++ b/doxygen/general_pages/JsSetupGuide.md @@ -1,9 +1,8 @@ -/** -\page MeshLibJsSetupGuide How to Install MeshLib SDK for JavaScript +# How to Install MeshLib SDK for JavaScript {#MeshLibJsSetupGuide} # Installing MeshLib SDK for JavaScript -\tableofcontents +[TOC] [MeshLib](https://meshlib.io/) is available for JavaScript as the geometry library compiled to WebAssembly. It runs both in Node.js and in the browser, and is published to npm as two packages that share an identical API: @@ -31,49 +30,49 @@ MeshLib ships in two flavors with an identical API: - `@meshinspector/meshlib`: the single-threaded build. The simplest choice, and the right one for most applications. - `@meshinspector/meshlib-mt`: the multi-threaded build. It uses worker threads to parallelize geometry operations for higher throughput, and requires Node.js 21 or newer. -The examples below use `@meshinspector/meshlib`. To use the multi-threaded build instead, install `@meshinspector/meshlib-mt` and change the import specifier; in Node.js nothing else changes. In the browser the page must additionally be \ref JsMtCrossOriginIsolation "cross-origin isolated". +The examples below use `@meshinspector/meshlib`. To use the multi-threaded build instead, install `@meshinspector/meshlib-mt` and change the import specifier; in Node.js nothing else changes. In the browser the page must additionally be [cross-origin isolated](\ref JsMtCrossOriginIsolation). ## Installation ### Installation via npm Install the package from npm and enable ES module support in your project: -\code{.sh} +```sh npm install @meshinspector/meshlib npm pkg set type=module -\endcode +``` ### Use from CDN In the browser you can skip npm entirely and import the module directly: -\code{.js} +```js // latest release import createMeshLib from 'https://js.meshlib.io/meshlib/meshlib.mjs'; // or pin a release import createMeshLib from 'https://js.meshlib.io/meshlib@v1.2.3.456/meshlib.mjs'; -\endcode +``` #### Multi-Threaded Build The multi-threaded build cannot be imported straight from the CDN, because the browser refuses to run a worker script from another origin, so pass the fetched module to the factory as a `Blob` and its worker pool starts from a same-origin `blob:` URL: -\code{.js} +```js const url = 'https://js.meshlib.io/meshlib-mt/meshlib-mt.mjs'; const { default: createMeshLib } = await import( url ); const blob = new Blob( [ await ( await fetch( url ) ).text() ], { type: 'text/javascript' } ); const ml = await createMeshLib( { mainScriptUrlOrBlob: blob } ); -\endcode +``` -In the browser the multi-threaded build additionally requires the page to be \ref JsMtCrossOriginIsolation "cross-origin isolated". +In the browser the multi-threaded build additionally requires the page to be [cross-origin isolated](\ref JsMtCrossOriginIsolation). ### Bundlers Vite 8 and webpack 5 resolve `meshlib.wasm` from the module and emit it as an asset, so a plain `import` needs no configuration. For other bundlers, such as esbuild or Rollup, import the wasm as an asset URL and hand it to the loader via `locateFile`: -\code{.js} +```js import createMeshLib from '@meshinspector/meshlib'; import wasmUrl from '@meshinspector/meshlib/meshlib.wasm'; const ml = await createMeshLib( { locateFile: () => wasmUrl } ); -\endcode +``` -In the browser the multi-threaded build additionally requires the page to be \ref JsMtCrossOriginIsolation "cross-origin isolated". +In the browser the multi-threaded build additionally requires the page to be [cross-origin isolated](\ref JsMtCrossOriginIsolation). ### Payload Size {#MeshLibJsPayloadSize} MeshLib is a WebAssembly build of the full geometry library, so a browser downloads roughly **11 MB of wasm, about 3 MB gzipped over the wire**, before the first geometry call. `@meshinspector/meshlib-mt` is the same order of magnitude. @@ -84,25 +83,25 @@ Two consequences for a browser application: - `npm install` unpacks about 21 MB, because the browser and the Node.js wasm ship side by side in one package. Only one of them ever reaches the browser; the rest is bundler input, not payload. If the geometry is not needed on first paint, load the module lazily instead of at the top level, so the wasm download does not block startup: -\code{.js} +```js // load MeshLib only when the user actually needs geometry const { default: createMeshLib } = await import('@meshinspector/meshlib'); const ml = await createMeshLib(); -\endcode +``` ## Cross-Origin Isolation for the Multi-Threaded Build in the Browser {#JsMtCrossOriginIsolation} This section applies to browsers only. In Node.js the multi-threaded build needs no headers, flags, or extra configuration. The multi-threaded package `@meshinspector/meshlib-mt` relies on `SharedArrayBuffer`, which browsers only enable on **cross-origin isolated** pages. The server that serves the page loading the module must send these headers: -\code{.txt} +```unparsed Cross-Origin-Opener-Policy: same-origin Cross-Origin-Embedder-Policy: require-corp -\endcode +``` Without them `crossOriginIsolated` is `false`, `SharedArrayBuffer` is unavailable, and `createMeshLib()` never resolves. For a Vite dev server, set the headers in `vite.config.js` (whatever hosts the production build must send them too; `vite-plugin-cross-origin-isolation` can stamp them for `vite preview`): -\code{.js} +```js // vite.config.js export default { server: { @@ -112,7 +111,7 @@ export default { }, }, }; -\endcode +``` Where you cannot set response headers at all — GitHub Pages and similar static hosting — the usual workaround is a `coi-serviceworker`-style shim: a service worker that re-serves the page with the two headers and reloads it once. MeshLib's own [interactive demo](https://demo.meshlib.io/) is hosted exactly this way. @@ -120,7 +119,7 @@ So on a page that is not cross-origin isolated you have three options: send the ## Getting Started: Your First Example The default export is an async factory. Await it once to get the module instance, then call MeshLib functions on it: -\code{.js} +```js import createMeshLib from '@meshinspector/meshlib'; const ml = await createMeshLib(); @@ -140,48 +139,50 @@ using tris = ml.Triangulation.fromArray(indices); using mesh = ml.Mesh.fromTriangles(coords, tris); console.log('volume =', mesh.volume()); // ~8 -\endcode +``` -\note This example loads the module at the top level, which downloads the wasm on startup. In the browser, consider the lazy alternative in \ref MeshLibJsPayloadSize "Payload Size". +> [!NOTE] +> This example loads the module at the top level, which downloads the wasm on startup. In the browser, consider the lazy alternative in [Payload Size](\ref MeshLibJsPayloadSize). -\note The `using` declaration requires Node.js 24+ or a current browser. On older runtimes, call `.delete()` on each object instead (see the **Memory Management** section below). +> [!NOTE] +> The `using` declaration requires Node.js 24+ or a current browser. On older runtimes, call `.delete()` on each object instead (see the **Memory Management** section below). ## TypeScript The package ships type definitions, so `createMeshLib` and the whole module API are typed with minimal setup: -\code{.ts} +```ts import createMeshLib, { type Mesh } from '@meshinspector/meshlib'; const ml = await createMeshLib(); const mesh: Mesh = ml.Mesh.fromTriangles(coords, tris)!; const { valid, distSq } = ml.findProjection(point, mesh); mesh.delete(); -\endcode +``` ## Memory Management {#JsMemoryManagement} Values returned from the API (meshes, bit sets, settings, result objects, and so on) hold WebAssembly memory that the JavaScript garbage collector does not reclaim, so each one must be freed explicitly. The preferred way is JavaScript's explicit resource management: declare a handle with [`using`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using) and it is freed automatically when its scope ends, even if an exception is thrown. -\code{.js} +```js using mesh = ml.Mesh.fromTriangles(coords, tris); // ... use mesh; it is freed at the end of this scope -\endcode +``` When the number of handles is dynamic (for example built in a loop), collect them in a [`DisposableStack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DisposableStack), which frees everything it holds, in reverse order, at the end of the scope: -\code{.js} +```js using stack = new DisposableStack(); for (const path of inputPaths) { const cloud = stack.use(ml.PointsLoad.fromAnySupportedFormat(path)); // ... use cloud } // every handle passed to stack.use(...) is freed here -\endcode +``` `using` and `DisposableStack` are part of JavaScript's Explicit Resource Management, available in Node.js 24+ and current browsers. On older runtimes and browsers, call `.delete()` on each object when you are done instead: -\code{.js} +```js const mesh = ml.Mesh.fromTriangles(coords, tris); // ... use mesh mesh.delete(); -\endcode +``` ## Try Interactive MeshLib Examples You can check how MeshLib works in a browser environment with live interactive examples: https://demo.meshlib.io/ @@ -194,5 +195,3 @@ After installing MeshLib, a great way to start exploring its capabilities is thr - [**Mesh Decimation**](\ref ExampleMeshDecimate) Browse the full set on the [**MeshLib Code Samples**](\ref Examples) page. - -*/ diff --git a/doxygen/general_pages/License.dox b/doxygen/general_pages/License.md similarity index 91% rename from doxygen/general_pages/License.dox rename to doxygen/general_pages/License.md index 72faf6334081..d87d51980c37 100644 --- a/doxygen/general_pages/License.dox +++ b/doxygen/general_pages/License.md @@ -1,6 +1,4 @@ -/** -\page License License +# License {#License} MeshLib SDK is offered under a **dual licensing** model. It is free for **non-commercial** and **educational** use, but requires a **commercial license** for business and commercial development. For information please [visit the license page](https://meshlib.io/license) or contact our sales team. -*/ \ No newline at end of file diff --git a/doxygen/general_pages/MeshStructureOverview.dox b/doxygen/general_pages/MeshStructureOverview.md similarity index 91% rename from doxygen/general_pages/MeshStructureOverview.dox rename to doxygen/general_pages/MeshStructureOverview.md index 48ebc294b974..53325a03e908 100644 --- a/doxygen/general_pages/MeshStructureOverview.dox +++ b/doxygen/general_pages/MeshStructureOverview.md @@ -1,8 +1,6 @@ -/** +# Mesh Structure Overview {#MeshStructureOverview} -\page MeshStructureOverview Mesh Structure Overview - -\tableofcontents +[TOC] # MeshLib Mesh Structure and Topology @@ -17,8 +15,8 @@ In MeshLib Mesh structure consists of two major parts: Is ordered array of (x,y,z) values for each point (vertex) indexed by `VertId` (integer value that indicates vertex position in the array) ### Topology -Topology in Meshlib is represented as "Half-Edge structure" which means that core primitives are "Half-Edges". \n -"Half-Edges" are called "Half" because a pair of half edges represent one "Oriented Edge" (one for origin vertex and left face, and the other for destination vertex and right face) \n +Topology in Meshlib is represented as "Half-Edge structure" which means that core primitives are "Half-Edges".
+"Half-Edges" are called "Half" because a pair of half edges represent one "Oriented Edge" (one for origin vertex and left face, and the other for destination vertex and right face)
`MeshTopology` consists of 3 major parts: - "Half-Edge" records (4 attributes for each "Half-Edge") - Face to Edge map (for each `FaceId` stores one `EdgeId` with this `FaceId` to the left) @@ -36,7 +34,7 @@ For example "Oriented Edge" can be considered as a vector from the "Half-Edge" o Each "Half-Edge" is indexed by its unique `EdgeId` "The Other Half" also have unique `EdgeId` which is always equal to `"Half-Edge" XOR 1` -\image html mesh_structure/Half-Edge.png +![](mesh_structure/Half-Edge.png) ## Mesh Navigation `EdgeId e = ...` is unique identifier of an oriented edge in mesh ("Half-Edge"). @@ -55,21 +53,21 @@ Each "Half-Edge" is indexed by its unique `EdgeId` `MeshTopology::dest( e )` - returns the identifier of the vertex in the destination of `e`. It is assumed that all edges either have valid vertices on the ends, or "lone" (not connected to the mesh) (Origin `VertId` of "The Other Half"). -\image html mesh_structure/navigation_base.png +![](mesh_structure/navigation_base.png) -\image html mesh_structure/navigation_hole.png +![](mesh_structure/navigation_hole.png) ### Iterating over valid vertices -\code{.cpp} +```cpp for ( VertId v : mesh.topology.getValidVerts() ) { std::cout << mesh.points[v].x << ", " << mesh.points[v].y << ", " << mesh.points[v].z << "\n"; //... } -\endcode +``` ### Iterating over valid faces -\code{.cpp} +```cpp for ( FaceId f : mesh.topology.getValidFaces() ) { ThreeVertIds vertIds; @@ -77,15 +75,15 @@ for ( FaceId f : mesh.topology.getValidFaces() ) std::cout << vertIds[0] << ", " << vertIds[1] << ", " << vertIds[2] << "\n"; //... } -\endcode +``` ### Iterating ofer vertex edges ring -\code{.cpp} +```cpp for ( EdgeId e : orgRing( mesh.topology, vertId ) ) { //... } -\endcode +``` Find more advanced mesh navigation techniques in this [discussion](https://github.com/MeshInspector/MeshLib/issues/1377) @@ -97,7 +95,7 @@ In this [paper](https://www.cs.cornell.edu/courses/cs4620/2017sp/slides/03trimes In this [paper](http://www.sccg.sk/%7Esamuelcik/dgs/quad_edge.pdf), one can find description of more advanced "Quad-Edge" structure, please find some basic edge functions mapping bellow: -\image html mesh_structure/Quad-Edge.png +![](mesh_structure/Quad-Edge.png) |Quad-Edge paper|MeshLib| |---------------|-------| @@ -110,5 +108,3 @@ In this [paper](http://www.sccg.sk/%7Esamuelcik/dgs/quad_edge.pdf), one can find |`eLprev`|`topology.next( mE ).sym()`| |`eRnext`|`topology.prev( mE ).sym()`| |`eRprev`|`topology.next( mE.sym() )`| - -*/ \ No newline at end of file diff --git a/doxygen/general_pages/PackageOverview.dox b/doxygen/general_pages/PackageOverview.md similarity index 83% rename from doxygen/general_pages/PackageOverview.dox rename to doxygen/general_pages/PackageOverview.md index bbf9994b2618..60da21689104 100644 --- a/doxygen/general_pages/PackageOverview.dox +++ b/doxygen/general_pages/PackageOverview.md @@ -1,6 +1,4 @@ -/** - -\page PackageOverview Package Overview +# Package Overview {#PackageOverview} - \ref FileFormatSupport - \ref MeshStructureOverview @@ -12,5 +10,3 @@ - \ref StatePluginsHelp - \ref HowtoAddPluginOverview - \ref I18nGuide - -*/ diff --git a/doxygen/general_pages/PythonSetupGuide.dox b/doxygen/general_pages/PythonSetupGuide.md similarity index 74% rename from doxygen/general_pages/PythonSetupGuide.dox rename to doxygen/general_pages/PythonSetupGuide.md index dd040962d256..c7f30461c5d9 100644 --- a/doxygen/general_pages/PythonSetupGuide.dox +++ b/doxygen/general_pages/PythonSetupGuide.md @@ -1,9 +1,8 @@ -/** -\page MeshLibPythonSetupGuide How to Install MeshLib SDK for Python +# How to Install MeshLib SDK for Python {#MeshLibPythonSetupGuide} # Installing MeshLib SDK for Python -\tableofcontents +[TOC] \htmlonly
@@ -13,8 +12,8 @@ The first part of this video shows MeshLib Python Installation process on Windows -When `pip` is done, confirm the result with \ref PythonSetupVerify "Verify the installation" — one command, with the output to expect. -If a step fails, see \ref PythonSetupTroubleshooting "Troubleshooting" at the end of the Installation Process section. +When `pip` is done, confirm the result with [Verify the installation](\ref PythonSetupVerify) — one command, with the output to expect. +If a step fails, see [Troubleshooting](\ref PythonSetupTroubleshooting) at the end of the Installation Process section. ## Prerequisites {#PythonSetupPrerequisites} Before installing MeshLib SDK for Python, ensure you have the following: @@ -25,12 +24,12 @@ Python 3.8 (end-of-life since October 2024) and 3.9 (end-of-life since October 2 no longer receive security updates, and remain listed only because the published wheels still install on them. - - On \b Windows: 3.8 to 3.14 on x64, and 3.11 to 3.14 on ARM64. There is no + - On **Windows:** 3.8 to 3.14 on x64, and 3.11 to 3.14 on ARM64. There is no 32-bit wheel. ARM64 starts at 3.11 because python.org publishes no earlier win-arm64 installer; on ARM64 with an older Python, use the x64 build instead. - - On \b macOS: 3.8 to 3.14, on macOS 12 or newer. Both arm64 (Apple Silicon) + - On **macOS:** 3.8 to 3.14, on macOS 12 or newer. Both arm64 (Apple Silicon) and x86_64 (Intel) are supported. - - On \b Linux: 3.8 to 3.14 for distributions + - On **Linux:** 3.8 to 3.14 for distributions with glibc 2.28 or newer (manylinux_2_28) — e.g. Ubuntu 20.04+, Debian 10+, RHEL/Rocky/AlmaLinux 8+, Fedora 29+. Both x86_64 and aarch64 are supported. @@ -51,39 +50,39 @@ and PyCharm offer completion and signature help for the MeshLib API with no extr ## Installation Process {#PythonSetupInstall} MeshLib is available on [PyPI](https://pypi.org/project/meshlib/) for Windows, macOS, and Linux: -\code{.sh} +```sh pip install meshlib -\endcode +``` It installs two packages: `meshlib-core` — the headless core with `mrmeshpy`, `mrmeshnumpy` and `mrcudapy` — and the `meshlib` wheel on top of it, adding the interactive viewer (`mrviewerpy`) with its UI resources. `numpy` (>= 1.19) is the only external dependency. -On \b Windows that command works as written. A virtual environment is still worth using once you +On **Windows** that command works as written. A virtual environment is still worth using once you have more than one project, so their dependencies cannot collide: -\code{.bat} +```bat py -m venv .venv .venv\Scripts\activate pip install meshlib -\endcode +``` -On \b Linux, and on \b macOS with Homebrew Python, the plain command is refused before it +On **Linux**, and on **macOS** with Homebrew Python, the plain command is refused before it downloads anything — `error: externally-managed-environment` — because pip will not install into an interpreter the system package manager owns (PEP 668); Apple's Command Line Tools Python instead accepts it quietly into a per-user directory you did not choose. There, install into a virtual environment: -\code{.sh} +```sh python3 -m venv .venv source .venv/bin/activate pip install meshlib -\endcode +``` ### Headless installation {#PythonSetupHeadless} On servers, in docker images, and in CI — anywhere the interactive viewer is never opened — install just the core: -\code{.sh} +```sh pip install meshlib-core -\endcode +``` The download is about 30% smaller and provides everything except `meshlib.mrviewerpy`; every other import (`from meshlib import mrmeshpy`, `mrmeshnumpy`, `mrcudapy`) works exactly as with the full package. Installing `meshlib` later adds the viewer on top, and `pip uninstall meshlib` removes @@ -92,43 +91,43 @@ requires exactly `meshlib-core` of the same version. ### Verify the installation {#PythonSetupVerify} `pip install` reporting success is not the same as a working install: the wheel is tens of megabytes of prebuilt native code, and it can install cleanly and still fail to load. This one command covers the whole chain — import the package, load the native module, run a real geometry call: -\code{.sh} +```sh python -c "from meshlib import mrmeshpy as mm; m = mm.makeCube(); print(mm.__file__); print(m.topology.numValidVerts(), 'verts', m.topology.numValidFaces(), 'faces')" -\endcode +``` Expected output — the path is yours and ends in `mrmeshpy.pyd` on Windows, while the two counts are fixed: -\code{.txt} +```unparsed /path/to/.venv/lib/python3.12/site-packages/meshlib/mrmeshpy.so 8 verts 12 faces -\endcode +``` -If it prints those two lines and exits `0`, the installation is working. Anything else — a traceback, a loader error, no output — means it is not: see \ref PythonSetupTroubleshooting "Troubleshooting" below. The printed path is worth a glance too, since it names the environment that actually received the package. +If it prints those two lines and exits `0`, the installation is working. Anything else — a traceback, a loader error, no output — means it is not: see [Troubleshooting](\ref PythonSetupTroubleshooting) below. The printed path is worth a glance too, since it names the environment that actually received the package. ### Your first script With the install confirmed, the same call is the starting point of a real script — this one also writes the cube to a file: -\code{.py} +```py from meshlib import mrmeshpy as mm mesh = mm.makeCube() print(mesh.topology.numValidVerts(), "vertices", mesh.topology.numValidFaces(), "faces") mm.saveMesh(mesh, "cube.stl") -\endcode +``` Output: -\code{.txt} +```unparsed 8 vertices 12 faces -\endcode +``` ### Troubleshooting {#PythonSetupTroubleshooting} -The failures new installations actually hit, with the message each one produces. One of them leaves `pip install` reporting success, which is what \ref PythonSetupVerify "Verify the installation" is for. +The failures new installations actually hit, with the message each one produces. One of them leaves `pip install` reporting success, which is what [Verify the installation](\ref PythonSetupVerify) is for. | Path | Symptom | Cause | Fix | |------|---------|-------|-----| -| Linux distribution Python, Homebrew Python on macOS | `pip install meshlib` stops before downloading anything with `error: externally-managed-environment`, then `× This environment is externally managed`. | Not a MeshLib problem: pip 23.0 and newer refuse to install any package into an interpreter the OS package manager owns (PEP 668, marked by a `EXTERNALLY-MANAGED` file next to the standard library). | Install into a virtual environment, as \ref PythonSetupInstall "Installation Process" above shows. `pip install --break-system-packages meshlib` also installs, but into the system interpreter — prefer the virtual environment. | -| Any | `ERROR: Could not find a version that satisfies the requirement meshlib (from versions: none)`, then `ERROR: No matching distribution found for meshlib`. | No published wheel matches this interpreter: the Python version is outside the range in \ref PythonSetupPrerequisites "Prerequisites" above, the interpreter is 32-bit, or the platform has no wheel at all — on ARM64 Windows the wheels start at Python 3.11, so an older interpreter there needs the x64 build. | Check what pip is matching against — `python -c "import sys, sysconfig; print(sys.version, sysconfig.get_platform())"` — and install a Python listed in \ref PythonSetupPrerequisites "Prerequisites". | -| Any | Install and import both succeed, but a documented function is missing — `AttributeError: module 'meshlib.mrmeshpy' has no attribute ...` — or `pip show meshlib` prints a version well behind the latest. | The package requires Python 3.8 or newer overall, but each release's wheel tags are narrower than that and change over time. When no wheel of the newest release matches your interpreter, pip does not fail: it silently installs the newest *older* release that does. | `pip show meshlib`, and compare with the version on the [PyPI page](https://pypi.org/project/meshlib/). If it is behind, move to a Python version listed in \ref PythonSetupPrerequisites "Prerequisites" and reinstall with `pip install --upgrade --force-reinstall meshlib`. | +| Linux distribution Python, Homebrew Python on macOS | `pip install meshlib` stops before downloading anything with `error: externally-managed-environment`, then `× This environment is externally managed`. | Not a MeshLib problem: pip 23.0 and newer refuse to install any package into an interpreter the OS package manager owns (PEP 668, marked by a `EXTERNALLY-MANAGED` file next to the standard library). | Install into a virtual environment, as [Installation Process](\ref PythonSetupInstall) above shows. `pip install --break-system-packages meshlib` also installs, but into the system interpreter — prefer the virtual environment. | +| Any | `ERROR: Could not find a version that satisfies the requirement meshlib (from versions: none)`, then `ERROR: No matching distribution found for meshlib`. | No published wheel matches this interpreter: the Python version is outside the range in [Prerequisites](\ref PythonSetupPrerequisites) above, the interpreter is 32-bit, or the platform has no wheel at all — on ARM64 Windows the wheels start at Python 3.11, so an older interpreter there needs the x64 build. | Check what pip is matching against — `python -c "import sys, sysconfig; print(sys.version, sysconfig.get_platform())"` — and install a Python listed in [Prerequisites](\ref PythonSetupPrerequisites). | +| Any | Install and import both succeed, but a documented function is missing — ``AttributeError: module 'meshlib.mrmeshpy' has no attribute ...`` — or `pip show meshlib` prints a version well behind the latest. | The package requires Python 3.8 or newer overall, but each release's wheel tags are narrower than that and change over time. When no wheel of the newest release matches your interpreter, pip does not fail: it silently installs the newest *older* release that does. | `pip show meshlib`, and compare with the version on the [PyPI page](https://pypi.org/project/meshlib/). If it is behind, move to a Python version listed in [Prerequisites](\ref PythonSetupPrerequisites) and reinstall with `pip install --upgrade --force-reinstall meshlib`. | Anything not listed here: please open an issue at [MeshLib Issues](https://github.com/MeshInspector/MeshLib/issues), quoting the full `pip` output or traceback. @@ -145,8 +144,9 @@ The `meshlib` package ships four importable modules: Import them from the package, for example `from meshlib import mrmeshpy`. -\note `mrcudapy` imports on any machine, including one without a GPU, but its routines -need an NVIDIA GPU with a working CUDA driver at runtime. +> [!NOTE] +> `mrcudapy` imports on any machine, including one without a GPU, but its routines +> need an NVIDIA GPU with a working CUDA driver at runtime. ### Predefined Functions and Example Scripts MeshLib provides a set of example scripts that are available [here](\ref Examples). @@ -162,5 +162,3 @@ After installing MeshLib, a great way to start exploring its capabilities is thr - **On macOS**, the interactive Viewer is not supported yet. The `meshlib.mrviewerpy` module installs and imports, but `mrviewerpy.launch()` raises `RuntimeError: MeshLib Viewer is not supported on macOS yet` — and in releases before 3.1.3.566 it terminated the Python process outright, with no exception — so the [**Viewer example**](\ref ExampleViewer) will not run. Start with the [**mesh loading and saving example**](\ref ExampleMeshLoadSave) instead, which demonstrates how to work with mesh files programmatically. These examples are a great entry point for integrating MeshLib into your workflow, regardless of your operating system. - -*/ \ No newline at end of file diff --git a/doxygen/general_pages/Spaces.dox b/doxygen/general_pages/Spaces.dox deleted file mode 100644 index 0a831f42f4c0..000000000000 --- a/doxygen/general_pages/Spaces.dox +++ /dev/null @@ -1,9 +0,0 @@ -namespace MR { - -/** \page SpacesHelp Spaces and Transformations - -\image html transformationsAndSpaces.png - -*/ - -} \ No newline at end of file diff --git a/doxygen/general_pages/Spaces.md b/doxygen/general_pages/Spaces.md new file mode 100644 index 000000000000..c50c80f44520 --- /dev/null +++ b/doxygen/general_pages/Spaces.md @@ -0,0 +1,3 @@ +# Spaces and Transformations {#SpacesHelp} + +![](transformationsAndSpaces.png) diff --git a/doxygen/general_pages/StatePluginsHelp.dox b/doxygen/general_pages/StatePluginsHelp.md similarity index 64% rename from doxygen/general_pages/StatePluginsHelp.dox rename to doxygen/general_pages/StatePluginsHelp.md index c703c4dcf49a..8a87b68872ae 100644 --- a/doxygen/general_pages/StatePluginsHelp.dox +++ b/doxygen/general_pages/StatePluginsHelp.md @@ -1,40 +1,37 @@ -namespace MR { - -/** \page StatePluginsHelp State Plugins Overview +# State Plugins Overview {#StatePluginsHelp} ## Base Functions -\b State \b plugins is simple objects to work with MeshLib scene and/or objects. It is one of possible inheritance of \ref RibbonMenuItem +**State plugins** is simple objects to work with MeshLib scene and/or objects. It is one of possible inheritance of \ref MR::RibbonMenuItem It has base functions: -\b Available \b function - \ref ISceneStateCheck interface function that block plugin in UI +**Available function** - \ref MR::ISceneStateCheck interface function that block plugin in UI -\parblock -\note This fuction can be inherited from some helper classes \ref SceneStateExactCheck \ref SceneStateAtLeastCheck \ref SceneStateAtMostCheck \ref SceneStateOrCheck \ref SceneStateAndCheck -\endparblock +> [!NOTE] +> This fuction can be inherited from some helper classes \ref MR::SceneStateExactCheck \ref MR::SceneStateAtLeastCheck \ref MR::SceneStateAtMostCheck \ref MR::SceneStateOrCheck \ref MR::SceneStateAndCheck -\code +```cpp // return empty string if all requirements are satisfied, otherwise return first unsatisfied requirement virtual std::string isAvailable( const std::vector>& ) const { return ""; } -\endcode -\b On \b Enable \b function - will be called if user enables plugin (only possible if `isAvailable` has returned true), if \c onEnable_ function returns false plugin will not be enabled (useful for some expensive checks, not to do them in each frame \c available function) -\code +``` +**On Enable function** - will be called if user enables plugin (only possible if `isAvailable` has returned true), if `onEnable_` function returns false plugin will not be enabled (useful for some expensive checks, not to do them in each frame `available` function) +```cpp MRVIEWER_API virtual bool onEnable_(); -\endcode -\b On \b Disable \b function - will be called if user disable plugin, it is necessary to clear all plugin data -\code +``` +**On Disable function** - will be called if user disable plugin, it is necessary to clear all plugin data +```cpp MRVIEWER_API virtual bool onDisable_(); -\endcode -\b Draw \b Dialog \b function - this function is called in each frame, only if plugin is enabled (will not be called after \c onDisable_ function). It is necessary to show plugin custom UI. -\code +``` +**Draw Dialog function** - this function is called in each frame, only if plugin is enabled (will not be called after `onDisable_` function). It is necessary to show plugin custom UI. +```cpp MRVIEWER_API virtual void drawDialog( ImGuiContext* ctx ); -\endcode +``` ## How to make your first plugin -To create you plugin you need to inherit class from MR::StatePlugin or MR::StateListenerPlugin (in case you need to get some events)\n +To create you plugin you need to inherit class from MR::StatePlugin or MR::StateListenerPlugin (in case you need to get some events)
Example: -\code +```cpp class MyOwnPlugin : public MR::StatePlugin { public: @@ -79,25 +76,21 @@ private: return true; } } -\endcode +``` Register your plugin with -\code +```cpp MR_REGISTER_RIBBON_ITEM( MyOwnPlugin ) -\endcode +``` To show this item on Ribbon menu, it should be present in MenuSchema.ui.json file (special page about these files are coming soon) -\n -\ref StateListenerPlugin is more simple way to make plugin listen to some events: -\code +
+\ref MR::StateListenerPlugin is more simple way to make plugin listen to some events: +```cpp // This plugin will listen to mouse move and mouse down, also isAvailable function will be imlemented with SceneStateExactCheck class MyListenerPlugin : public StateListenerPlugin, public SceneStateExactCheck<1, ObjectMesh> -\endcode +``` Find more: -\ref RibbonMenuItem -\ref StateBasePlugin -\ref StateListenerPlugin - -*/ - -} +\ref MR::RibbonMenuItem +\ref MR::StateBasePlugin +\ref MR::StateListenerPlugin diff --git a/doxygen/general_pages/SupportGeneratorTutorial.dox b/doxygen/general_pages/SupportGeneratorTutorial.md similarity index 91% rename from doxygen/general_pages/SupportGeneratorTutorial.dox rename to doxygen/general_pages/SupportGeneratorTutorial.md index 12e634631123..6b79435a1003 100644 --- a/doxygen/general_pages/SupportGeneratorTutorial.dox +++ b/doxygen/general_pages/SupportGeneratorTutorial.md @@ -1,5 +1,4 @@ -/** -\page SupportGeneratorTutorial Building a Support Generator Plugin Using MeshLib C++ on Windows +# Building a Support Generator Plugin Using MeshLib C++ on Windows {#SupportGeneratorTutorial} \htmlonly
@@ -9,7 +8,7 @@ ### Overview -This tutorial demonstrates how to create a practical support generator for 3D printing using the \b MeshLib \b SDK. +This tutorial demonstrates how to create a practical support generator for 3D printing using the **MeshLib SDK**. You will learn how to connect the dialog UI, handle user input, apply geometric algorithms (including mesh booleans), and render the result in one coherent workflow inside the MeshLib Viewer. ## Prerequisites @@ -37,5 +36,3 @@ https://meshlib.io/building_support_generator By the end of this tutorial, you will understand how to combine user interaction, geometry processing, and rendering into one cohesive workflow using the MeshLib SDK. This foundation enables development of more advanced 3D tools and plugins for MeshLib and MeshInspector. - -*/ \ No newline at end of file diff --git a/doxygen/general_pages/SwitchingFromOtherLibraries.dox b/doxygen/general_pages/SwitchingFromOtherLibraries.md similarity index 94% rename from doxygen/general_pages/SwitchingFromOtherLibraries.dox rename to doxygen/general_pages/SwitchingFromOtherLibraries.md index f08c4e17ad7a..ef0300955522 100644 --- a/doxygen/general_pages/SwitchingFromOtherLibraries.dox +++ b/doxygen/general_pages/SwitchingFromOtherLibraries.md @@ -1,8 +1,6 @@ -/** +# Switching from Other Libraries to MeshLib {#SwitchingFromOtherLibraries} -\page SwitchingFromOtherLibraries Switching from Other Libraries to MeshLib - -\tableofcontents +[TOC] MeshLib is a C++/Python geometry library focused on robust boolean operations, offsets, voxel-based reconstruction, decimation and remeshing. If you already work with CGAL, libigl, Open3D, PCL or VTK, the pairs below show the equivalent MeshLib code for the operations users most often port over. @@ -18,7 +16,7 @@ Every C++ snippet has a one-to-one equivalent in our Python bindings. ## Boolean union of two triangle meshes CGAL: -\code{.cpp} +```cpp #include #include #include @@ -31,10 +29,10 @@ PMP::IO::read_polygon_mesh("a.off", a); PMP::IO::read_polygon_mesh("b.off", b); PMP::corefine_and_compute_union(a, b, out); CGAL::IO::write_polygon_mesh("out.off", out); -\endcode +``` MeshLib: -\code{.cpp} +```cpp #include #include #include @@ -43,12 +41,12 @@ auto a = MR::MeshLoad::fromAnySupportedFormat("a.off").value(); auto b = MR::MeshLoad::fromAnySupportedFormat("b.off").value(); auto res = MR::boolean(a, b, MR::BooleanOperation::Union); MR::MeshSave::toAnySupportedFormat(res.mesh, "out.off"); -\endcode +``` ## Connected components of a mesh CGAL: -\code{.cpp} +```cpp #include namespace PMP = CGAL::Polygon_mesh_processing; using face_descriptor = boost::graph_traits::face_descriptor; @@ -56,22 +54,22 @@ using face_descriptor = boost::graph_traits::face_descriptor; auto fccmap = mesh.add_property_map("f:CC").first; std::size_t n = PMP::connected_components(mesh, fccmap); // fccmap[f] = component id -\endcode +``` MeshLib: -\code{.cpp} +```cpp #include auto [labels, n] = MR::MeshComponents::getAllComponentsMap(mesh); // labels[face] = component id -\endcode +``` # libigl ## Decimate a mesh to half its faces libigl: -\code{.cpp} +```cpp #include #include @@ -80,10 +78,10 @@ Eigen::MatrixXi F, G; Eigen::VectorXi J, I; igl::read_triangle_mesh("in.obj", V, F); igl::decimate(V, F, F.rows() / 2, U, G, J, I); -\endcode +``` MeshLib: -\code{.cpp} +```cpp #include #include #include @@ -92,35 +90,35 @@ auto mesh = MR::MeshLoad::fromAnySupportedFormat("in.obj").value(); MR::DecimateSettings s; s.maxDeletedFaces = int(mesh.topology.numValidFaces() / 2); MR::decimateMesh(mesh, s); -\endcode +``` ## Signed distance from a point to a mesh libigl: -\code{.cpp} +```cpp #include Eigen::VectorXd S; Eigen::VectorXi I; Eigen::MatrixXd C, N; igl::signed_distance(P, V, F, igl::SIGNED_DISTANCE_TYPE_PSEUDONORMAL, S, I, C, N); -\endcode +``` MeshLib: -\code{.cpp} +```cpp #include #include auto sd = MR::findSignedDistance(point, mesh); float dist = sd->dist; -\endcode +``` # Open3D ## Point-to-point ICP registration Open3D: -\code{.cpp} +```cpp #include using namespace open3d; @@ -131,10 +129,10 @@ auto result = pipelines::registration::RegistrationICP( Eigen::Matrix4d::Identity(), pipelines::registration::TransformationEstimationPointToPoint()); Eigen::Matrix4d xf = result.transformation_; -\endcode +``` MeshLib: -\code{.cpp} +```cpp #include #include #include @@ -143,12 +141,12 @@ auto src = MR::PointsLoad::fromAnySupportedFormat("src.ply").value(); auto tgt = MR::PointsLoad::fromAnySupportedFormat("tgt.ply").value(); MR::ICP icp( {src}, {tgt}, MR::AffineXf3f{}, MR::AffineXf3f{}, /*samplingVoxel=*/0.05f ); auto xf = icp.calculateTransformation(); -\endcode +``` ## Point cloud to mesh (surface reconstruction) Open3D (Ball Pivoting): -\code{.cpp} +```cpp #include using namespace open3d; @@ -156,10 +154,10 @@ auto pcd = io::CreatePointCloudFromFile("cloud.ply"); pcd->EstimateNormals(); std::vector radii = {0.005, 0.01, 0.02, 0.04}; auto mesh = geometry::TriangleMesh::CreateFromPointCloudBallPivoting(*pcd, radii); -\endcode +``` MeshLib (voxel fusion): -\code{.cpp} +```cpp #include #include #include @@ -169,14 +167,14 @@ auto cloud = MR::PointsLoad::fromAnySupportedFormat("cloud.ply").value(); MR::PointsToMeshParameters p; p.voxelSize = cloud.computeBoundingBox().diagonal() * 1e-2f; MR::Mesh mesh = MR::pointsToMeshFusion(cloud, p).value(); -\endcode +``` # PCL ## Voxel-grid downsampling of a point cloud PCL: -\code{.cpp} +```cpp #include #include @@ -187,10 +185,10 @@ vg.setInputCloud(cloud); vg.setLeafSize(0.05f, 0.05f, 0.05f); pcl::PointCloud::Ptr out(new pcl::PointCloud); vg.filter(*out); -\endcode +``` MeshLib: -\code{.cpp} +```cpp #include #include #include @@ -200,12 +198,12 @@ auto cloud = MR::PointsLoad::fromAnySupportedFormat("cloud.ply").value(); MR::UniformSamplingSettings s; s.distance = 0.05f; MR::PointCloud out = MR::makeUniformSampledCloud(cloud, s).value(); -\endcode +``` ## Estimate point-cloud normals PCL: -\code{.cpp} +```cpp #include pcl::NormalEstimation ne; @@ -215,15 +213,15 @@ ne.setSearchMethod(tree); ne.setKSearch(20); pcl::PointCloud::Ptr normals(new pcl::PointCloud); ne.compute(*normals); -\endcode +``` MeshLib: -\code{.cpp} +```cpp #include auto normals = MR::makeNormals(cloud, /*avgNeighborhoodSize=*/20); cloud.normals = normals; -\endcode +``` # VTK @@ -233,7 +231,7 @@ In Python the bridge is even shorter: vtkPolyData arrays go straight into MeshLi ## Decimate a mesh VTK: -\code{.cpp} +```cpp #include #include #include @@ -248,10 +246,10 @@ dec->SetInputData(reader->GetOutput()); dec->SetTargetReduction(0.5); dec->Update(); vtkPolyData* out = dec->GetOutput(); -\endcode +``` MeshLib: -\code{.cpp} +```cpp #include #include #include @@ -261,12 +259,12 @@ auto mesh = MR::MeshLoad::fromAnySupportedFormat("in.stl").value(); MR::DecimateSettings s; s.maxDeletedFaces = int(mesh.topology.numValidFaces() / 2); MR::decimateMesh(mesh, s); -\endcode +``` ## Boolean union of two meshes VTK: -\code{.cpp} +```cpp #include #include #include @@ -280,10 +278,10 @@ boolOp->SetInputData(0, ra->GetOutput()); boolOp->SetInputData(1, rb->GetOutput()); boolOp->Update(); vtkPolyData* out = boolOp->GetOutput(); -\endcode +``` MeshLib: -\code{.cpp} +```cpp #include #include @@ -292,12 +290,12 @@ auto a = MR::MeshLoad::fromAnySupportedFormat("a.stl").value(); auto b = MR::MeshLoad::fromAnySupportedFormat("b.stl").value(); auto res = MR::boolean(a, b, MR::BooleanOperation::Union); MR::Mesh out = res.mesh; -\endcode +``` ## Read and write mesh files VTK: -\code{.cpp} +```cpp #include #include #include @@ -310,21 +308,21 @@ auto writer = vtkSmartPointer::New(); writer->SetFileName("out.obj"); writer->SetInputData(reader->GetOutput()); writer->Write(); -\endcode +``` MeshLib: -\code{.cpp} +```cpp #include #include auto mesh = MR::MeshLoad::fromAnySupportedFormat("in.stl").value(); MR::MeshSave::toAnySupportedFormat(mesh, "out.obj"); -\endcode +``` ## Moving data in memory (Python) In Python no files are needed: vtkPolyData arrays go straight into MeshLib via numpy and back. -\code{.py} +```py from vtk.util.numpy_support import vtk_to_numpy from meshlib import mrmeshpy, mrmeshnumpy @@ -338,11 +336,9 @@ mesh = mrmeshnumpy.meshFromFacesVerts(faces, verts) # MeshLib -> numpy (rebuild vtkPolyData with numpy_to_vtk) out_verts = mrmeshnumpy.getNumpyVerts(mesh) out_faces = mrmeshnumpy.getNumpyFaces(mesh.topology) -\endcode +``` # Missing your case? Don't see your library or your operation? [Open an issue](https://github.com/MeshInspector/MeshLib/issues) or [start a GitHub Discussion](https://github.com/MeshInspector/MeshLib/discussions) — we'll add the snippet. - -*/ diff --git a/doxygen/general_pages/ThirdpartyList.dox b/doxygen/general_pages/ThirdpartyList.md similarity index 93% rename from doxygen/general_pages/ThirdpartyList.dox rename to doxygen/general_pages/ThirdpartyList.md index e710f7ed42e2..8468aa2b82d0 100644 --- a/doxygen/general_pages/ThirdpartyList.dox +++ b/doxygen/general_pages/ThirdpartyList.md @@ -1,6 +1,4 @@ -namespace MR { - -/** \page ThirdParty Third-Party Dependencies +# Third-Party Dependencies {#ThirdParty} # List of dependencies @@ -22,7 +20,7 @@ Below is a summary of all modules and their dependencies, so you can see what ea ### MRMesh -\b MRMesh is our core module, handling geometry operations. Since it is mandatory, its dependencies are required for every build. +**MRMesh** is our core module, handling geometry operations. Since it is mandatory, its dependencies are required for every build. |Name |Description |License | |---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|-------------------------------| @@ -43,7 +41,7 @@ Below is a summary of all modules and their dependencies, so you can see what ea ### MRIOExtras -\b MRIOExtras adds support for the input and output of additional file formats (e.g., glTF, STEP, PDF). It requires MRMesh and includes: +**MRIOExtras** adds support for the input and output of additional file formats (e.g., glTF, STEP, PDF). It requires MRMesh and includes: |Name |Description |License | |------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|-------------------------------------------| @@ -60,7 +58,7 @@ Below is a summary of all modules and their dependencies, so you can see what ea ### MRSymbolMesh -\b MRSymbolMesh is our module responsible for text-to-mesh conversion operations. As such, it requires MRMesh plus: +**MRSymbolMesh** is our module responsible for text-to-mesh conversion operations. As such, it requires MRMesh plus: |Name |Description |License | |-----------------------------------------------------------|-----------------------------------------------------------------------------|-------------------------------------------| @@ -68,7 +66,7 @@ Below is a summary of all modules and their dependencies, so you can see what ea ### MRPython -\b MRPython enables Python bindings and embedded Python scripting for MeshLib. It depends on MRMesh and: +**MRPython** enables Python bindings and embedded Python scripting for MeshLib. It depends on MRMesh and: |Name |Description |License | |-------------------------------------------------------------------------|-----------------------------------------------------------------------------|-------------------------------------------| @@ -78,7 +76,7 @@ Below is a summary of all modules and their dependencies, so you can see what ea ### MRVoxels -\b MRVoxels provides functionality for volumetric operations. It depends on MRMesh plus: +**MRVoxels** provides functionality for volumetric operations. It depends on MRMesh plus: |Name |Description |License | |------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|--------------------| @@ -88,7 +86,7 @@ Below is a summary of all modules and their dependencies, so you can see what ea ### MRCuda -\b MRCuda enables GPU-accelerated algorithms using NVIDIA CUDA. Here, you need MRMesh, MRVoxels, and: +**MRCuda** enables GPU-accelerated algorithms using NVIDIA CUDA. Here, you need MRMesh, MRVoxels, and: |Name |Description |License | |----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------| @@ -97,7 +95,7 @@ Below is a summary of all modules and their dependencies, so you can see what ea ### MRViewer -\b MRViewer is MeshLib’s module for rendering and UI. It handles window creation, input, and GUI elements. It needs MRMesh, MRVoxels, MRSymbolMesh, MRIOExtras, and: +**MRViewer** is MeshLib’s module for rendering and UI. It handles window creation, input, and GUI elements. It needs MRMesh, MRVoxels, MRSymbolMesh, MRIOExtras, and: |Name |Description |License | |---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|-----------------------------| @@ -113,7 +111,7 @@ Below is a summary of all modules and their dependencies, so you can see what ea ### MRMcp -\b MRMcp exposes MeshLib functionality through the Model Context Protocol (HTTP + SSE) and a parallel REST API. It depends on MRMesh and: +**MRMcp** exposes MeshLib functionality through the Model Context Protocol (HTTP + SSE) and a parallel REST API. It depends on MRMesh and: |Name |Description |License | |------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|-------------------------------------------| @@ -123,7 +121,7 @@ Below is a summary of all modules and their dependencies, so you can see what ea ### MRMCPGateway -\b MRMCPGateway is a small standalone executable (`McpGateway[.exe]`) that proxies stdio-based MCP clients onto the HTTP MCP server hosted by MeshInspector. It has no MeshLib dependencies and pulls in: +**MRMCPGateway** is a small standalone executable (`McpGateway[.exe]`) that proxies stdio-based MCP clients onto the HTTP MCP server hosted by MeshInspector. It has no MeshLib dependencies and pulls in: |Name |Description |License | |------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|-------------------------------------------| @@ -137,7 +135,3 @@ The Windows distribution ships its executables (MeshViewer, meshconv, MRTest) wi |Name |Description |License | |-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------|-------------------------------------------| |mimalloc |a compact general purpose allocator with excellent performance |MIT | - -*/ - -} \ No newline at end of file diff --git a/doxygen/general_pages/Tutorials.dox b/doxygen/general_pages/Tutorials.md similarity index 89% rename from doxygen/general_pages/Tutorials.dox rename to doxygen/general_pages/Tutorials.md index b5d2792b1f3f..0cd098f30ab8 100644 --- a/doxygen/general_pages/Tutorials.dox +++ b/doxygen/general_pages/Tutorials.md @@ -1,5 +1,4 @@ -/** -\page Tutorials MeshLib SDK Tutorials +# MeshLib SDK Tutorials {#Tutorials} Welcome to the MeshLib SDK Tutorials! Here you'll find guides, examples, and step-by-step instructions to help you get started with MeshLib and explore its features. @@ -13,13 +12,11 @@ You can also try these operations in the browser: the [live demo](https://demo.m In just a few minutes, you'll learn how to set up your development environment, write your first plugin, and get it running with MeshLib. This tutorial will help you establish a solid foundation for more advanced plugin development. -\ref FirstPluginTutorial "Start Tutorial" +[Start Tutorial](\ref FirstPluginTutorial) ### Building a Support Generator Plugin Using MeshLib C++ on Windows In this extended tutorial, you'll learn how to expand MeshLib's capabilities by developing custom tools. Through a practical, hands-on session, you'll build a fully functional support generator that combines user interaction, geometric processing, and real-time visualization within the MeshLib Viewer. -\ref SupportGeneratorTutorial "Support Generator Tutorial" - -*/ +[Support Generator Tutorial](\ref SupportGeneratorTutorial)