5
votes

Are there any libraries that provide 3D polyhedra, and support calculating the intersection of two polyhedra?

If it makes a difference, the polyhedra I want to model do not have 'holes' in them.

The focus would be on correctness first and speed a close second!

Ideally this library would:

  • have existing tidy python bindings
  • be free-standing or have reasonable and small dependencies
  • support calculating the outline of the polyhedron when view from any given angle
1
Did you find what you were looking for with CGAL? How are you computing the intersection of polyhedra? Thanks. - Geoff
@Geoff sorry I have difficulty even recalling the project this was for; I think I ended up writing my own not-fast code from first-principles; but looking at it, CGAL seems a good choice for you to explore. - Will
Thanks for the follow up. I'm working with the Nef_polyhedron_3 class for now. - Geoff

1 Answers

5
votes

CGAL offers rather more than you're asking for, but does in particular include polyhedra and "boolean"-like operations on them (I'm not sure about "view from any angle" as a primitive, though -- as I recall it wasn't there when I last used it, but that was a while ago -- you may have to iterate projecting the hedges on the appropriate plane).

The Python bindings are here and I believe the only "big" dependency is Boost Python (used for the bindings).