Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics

IGES to STL, conversion

IGES to STL, conversion
srinivas 2007/09/24 16:58
Hi all,

I am trying to use Opencascade to convert an IGES file to STL. is it possible. if yes can any one please let me know

appreciate it and thank you very much

Jun WANG 2009/01/21 00:49
co-ask ???
Patrik Mueller 2009/01/21 01:16

take a look at the ImportExport sample - it should contain all needed infos...


Jun WANG 2009/02/26 19:33
Thanks for your information. According to your suggestion, I use ReadIGES() to read the IGES file and then take advantage of "StlAPI_Writer::Write()" to generate stl file. That works well.

However, I got a problem. My IGES file consists of several surface patches. When I use visualize the generated stl file and find that the triangle meshes are not manifold on the boundary of each surface patches. That is to say, the triangle meshes on the boundaries of adjacent surface patches do NOT share vertex and edge, which means that the triangle meshes are generated surface by surface, instead of for the whole IGES model. Here is codes:
StlAPI_Writer myStlWriter;
myStlWriter.Write(m_topoShape, "tmp.stl");
Handle(StlMesh_Mesh) myMesh = RWStl::ReadFile(OSD_Path("tmp.stl"));

Additionally, I also utilize the APIs: "BRepMesh_FastDiscret" and "BRepMesh_Discret" with setting the parameter of "withShare" as Standard_True to generate triangle meshes. The result is same as above: the triangle meshes are generated seperately. Below is codes:
double myDeflection = 0.1;
double myDefAngle = 0.17;
     BRepMesh_FastDiscret* myMesh =
     new BRepMesh_FastDiscret(myDeflection, m_topoShape, myBox, myDefAngle,
     Standard_True, Standard_True, Standard_False, Standard_False);
catch (...)
     BRepMesh_IncrementalMesh(m_topoShape, myDeflection, false, myDefAngle);

And alos I use some 3D softwares like CATIA and Geomagic to import my IGES file and export the corresponding STL file. The result is as good as expected.

Does anybody know how to handle this problem ???

Patrik Mueller 2009/02/27 08:05
Hi Jun,

here's what I do: I use the triangulation from BRepMesh_FastDiscret and collect all resulting vertices in a set - for the triangles I'll take the positions inside the set.
Don't forget to add the transforms to the vertices before adding them...

Hope this helps,

Jun WANG 2009/03/02 08:46
Hi Patrik-
Thanks for your reply.

1. Is there any problem on the boudaries of adjacent surfaces as I have mentioned? Thanks.
2. In addtion, would you mind give me your sample codes? Thanks in advance.
Patrik Mueller 2009/03/11 10:14
Hi Jun,

1) I don't have the problem - but this could also be depeding on your data set. Perhaps you could also try another mesher like netgen?
2) Sorry - wouldn't make sense since I use software components outside OCCT...


Latest news
  • Open CASCADE CAD Assistant for iOS platform is available!
  • Open CASCADE Technology 6.9.0 is available for download!
  • JT Assistant for Android

  • © OPEN CASCADE 2000 - 2015  |  Search  |  Contacts   |  Site map