2

I am interested in writing interactive programs in computational geometry using Python. Here are a couple of nice examples to illustrate what I have in mind.

  1. This part in the Youtube video
  2. Angles in a kite
  3. Similar Triangles

I want to prototype several heuristics for a research problem I am working on. The following example would be a typical use-case for me.

Once the program runs, a GUI window opens up into which a user can "mouse" in his/her points in the two dimensional plane using mouse-clicks. The user can also move these points to a different position by clicking these points.

I would then like to have several buttons available below to experiment with, say, different convex-hull algorithms -- Each button would run and animate different convex-hull algorithm on the same set of points.

Scipy, Numpy and the CGAL Python bindings contain the necessary algorithmic ingredients but they do not have any visualization tools. I know MATPLOTLIB is a great plotting tool, but AFAIK it cannot do interactive animations of the types above.

I know I would have to base my GUI program on GUI toolkits using WxPython or PyQT. But from what I know, these libraries only provide the GUI part of drawing windows, mouse-clicks, status bars, menu bars etc. -- nothing to draw or handle geometric objects like points, segments, lines, circles, splines etc.

I am guessing some kind of "geometry manager / app" would have to be "embedded" inside a wxPython frame with which the user can interact. Every mouse-click should then translate into a pair/triple of real numbers depending on the dimension of the problem.

But I am not sure, since I have never done GUI programming. The only animations I have done are non-interactive by using ffmpeg to stitch together my .png plot output files from matplotlib at successive time-steps.

**Any recommendations for a good mature library to do this? **

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.