MantisBT - Community
View Issue Details
0023202Community[OCCT] OCCT:Data Exchangepublic2012-06-14 14:282016-04-20 15:49
goeranbarz 
abv 
normalminor 
closedfixed 
WindowsVC++ 201032 bit
[OCCT] 6.5.3 
[OCCT] 7.0.0[OCCT] 7.0.0 
bugs mesh bug23202
0023202: BRepMesh of face fails
When I try to Mesh the attached step file, the Meshing fails for face 714
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(714), nMax(714); //The exception occurs in face 714
  for (Standard_Integer numFace = 1; 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);//Triangulation is Null
  }
  }
  }
  }
 
No tags attached.
related to 0024595closed bugmaster STEP import missing surfaces 
? Leuchte.stp (1,755,216) 2012-06-14 14:28
https://tracker.dev.opencascade.org/
png axo.png (5,076) 2013-03-04 17:41
https://tracker.dev.opencascade.org/
png v2d.png (1,455) 2013-03-04 17:41
https://tracker.dev.opencascade.org/
Issue History
2012-06-14 14:28goeranbarzNew Issue
2012-06-14 14:28goeranbarzAssigned To => jgv
2012-06-14 14:28goeranbarzFile Added: Leuchte.stp
2012-11-09 09:54abvCategoryOCCT:Modeling Algorithms => OCCT:Mesh
2013-03-04 17:40oanNote Added: 0023579
2013-03-04 17:41oanFile Added: axo.png
2013-03-04 17:41oanFile Added: v2d.png
2013-03-04 17:41oanAssigned Tojgv => abv
2013-03-04 17:41oanStatusnew => feedback
2013-03-05 10:33abvNote Added: 0023582
2013-03-05 10:33abvAssigned Toabv => goeranbarz
2013-03-05 10:33abvTarget Version => Unscheduled
2013-03-07 19:15goeranbarzNote Added: 0023634
2013-03-07 19:15goeranbarzStatusfeedback => assigned
2013-03-29 11:39oanCategoryOCCT:Mesh => OCCT:Data Exchange
2016-02-15 15:17abvRelationship addedrelated to 0024595
2016-02-15 15:28oanTarget VersionUnscheduled => 7.0.0
2016-02-15 15:29oanNote Added: 0050757
2016-02-15 15:29oanAssigned Togoeranbarz => apn
2016-02-15 15:29oanStatusassigned => feedback
2016-02-17 13:25gitNote Added: 0050868
2016-02-17 13:26apnNote Added: 0050869
2016-02-17 13:26apnTest case number => bugs mesh bug23202
2016-02-17 13:26apnAssigned Toapn => oan
2016-02-17 13:47oanNote Added: 0050870
2016-02-17 13:47oanAssigned Tooan => apn
2016-02-17 13:47oanStatusfeedback => assigned
2016-02-17 14:25gitNote Added: 0050872
2016-02-17 14:26apnNote Added: 0050873
2016-02-17 14:27apnAssigned Toapn => bugmaster
2016-02-17 14:27apnStatusassigned => resolved
2016-02-17 14:27apnStatusresolved => reviewed
2016-02-17 14:27apnStatusreviewed => tested
2016-02-21 08:52abvChangeset attached => occt master 85b47ba4
2016-02-21 08:52abvAssigned Tobugmaster => abv
2016-02-21 08:52abvStatustested => verified
2016-02-21 08:52abvResolutionopen => fixed
2016-04-17 13:18gitNote Added: 0052828
2016-04-20 15:43aivFixed in Version => 7.0.0
2016-04-20 15:49aivStatusverified => closed

Notes
(0023579)
oan   
2013-03-04 17:40   
Checkshape and incmesh commands indicate the open wire problem on face #714. It is obvious in 2d (see v2d.png) - the whole face is represented by a single unclosed curve. The following script can be used to reproduce these results:

pload ALL

stepread Leuchte.stp a *
explode a_1 f
renamevar a_1_714 b

donly b
small
fit
isos b 10

incmesh b 0.1

# Incremental Mesh, multi-threading OFF
# Meshing statuses: OpenWire

checkshape b

# On Shape faulty_1 :
# BRepCheck_UnorientableShape
# Shape faulty_2 on shape faulty_1 :
# BRepCheck_NotClosed
#
# Faulty shapes in variables faulty_1 to faulty_2

v2d2
pcurve b
2dfit

I suppose it is out of responsibility of the BRepMesh and some troubles during importation process of the STEP file are the cause of this problem. I propose to move it to the DataExchange category.

Dear ABV,
could you express your suggestions?
(0023582)
abv   
2013-03-05 10:33   
I believe the face #27244 in the STEP file is incorrectly defined: its bounding loop contains only VERTEX_LOOP which is (as far as I remember) is allowed to be used only on complete spheres. The actual surface of that face is B-spline representing half-sphere (with a pole inside).

I suggest this file should be checked for reading by other (third-party) applications, and only if other systems can read this face correctly, we shall consider improving OCCT to handle such cases.
(0023634)
goeranbarz   
2013-03-07 19:15   
The halfsphere is imported correctly by "Autodesk Inventor 2012". The older version "Autodesk Inventor 2008" wasn't able to import the half-sphere.
(0050757)
oan   
2016-02-15 15:29   
Dear Bugmaster,

it seems that this issue has been fixed by 0024595. Please create test case and verify.
(0050868)
git   
2016-02-17 13:25   
Branch CR23202 has been created by apn.

SHA-1: 59bb2e1ead78bcaa4029f60c84536ec208f5d75f


Detailed log of new commits:

Author: apn
Date: Wed Feb 17 13:24:44 2016 +0300

    0023202: BRepMesh of face fails
    
    Added test case bugs/mesh/bug23202
(0050869)
apn   
2016-02-17 13:26   
Test case bugs mesh bug23202 was added to CR23202
http://occt-tests/bug23202_Lin/bugs/mesh/bug23202.html [^]
http://occt-tests/bug23202_WNT/bugs/mesh/bug23202.html [^]

Dear oan, please review test case.
(0050870)
oan   
2016-02-17 13:47   
Dear Andrey,

could you please add an additional check like checktriarea.
(0050872)
git   
2016-02-17 14:25   
Branch CR23202 has been updated forcibly by apn.

SHA-1: 251d2ead21a3037d3ae18881e93d85fa6d35bf96
(0050873)
apn   
2016-02-17 14:26   
Done.
(0052828)
git   
2016-04-17 13:18   
Branch CR23202 has been deleted by kgv.

SHA-1: 251d2ead21a3037d3ae18881e93d85fa6d35bf96