]> OCCT Git - occt.git/commitdiff
Revert "0028500: Artifact in shaded view of the shape"
authormzernova <mzernova@opencascade.com>
Mon, 3 Mar 2025 13:44:30 +0000 (13:44 +0000)
committermzernova <mzernova@opencascade.com>
Mon, 3 Mar 2025 13:44:30 +0000 (13:44 +0000)
This reverts commit f73592edf0ad5231c84e5332c8c47f54ed178780.

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/bug25044_60
tests/bugs/mesh/bug28500
tests/bugs/mesh/bug32692_1
tests/hlr/poly_hlr/bug23625_1

index c8e942ec3a686f217139febcdfd93c40d0c5fa88..1d293f0204896770850dc80f503102d834eecea3 100644 (file)
@@ -35,13 +35,11 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_CurveTessellator, IMeshTools_CurveTessellato
 //=======================================================================
 BRepMesh_CurveTessellator::BRepMesh_CurveTessellator(
   const IMeshData::IEdgeHandle& theEdge,
-  const IMeshTools_Parameters&  theParameters,
-  const Standard_Integer        theMinPointsNb)
+  const IMeshTools_Parameters&  theParameters)
   : myDEdge(theEdge),
     myParameters(theParameters),
     myEdge(theEdge->GetEdge()),
-    myCurve(myEdge),
-    myMinPointsNb (theMinPointsNb)
+    myCurve(myEdge)
 {
   init();
 }
@@ -54,13 +52,11 @@ BRepMesh_CurveTessellator::BRepMesh_CurveTessellator (
   const IMeshData::IEdgeHandle& theEdge,
   const TopAbs_Orientation      theOrientation,
   const IMeshData::IFaceHandle& theFace,
-  const IMeshTools_Parameters&  theParameters,
-  const Standard_Integer        theMinPointsNb)
+  const IMeshTools_Parameters&  theParameters)
   : myDEdge(theEdge),
     myParameters(theParameters),
     myEdge(TopoDS::Edge(theEdge->GetEdge().Oriented(theOrientation))),
-    myCurve(myEdge, theFace->GetFace()),
-    myMinPointsNb (theMinPointsNb)
+    myCurve(myEdge, theFace->GetFace())
 {
   init();
 }
@@ -101,21 +97,20 @@ void BRepMesh_CurveTessellator::init()
   myEdgeSqTol  = BRep_Tool::Tolerance (myEdge);
   myEdgeSqTol *= myEdgeSqTol;
 
-  Standard_Integer aMinPntThreshold = 2;
+  Standard_Integer aMinPntNb = 2;
   switch (myCurve.GetType())
   {
     case GeomAbs_Circle:
     case GeomAbs_Ellipse:
     case GeomAbs_Parabola:
     case GeomAbs_Hyperbola:
-      aMinPntThreshold = 4;
+      aMinPntNb = 4;
       break;
 
     default:
       break;
   }
 
-  const Standard_Integer aMinPntNb = Max (myMinPointsNb, aMinPntThreshold); //OCC287
   myDiscretTool.Initialize (myCurve,
                             myCurve.FirstParameter(), myCurve.LastParameter(),
                             aPreciseAngDef, aPreciseLinDef, aMinPntNb,
index d9406a842309f94096212a60f858953df1e89535..ddf3bcfa525d214765d050ea591bc87ca7cb7667 100644 (file)
@@ -34,16 +34,14 @@ public:
   //! Constructor.
   Standard_EXPORT BRepMesh_CurveTessellator(
     const IMeshData::IEdgeHandle& theEdge,
-    const IMeshTools_Parameters&  theParameters,
-    const Standard_Integer        theMinPointsNb = 2);
+    const IMeshTools_Parameters&  theParameters);
 
   //! Constructor.
   Standard_EXPORT BRepMesh_CurveTessellator (
     const IMeshData::IEdgeHandle& theEdge,
     const TopAbs_Orientation      theOrientation,
     const IMeshData::IFaceHandle& theFace,
-    const IMeshTools_Parameters&  theParameters,
-    const Standard_Integer        theMinPointsNb = 2);
+    const IMeshTools_Parameters&  theParameters);
 
   //! Destructor.
   Standard_EXPORT virtual ~BRepMesh_CurveTessellator ();
@@ -98,7 +96,6 @@ private:
   const IMeshTools_Parameters&  myParameters;
   TopoDS_Edge                   myEdge;
   BRepAdaptor_Curve             myCurve;
-  Standard_Integer              myMinPointsNb;
   GCPnts_TangentialDeflection   myDiscretTool;
   TopoDS_Vertex                 myFirstVertex;
   TopoDS_Vertex                 myLastVertex;
index 31c7963c5983f4d42d546aaf946d4bd7a68e4c97..a68165a291c1d714a1e148d387210845ea2c48c6 100644 (file)
@@ -49,10 +49,9 @@ BRepMesh_EdgeDiscret::~BRepMesh_EdgeDiscret ()
 //=======================================================================
 Handle(IMeshTools_CurveTessellator) BRepMesh_EdgeDiscret::CreateEdgeTessellator(
   const IMeshData::IEdgeHandle& theDEdge,
-  const IMeshTools_Parameters&  theParameters,
-  const Standard_Integer        theMinPointsNb)
+  const IMeshTools_Parameters&  theParameters)
 {
-  return new BRepMesh_CurveTessellator(theDEdge, theParameters, theMinPointsNb);
+  return new BRepMesh_CurveTessellator(theDEdge, theParameters);
 }
 
 //=======================================================================
@@ -63,12 +62,11 @@ Handle(IMeshTools_CurveTessellator) BRepMesh_EdgeDiscret::CreateEdgeTessellator(
   const IMeshData::IEdgeHandle& theDEdge,
   const TopAbs_Orientation      theOrientation,
   const IMeshData::IFaceHandle& theDFace,
-  const IMeshTools_Parameters&  theParameters,
-  const Standard_Integer        theMinPointsNb)
+  const IMeshTools_Parameters&  theParameters)
 {
   return theDEdge->GetSameParam() ? 
-    new BRepMesh_CurveTessellator(theDEdge, theParameters, theMinPointsNb) :
-    new BRepMesh_CurveTessellator(theDEdge, theOrientation, theDFace, theParameters, theMinPointsNb);
+    new BRepMesh_CurveTessellator(theDEdge, theParameters) :
+    new BRepMesh_CurveTessellator(theDEdge, theOrientation, theDFace, theParameters);
 }
 
 //=======================================================================
index 89b67eda394ed0b213f2e09372c1cc9e2c03b852..c8db5ec34203427f6c229e3ccab649122faeefd7 100644 (file)
@@ -38,16 +38,14 @@ public:
   //! Creates instance of free edge tessellator.
   Standard_EXPORT static Handle(IMeshTools_CurveTessellator) CreateEdgeTessellator(
     const IMeshData::IEdgeHandle& theDEdge,
-    const IMeshTools_Parameters&  theParameters,
-    const Standard_Integer        theMinPointsNb = 2);
+    const IMeshTools_Parameters&  theParameters);
 
   //! 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 Standard_Integer        theMinPointsNb = 2);
+    const IMeshTools_Parameters&  theParameters);
 
   //! Creates instance of tessellation extractor.
   Standard_EXPORT static Handle(IMeshTools_CurveTessellator) CreateEdgeTessellationExtractor(
index 4c2eed209ac8e31e36cdf9bb5faadfd98c585e77..def938d41a6de6cf6823ffb379da0c3d3f4d07d9 100644 (file)
@@ -50,32 +50,14 @@ namespace
     void operator()(const IMeshData::IEdgePtr& theDEdge) const
     {
       const IMeshData::IEdgeHandle aDEdge = theDEdge;
-
-      Standard_Integer aPointsNb = aDEdge->GetCurve()->ParametersNb();
-
       aDEdge->Clear(Standard_True);
       aDEdge->SetDeflection(Max(aDEdge->GetDeflection() / 3., Precision::Confusion()));
 
-      for (Standard_Integer aPCurveIt = 0; aPCurveIt < aDEdge->PCurvesNb(); ++aPCurveIt)
-      {
-        const IMeshData::IPCurveHandle& aPCurve = aDEdge->GetPCurve(aPCurveIt);
-        const IMeshData::IFaceHandle    aDFace  = aPCurve->GetFace();
-
-        // Check that outer wire contains 2 edges or less and add an additional point.
-        const IMeshData::IWireHandle&   aDWire  = aDFace->GetWire(0);
-        if (aDWire->EdgesNb() <= 2)
-        {
-          ++aPointsNb;
-          break;
-        }
-      }
-
       const IMeshData::IPCurveHandle& aPCurve = aDEdge->GetPCurve(0);
       const IMeshData::IFaceHandle    aDFace = aPCurve->GetFace();
       Handle(IMeshTools_CurveTessellator) aTessellator =
         BRepMesh_EdgeDiscret::CreateEdgeTessellator(
-          aDEdge, aPCurve->GetOrientation(), aDFace,
-          myParameters, aPointsNb);
+          aDEdge, aPCurve->GetOrientation(), aDFace, myParameters);
 
       BRepMesh_EdgeDiscret::Tessellate3d(aDEdge, aTessellator, Standard_False);
       BRepMesh_EdgeDiscret::Tessellate2d(aDEdge, Standard_False);
index 31d1c179adb98951ed47bcd8bcc496144bf55e7d..1ddf82927d8c7b5ff93f5ffd7a347ec4ae0d6b8c 100644 (file)
@@ -1,3 +1,6 @@
+puts "TODO 25044 ALL: SelfIntersectingWire"
+puts "TODO 25044 ALL: Number of triangles is equal to 0"
+
 puts "======="
 puts "0025044: BRepMesh tweaks"
 puts "======="
index 12b8348b95f55e479ef316d7e5deb4c95cc3c164..f02bc31f583b537bdf1d0ca89f1beeae39912cb2 100644 (file)
@@ -1,3 +1,6 @@
+puts "TODO 25044 ALL: SelfIntersectingWire"
+puts "TODO 25044 ALL: Number of triangles is equal to 0"
+
 puts "======="
 puts "0025044: BRepMesh tweaks"
 puts "======="
index 6c892505875b0b384c4e477d77fcf387d0a15f20..78ae38610968b701b8a495a28ab2942cf802b354 100644 (file)
@@ -3,9 +3,6 @@ puts "0025588: BRepMesh_ShapeTool::FindUV check for 2d points to be the same is
 puts "======="
 puts ""
 
-puts "TODO OCC25588 All: Not connected mesh inside face 893"
-puts "TODO OCC25588 All: Not connected mesh inside face 1094"
-
 pload XDE
 
 stepread [locate_data_file Median_cx-fs01_bicycle.stp] a *
index 56e1699978f81b434d17ddd1d0fcdda21ebd8e1f..3bab0b6875e6cd13daf685f0d65d8312d4942cdb 100644 (file)
@@ -3,20 +3,22 @@ puts "CR28500: Artifact in shaded view of the shape"
 puts "======="
 puts ""
 
-restore [locate_data_file bug28500_shape_mesh_artifact.brep] result
+puts "TODO CR28500 ALL: Artifact in shaded view of the shape"
+puts "TODO CR30056 ALL: Meshing statuses: SelfIntersectingWire Failure Reused"
 
-tclean result
-incmesh result 0.01
+restore [locate_data_file bug28500_shape_mesh_artifact.brep] a
+
+incmesh a 0.01
 
 vinit
 vsetdispmode 1
-vdefaults -autoTriang 0 
-vdisplay result
+vdisplay a
 vfit
 
-set log [tricheck result]
-if { [llength $log] != 0 } {
-  puts "Error : Mesh contains faulties"
+set x 150
+set y 150
+if { [checkcolor $x $y 0 1 0] == 1 } {
+  puts "Error: Artifact in shaded view of the shape"
 }
 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 1712b35ab111ba637524b1378a157b6149f3ceb1..5a85bff3db5fee40cb96a625d715c698dabde642 100644 (file)
@@ -8,4 +8,4 @@ puts "REQUIRED ALL: Meshing statuses: SelfIntersectingWire Failure"
 restore [locate_data_file bug32692.brep] s
 incmesh s 0.01 -parallel
 
-checktrinfo s -nod 7389 -tri 7419 -empty 9 -face 309
+checktrinfo s -nod 7427 -tri 7457 -empty 9 -face 309
index ed7a28c97a49a7cccb3e05a28264e692585d3333..598634bec4288610799f2dcff52d91e45d90aa98 100644 (file)
@@ -3,8 +3,16 @@ puts "OCC23625"
 puts "============"
 puts ""
 
+puts "REQUIRED All: Meshing statuses: SelfIntersectingWire Failure"
+
 set viewname "vfront"
-set length 26411.2
+set length 26411.7
 
 restore [locate_data_file bug23625_a1.brep] a
+
+# workaround bug 0031426 until fix
+vinit View1
+vdefaults -autoTriang 0
+incmesh a 7.6
+
 COMPUTE_HLR $viewname $algotype