tpaviot / oce

OpenCASCADE Community Edition (OCE): a community driven fork of the Open CASCADE library.
http://groups.google.com/group/oce-dev
GNU Lesser General Public License v2.1
815 stars 284 forks source link

Only 3/4 of spline surface from imported STEP model is meshed #641

Open billtsalamander opened 8 years ago

billtsalamander commented 8 years ago

I loaded and meshed the attached step file, badmesh.zip save as zip, and triangles were only generated for 3/4 of the spline surface at the base of the pocket. The face is fine when the STEP file is loaded in Solidworks and OnShape. Furthermore, it meshes perfectly when re-exported to STEP from OnShape, but that's beside the point. I used the following code

STEPControl_Reader reader;
IFSelect_ReturnStatus stat = reader.ReadFile(filename);
if (stat == IFSelect_RetDone) {
        Standard_Integer NbRoots = reader.NbRootsForTransfer();
        Standard_Integer NbTrans = reader.TransferRoots();
        Handle(TColStd_HSequenceOfTransient) list = reader.GiveList();
        Standard_Integer NBTrans = reader.TransferList(list);         
        //Load the solid from the file
        TopoDS_Shape ocesolid = reader.OneShape();
        //Write directly to STL
        StlAPI_Writer writer;
        writer.ASCIIMode() = false;
        writer.Write(ocesolid, "exported.stl");
}

Alternative versions of code, that give identical results, involve calling BRepMesh_IncrementalMesh(ocesolid, .01); and BRep_Tool::Triangulation to extract the triangles one by one from each face. The results are the same.

screen shot 2016-09-07 at 10 21 25 am
billtsalamander commented 8 years ago

Quadrant is also missing when the file is opened in FreeCAD, so I don't think it's my error. It looks like the spline face shares an edge with itself (this file was created by Siemans NX), and I'm curious if that is part of the issue.

ghost commented 8 years ago

Hi, I really don't have much time anymore to help out here, you should go to the OCCT forum or the OCCT bugtracker for this type of problem as it is related to algorithms made by them. They will have better advice than us IMO.

On Thu, Sep 8, 2016 at 11:41 AM, billtsalamander notifications@github.com wrote:

Quadrant is also missing when the file is opened in FreeCAD, so I don't think it's my error. It looks like the spline face shares an edge with itself (this file was created by Siemans NX), and I'm curious if that is part of the issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tpaviot/oce/issues/641#issuecomment-245697101, or mute the thread https://github.com/notifications/unsubscribe-auth/AEXv6IId48CqwuwotNz1s1hWTOAKoRSHks5qoFbEgaJpZM4J3X8n .

billtsalamander commented 8 years ago

OK, I will do that. Thanks for getting back to me.