1
votes

I am a geology student and am trying to come up with a program for illustrating joint networks in rock masses.

Basically I just need wxPython script, or any snippets of script that would be able to create a GUI program which displays a number of disks inside a box, with the parameters (ie relative position, orientation and radius) of the disks being input at the beginning. Does anyone know of any script like that, or if thats even possible? My problem is that this is for my thesis, and although I have dabbled in Python before, not on anything anywhere near as complex as this, and certainly not GUI. I literally don't even know where to begin trying to display geometric shapes.

I unfortunately don't have the time to learn enough wxPython to do this, I'm looking for any pre-written example code. I have downloaded wxPython and have done some tutorials on creating message windows etc but now I'm not sure where to look for help now. Any advice/tips/code at ALL would be greatly appreciated, I am desperate for help!

1
Seriously, I don't see how this would need a GUI application. Just create some ellipses in SVG and render them using cairo or AGG - SVG is XML and can be easily edited by hand, if need be, which is just as fast as entering some values in a pre-written GUI. You can easily pack the whole operation in a shell script for semi-automation... - Jim Brissom
I recommend using Traits (code.enthought.com/projects/traits) for scientific apps. If you already know how to use matplotlib then the solution to your problem is quite straightforward with matplotlib and Traits. - Christian Alis

1 Answers

0
votes

I'm not sure I understand exactly what you are trying to do here. Are you creating an interactive GUI or just a visualization? It sounds like you want something in 3D. In that can you should check out VPython which has some tutorials and demo code. Also much more powerful is PyOpenGL. For something and actual 2D user interface in wxPython you should really look through the demo code included with wxPython. There is quite a nice library of complete examples with source code that you can just copy and modify. I am pretty sure there are some examples for drawing polygons of arbitrary size/shape.