[Plugin] IGES Export - 27 February 2012

[Plugin] IGES Export - 27 February 2012

Postby rainer.ochs » Wed Feb 15, 2012 10:45 pm

When sketchup is used to do mechanical CAD it is sometimes desirable to convert the models to a CAD format.
There are two standard exchange formats, step and iges, that are widely used. I have chosen iges as the format is much more manageable, though it is the older standard. There are tools available to convert from iges to step if required (I use the free HeeksCAD)

The plugin first does some checking if the model contains valid solid geometry. Only closed shells are recognized as solid geometry and exported. The parts are not allowed to have inner surfaces or dangling lines. Geometry that does not conform is deleted prior to export, a warning message is given.

The model is segmented into solid shapes and then these are exported into an iges file. All the changes to the model are undone afterwards.

Sketchup represents all geometry as faces and edges, curved geometry is smoothed for viewing, but internally it is still edgy. Iges however expects the shapes to be defined in their actual shape. Thus a solid in iges is usually represented as a collection of analytical shapes and spline surfaces.

There is no universal way to create this shapes from the sketchup faceted mesh. My exporter recognizes cylindrical and conical shapes and exports these as true cylindrical surfaces. All other geometry is exported as edgy facets.
This is the curved geometry that most often is present in mecanical parts.
Probably I will attempt to do some spline fitting in the future.

Install the exporter by copying the file into the plugins directory. There will be a new function added to the tools menu.

Update:
V 0.5 Undo-Bug corrected. The exporter manipulates the model, but now undoes the changes afterwards correctly.
V 0.6 deletes temp file. Removes inner faces instead of deleting the whole object. Clean exit if no filename or nothing to export
V 0.7 Delete edges that connect to inner surfaces before export
6
Last edited by rainer.ochs on Tue May 22, 2012 6:41 pm, edited 5 times in total.

rainer.ochs 
 

Re: IGES Export Plugin

Postby zapwizard » Thu Feb 16, 2012 12:00 am

This is a greatly needed plugin.

I tested the plugin on SketchUp 8.0.3117 and tried importing the IGES file into Alibre.
A .igs.tmp file was left behind, and Alibre spit out the error: ACISERROR_FILE_OF_UNSUPPORTED_UNIT.
I overrode the units in the Alibre import settings and got the error: ACICERROR_IMPORT_NO_FACES.
No combination of settings in the Alibre importer let me import the IGES file.

The file did import perfectly into ProE and a crappy IGES viewer program I found online, so I am not sure what is up with Alibre.

The curves came out perfectly, even a six sided cylindrical worked correctly when smoothed (circle) and un-smoothed (hex).
0

zapwizard 
 

Re: IGES Export Plugin

Postby rainer.ochs » Thu Feb 16, 2012 8:41 am

If you have problems it may be an option to convert the iges to step with an apropriate program. I have done this for Autodesc Inventor that will not import the iges into solids but wireframes. Converted to step it works fine.
It is also a good idea to export one part at a time and not too many together. You then see what part causes the problems and I have the impression that complex collection of parts tend to be more difficult.
0

rainer.ochs 
 

Re: [Plugin] IGES Export - 15 February 2012

Postby thomthom » Thu Feb 16, 2012 10:06 am

Hi and welcome to the forum. :)

I had a quick scan through your plugin - got a couple of comments:
.typename: Avoid at all cost! It's very slow to use! It has always bugged me that the API doc use it for its examples.

I see you use attributes a lot - but they are all removed at the beginning of an export. Is that to keep track of entity information while you process the model? If so I'd suggest you use a Hash to keep track of entity data - instead of adding prosessing data to the model which will increase file size. In addition, attributes are slow - lots of string manipulation and lookups.

I generally recommend people not to extend the base classes - due to the possibilities of conflict.
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] IGES Export - 15 February 2012

Postby thomthom » Thu Feb 16, 2012 10:19 am

You should mention that the exporter might erase stuff.

And that it makes all groups and components unique!

It is not expected behavior that an exporter modifies the model it exports.
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] IGES Export - 15 February 2012

Postby TIG » Thu Feb 16, 2012 11:00 am

Exported data/files are not subject to an undo or an abort call...
IF your exporter must change the model's data so it can work successfully, then the correct way to proceed is to satrt ALL of its actions after a Sketchup.active_model.start_operation('IGESexport') and after it's made the export use a closing Sketchup.active_model.abort_operation, which undoes ALL of the changes you have made to the model BUT leaves the external file[s] alone...
That way you get your data exported correctly but the user gets no nasty surprises when he finds his model has be tampered with !
:geek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] IGES Export - 16 February 2012

Postby rainer.ochs » Thu Feb 16, 2012 7:11 pm

Of course the exporter should not modify the model. It does it during work but afterwards undoes the changes. In V0.4 the undo was made a comment for testing, in V0.5 this is corrected.

TIG: is there a difference whether I use "model.abort_operation" or "model.commit_operation" and "Sketchup.undo" as I do?

thomthom: the exporter never was optimized for fast operation, I wanted to keep it simple. As I undo the changes it is no problem to adhere attributes to the entities, they never will be saved. IGES is constantly referring with pointers to its structural elements, keeping track with attributes was simpler to implement and more descriptive. I agree that hashes might be faster. But as the structure is still growing when I am going to implement splines I still prefer the more understandable approach.
What do you recommend to use instead of "typename"?
0

rainer.ochs 
 

Re: [Plugin] IGES Export - 16 February 2012

Postby thomthom » Thu Feb 16, 2012 7:26 pm

rainer.ochs wrote:What do you recommend to use instead of "typename"?

Use .is_a?( Sketchup::Face ) etc...
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] IGES Export - 16 February 2012

Postby Zacchia » Fri Feb 17, 2012 12:01 am

I have some files in iges format I would like to import in SU, so an importer would also be nice to have...
0

Zacchia 
 

Re: [Plugin] IGES Export - 16 February 2012

Postby Anssi » Sat Feb 18, 2012 8:51 pm

One interesting part in this is that it creates "real" solid geometry out of SU "solids". Could it be expanded into the DXF format too? That would add a useful feature that the current DWG/DXF exporters lack.

Anssi
0
securi adversus homines, securi adversus deos rem difficillimam adsecuti sunt, ut illis ne voto quidem opus esset
User avatar
Anssi 
 

Re: [Plugin] IGES Export - 16 February 2012

Postby rainer.ochs » Sat Feb 18, 2012 10:37 pm

Anssi wrote:Could it be expanded into the DXF format too?


I got good results with HeeksCAD ( http://heeks.net) a freeware CAD program.
It can import iges and once in Heeks you can save it to step, dxf and stl.
The programs file converting is based on open cascade (http://www.opencascade.org) a very sophisticated system. As far as I have been testing, the results are reliable.
0

rainer.ochs 
 

Re: [Plugin] IGES Export - 16 February 2012

Postby rainer.ochs » Mon Feb 27, 2012 8:27 pm

Zacchia wrote:I have some files in iges format I would like to import in SU, so an importer would also be nice to have...


There is a description on http://eagleup.wordpress.com/?s=iges&searchbutton=go%21
on Importing a STEP or IGES file into Sketchup using FreeCAD and MeshLab.
file.step => FreeCAD => file.stl => MeshLab => file.dae => Sketchup => file.skp
0

rainer.ochs 
 

Re: [Plugin] IGES Export - 16 February 2012

Postby Zacchia » Wed Feb 29, 2012 8:39 am

rainer.ochs wrote:There is a description on http://eagleup.wordpress.com/?s=iges&searchbutton=go%21
on Importing a STEP or IGES file into Sketchup using FreeCAD and MeshLab.
file.step => FreeCAD => file.stl => MeshLab => file.dae => Sketchup => file.skp


Thank you for this information, it works! I already knew meshlab, freecad not...
0

Zacchia 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby sepo » Sun Mar 04, 2012 5:46 pm

I tried to open .igs export from SU in Rhino. It bring geometry but geometry is broken. The model is made of separate surfs and some surfs (curved) are missing.
0

sepo 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby DavidVT » Fri Mar 09, 2012 4:20 pm

Nice addition!
I am struggling to find the size limit that will work.
I have a very complex model the size of an aircraft that seems to lockup everytime.

I test this with a small box and it works great.

Suggestions???
0

DavidVT 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby rainer.ochs » Mon Mar 12, 2012 1:45 pm

DavidVT wrote:I am struggling to find the size limit that will work.
I have a very complex model the size of an aircraft that seems to lockup everytime.

sepo wrote:I tried to open .igs export from SU in Rhino. It bring geometry but geometry is broken.


I do not think, that the size itself is a problem. I usually scale my models in micron so I also have fairly big numbers and this worked fine. I think the problem is more the complexity. To convert from a face-model to solid it is very important that the outer shell has no gaps and no inner geometry. The exporter removes all parts it cannot convert to real shells.

Suggestion 1: Try redo to see what the exporter does to the model. If the parts are deleted there it is a problem with the geometry.

Suggestion 2: Try HeeksCAD to open the iges. If it is ok there, convert to step and import from there. If it is not ok the iges is the problem. Feel free to send me your model to the email that is given in the code.
0
Last edited by rainer.ochs on Tue Mar 13, 2012 7:25 pm, edited 1 time in total.

rainer.ochs 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby jonorman » Mon Mar 12, 2012 10:39 pm

This plugin is amazing. The possibility to export "solids" out of SU is for me close to the holy grale :-) Thank you so much.. :sketchstatic:
0

jonorman 
Premium Member
Premium Member
 

Re: [Plugin] IGES Export - 27 February 2012

Postby gordon_smith » Thu Mar 15, 2012 2:13 pm

I haven't tried the plugin yet, but it is very exciting. This could make sketchup much more useful for me. Where I work the mechanical engineers use Catia, and it would be awseome to be able to send them my drawings in a format that they can use.
I also want to second the FreeCad & MeshLabs method as a great way to get IGES files into sketchup. :thumb:
0
Irrationally held truths may be more harmful than reasoned errors.
Thomas Huxley

gordon_smith 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby rainer.ochs » Thu Mar 15, 2012 11:02 pm

gordon_smith wrote:I also want to second the FreeCad & MeshLabs method as a great way to get IGES files into sketchup. :thumb:


There is also a direct importer plug-in for stl into sketchup:
http://sketchuptips.blogspot.com/2010/0 ... -redo.html

A direct export to stl can be found at http://www.guitar-list.com/download-sof ... dxf-or-stl

STL from other formats can be converted with FreeCAD or the above mentioned HeeksCAD.

All of these tools do not segment the model into different objects and the exporter does not generate a solid.

The importer generates a lot of nasty inner edges, but with a small tweeking of the script this can be fixed.

Just add the following lines into main after the import:
Code: Select all
           
a = Array.new
Sketchup.active_model.entities.each{|e|
if (not e.deleted?) && (not e.hidden?)
  if e.is_a? Sketchup::Edge
     if e.faces.size == 2
        if e.faces[0].normal == e.faces[1].normal
           a << e
        end
     end
  end
end
Sketchup.active_model.entities.erase_entities(a)
}
0

rainer.ochs 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby Adrian Berghorst » Tue Mar 20, 2012 12:38 pm

This has helped me a LOT! Thank you very much.
0

Adrian Berghorst 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby realwarder » Sun Apr 22, 2012 1:37 am

Great plugin. Helped me. Thank you!

My model does export with one problem. If you want the file to test with, let me know.
0

realwarder 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby thomthom » Sun Apr 22, 2012 8:52 am

realwarder wrote:My model does export with one problem. If you want the file to test with, let me know.

You need to describe what this problem is. Otherwise it's completely impossible to know what is going on.
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] IGES Export - 27 February 2012

Postby realwarder » Fri Apr 27, 2012 2:41 am

thomthom wrote:
realwarder wrote:My model does export with one problem. If you want the file to test with, let me know.

You need to describe what this problem is. Otherwise it's completely impossible to know what is going on.


The first problem I was having was a section that was a long PCB cutout shaped with half-circle ends and straight sides was exported as curved sides.

I got around that by manually fixing in the destination CAD.

Current issue is a metric sized drawing is exporting to inches. Not sure how this plugin determines the units.

I.e. my PCB which is 72mm wide, after exporting to an IGS, imports as a 72" wide drawing.
0

realwarder 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby pilou » Sat Apr 28, 2012 1:44 am

I have just found the free Creo element who can reload a cube from this iges export :enlight:
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] IGES Export - 27 February 2012

Postby tmiehle » Wed May 16, 2012 2:18 pm

This plugin is great ! :berserk:
I use it with the "EagleUp" script to build 3D models out of PCB layouts.
Now I have one feature request:
Is it possible to generate a list of the components which are buggy?
It is a little frustrating to check the output visually and try to find out which elements are meant by "Model contains non-solid elements" which will not be exported?

Best regards
Tom
0

tmiehle 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby rainer.ochs » Tue May 22, 2012 6:39 pm

tmiehle wrote:Is it possible to generate a list of the components which are buggy?

During export the model is changed and some parts are deleted as they cannot be exported. After the export the changes are undone, but it is possible with the redo function to see these again.

There is a new version of the plugin where I have further enhanced the checks epecially for EagleUp so less parts are deleted. Now all edges that connect to inner surfaces are deleted, so these inner objects also vanish. Please try V0.7

Rainer
0

rainer.ochs 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby bg211 » Thu Jun 07, 2012 5:58 pm

I've just tried Rainer's plugin (V0.7). It seemed to work quite well with the assembly that I tried it on. There were maybe 50 components, made up of some plates and some terminal lugs that are cylindrical. I imported the iges into CoCreate and all seemed good, dimensionally it checked out. It did take 5 mins or so to convert and then import, but ultimately it did the job!

Thanks and I look forward to any updates that may speed it up a little.
0

bg211 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby micione » Wed Jul 04, 2012 2:33 pm

I have a problem with this tool:
- Create a group (cylinder)
- Export iges format
- Open with MOI
only a surface appears.
I do something wrong?
Any help appreciated.
0
User avatar
micione 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby rainer.ochs » Wed Jul 04, 2012 4:32 pm

micione wrote: - Open with MOI

As already mentioned: Many importers do not import IGES correctly. Try: HeeksCAD and the IGES-Viewer, both work for me. Heeks also allows to save in STEP that is more likely to be imported in other programs.
If your model does not import correctly to HeeksCAD please send me your skp. If it does, the problem is the importer, not the exporter.
Rainer
0

rainer.ochs 
 

Re: [Plugin] IGES Export - 27 February 2012

Postby micione » Wed Jul 04, 2012 6:15 pm

Grande. model is clearly visible in in HeeksCAD and IGES-viewer. I save the file to IGES (from SketchUp) as IGES in HeeksCAD. Then export successfully, both in the MOI, both in DoubleCAD. Thank you.
0
User avatar
micione 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: imetetet, sokhet and 6 guests

Visit our sponsors: