View License

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

» Watch video

Highlights from

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.5 | 2 ratings Rate this file 23 Downloads (last 30 days) File Size: 3.83 MB File ID: #12087 Version: 1.0
image thumbnail




29 Aug 2006 (Updated )

This code allows one to convert a NURBS Surface to an IGES surface file for import into a CAD progra

| Watch this File

File Information

This code allows one to convert a NURBS Surface to an IGES surface file for import into a CAD program. Entity 128 is used and is the only entity type output. NURBS curves could be output with some modification. This code is rough but works for what I am doing.

Attached IGES format guidelines to help understand it. All the lines (in the *.igs file) on the right MUST line up or the file will not open up.


This file inspired Igesout and Iges Toolbox.

MATLAB release MATLAB 7 (R14)
Other requirements NURBS toolkit
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
14 Sep 2016 Mark

Mark (view profile)

The subroutine matlab2iges.m does not seem to work for other than uniform weighting (e.g. does not work for surfaces with an edge that is a circular arc). Is there an easy fix for this???

26 Feb 2016 SACHIN PATIL

I am very new to nurbs2IGES.I have just generated a 3d image in matlab,i want to convert it into iges so that i can model it in CAD softwares.Any one please help me how to start with it

Comment only
28 May 2015 Michael Weise

I found the problem with circular arcs. The coefficients are multiplied with the weights in the nurbs toolbox, which is not accounted for in nurbs2iges. Fix: Replace line 203 NrbSurf.coefs(1,V,U), NrbSurf.coefs(2,V,U), NrbSurf.coefs(3,V,U));


NrbSurf.coefs(1,V,U)./NrbSurf.coefs(4,V,U), NrbSurf.coefs(2,V,U)./NrbSurf.coefs(4,V,U), NrbSurf.coefs(3,V,U)./NrbSurf.coefs(4,V,U));

Comment only
31 Mar 2015 Elías Siggeirsson

I am wondering Fa if you got somewhere with your problem. I am having a trouble also with a circular shapes.

I was also wondering if someone could inform me if I could increase the accuracy of the imported part. Since in matlab the NURBS surfaces follow the geometry I want to export quite well but in my cad software the accuracy is not that good. I have tried the G{19,1} block but it does not seem to have the required effect.

Thank you

Comment only
13 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
25 Apr 2012 Lee byan

i found the same question with Roland, it seems that the length of output file name should be equal to 11.

i just simply rewrite the code instead the original code line numbered 152~155 using the following code:

tstr = sprintf('%1.0fH%s,', G{1,2}, G{1,1});
tstr = [tstr,sprintf('%1.0fH%s,', G{2,2}, G{2,1})];
tstr = [tstr,sprintf('%2.0fH%s,', G{3,2}, G{3,1})];
tstr = [tstr,sprintf('%2.0fH%s,', G{4,2}, G{4,1})];
fprintf(fid, '%s',tstr);
len_tstr = length(tstr);
for kk = 1:(72-len_tstr)
fprintf(fid, ' ');
fprintf(fid, 'G%07.f\n', Gln); Gln=Gln+1;

Comment only
14 Jan 2012 Roland

Roland (view profile)

it happens that the end line delimiter (?) "G0000001" of the second line does not align with the other delimiters, than some CAD programs (like freeCAD) can not read the iges file. In this case, I just edit the iges file manually, but it would be good to make the output more robust.

Comment only
25 Oct 2011 kunal

kunal (view profile)

Hi, all

I am using NURBS Toolbox and IGES reader for MATLAB. The IGES reader is supposed to read IGES files from CAD softwares and extract geometric info from it. When i try to extract entities 126 and 128 (which correspond to NURBS Curves and surface). I am getting inconsistent results.

for example.

when extracting NURBS from a Cylinder IGS file from solidworks, I am getting no surface at all. When i use Rhino 3D i get a nurbs surface which looks like a cylinder but it's not Circular in shape like the IGES file.

I need to extract a proper NURBS surface that looks exactly like the IGS file

Comment only
23 Dec 2010 Luigi Giaccari

Nice Work!
A few question:
-Do you know how to create triangular NURBS patches?
-How to export multiple surfaces in the same file?


Contact us