Skip to content
C++ implementation of the Medial Axis Shrinking Ball algorithm
C++ CMake C
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Use size_t to index simplification grid (#23) Jan 28, 2017
thirdparty Update projects and remove vrui/kdtree2 Oct 19, 2016
vs_build compute_ma - A more complete solution to handle duplicate coordinates… Oct 27, 2016
CMakeLists.txt let cmake compile everything again Oct 25, 2016
LICENSE switch to MIT license Apr 21, 2016 update README Oct 26, 2016


masbcpp is a C++ implementation of the shrinking ball algorithm to approximate the Medial Axis Transform (MAT) of an oriented point cloud. It is being developed in support of the 3DSM project that aims to explore possible applications of the MAT for GIS point clouds (e.g. from airborne LiDAR). To deal with noisy input data a novel noise-handling mechanism is built-in.

See this video for a demonstration of the MAT of some LiDAR point clouds. And this video demonstrates how the shrinking ball algorithm works.


For Linux/OS X:

$ git clone
$ cd masbcpp
$ cmake .
$ make

Building on windows should be possible with Visual Studio.

External dependencies

PCL is currently the only dependency that is not included in this distribution (but PCL has many dependencies of its own).

###Build with OpenMP support (multithreading) The build system should autodetect whether your compiler supports OpenMP and build masbpp with multithreading support accordingly. To enable multithreading on Mac OS X (tested with version 10.10), do

$ brew install clang-omp

prior to building masbcpp (assuming you have installed Homebrew).



$ ./compute_ma --help


$ ./compute_normals --help


$ ./simplify --help

Currently only NumPy binary files (.npy) are supported as input and output. Use pointio for reading and writing of .npy files and conversion from the ASPRS LAS format.


The current implementation is not infinitely scalable, mainly in terms of memory usage. Processing very large datasets (hundreds of millions of points or more) is therefore not really supported.


The shinking ball algorithm was originally introduced by

  title={3D medial axis point approximation using nearest neighbors and the normal field},
  author={Ma, Jaehwan and Bae, Sang Won and Choi, Sunghee},
  journal={The Visual Computer},

Details on how I adapted the shrinking ball algorithm to handle noisy inputs can be found in

	author = {Peters, Ravi and Ledoux, Hugo},
	title = {Robust approximation of the {Medial Axis Transform} of {LiDAR} point clouds as a tool for visualisation},
	journal = {Computers \& Geosciences},
	year = {2016},
	volume = {90},
	number = {A},
	pages = {123--133},
	month = {mar}

I would like to thank the authors of the following libraries for releasing their code to the general public under permissive licenses, masbcpp ships with (parts of) these libraries:

You can’t perform that action at this time.