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
Conversion tools: stl2pov, pov2png, iges2stl, iges2png
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
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.
Bryan Bishop  
View profile  
 More options Oct 14 2009, 2:48 pm
From: Bryan Bishop <kanz...@gmail.com>
Date: Wed, 14 Oct 2009 13:48:28 -0500
Local: Wed, Oct 14 2009 2:48 pm
Subject: Re: [Open Manufacturing] Re: Conversion tools: stl2pov, pov2png, iges2stl, iges2png

On Wed, Oct 14, 2009 at 1:42 PM, Vitaly Mankevich <albanetc...@gmail.com> wrote:
> Looks like Thingiverse uses povray for actual rendering:

> http://blog.reprap.org/2008/11/announcing-thingiversecom.html
> "From STL, its easy to convert to POV which i use for doing the actual
> rendering. linux (or something independent, say python) and command
> line is also crucial here."

I see. Right now converting from IGES to STL is taking a long time.
The povray part is pretty quick. One other option that I am
investigating is using gmsh (which links to OCC) to load an IGES file
and then save an image (it has some image saving functions). The
problem is that the output of the GIF exporter looks like this:

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

But it is significantly faster, so a compiled tool (linking to gmsh)
might be better in the end. I don't know how fast occray is, it was
just announced this morning. An off-screen OpenGL renderer would be
even better. I guess I'll go back to digging through the OCC
code-base.

- 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.
Erik  
View profile  
 More options Oct 15 2009, 8:17 am
From: Erik <erikdebrui...@gmail.com>
Date: Thu, 15 Oct 2009 05:17:42 -0700 (PDT)
Local: Thurs, Oct 15 2009 8:17 am
Subject: Re: Conversion tools: stl2pov, pov2png, iges2stl, iges2png

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

> - Bryanhttp://heybryan.org/

I've experimented a bit with Zach Smith's render, which is in use at
Thingiverse.com. I think I have the files you need to get similar to
Thingiverse rendering. The following are files branched from a very
old release of Zach's setup, but they do work under Debian and Ubuntu
(with perl and probably requiring some libraries). I've uploaded it
here:

http://counter.reprap.org/stl2web/povray-render-stl.tgz

It was part of an attempt to improve it for Thingiverse, which I
really wish to support. Perhaps, since it's also useful to you, we can
improve it together.

In http://counter.reprap.org/stl2web/ you'll find an interactive
viewer that I started building. It's very coarse at this moment, but
should work in any browser (no flash/java required). I've just
committed it into the RepRap subversion repository under my personal
directory:
svn co http://reprap.svn.sourceforge.net/svnroot/reprap/trunk/users/erik/stl...

Eventually it should be part of a system, I envision that serves as a
distributed processing system where everyone can participate in
helping rendering and toolpath generation (skeinforge for 3D printing
is pretty processor intensive) for fabbing.

Also, I'd like to see user generated parametric models being converted
into fabber ready (e.g. STL) file format. I've just tried a proof of
concept of this by making a bottle from a script. I only 'told it'
which dimensions I wanted. Creating a completely seamless (but clogged
together) toolchain to have the machine fab without any manual steps
in between it is entirely a plausible thing to code in a week, but I'm
afraid that I don't have a spare week right now ;)


 
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.
Andrew Mazzotta  
View profile  
 More options Oct 20 2012, 4:03 pm
From: Andrew Mazzotta <andrewmazzo...@gmail.com>
Date: Sat, 20 Oct 2012 13:03:01 -0700 (PDT)
Local: Sat, Oct 20 2012 4:03 pm
Subject: Re: Conversion tools: stl2pov, pov2png, iges2stl, iges2png

Bryan and Erik,

Here is a blast from the past! I was reading a lot of stuff to get .stl
files to load on a site I'm creating and found this from 2009.

Would one of you be able to elaborate on how to have stls be viewable like
Thingiverse? The file can be successfully loaded by a user but open up in a
new page as data.

Thanks,

Andrew


 
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.
Bryan Bishop  
View profile  
 More options Oct 20 2012, 4:32 pm
From: Bryan Bishop <kanz...@gmail.com>
Date: Sat, 20 Oct 2012 15:32:26 -0500
Local: Sat, Oct 20 2012 4:32 pm
Subject: Re: [Open Manufacturing] Re: Conversion tools: stl2pov, pov2png, iges2stl, iges2png

On Sat, Oct 20, 2012 at 3:03 PM, Andrew Mazzotta
<andrewmazzo...@gmail.com>wrote:

> Would one of you be able to elaborate on how to have stls be viewable like
> Thingiverse? The file can be successfully loaded by a user but open up in a
> new page as data.

I don't understand your second sentence. Anyway, thingiverse has since
changed their rendering system to something using blender. The original
method was the stl2pov script with some tweaks.

Here, have some things:

http://diyhpl.us/~bryan/irc/stl2pov/
http://diyhpl.us/cgit/skdb/plain/import_tools/stl2pov.py
http://www.xs4all.nl/~rsmith/software/stl2pov-2.4.3.tar.gz
http://freshmeat.net/projects/stl2pov/
http://diyhpl.us/reprap/trunk/users/hoeken/stl2pov/
http://diyhpl.us/reprap/trunk/users/erik/stl2web/
http://diyhpl.us/reprap/trunk/users/erik/stl2web/stl2web.js
https://github.com/tbuser/thingiview.js

Basically you want to use a task queue to render things as they are
uploaded from your website. For example, I was doing this from a git
post-receive hook.

- 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.
Triffid Hunter  
View profile  
 More options Oct 20 2012, 10:23 pm
From: Triffid Hunter <triffid.hun...@gmail.com>
Date: Sun, 21 Oct 2012 13:23:18 +1100
Local: Sat, Oct 20 2012 10:23 pm
Subject: Re: [Open Manufacturing] Re: Conversion tools: stl2pov, pov2png, iges2stl, iges2png
On Sun, Oct 21, 2012 at 7:03 AM, Andrew Mazzotta

<andrewmazzo...@gmail.com> wrote:
> Would one of you be able to elaborate on how to have stls be viewable like
> Thingiverse? The file can be successfully loaded by a user but open up in a
> new page as data.

how about using an in-browser renderer like jsc3d or three.js?

 
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.
Andrew Mazzotta  
View profile  
 More options Oct 20 2012, 10:48 pm
From: Andrew Mazzotta <andrewmazzo...@gmail.com>
Date: Sat, 20 Oct 2012 19:48:33 -0700 (PDT)
Local: Sat, Oct 20 2012 10:48 pm
Subject: Re: [Open Manufacturing] Re: Conversion tools: stl2pov, pov2png, iges2stl, iges2png

Just ran across three.js. Reading on jsc3d now. Thanks guys.


 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »