3D geometry module?

W

Will McGugan

Hi,

Is there a general purpose 3D geometry module for Python? I would like
to be able to read / write 3D models and perform per vertex / per face
operations on them.

Failing that, are there vector / matrix / quaternion classes I can make
use of?

Thanks..

Will McGugan
 
M

Mike C. Fletcher

Will said:
Hi,

Is there a general purpose 3D geometry module for Python? I would like
to be able to read / write 3D models and perform per vertex / per face
operations on them.

Pivy gives you an Inventor mechanism for loading .iv and .wrl (VRML97)
files, not sure how it handles exposing faces/points, but I'd imagine
it's fairly straightforward.

OpenGLContext will read/write VRML97 files, and (though it's not set up
for it as an API feature) let you process the vertices/faces (there's
code in there that will tessellate the faces, for instance, though you
need an OpenGL context to do it), see the IndexedFaceSet implementation
for example code.

There is at least one module that loads 3DS files.

You could use Blender's in-program scripting support for any format it
supports.

I think the U of Waterloo people have a .obj loader, but I'm not sure if
it's open-source or not.

Don't think anyone has a 3DSMax .ASC loader, (which would be really nice).
Failing that, are there vector / matrix / quaternion classes I can
make use of?

I tend to use Numpy for vector and matrix. Both PyOpenGL and
OpenGLContext have quaternion classes available, there's a few more in
various other packages.

Have fun,
Mike

________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
 
J

John Hunter

Will> Hi, Is there a general purpose 3D geometry module for
Will> Python? I would like to be able to read / write 3D models
Will> and perform per vertex / per face operations on them.

Will> Failing that, are there vector / matrix / quaternion classes
Will> I can make use of?

VTK is absolutely astounding in depth, breadth and quality, and has a
full python wrapper. For win32, the enthought edition of python has
VTK built in.

Can take years to wrap your head around, though, in my experience.
It's that big.

JDH
 
S

Simon Burton

Hi,

Is there a general purpose 3D geometry module for Python? I would like to
be able to read / write 3D models and perform per vertex / per face
operations on them.

Failing that, are there vector / matrix / quaternion classes I can make
use of?

cgkit has 3d/4d matrix/vector classes.. and it's fast, if you need that.

Simon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top