Beginner Question: 3D Models

Rick Johnson rantingrickjohnson at gmail.com
Wed Jun 19 10:17:36 EDT 2013


On Tuesday, June 18, 2013 9:47:34 PM UTC-5, andrew... at gmail.com wrote:

> I'm looking at developing a program for work that can be
> distributed to others (i.e. and exe file).  The
> application would open various dialogue boxes and ask the
> user for input and eventually perform mathematical
> calculations on the input.

Tkinter sucks for GUI (at least as it stands today) however
it IS part of the stdlib and you can get going fairly
quickly with it -- although Tkinter does not supply a native
3dcanvas widget so you'll have to use "togl", which is very
old and poorly written, but it works! ;-)

Alternatively, WxPython is a full featured GUI library which
has a glCanvas waiting for you. But like anything there is a
trade-off -- will take a bit more time to understand Wx than
Tkinter.

> From what I've read Python would have no trouble with
> this. However, for one part of the program I'd like to be
> able to create a 3D model based on the user input.  The
> model would be very basic consisting of a number of lines
> and objects.
> [...]
> Are there any capabilities to import existing
> CAD geometry, arrange the components in particular 3D
> coordinates in space and then view the results in some
> sort of 3D viewer?  Ideally the user would then be able to
> zoom in and orbit around looking at the model. Is this
> possible?  Is Python the right language?

Sounds like "OpenGL" is what you need.

Others have mentioned Blender, however i would say that is a
bad idea. Sure, all the zoom and orbit code is written for
you but then your users are going to be overwhelmed by the
Blender interface. Blender is overkill for what you want!
Suggesting Blender for this problem is like suggesting you
rent a semi-truck to ship a toaster one block.

Adding lines and faces (or even geometric primitives) in
OpenGL is so easy you'd have to be a complete moron not to
understand it. There's a little bit of complication when
handling concave faces (or faces containing holes), but
nothing impossible about it. Importing data from outside
programs is pure Python (easy stuff).

PS: Be aware that you'll most likely want to use the latest
version of Python 2.x if you go the OpenGL route. You need
the following.

Python2.x + (Tkinter & Togl or WxPython) + OpenGL



More information about the Python-list mailing list