Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Conversion tools: stl2pov, pov2png, iges2stl, iges2png
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bryan Bishop  
View profile  
 More options Oct 14 2009, 2:25 pm
From: Bryan Bishop <kanz...@gmail.com>
Date: Wed, 14 Oct 2009 13:25:28 -0500
Local: Wed, Oct 14 2009 2:25 pm
Subject: Re: Conversion tools: stl2pov, pov2png, iges2stl, iges2png

On Wed, Oct 14, 2009 at 10:46 AM, Bryan Bishop wrote:
> stl2pov.py
> http://adl.serveftp.org/skdb/import_tools/stl2pov.py

Now with images. Here's what the output looks like for me:

http://adl.serveftp.org/~bryan/pythonocc-tools/bearing.png

The rest of this email is just describing how I did it and what files I used.

You can find bearing.stl in OCC 6.3.0; linux users can run `locate
bearing.stl` and find it.

bearing.stl was here for me on various machines:
/home/bryan/opencascade/OpenCASCADE6.3.0/data/stl/bearing.stl
/home/kanzure/local/opencascade/OpenCASCADE6.3.0/data/stl/bearing.stl

python stl2pov.py bearing.stl bearing.pov

stl file: http://adl.serveftp.org/~bryan/pythonocc-tools/bearing.stl
pov file (mesh data):
http://adl.serveftp.org/~bryan/pythonocc-tools/bearing.pov.inc
pov file: http://adl.serveftp.org/~bryan/pythonocc-tools/bearing.pov

python pov2png.py bearing.pov bearing.png

pov file (mesh data):
http://adl.serveftp.org/~bryan/pythonocc-tools/bearing.pov.inc
pov file: http://adl.serveftp.org/~bryan/pythonocc-tools/bearing.pov

resulting png: http://adl.serveftp.org/~bryan/pythonocc-tools/bearing.png

You can find bearing.iges in OCC 6.3.0; linux users can run `locate
bearing.iges` and find it.

bearing.iges was here for me on various machines:
/home/bryan/opencascade/OpenCASCADE6.3.0/data/iges/bearing.iges
/home/kanzure/local/opencascade/OpenCASCADE6.3.0/data/iges/bearing.iges
/home/kanzure/code/skdb/import_tools/models/bearing.iges

python iges2stl.py bearing.iges bearing.stl

input iges file: http://adl.serveftp.org/~bryan/pythonocc-tools/bearing.iges

I don't want to upload that STL file, sorry. There's already an STL
file there, but it's the one provided with OCC 6.3.0, not the one
generated by running iges2stl.

iges2stl is *slow*. OCC is very slow when exporting or converting to
STL. Took me about 30 to 60 seconds for the bearing.

python iges2png.py bearing.iges bearing.png

input iges file: http://adl.serveftp.org/~bryan/pythonocc-tools/bearing.iges
resulting png: http://adl.serveftp.org/~bryan/pythonocc-tools/bearing.png

Clearly the resulting image doesn't look as good as occray. I wish I
would have known about occray last night, I wouldn't have written
iges2png and have to reinvent the wheel.

http://code.google.com/p/occray/

I looked around on the opencascade.org forum and found that others
have been trying to generate images from CAD files since 2000. There
were posts in 2000, 2002, and one more recently in 2008, of people
complaining about Xw_Window.cxx and how OCC uses Xlib to save an image
of the scene, rather than using some off screen rendering mechanism. I
also noticed that src/OpenGl/ isn't included in pythonOCC? I was
hoping to dig around in there and see if I could find a way to do off
screen rendering. PyOpenGL doesn't implement the gl off screen
rendering method, sadly enough, so it might have to be either compiled
into OCC, or we just hope that the OCC devs bothered to put it in
(which I am starting to doubt).

The other option is to use blender for rendering of STL files. Sadly
this still requires using OCC to convert from IGES/STEP to STL, which
takes forever. The other problem is that my blender script doesn't
seem to work-- I use renderAnim, I set up lamps and lights, and point
the camera at the object, but the resulting image is just black
pixels.

I was running blender with:
blender -b -P render_image.py

And here's what I had in render_image.py ...
http://adl.serveftp.org/~bryan/pythonocc-tools/render_image.py

Why is it so hard to get a rendered image? Does anyone know how
thingiverse is rendering their images of STL and DXF files?

- Bryan
http://heybryan.org/
1 512 203 0507


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.