MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #23105 All Revisions ] Back to Issue ]
Summary 0023105: Exception during Meshing / Missing triangles
Revision 2012-04-12 19:00 by szy
Steps To Reproduce Here is some sample-Code to reproduce this error:

Handle(TDocStd_Document) hDoc;
XCAFApp_Application::GetApplication()->NewDocument("MDTV_XCAF", hDoc);
STEPCAFControl_Reader reader;
reader.SetColorMode(true);
reader.ReadFile(strFileName);
reader.Transfer(hDoc);

for (TDF_ChildIterator it(XCAFDoc_DocumentTool::ShapesLabel(hDoc->Main())); it.More() && !progress.canceled(); it.Next())
{
if (XCAFDoc_ShapeTool::IsSimpleShape(it.Value()))
{
TopoDS_Shape shapeCurrent;
XCAFDoc_ShapeTool::GetShape(it.Value(), shapeCurrent);

TopExp_Explorer expFace;
expFace.Init(shapeCurrent, TopAbs_FACE);
int nMin(371), nMax(371); //The exception occurs in face 371
for (Standard_Integer numFace = 0; expFace.More(); expFace.Next(), ++numFace)
{
if (numFace < nMin || numFace > nMax)
continue;
TopoDS_Face myFace = TopoDS::Face(expFace.Current());
Handle(Poly_Triangulation) myT = BRep_Tool::Triangulation(myFace, myLocation);
if (myT.IsNull())
{
BRepMesh_IncrementalMesh Mesh(myFace, 0.7, Standard_False, 0.75);
myT = BRep_Tool::Triangulation(myFace, myLocation);
}
}
}
}

// Draw reproducer from the post - http://www.opencascade.org/org/forum/thread_23134/ [^]
Draw[25]> pload ALL
Draw[26]> smallview
Draw[27]> stepread 3359.500_Klima_high.stp s *
# ...
#Transfer entity n0 34 OK -> DRAW Shape: s_1
#Now, 1 Shapes produced
Draw[28]> explo s_1 F
Draw[29]> don s_1_372 ## <== the expected face
Draw[30]> checkshape s_1_372
# This shape seems to be valid
Draw[31]> fit
Draw[32]> incmesh s_1_372 0.1
#Meshing statuses: NoError
Draw[33]> trinfo s_1_372

#This shape contains 0 triangles.
# 0 nodes.
#Maximal deflection 0

The exception (OutOfRange) is catched by Draw.
Revision 2012-04-12 18:26 by szy
Steps To Reproduce Here is some sample-Code to reproduce this error:

Handle(TDocStd_Document) hDoc;
XCAFApp_Application::GetApplication()->NewDocument("MDTV_XCAF", hDoc);
STEPCAFControl_Reader reader;
reader.SetColorMode(true);
reader.ReadFile(strFileName);
reader.Transfer(hDoc);

for (TDF_ChildIterator it(XCAFDoc_DocumentTool::ShapesLabel(hDoc->Main())); it.More() && !progress.canceled(); it.Next())
{
if (XCAFDoc_ShapeTool::IsSimpleShape(it.Value()))
{
TopoDS_Shape shapeCurrent;
XCAFDoc_ShapeTool::GetShape(it.Value(), shapeCurrent);

TopExp_Explorer expFace;
expFace.Init(shapeCurrent, TopAbs_FACE);
int nMin(371), nMax(371); //The exception occurs in face 371
for (Standard_Integer numFace = 0; expFace.More(); expFace.Next(), ++numFace)
{
if (numFace < nMin || numFace > nMax)
continue;
TopoDS_Face myFace = TopoDS::Face(expFace.Current());
Handle(Poly_Triangulation) myT = BRep_Tool::Triangulation(myFace, myLocation);
if (myT.IsNull())
{
BRepMesh_IncrementalMesh Mesh(myFace, 0.7, Standard_False, 0.75);
myT = BRep_Tool::Triangulation(myFace, myLocation);
}
}
}
}


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker