No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.1 | 11 ratings Rate this file 57 Downloads (last 30 days) File Size: 18.1 KB File ID: #14470 Version: 1.1
image thumbnail



Daniel Claxton (view profile)


29 Mar 2007 (Updated )

Convert surfaces, curves and lines to IGES file

| Watch this File

File Information

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.


Nurbs2 Iges inspired this file.

MATLAB release MATLAB 7.3 (R2006b)
Other requirements
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (28)
06 Nov 2016 Di Zhu

Di Zhu (view profile)

06 Nov 2016 Di Zhu

Di Zhu (view profile)

31 Aug 2016 Xiaoxiao Du

Di Zhu,
ABAQUS could also read iges files, please use commands 'File->Import->Sketch/Part'.

Comment only
22 Jul 2016 Di Zhu

Di Zhu (view profile)

Rhino could read the igs file, but Abaqus couldn't...

28 May 2015 Michael Weise

I found an error in the code: The coefficients are multiplied with the weights in the nurbs toolbox, which is not accounted for in igesout. Possible fix: Change line 171

Coefs = [X(:) Y(:) Z(:)]';


Coefs = [X(:)./W(:) Y(:)./W(:) Z(:)./W(:)]';

Furthermore, the (R) sign after 'Matlab' in line 118 seems to cause problems with some readers, I replaced the line by

G.sendid = 'MatlabR'; % Product ID from Sender

Comment only
01 Sep 2014 Fa

Fa (view profile)

I had this problem, check the G section.
There is something wrong.

Comment only
30 Aug 2014 Sridhar


I tried running an example. The IGS file is created but Autocad says it is invalid/cannot be read.
Any solution?

Comment only
14 Aug 2014 Fa

Fa (view profile)

Am I the only one having problem with circular shapes ?
When I use democirc.m then nrbplot.m I have a good result but if I try to export it int the iges format it does not look the same.

Thank you !

Comment only
18 Sep 2012 TCH

TCH (view profile)

!!!!!!!!!!!---------BUG REPORT--------!!!!!!!!!!!!!!!

for anyone who would download this code please revise the code in function wrapmat:
@code revision start:
387 nsrt = nchar-size(str,2);
388 if nsrt
389 % str(:,end+nsrt) = ' '; // comment this phrase
389 +str(:,end+1:end+nsrt)=' ';
390 end
@code revision end
the original code directly assign a space to the end+nsrt position of current line, the jumped spaces will be left to the null characters which is a fatal error according to the IGES file standard.
Hope you a nice use!


11 Jun 2012 Mahdi Damghani

I need to get lots of cylinders into Iges format for Ansys meshing. Unfortunately this does not work for me.

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,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
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

Comment only
19 Jan 2012 Brendan

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

Comment only
19 Jan 2012 Brendan

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?

Comment only
10 Jan 2012 Jessica

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

Comment only
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.


21 Nov 2011 Brian

Brian (view profile)

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?

Comment only
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!

Comment only
15 Apr 2009 Matt

Matt (view profile)

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.

Comment only
09 Feb 2009 Liang

Liang (view profile)

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;
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;
if (strlength-index+1>0)
s(i,:) = [str(index:strlength) blanks(n-(strlength-index+1))];

Comment only
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:

Comment only
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.

Comment only
19 Sep 2007 Michael Fassbind

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

23 Aug 2007 Johannes Korsawe

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

05 Jul 2007 Wenbin Chen

thanks,it works well in UG!

Comment only
21 Jun 2007 johnny chen


Comment only
24 May 2007 Daniel Lopes

Works brilliantly! Thanks a lot!
CUBIT ( is also capable to import the *.igs file created by igesout(.).

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

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!

08 Mar 2009 1.1

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

Contact us