cythonized version of py3D module