I am looking for a good and well developed library for geometrical manipulations and evaluations in python, like:
- evaluate the intersection between two lines in 2D and 3D (if present)
- evaluate the point of intersection between a plane and a line, or the line of intersection between two planes
- evaluate the minimum distance between a line and a point
- find the orthonormal to a plane passing through a point
- rotate, translate, mirror a set of points
- find the dihedral angle defined by four points
I have a compendium book for all these operations, and I could implement it but unfortunately I have no time, so I would enjoy a library that does it. Most operations are useful for gaming purposes, so I am sure that some of these functionalities can be found in gaming libraries, but I would prefer not to include functionalities (such as graphics) I don't need.
Any suggestions ? Thanks
Shapely is a nice python wrapper around the popular GEOS library.
CGAL has Python bindings too.
geometry-simple has classes Point Line Plane Movement in ~ 300 lines, using only numpy; take a look.
Perhaps take a look at SymPy.
I really want a good answer to this question, and the ones above left me dissatisfied. However, I just came across pythonocc which looks great, apart from lacking good docs and still having some trouble with installation (not yet pypi compatible). The last update was 4 days ago (June 19th, 2011). It wraps OpenCascade which has a ton of geometry and modeling functionality. From the pythonocc website:
[EDIT: I've now downloaded pythonocc and began working through some of the examples]
I believe it can perform all of the tasks mentioned, but I found it to be unintuitive to use. It is created almost entirely from SWIG wrappers, and as a result, introspection of the commands becomes difficult.
You may be interested in Python module SpaceFuncs from OpenOpt project, http://openopt.org
SpaceFuncs is tool for 2D, 3D, N-dimensional geometric modeling with possibilities of parametrized calculations, numerical optimization and solving systems of geometrical equations