View License

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

» Watch video

Highlights from
IGES Toolbox

4.3 | 29 ratings Rate this file 90 Downloads (last 30 days) File Size: 291 KB File ID: #13253 Version: 1.7
image thumbnail

IGES Toolbox


Per Bergström (view profile)


05 Dec 2006 (Updated )

Toolbox for working with IGES CAD-models in Matlab

| Watch this File

File Information

The Matlab function "iges2matlab" extracts parameter data in an IGES file into Matlab. Other functions in the toolbox do plots, transformations, projections etc. All users must first compile the C-source code. This is done in Matlab by running

and the mex-functions are compiled.


Nurbs2 Iges inspired this file.

Required Products Simulink Verification and Validation
MATLAB release MATLAB 8.5 (R2015a)
MATLAB Search Path
Other requirements Some C-compiler must be installed.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (61)
30 Jan 2017 Eyma

Eyma (view profile)


i tried to run example2, but received such errors.

Undefined function or variable 'nrbSrfRegularEvalIGES'.

Error in iges2matlab (line 3045)

Error in example2 (line 7)

for the first error, does it means that nrbSrfRegularEvalIGES.c cannot compile under win64 platform?

i don't know what is wrong with the second error. gosh!

Comment only
26 Jan 2017 Eyma

Eyma (view profile)

hi all

can someone tell me how to input/load the iges file to the m file? for example, i wanted to use iges2matlab file, but i do not know how to load my iges file. i tried couple of times, but still unable to run the function. please help me on this please. thanks.

Comment only
21 Jan 2017 Chris Hooper

made some edits to include layer information. what is the best way to share them?

Comment only
21 Jan 2017 Chris Hooper

excellent. using it with nurbs from rhino. is there a way to access layer information as well?

08 Dec 2016 Irwin Gan

any solution for 'nrbevallGES' error? delting -v did not work

Comment only
17 Oct 2016 Hasret Gümgümcü

I've tried with removing all "-v" but it still has the error message: Undefined function or variable 'nrbevalIGES'

Comment only
10 Oct 2016 Matteo Bottin

In order to remove all "nrbevalIGES" errors I discovered this workaround:

1) Open "makeIGESmex" file
2) remove all "-v" inside the "try" structures.


Comment only
09 Oct 2016 Rick

Rick (view profile)

The error messsge:
Undefined function or variable 'nrbevalIGES'
Happens if the MEX files were never built.
The command that builds then 'makeIGESmex' instantly with no output that means it failed silently. The try-catch blocks hide the error messages. CD to the directory where the toolbox files live.

To find the home directory type:
which makeIGESmex

Once I built the MEX files the MEX files I could load IGS files using 'iges2matlab' but the next problem is that my file contains unsupported entity types:
190 'Plane Surface'
502 'Vertex Entity'
504 'Edge Entity'
508 'Loop Entity'
510 'Face Entity'
514 'Shell Entity'
186 'Manifold Solid B-Rep Object Entity'
192 'Right Circular Cylindrical Surface'
At which point I have to give up for now.

Comment only
03 Oct 2016 Mengju Chuang

I would like to use optometrika toolbox to simulate light tracing. So I need to input a complex 3D drawing. IGES toolbox can support me to input the file?

Comment only
14 Sep 2016 Mark

Mark (view profile)

ignore previous comment -(wrong toolbox).

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

15 Jul 2016 Matfun

Matfun (view profile)

24 Jun 2016 Saaddin Nur

Firstly, I want to appreciate the author of Iges toolbox since it helps me very much for importing geometry from CAD without reducing its quality especially for curve.

Then, how to access the geometry properties of Iges file like vertices, faces and parameters of curve after importing it in Matlab?
Because, so far I just got the plot of geometry of Iges in Matlab and didn't get its properties.

My purpose is to import Iges in Matlab and meshing it using DistMesh in Matlab.


05 Mar 2016 amina lk

how to run more nurbs surf to one iges file

Comment only
11 Feb 2016 Jean-Marc Moret

29 Dec 2015 WenLuo Lau


i have tried using the toolbox but i encounter an error while running example.m

Undefined function or variable 'nrbevalIGES'.
Error in iges2matlab (line 938)
Error in exampleICP (line 12)

how can i solve the nrbevalIGES as it is a function?

Comment only
01 Dec 2015 Bertrand Bastien


I would like to use this iges toolbox to convert iges files to matlab or stl files to matlab and then using the function "getSurfaceDistributedPoints".
But the outputs of these functions are not compatible with the inputs of "getSurfaceDistributedPoints". Can you help me please ?


Comment only
09 Oct 2015 knutsel

nrbSrfRegularEvalIGES.c doesn't compile on windows 64 bit.
It tries to compile a few minutes, but then matlab gives the error 'Error using mex
Matlab builds it with Microsoft Visual C++ 2012 (C).

Any ideas to solve this?

Comment only
28 Sep 2015 IL HYUK AHN

In the function of closestNrbLinePointIGES.c ,


what is the mean of r0??

Comment only
24 Sep 2015 Morteza Vatani

Great Work,
It might be very simple, But I don't know!!!
I have a curve and I want to extract uniformly distributed points from that curve.( Start with start point and end with the End Point) Lets say dividing the curve to the "n" consequent segments.
I used the following function:
for i=1:length(ParameterData)
However it doesn't give me the end point of the curve.
is there any way to solve this issues?

02 Sep 2015 haitham

Great Work and effort. Really useful!

20 Aug 2015 IL HYUK AHN

mex -v nrbSrfRegularEvalIGES.c

I cannot compile this file.
How to solve it?

please, let me know

Comment only

The toolbox works pretty great. I wanted to know is there a possibility to obtain coordinates on the iges surface. I would like to get the coordinates in regular interval. The basic idea is to estimate the data loss during data points to NURBS conversion.
Thank you!

Comment only
15 Apr 2015 nithish kalakonda

Im new to matlab. Can someone please let me know how to use this ?

Comment only
22 Jan 2015 Wenzhen

im using matlab on mac and im confused where to put the Precompiled mex-functions for win64 files

27 Sep 2014 Zubair Rafiq

Thank you very much , I really appreciate your effort.

22 Sep 2014 Charles Eloquin Leclerc

After a LOT of trouble to install the C compiler (mex command) on Windows 8.1 64bit, example.m work but not example2.m. It seem that I got the same problem as TCH and nrbSrfRegularEvalIGES.c refuse to compile under Win 8.1 64bit.

01 Aug 2014 mostafa

I have tried this solution and it works for me... check this link

Comment only
01 Aug 2014 rohan vaidya

31 May 2014 mostafa

hello there,
i'm a new user, so please i need to know how to run this tool box in matlab

14 Mar 2014 Aleksandar Petrov

I'm using the function iges2matlab and it's very useful but I'm wondering if there is an inverse function that already extracted parameter data will transform into an iges file (matlab2iges)? :)

Comment only
06 Nov 2013 TCH

TCH (view profile)

nrbSrfRegularEvalIGES.c cannot compile under win64 platform

Comment only
23 Aug 2013 faculaganymede

Thanks for creating the IGES Toolbox. I'm trying to use it to read a truck IGES model (58729_Cement_Truck_NURBS.iges downloaded from and there's something funny about both ends of the trunk when the model is displayed (see problem here Looks like something wrong with trimming the sphere surfaces. Any ideas/suggestions?? The model displays OK in Rhino.

Comment only
29 Jul 2013 Sabrina

I have the exact same problem as Daniel.

Comment only
09 Jul 2013 Daniel

Daniel (view profile)

how do I run the examples, do I just type in "example2" and thats it ? because I allways get this errors:

Trial>> example2
Undefined function 'nrbSrfRegularEvalIGES' for input arguments of type 'struct'.

Error in retSrfCrvPnt (line 43)

Error in plotIGES (line 221)

Error in example2 (line 11)

I'm new to all this and I couldn't finde a solution jet.

Thank you in advance.


Comment only
14 May 2013 shi

shi (view profile)

thans...i am new in this aspect and donot know how use it now

02 May 2013 Brian

Brian (view profile)

Is anyone else getting an error when trying to open an iges file?

Undefined function 'nrbevalIGES' for input arguments of type 'struct'.

Error in iges2matlab (line 628)
p =

Error in igesToolBoxGUI>menuOpenIGES_Callback (line 419)

Error in gui_mainfcn (line 96)

Error in igesToolBoxGUI (line 42)
gui_mainfcn(gui_State, varargin{:});

Error in

Error while evaluating uipushtool ClickedCallback

Comment only
03 Apr 2013 Adam

Adam (view profile)

Great code! Thanks!

14 Nov 2012 Yongxing

very good

05 Sep 2012 NTUT

NTUT (view profile)

when i run('C:\Program Files\MATLAB\R2007b\toolbox\IGES\makeIGESmex.m')

Could not find the compiler "cl" on the DOS path.
Use mex -setup to configure your environment properly.

how to solve this problem

Comment only
30 Jun 2012 Luis Acevedo

It is working now. I had a corrupt file in my comp . Good toolbox :-)

Comment only
29 Jun 2012 Luis Acevedo

Which type of compiler do i need?
C what? send me link

I have got the same problem than LuisCarlos, Liu and so on with a 64bits machine. fatal error LNK1104: 'nrbevalIGES.mexw64

Would be nice an update soon!

12 Jun 2012 Aleksandar Petrov

:) I can use it, it works great!!

thank you

03 May 2012 LuisCarlosAbsalon RojasTorres

Hi everybody! Please somebody can help me? when execute makeIGESmex i read this
LINK : fatal error LNK1104: no se puede abrir el archivo 'nrbevalIGES.mexw64'
I run it on 64bits corei7 and I cant use IGEStoolbox.

03 May 2012 LuisCarlosAbsalon RojasTorres

Hi everybody! Please somebody can help me? when execute makeIGESmex i read this
LINK : fatal error LNK1104: no se puede abrir el archivo 'nrbevalIGES.mexw64'
I run it on 64bits corei7 and I cant use IGEStoolbox.

21 Mar 2012 liu

liu (view profile)

I am using these code. It is very good.

Now, We are waiting for Mr. Per to Add a new function "getpointfromIGES".
Hope we can get update soon.


14 Mar 2012 Razmara

Trying to import some IGES files but i get the following warning: Warning: There are unknown entity types for iges2matlab file.

Use "I-DEAS 3D IGES Translator" with NURBS as surface representation instead.
If you dont have that posibility you can add IGES entities into iges2matlab().
The IGES manual is found at

IGES files are not shown properly. How to add IGES entities into iges2matlab()

Comment only
26 Feb 2012 Oscar

Oscar (view profile)

Can somebody told me, how to do the opposite. I have a 3D figure generated in Matlab, but I need the figure in IGES or another CAD extension.

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
05 Jul 2011 Snahungshu

Is it 2D plot only??

Comment only
19 Nov 2010 Ernest West

I have the same question above. I just want to be able to obtain the data points of a simple rectangle from IGES to matlab

26 May 2010 Bryn littlefair

Can you provide a little more infomation on the application of retSrfCrvPnt. I am trying to extract an array of data for a surface i have imported. Many thanks

16 Mar 2010 By ?

By ? (view profile)

Thank you,this is a great job

Comment only
29 Jun 2009 ricky martin

21 Apr 2009 Jose M.

22 Dec 2008 iokinberistain Beristain

fantastic job!!! thank you very much

03 Oct 2007 alloucherie franck


14 Jun 2007 Kava Crosson

Needs better documentation about projection parameters. Otherwise very impressive.

16 Jan 2007 bruce bi

This is what I need. Thank You!

06 Dec 2006 Petr Volegov

Need bspeval.dll for Windows x64. Could you please submit the source files too?

Comment only
06 Dec 2006 Paolo Bertolo

Fantastic job!
I've just opened a CATIA CAD file, converted into IGES using Hypermesh and then loaded it into Matlab. That's great!

15 Dec 2006

Have added a function.

19 Dec 2006

Have added a function.

08 Jan 2007

Have done a small improvement.

09 Jan 2007

Makes the previous update complete.

18 Jan 2007

Have done some small improvements.

20 Mar 2007

Have added the source code to bspeval.

26 Jun 2007

Have done some small improvements.

19 Nov 2007

Have added some entities.

29 Apr 2008

The projection is better documented by adding an example.

27 Apr 2009 1.1

Mesh2d is used for meshing the surfaces.

14 Aug 2009 1.2

One more example is added, plotIGES draws surfaces faster using patch().

10 Dec 2009 1.3

2 old m-files are replaced by:

20 Mar 2012 1.5

More entities are added, a GUI is developed, more examples are attached.

29 Oct 2014 1.6

The toolbox are now compatible with more IGES-entities

11 Dec 2016 1.7

Some functions have been improved.

Contact us