No BSD License  

Highlights from
igesout

4.33333

4.3 | 6 ratings Rate this file 52 Downloads (last 30 days) File Size: 18.06 KB File ID: #14470
image thumbnail

igesout

by Daniel Claxton

 

29 Mar 2007 (Updated 08 Mar 2009)

Convert surfaces, curves and lines to IGES file

| Watch this File

File Information
Description

IGESOUT converts nurbs surfaces, curves and polylines to a single compact IGES format file.

Vectorizing was implemented wherever possible, so the code should run quickly.

It was verified by ProE and MasterCam.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Nurbs2IGES

MATLAB release MATLAB 7.3 (R2006b)
Other requirements http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=312&objectType=file
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (18)
23 Apr 2007 c m

Really fast.
I used it to get a surface model from a coordinate measuring machine.
Now if only I could get it into Solidworks properly!

24 May 2007 Daniel Lopes

Works brilliantly! Thanks a lot!
CUBIT (http://cubit.sandia.gov/) is also capable to import the *.igs file created by igesout(.).

Just one remark:
At line 136,
"G.date = datestr(today); ",
I had to change 'today' -> 'date', since MATLAB apparently doesn't recognize 'today'.

21 Jun 2007 johnny chen

good

05 Jul 2007 Wenbin Chen

thanks,it works well in UG!

23 Aug 2007 Johannes Korsawe

This is perfect! Thank you a lot for doing the ugly work of going through the syntax of IGES.

19 Sep 2007 Michael Fassbind

A very good and useful improvement to my initial offering. I use your code now.

05 Jun 2008 Kian Chai

Are you able to do vice versa? I am sure you understand the IGES code before you create this program. I am trying to understand the IGES structure. Can your code write out the boundary points to represent a surface? It would be great to import this point into Excel to show the figure. Generally I would like to import IGES data as the data points in the array then I can plot it into Matlab figure.

02 Oct 2008 Daniel Claxton

I have received several questions asking about the reverse process iges conversion ie read an iges file into Matlab. Someone has already submitted a handy toolbox that does just that. You can find it here: http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13253&objectType=file

09 Feb 2009 Liang

It is really an excellent code. However, when I try to create a large geometry, it is still time consuming. The function 'swap' excutes too many string copy in the 'while' loop and it cost much time when there are a mount of data points. I rewrote the function as follow and the it only needs 1/3 time.

function s = wrap(str,delim,n)
    tmp = blanks(n);
    strlength = length(str);
    i = 1;
    index=1;
    while (strlength-index+1>n)
        tmp = str(index:index+n-1);
        d = strfind(tmp,delim);
        d = d(end);
        index = index + d;
        s(i,:) = [tmp(1:d) blanks(n-d)];
        i = i+1;
    end
    if (strlength-index+1>0)
        s(i,:) = [str(index:strlength) blanks(n-(strlength-index+1))];
    end

15 Apr 2009 Matt

I had trouble with changing the units from 'IN' to 'MM'. I had to remove {:} after vargin in the call to setParams. Also, inside of setParams, I moved G to be outside of the 'lower' function. I'm using V7.7, so maybe it used to work this way in a previous version.

10 May 2011 Frank Gommer

Probably I'm just not good enough with the "igesout" code but I'm wondering how a bit more complex structure, e.g. surface with holes, could be exported? For example, I tried to export the 2D geometry from the demos of the nurbs toolbox "demogeom.m". This one consist out of multiple nurb curves... I just can't get it running :( Any suggestions? Thanks!

21 Nov 2011 Brian

Hey, thanks a LOT for posting this, you saved me days of work.

I was wondering: I have a binary tube structure geometry (so just a series of connected cylinders), and I was wondering if this can be used with your tool to export it into a IGES format. Would you expect there to be any conflicts?

24 Dec 2011 Ahmad Rafsanjani

Thank you for this excelent job!
Is it possible to create two curve separately?
Because by default it will connect the 2nd curve to end of the 1st one.

Thanks,
Ahmad

10 Jan 2012 Jessica

Could you add a simple example of surf (or mesh) to iges conversion?

11 Jan 2012 Mark Gordon

I'm trying to convert point cloud data (from a Kinect) to iges to import into Rhino (and then to Solidworks).

I put my data in to X, Y, and Z columns and the function appears to run successfully. However, when I try to import this file into Rhino it says: "Rhino found nothing to import from this IGES file.
This happens when an IGES file has no valid independent geometry."

Any thoughts on what is going wrong?

19 Jan 2012 Brendan  
19 Jan 2012 Brendan

Seemed to run just fine, but ANSYS can't read it. NrbsSrf2IGES produces IGES that can be read.

24 Apr 2012 Lee byan

seemed to run fine, but the output iges file seemed to be wrong and can not be read in ug,
i just used the example in the code as following,
pline = [0,0,1.1112;0,1.3333,2.1082;0,2.6667,1.6397;0,4,1.3346;];
   lin = pline(1,:)*3;
pt = pline(1,:);
igesout({pline lin pt},'TestIGES')

the TestIGES.igs is as following:

Matlab to IGES converter. Written by Daniel Claxton S0000001
1H,,1H;,7HMatlab ,11HReceiver ID,12HTestIGES.igs,5HPCWIN, G0000001
14HMatlab -> IGES,16,6,15,13,15,1,3,2HIN,8,0.016000, G0000002
20H24-Apr-2012 19:54:21,0.000100,4, G0000003
27HD. Claxton dclaxton@ufl.edu,21HUniversity of Florida,11,3, G0000004
20H24-Apr-2012 19:54:21; G0000005
     106 1 0 1 0 0 0 1D0000001
     106 1 0 3 12 0D0000002
     116 4 0 1 0 0 0 3D0000003
     116 1 0 1 0 0D0000004
     116 5 0 1 0 0 0 5D0000005
     116 1 0 1 0 0D0000006
106,2,4,0.000000,0.000000,1.111200,0.000000,1.333300,2.108200,
0.000000,2.666700,1.639700,0.000000,4.000000,1.334600,0., 1.,
 0., 1.;
116,0.000000,0.000000,3.333600,0., 1., 0., 1.;
116,0.000000,0.000000,1.111200,0., 1., 0., 1.;
S0000001G0000005D0000006P0000005 T0000001

Please login to add a comment or rating.
Updates
08 Mar 2009

- Major improvements in write speed for large files
- Minor enhancements to version number

Tag Activity for this File
Tag Applied By Date/Time
data import Daniel Claxton 22 Oct 2008 09:06:18
data export Daniel Claxton 22 Oct 2008 09:06:18
spline Cristina McIntire 09 Mar 2009 13:49:18
cad Cristina McIntire 09 Mar 2009 13:49:18
nurbs Cristina McIntire 09 Mar 2009 13:49:18
iges Cristina McIntire 09 Mar 2009 13:49:18
export Cristina McIntire 09 Mar 2009 13:49:18
line Cristina McIntire 09 Mar 2009 13:49:18
surface Cristina McIntire 09 Mar 2009 13:49:18
curve Cristina McIntire 09 Mar 2009 13:49:18
convert Cristina McIntire 09 Mar 2009 13:49:18
iges Gael 27 Apr 2011 07:44:37
cad Rania atia 19 Oct 2011 04:15:28
iges Rania atia 19 Oct 2011 04:15:52

Contact us at files@mathworks.com