Beginner Question: 3D Models

2013-06-18 Thread andrewblundon
Hi there,

Sorry for the complete beginner question but I thought the readers here might 
be able to provide me with some guidance.

I've done some programming with Visual Basic and VBA plus a little PHP, CSS and 
HTML.  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.  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.  We have 3D models of each component within our CAD 
system so it would be great if we could utilize those models.

Most of the 3D graphic capabilities I've seen seem to center around either 
gaming or mathematical plotting.  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?

Thanks
AB
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Beginner Question: 3D Models

2013-06-19 Thread andrewblundon
On Wednesday, June 19, 2013 12:50:52 AM UTC-2:30, Steven D'Aprano wrote:
> On Tue, 18 Jun 2013 19:47:34 -0700, andrewblundon wrote:
> 
> 
> 
> > 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.  We have 3D models of each component
> 
> > within our CAD system so it would be great if we could utilize those
> 
> > models.
> 
> [...]
> 
> > Is this possible?  Is Python the right language?
> 
> 
> 
> 
> 
> Is Blender the sort of thing you are looking for?
> 
> 
> 
> https://duckduckgo.com/html/?q=blender%20python
> 
> 
> 
> 
> 
> -- 
> 
> Steven

I've seen some information on Blender.  Is it possible to have the entire 
program contained within a single exe (or exe and some other files) so that it 
can be passed around and used by others without having to install blender?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Beginner Question: 3D Models

2013-06-19 Thread andrewblundon
On Wednesday, June 19, 2013 3:30:41 AM UTC-2:30, Christian Gollwitzer wrote:
> Am 19.06.13 04:47, schrieb andrewblun...@gmail.com:
> 
> > 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.  We have 3D models of
> 
> > each component within our CAD system so it would be great if we could
> 
> > utilize those models.
> 
> 
> 
> Have a look at vtk
> 
> 
> 
> http://www.vtk.org/
> 
> 
> 
> Using VTK you can import CAD models and visualize them, combine to 
> 
> scenes and export. VTK has Python bindings. It is a real big library, 
> 
> but focused on polygonal models, i.e. it will happily import STL and 
> 
> OBJ, but not IGES and the like ith real curves. Then the question is how 
> 
> you'd want to export your model. VTK can export to VRML and X3D, but if 
> 
> you want to CREATE a real model by CSG of the exisiting parts, you would 
> 
> need a true CAD system. There is not much useful free stuff out there, 
> 
> you could try BRL-CAD or OpenCascade. The latter also has python 
> 
> bindings. http://www.pythonocc.org/
> 
> 
> 
>   Christian

I don't need to create and export the model.  I just want to be able to view it 
within the application I'm creating (without any other programs).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Beginner Question: 3D Models

2013-06-19 Thread andrewblundon
As I've said, I'm a fairly novice. I've compiled simple VB programs previously 
into exe files for use but nothing with pyton and nothing of this complexity. 
This application could potentially be distributed to hundreds of people 
throughout the world as our company is worldwide. Asking these people to 
install other software is really not realistic. I'd like to have it all 
contained in one project. I stated one exe but it could be a number of files 
packaged into one "distribution" if that it's the right term.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Beginner Question: 3D Models

2013-06-19 Thread andrewblundon
This sounds similar to what I might want. So you know of any online tutorials 
for this?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Beginner Question: 3D Models

2013-06-19 Thread andrewblundon
On Wednesday, June 19, 2013 11:47:36 AM UTC-2:30, Rick Johnson wrote:
> On Tuesday, June 18, 2013 9:47:34 PM UTC-5, andrew...@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

Excellent..  Thank you for your response.  I'll start looking at OpenGL.  I've 
looked into Blender previously for simply animations and having an average user 
use that for any sort of interface would indeed be overwhelming.  I simply need 
a viewer that you could zoom and orbit.

It would also be nice if you could import an existing 3D CAD geometry for 
viewing.

I think I need to start downloading Python with a few of the libraries and 
start playing around.

Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list