
non-gon: A Non-Polygonal Collision Detection Library for Real-Time Queries Between Smooth Convex Shapes
Abstract
Accurate collision detection is fundamental to modern game engines and physics simulators, enabling applications in biomechanics, robotic obstacle avoidance, surgical training, and granular material simulation. While polygonal meshes remain the standard, smooth convex shapes, such as ellipses and ellipsoids, offer significant advantages in geometric accuracy, memory efficiency, and computational performance. Although analytical methods exist, they are scattered across disciplines and lack a unified implementation. To address this, we present non-gon a curated library comprised of 14 analytical functions for real-time distance and proximity queries between 2D and 3D smooth convex shapes, implemented in TypeScript and Three.js. In addition to the core analytic functions, the library features curve and surface rendering, along with several interactive web application examples. Finally, we invite all communities working on physics-based engines to contribute to the library, either by integrating its analytic functions into their codebases or by extending the collection of supported contact pairs.
© 2026 Ivo Roupa, Rodrigo Damasceno, Aasam Karim, Lourenço Mourão, João Afonso, Pedro Campos, Daniel Simões Lopes, published by Ubiquity Press
This work is licensed under the Creative Commons Attribution 4.0 License.