[Plugin] Import STL files

[Plugin] Import STL files

Postby Didier Bur » Fri Mar 14, 2008 10:09 pm

This is an update of su2stl.rb:
- Import STL file added.

26.03.08 (1)
- Unit support: select your unit when exporting or when importing (this gives the opportunity to scale your model for instance). previous version was saving and restoring only in inches.

26.03.08 (2)
Small glitch corrected with the import function :oops:

Discuss here.
2
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

[Plugin] SU2STL update

Postby Didier Bur » Wed Mar 26, 2008 4:02 pm

Hi all,

I've added unit support to su2stl import/export features
D/L here (same link than previous version)
http://www.sketchucation.com/forums/scf/viewtopic.php?f=153&t=8081&p=47575#p47575
Enjoy,
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Import STL files

Postby watkins » Wed Mar 26, 2008 4:19 pm

Dear Didier,

Many thanks for all your hard work. Any chance of a STEP (*.stp, *.step), or an IGES (*.igs, *.iges) exporter, or is this not an appropriate export file format for Sketchup? It would be nice to be able to export a 'surface' model from Sketchup, and then import it as a surface model into a 3D CAD application (Inventor, Pro/E etc) for further modelling.

Regards,
Bob
0

watkins 
 

Re: SU2STL update

Postby Didier Bur » Sun Mar 30, 2008 5:14 pm

Wow ! IGES and STP are muuuuuccccchhhh more complex than STL...
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: SU2STL update

Postby watkins » Sun Mar 30, 2008 10:51 pm

Dear Didier,

I imagine so or someone would have done it by now. It was just something to put on the wish list.

Regards,
Bob
0

watkins 
 

Re: SU2STL update

Postby Eric_J » Tue May 20, 2008 8:53 pm

Hello Didier

This file does not seem to work for me, and I have some questions?

1) The file appears to be in binary format. Do I need to have it in ASCII format to use it on a Mac?
2) On a Mac, exactly which "plugins" folder should the file be placed? I can find at least two. (Library/Application Support/Google SketchUp 6/SketchUp/plugins and Applications/SketchUp.app/Contents/Plugins)
3) The file has an ".rb" extension. Double clicking the binary file attempts to open the application RealBasic, for which I do not have a license. Do I need to purchase a license for RealBasic or would that be resolved by having the file in ASCII format?

Many thanks in advance for any assistance.
0

Eric_J 
 

Re: SU2STL update

Postby remus » Tue May 20, 2008 8:57 pm

1) and 3) a .rb is really jsut a text file. You should be able to open it in any plain test editor, like notepad on windows (not sure what the mac equivalent is)

2)Not sure about this one, im sure a more mac savy person will come along and tell you where to put it.
0

remus 
 

Re: SU2STL update

Postby Eric_J » Tue May 20, 2008 9:12 pm

OK, it seems to work when put into Library/Application Support.../plugins, and it seems to export properly!

Thanks again!
0

Eric_J 
 

Re: SU2STL update

Postby Howard leslie » Thu Nov 13, 2008 9:51 pm

Didier,
If possible, could you adjust your script so it mines down into all groups and components and converts all data in a model to *.stl ??? (or a *.sat file ???)
Additionally, all stl objects are to retain the sketchup group and component names.
...........
I know TIG has produced several very useful scripts with this mining ability that dig down into all groups and components.
Some of his code could possibly help ???
............
This would make your script so much more useful
Anything you can do, hugely appreciated.

Regards
Howard L'
0

Howard leslie 
 

Re: SU2STL update

Postby Didier Bur » Fri Nov 14, 2008 9:20 am

Hi
I'll see what I can do. Code exists also in su2pov for instance so it is just a question of time (which is hard to find these days for me...)
Regards,
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Problem Importing

Postby casey344 » Mon Jan 19, 2009 1:25 pm

First, thank you for posting the utility - getting this to work will save us so much time.

My STL file is not importing properly. I get the prompt to specify scale then a jumbled version of what I am importing. See image below.

I am using Sketchup 7.0. Any ideas what I am doing wrong?

Thank you.
0

casey344 
 

Re: SU2STL update

Postby Didier Bur » Mon Jan 19, 2009 10:02 pm

Hi,

I am using Sketchup 7.0. Any ideas what I am doing wrong?

Not at all. It can be aproblem with SU7, or a problem with the STL file. Post it here so I can check it.
Regards,
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: SU2STL update

Postby casey344 » Mon Jan 19, 2009 10:44 pm

Thanks for offering to help.

You should be able to pick it up here ...

Link to file:
https://download.yousendit.com/bVlCSXR3Mm1wTVYzZUE9PQ
0

casey344 
 

Re: SU2STL update

Postby Didier Bur » Mon Jan 19, 2009 11:27 pm

AAARGGHHHH 71 Mb !
Downloading it now, but I guess the file is too big for SU...
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: SU2STL update

Postby casey344 » Mon Jan 19, 2009 11:39 pm

Sorry, not my doing. :?

Manufacturer sent it that way.
0

casey344 
 

Re: SU2STL update

Postby jwelin » Tue Jan 20, 2009 7:01 am

Thanks for the work on this plugin. I have a three questions:

Is there a limit to the level of nested groups/components it exports?

The exported STL seems to be incompatible with some applications. Rhino sees the geometry, for instance, while Magics does not. Also an SU2stl generated stl, opened in Rhino and resaved as an STL is much smaller in file size. Would you like to see examples?

Is there a way to call this plugin from another? I have a need to batch export.
0
John Welin
architectural model maker
Chicago, USA

jwelin 
 

Re: SU2STL update

Postby Didier Bur » Tue Jan 20, 2009 9:00 am

Hi,
The exported STL seems to be incompatible with some applications

There are several STL formats which slightly differ in their syntax. The one I have choosen to export is the most standard one, as defined here for instance:
http://www.gom.com/CONTAINER/files/sp_stl_en.pdf
or here:
http://mech.fsv.cvut.cz/~dr/papers/Lisbon04/node2.html
Maybe some applications do not support every kind of STL ?

an SU2stl generated stl, opened in Rhino and resaved as an STL is much smaller in file size

I don't have Rhino, but I suppose that it saves an STL in the binary format, while my script saves it in ASCII (text), which is 8 times bigger (average). You can see the same differences between an ascii dxf and a binary dxf (dxb) for instance.

Is there a limit to the level of nested groups

No. Not tested here but as a recursive method is involved, there should be no limits.
Components are NOT supported, groups are.

Is there a way to call this plugin from another?

Unfortunately no.

Regards,
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: SU2STL update

Postby thomthom » Tue Jan 20, 2009 9:44 am

Didier Bur wrote:
Is there a limit to the level of nested groups

No. Not tested here but as a recursive method is involved, there should be no limits.
Components are NOT supported, groups are.


I found that recursive methods might cause SU to bugsplat. viewtopic.php?f=180&t=15585&p=120726 I had a method that looped over entities to find connected entities which used a recursive method. Had to change it to an iterative method.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: SU2STL update

Postby Didier Bur » Tue Jan 20, 2009 11:10 am

I found that recursive methods might cause SU to bugsplat.

Bad news :(
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: SU2STL update

Postby thomthom » Tue Jan 20, 2009 12:13 pm

Mind you, it happens when you do many recursions. When crawling geometry you quickly end up with hundreds iterations. So if the script never goes that deep you're ok. But it's something to be aware of.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: SU2STL update

Postby NewOne » Tue Jul 21, 2009 2:29 pm

When exporting STL from SolidWorks, here is an option to put all geometry in same file or to create separate file for each part. Mr. Didier Bur, could this script to be modified in a manner that allows multiple file selection and each geometry to be made group (or component if there are more identical parts) ? Or to specify a folder where stl part files are located?

Thank you.
0

NewOne 
 

Re: SU2STL update

Postby Didier Bur » Wed Jul 22, 2009 6:21 pm

Dropped into the to-do list ;)
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: SU2STL update

Postby Gaieus » Wed Jan 06, 2010 11:19 am

bump
(sorry Dider - no practical reason just testing some moderation stuff)
0
User avatar
Gaieus 
 

Re: [Plugin] Import STL files

Postby stefkeB » Thu Dec 16, 2010 1:47 pm

Minor improvement:

On line 54 you call the "openpanel" method when exporting. This should be "savepanel", so the user gets the correct dialog displayed. Still works on Windows but not on OSX, where you need to point to an already existing file.

Also, the default "." file location could be replaced with ENV['USER'] or ENV['HOME'] or preferably the current file folder, as to make it more convenient. With 'USER' it works much better for me on OSX.

(I refer to the unscrambled file, obviously, not the compacted one -- maybe the reason why people think it is a binary file)
0

stefkeB 
 

Re: [Plugin] Import STL files

Postby Didier Bur » Sun Dec 19, 2010 12:20 pm

Hi,
@stefkeB: I'm using openpanel when importing, and savepanel when exporting. So I don't understand what you're talking about, propably you have an old version, because the latest one is v1.3. (Nov 2009) and is scrambled in a RBS file (so unreadable).
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: [Plugin] Import STL files

Postby thomthom » Mon Aug 22, 2011 10:18 am

I've been looking around at the various ruby based importers for SketchUp and I see that no one uses the Importer class. If this class is used the importer can be found in the native import list which would be very nice.
http://code.google.com/apis/sketchup/do ... orter.html
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Import STL files

Postby charly2008 » Mon Aug 22, 2011 10:56 pm

Hi Didier,

I have tried the tool in Sketchup 8. The Unit support appears and I can choose my unit but then nothing happens. I've attached the stl files which I downloaded from Internet.

Charly
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] Import STL files

Postby Didier Bur » Tue Aug 23, 2011 9:36 am

Hi Charly,
Your files are binary STL files. The script cannot read such files, but only ASCII STL format.
You can convert binary STL's to ASCII with Meshlab (free) for instance.
Regards,
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: [Plugin] Import STL files

Postby charly2008 » Tue Aug 23, 2011 12:54 pm

Hi Didier,

Thank you for the explanation. I learned something more to it.

Charly
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] Import STL files

Postby davidheim1 » Mon May 20, 2013 9:07 pm

Didier,
I just downloaded the STL Export/Import plug-in on my Mac, but I can't make it work. It asks me for the name of a file to export, but won't ever let me export anything. What am I missing? Can you provide a brief explanation of how to make the export function work?
Many thanks,
David Heim
0

davidheim1 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: Kamangom, or35bo and 6 guests

Visit our sponsors: