You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The minimal algorithm included with python's miniball package often calculates incorrect minimal bounding spheres for polyhedra with augmentations and/or large numbers of vertices. The current standard method of finding the minimal bounding sphere in three dimensions is Gärtner's miniball, which is an extension of Welzl’s algorithm and is written in c++. The package cyminiball (available with python -m pip install cyminiball) directly binds to the original c++ code, which is faster and more stable that the package miniball, which is a pure python implementation of the same algorithm with less stringent checks. This is the underlying issue behind the method as it currently stands, and will be fixed in an upcoming PR.
What about Fischer's exact solver?
There is a better method for calculating minimal bounding spheres, and it is available here. Although referred to as an "exact" solver, the method is not more accurate than Gärtner's implementation in all cases, although Fischer does include a number of internal checks as well as additional code to speed up runtimes. However, it is not currently available as a python package and would require a fair bit of complexity to incorporate into coxeter. For this reason, the fix PR for this will use Gärtner's miniball, and Fischer's algorithm can be revisited at a later date.
Running pytest tests/test_polyhedron.py::test_get_set_minimal_bounding_sphere_radius on a branch that includes Johnson solids will easily reproduce these errors.
Repeatedly running minimal_bounding_sphere on a highly aspherical mesh and comparing the results between runs will also reproduce this error
Description
The minimal algorithm included with python's
miniballpackage often calculates incorrect minimal bounding spheres for polyhedra with augmentations and/or large numbers of vertices. The current standard method of finding the minimal bounding sphere in three dimensions is Gärtner's miniball, which is an extension of Welzl’s algorithm and is written in c++. The packagecyminiball(available withpython -m pip install cyminiball) directly binds to the original c++ code, which is faster and more stable that the package miniball, which is a pure python implementation of the same algorithm with less stringent checks. This is the underlying issue behind the method as it currently stands, and will be fixed in an upcoming PR.What about Fischer's exact solver?
There is a better method for calculating minimal bounding spheres, and it is available here. Although referred to as an "exact" solver, the method is not more accurate than Gärtner's implementation in all cases, although Fischer does include a number of internal checks as well as additional code to speed up runtimes. However, it is not currently available as a python package and would require a fair bit of complexity to incorporate into coxeter. For this reason, the fix PR for this will use Gärtner's miniball, and Fischer's algorithm can be revisited at a later date.
Further reading.
To reproduce
test_get_set_minimal_bounding_sphere_radius methodon some Johnson solids (see Added new shape families for Archimedean, Catalan, Johnson, and other solids. #177).pytest tests/test_polyhedron.py::test_get_set_minimal_bounding_sphere_radiuson a branch that includes Johnson solids will easily reproduce these errors.Error output
See #177 and #178.
System configuration