QMAT
Code for 2015 SIGGRAPH paper Q-MAT: Computing Medial Axis Transform by Quadratic Error Minimization.
Install / Use
/learn @ningnawang/QMATREADME
Q-MAT
This is an open-source code repository for SIGGRAPH paper Q-MAT: Computing Medial Axis Transform by Quadratic Error Minimization. It contains the core simplify function of Q-MAT. For more supports, please see the Todo List.
If our open-source Q-MAT contributes to an academic publication, please cite it as:
@misc{qmatcode,
title = {Q-MAT Open-source Code},
author = {Yin, Yibo and Wang, Ningna and Song, Shibo},
howpublished = "\url{https://github.com/ningnawang/QMAT}",
year = {2024}
}
And please cite the original paper:
@article{li2015q,
title={Q-mat: Computing medial axis transform by quadratic error minimization},
author={Li, Pan and Wang, Bin and Sun, Feng and Guo, Xiaohu and Zhang, Caiming and Wang, Wenping},
journal={ACM Transactions on Graphics (TOG)},
volume={35},
number={1},
pages={1--16},
year={2015},
publisher={ACM New York, NY, USA}
}
Tested on:
- MacOS M3
- Windows
Requirements
-
C++ (>=14)
-
CGAL (5.6.1)
NOTE: Since CGAL version 5.0, CGAL is header-only be default, which means that there is no need to build CGAL before it can be used. Thus, CGAL header files are included in
include/CGAL. Also, you can see/Eigenand/boostin the same directory. These are dependencies for CGAL and are also header-only. Details can be seen at: CGAL 5.6.1 Manual -
CMake (3.16)
-
OpenMP (MacOS)
Installation & Run
- Clone the repository into your local machine:
git clone https://github.com/ningnawang/QMAT
- Compile the code using cmake (first compilation may takes a while):
cd QMAT
mkdir build && cd build
cmake ..
make -j4
- Run the program:
./QMAT <surface_mesh.off> <medial_mesh.ma> <num_target_spheres>
For example:
./QMAT ../data/bug.off ../data/bug.ma 200
The .ma Format
The .ma file is the commonly used MAT format:
numVertices numEdges numFaces
v x y z r
e v1 v2
f v1 v2 v3
One can load the *.ma file using Blender with an open-sourced blender-mat-addon.
Q&A
- For MacOS, resolving
clang: error: unsupported option ‘-fopenmp’:
The problem is that AppleClang does not support -fopenmp, one should use brew's 'llvm'.
- step 1:
$brew install llvm libomp
- step 2: Update Compiler Variables (or update in
~/.zshrcif you want to use brew'sClangthanAppleClangpermanently)
export CC=/usr/local/opt/llvm/bin/clang
Todo List:
- add
polyscopefor GUI - add computation for initial MA given OFF
- ...
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
