]> OCCT Git - occt-copy.git/commitdiff
0028500: Artifact in shaded view of the shape increase minimum number of discretizati... CR28500_1
authoroan <oan@opencascade.com>
Wed, 30 Oct 2019 09:08:19 +0000 (12:08 +0300)
committeroan <oan@opencascade.com>
Thu, 7 Nov 2019 09:19:17 +0000 (12:19 +0300)
13 files changed:
src/BRepMesh/BRepMesh_CurveTessellator.cxx
src/BRepMesh/BRepMesh_CurveTessellator.hxx
src/BRepMesh/BRepMesh_EdgeDiscret.cxx
src/BRepMesh/BRepMesh_EdgeDiscret.hxx
src/BRepMesh/BRepMesh_ModelHealer.cxx
tests/bugs/mesh/bug25044_12
tests/bugs/mesh/bug25044_13
tests/bugs/mesh/bug28500
tests/bugs/moddata_2/bug428
tests/bugs/vis/bug22849
tests/hlr/poly_hlr/C3
tests/hlr/poly_hlr/bug23625_1
tests/hlr/poly_hlr/bug23625_2

index bb780d27e0f0f0235d5e5e33d068e137d3c51ffc..105df23e90cf59c4b9a683b2abe93428c391c36f 100644 (file)
 //=======================================================================
 BRepMesh_CurveTessellator::BRepMesh_CurveTessellator(
   const IMeshData::IEdgeHandle& theEdge,
-  const IMeshTools_Parameters&  theParameters)
+  const IMeshTools_Parameters&  theParameters,
+  const Standard_Integer        theMinPointsNb)
   : myDEdge(theEdge),
     myParameters(theParameters),
     myEdge(theEdge->GetEdge()),
-    myCurve(myEdge)
+    myCurve(myEdge),
+    myMinPointsNb (theMinPointsNb)
 {
   init();
 }
@@ -51,11 +53,13 @@ BRepMesh_CurveTessellator::BRepMesh_CurveTessellator (
   const IMeshData::IEdgeHandle& theEdge,
   const TopAbs_Orientation      theOrientation,
   const IMeshData::IFaceHandle& theFace,
-  const IMeshTools_Parameters&  theParameters)
+  const IMeshTools_Parameters&  theParameters,
+  const Standard_Integer        theMinPointsNb)
   : myDEdge(theEdge),
     myParameters(theParameters),
     myEdge(TopoDS::Edge(theEdge->GetEdge().Oriented(theOrientation))),
-    myCurve(myEdge, theFace->GetFace())
+    myCurve(myEdge, theFace->GetFace()),
+    myMinPointsNb (theMinPointsNb)
 {
   init();
 }
@@ -96,7 +100,8 @@ void BRepMesh_CurveTessellator::init()
   myEdgeSqTol  = BRep_Tool::Tolerance (myEdge);
   myEdgeSqTol *= myEdgeSqTol;
 
-  const Standard_Integer aMinPntNb = (myCurve.GetType() == GeomAbs_Circle) ? 4 : 2; //OCC287
+  const Standard_Integer aMinPntNb = Max(myMinPointsNb,
+    (myCurve.GetType() == GeomAbs_Circle) ? 4 : 2); //OCC287
 
   myDiscretTool.Initialize (myCurve,
                             myCurve.FirstParameter(), myCurve.LastParameter(),
index 4a666be6b84937b6403c4be83733e3f9e86a3a60..4eb59c0e6013a618045d51ef88a596c25709cb5c 100644 (file)
@@ -35,14 +35,16 @@ public:
   //! Constructor.
   Standard_EXPORT BRepMesh_CurveTessellator(
     const IMeshData::IEdgeHandle& theEdge,
-    const IMeshTools_Parameters&  theParameters);
+    const IMeshTools_Parameters&  theParameters,
+    const Standard_Integer        theMinPointsNb = 2);
 
   //! Constructor.
   Standard_EXPORT BRepMesh_CurveTessellator (
     const IMeshData::IEdgeHandle& theEdge,
     const TopAbs_Orientation      theOrientation,
     const IMeshData::IFaceHandle& theFace,
-    const IMeshTools_Parameters&  theParameters);
+    const IMeshTools_Parameters&  theParameters,
+    const Standard_Integer        theMinPointsNb = 2);
 
   //! Destructor.
   Standard_EXPORT virtual ~BRepMesh_CurveTessellator ();
@@ -97,6 +99,7 @@ private:
   const IMeshTools_Parameters&  myParameters;
   TopoDS_Edge                   myEdge;
   BRepAdaptor_Curve             myCurve;
+  Standard_Integer              myMinPointsNb;
   GCPnts_TangentialDeflection   myDiscretTool;
   TopoDS_Vertex                 myFirstVertex;
   TopoDS_Vertex                 myLastVertex;
index d9e575af43b9b0faffae33733bb110b6d4f7c312..04dbca51985f1ff7649efc12be381d8cd30d38da 100644 (file)
@@ -48,9 +48,10 @@ BRepMesh_EdgeDiscret::~BRepMesh_EdgeDiscret ()
 //=======================================================================
 Handle(IMeshTools_CurveTessellator) BRepMesh_EdgeDiscret::CreateEdgeTessellator(
   const IMeshData::IEdgeHandle& theDEdge,
-  const IMeshTools_Parameters&  theParameters)
+  const IMeshTools_Parameters&  theParameters,
+  const Standard_Integer        theMinPointsNb)
 {
-  return new BRepMesh_CurveTessellator(theDEdge, theParameters);
+  return new BRepMesh_CurveTessellator(theDEdge, theParameters, theMinPointsNb);
 }
 
 //=======================================================================
@@ -61,11 +62,12 @@ Handle(IMeshTools_CurveTessellator) BRepMesh_EdgeDiscret::CreateEdgeTessellator(
   const IMeshData::IEdgeHandle& theDEdge,
   const TopAbs_Orientation      theOrientation,
   const IMeshData::IFaceHandle& theDFace,
-  const IMeshTools_Parameters&  theParameters)
+  const IMeshTools_Parameters&  theParameters,
+  const Standard_Integer        theMinPointsNb)
 {
   return theDEdge->GetSameParam() ? 
-    new BRepMesh_CurveTessellator(theDEdge, theParameters) :
-    new BRepMesh_CurveTessellator(theDEdge, theOrientation, theDFace, theParameters);
+    new BRepMesh_CurveTessellator(theDEdge, theParameters, theMinPointsNb) :
+    new BRepMesh_CurveTessellator(theDEdge, theOrientation, theDFace, theParameters, theMinPointsNb);
 }
 
 //=======================================================================
index 82ac8e48d2cd0b598cc8709a3f73815f6766fba2..76733d5f50e8819391f3786b0e3dfa0a0fcf4970 100644 (file)
@@ -38,14 +38,16 @@ public:
   //! Creates instance of free edge tessellator.
   Standard_EXPORT static Handle(IMeshTools_CurveTessellator) CreateEdgeTessellator(
     const IMeshData::IEdgeHandle& theDEdge,
-    const IMeshTools_Parameters&  theParameters);
+    const IMeshTools_Parameters&  theParameters,
+    const Standard_Integer        theMinPointsNb = 2);
 
   //! Creates instance of edge tessellator.
   Standard_EXPORT static Handle(IMeshTools_CurveTessellator) CreateEdgeTessellator(
     const IMeshData::IEdgeHandle& theDEdge,
     const TopAbs_Orientation      theOrientation,
     const IMeshData::IFaceHandle& theDFace,
-    const IMeshTools_Parameters&  theParameters);
+    const IMeshTools_Parameters&  theParameters,
+    const Standard_Integer        theMinPointsNb = 2);
 
   //! Creates instance of tessellation extractor.
   Standard_EXPORT static Handle(IMeshTools_CurveTessellator) CreateEdgeTessellationExtractor(
index 6ad9b83f566c8f1c33a947452c933a88563b04d8..933aff2d775e27fa2af259ee6cda871001c24bf9 100644 (file)
@@ -49,6 +49,9 @@ namespace
     void operator()(const IMeshData::IEdgePtr& theDEdge) const
     {
       const IMeshData::IEdgeHandle aDEdge = theDEdge;
+
+      const Standard_Integer aPointsNb = aDEdge->GetCurve()->ParametersNb();
+
       aDEdge->Clear(Standard_True);
       aDEdge->SetDeflection(Max(aDEdge->GetDeflection() / 3., Precision::Confusion()));
 
@@ -56,7 +59,8 @@ namespace
       const IMeshData::IFaceHandle    aDFace = aPCurve->GetFace();
       Handle(IMeshTools_CurveTessellator) aTessellator =
         BRepMesh_EdgeDiscret::CreateEdgeTessellator(
-          aDEdge, aPCurve->GetOrientation(), aDFace, myParameters);
+          aDEdge, aPCurve->GetOrientation(), aDFace,
+          myParameters, aPointsNb + 1);
 
       BRepMesh_EdgeDiscret::Tessellate3d(aDEdge, aTessellator, Standard_False);
       BRepMesh_EdgeDiscret::Tessellate2d(aDEdge, Standard_False);
index 1ddf82927d8c7b5ff93f5ffd7a347ec4ae0d6b8c..31d1c179adb98951ed47bcd8bcc496144bf55e7d 100644 (file)
@@ -1,6 +1,3 @@
-puts "TODO 25044 ALL: SelfIntersectingWire"
-puts "TODO 25044 ALL: Number of triangles is equal to 0"
-
 puts "======="
 puts "0025044: BRepMesh tweaks"
 puts "======="
index f02bc31f583b537bdf1d0ca89f1beeae39912cb2..12b8348b95f55e479ef316d7e5deb4c95cc3c164 100644 (file)
@@ -1,6 +1,3 @@
-puts "TODO 25044 ALL: SelfIntersectingWire"
-puts "TODO 25044 ALL: Number of triangles is equal to 0"
-
 puts "======="
 puts "0025044: BRepMesh tweaks"
 puts "======="
index 3bab0b6875e6cd13daf685f0d65d8312d4942cdb..3f265eb699262c49c74b1f87825f8422adf85188 100644 (file)
@@ -3,22 +3,20 @@ puts "CR28500: Artifact in shaded view of the shape"
 puts "======="
 puts ""
 
-puts "TODO CR28500 ALL: Artifact in shaded view of the shape"
-puts "TODO CR30056 ALL: Meshing statuses: SelfIntersectingWire Failure Reused"
+restore [locate_data_file bug28500_shape_mesh_artifact.brep] result
 
-restore [locate_data_file bug28500_shape_mesh_artifact.brep] a
-
-incmesh a 0.01
+tclean result
+incmesh result 0.01
 
 vinit
 vsetdispmode 1
-vdisplay a
+vdefaults -autoTriang 0 
+vdisplay result
 vfit
 
-set x 150
-set y 150
-if { [checkcolor $x $y 0 1 0] == 1 } {
-  puts "Error: Artifact in shaded view of the shape"
+set log [tricheck result]
+if { [llength $log] != 0 } {
+  puts "Error : Mesh containg faulties"
 }
 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index c2bb6f5b7c0f27bbcf9de052ee20932395bc500d..6bead818792a8518e91380b8b2cbed317d0c89b1 100755 (executable)
@@ -19,5 +19,5 @@ isos result 0
 triangles result
 fit
 
-checktrinfo result -tri 10886 -nod 7830
+checktrinfo result -tri 10799 -nod 7799
 checkview -screenshot -2d -path ${imagedir}/${test_image}_axo.png
index 5d53da5353487a70cb6786ef48e6016fe4510d5e..6fe5d8c4fbf8ac8e268b8ff77119ae2eed6026ac 100755 (executable)
@@ -1,4 +1,4 @@
-puts "TODO CR30056 ALL: Meshing statuses: SelfIntersectingWire Failure"
+puts "TODO CR30056 ALL: Meshing statuses: Failure"
 
 puts "============"
 puts "OCC22849"
index 9c0397e884f7ab99d7dad8baddd5cc3c78822422..03981b436c53f0ff63a2989b6a39306042f047dc 100644 (file)
@@ -1,5 +1,5 @@
 set viewname "vright"
-set length 3060.33
+set length 3058.63
 
 testreadstep [locate_data_file bug27341_570-DWLNL-40-08-L_131LANG_16VERSATZ_DIN.stp] a
 COMPUTE_HLR $viewname $algotype
index 79d0e80de28307cabac30d7d550a9cdb4d0f3e64..3eb20577f8ae9b3bf25d8db1bdeabf92cda369aa 100644 (file)
@@ -4,7 +4,7 @@ puts "============"
 puts ""
 
 set viewname "vfront"
-set length 28096.2
+set length 28097.3
 
 restore [locate_data_file bug23625_a1.brep] a
 COMPUTE_HLR $viewname $algotype
index bf6139d3907df01fff9f89adccef8b2f344c7612..88b143025921341dbc882e79d4c212cb6f5372dc 100644 (file)
@@ -4,7 +4,7 @@ puts "============"
 puts ""
 
 set viewname "vfront"
-set length 28990.3
+set length 28997.3
 
 restore [locate_data_file bug23625_a2.brep] a
 COMPUTE_HLR $viewname $algotype