File Exchange

image thumbnail

igesout

version 1.1 (18.1 KB) by

Convert surfaces, curves and lines to IGES file

4.11111
11 Ratings

41 Downloads

Updated

No License

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.

Comments and Ratings (28)

Di Zhu

Di Zhu (view profile)

Di Zhu

Di Zhu (view profile)

Xiaoxiao Du

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

Di Zhu

Di Zhu (view profile)

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

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(:)]';

to

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

Fa

Fa (view profile)

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

Sridhar

Hi,

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

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 !

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!

TCH

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

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

Brendan

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

Brendan

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?

Jessica

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

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

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?

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!

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.

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

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

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.

Michael Fassbind

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

Johannes Korsawe

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

Wenbin Chen

thanks,it works well in UG!

johnny chen

good

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'.

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!

Updates

1.1

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

MATLAB Release
MATLAB 7.3 (R2006b)
Acknowledgements

Inspired by: Nurbs2IGES

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

» Watch video

Win prizes and improve your MATLAB skills

Play today