'Is there a faster alternative to sympy to compute intersection of 3D segments and planes?

I am writing a Python code that needs to analyze if thousands of segments intersect with a cube. My approach has been to use SYMPY to compute the intersection between each segment and each face of the cube. This is painfully slow, and I need something that is at least one order of magnitude faster. Any alternative library or approach? Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source