
Mon, 08/22/2005 - 08:01
Forums:
Hey I was just wondering if anyone had successfully imported an STL file into OCC using this command OR any other command or script. I need to be able to import STL files into OCC so that I can manipulate them with the BRepAlgoAPI.
Thanks!
Mike
Mon, 08/22/2005 - 09:46
Hi,
you could try the following:
Handle(StlMesh_Mesh) theSTLMesh = theSTLMesh = RWStl::ReadFile(aFile);
After reading you have to iterate over the domains and try to build a shape having a TopoDS_Face for each STL facet.
But this needs a lot of time and memory!
Greets,
Patrik
Mon, 08/22/2005 - 09:54
Is the StlAPI::Read() function simply non-functional? Also, has anyone already written a routine to iterate over the domains and try to build a shape having a TopoDS_Face for each STL facet?
Thanks!
Mike
Mon, 08/22/2005 - 10:20
Hello Michael,
For your information, a full fledged STL import / export interface is a part of the OMF component (Open CASCADE Mesh Framework, http://www.opencascade.org/support/products/omf/). This interface is capable of transferring STL data to and from OMF mesh data structures.
Best regards,
Forum Supervisor
Tue, 08/23/2005 - 09:22
see this
http://www.opencascade.org/org/forum/thread_3145/
pg
Tue, 08/23/2005 - 18:20
Ok nevermind, I already figured out which libraries I needed. But now I have another one! The routine is ALMOST working, it just seems to be inverting many of the faces. Many of the faces are facing to the inside of the object. Does anyone know what might be wrong with the algorithm?
Also, for people who come to this thread with a similar problem to mine, the headers I needed to include are as follows:
#include
#include
#include
#include
#include
#include
#include
#include
Thanks,
Mike
Tue, 08/23/2005 - 09:22
see this
http://www.opencascade.org/org/forum/thread_3145/
pg
Tue, 08/23/2005 - 18:05
Hi PG,
Thank you so much for the link. Do you by any chance know which headers are required for the algorithm in question? I get a lot of errors when I try and compile with it, it would help me out a lot if you knew this.
In the mean time I will try and hack through it, and if I get it figured out I'll post another reply. But until I do its safe to assume I haven't gotten it working.
Thanks,
Mike
Tue, 08/23/2005 - 18:24
Replying to myself becuase I posted these in a bad reply order, the above reply to PG is actually later in time than the lower reply. Sorry for the confusion.