Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 1.29 KB

README.md

File metadata and controls

35 lines (25 loc) · 1.29 KB

minballPy

Port of C++ algorithm to Python for finding smallest enclosing sphere of spheres. Library documentation avaliable here For further information about the problem I recommend reading thesis by Kaspar Fisher.

alt text

Usage:

import random
import minball
spheres = []
for _ in range(10):
    center = [random.random() * 10, random.random() * 10]
    radius = random.random() * 5
    spheres.append(minball.Sphere2D(center, radius))

min_sphere = minball.get_min_sphere2D(spheres)
print(min_sphere.radius, min_sphere.center)

Available dimensions

Dimensions 1D-4D are provided out of the box. If other dimensions are needed, simply head to include/minball_py.hpp, change the range and recompile.

Dependencies

CGAL (For Ubuntu should be sufficient to do sudo apt-get install libcgal-dev)

gcc or clang (gcc is default)

Setup && Build

make setup && make