]> OCCT Git - occt.git/commitdiff
0032471: Mesh - Deflection of the triangulation is not recomputed for planar face
authoroan <oan@opencascade.com>
Wed, 21 Jul 2021 11:12:35 +0000 (14:12 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 23 Jul 2021 15:15:55 +0000 (18:15 +0300)
Method EstimateDeflection has been added to BRepLib in order to check and update value of deflection provided by Poly_Triangulation;
Introduction of Poly_TriangulationParameters intended to keep info about initial parameters of mesh stored by Poly_Triangulation;
BRepMesh stores user-specified parameters to Poly_Triangulation via Poly_TriangulationParameters;
Prefer initial parameters of mesh generator stored in Poly_Triangulation during check of mesh consistency.

41 files changed:
src/BRepLib/BRepLib.cxx
src/BRepLib/BRepLib.hxx
src/BRepMesh/BRepMesh_BaseMeshAlgo.cxx
src/BRepMesh/BRepMesh_ModelPostProcessor.cxx
src/BRepMesh/BRepMesh_ModelPreProcessor.cxx
src/Poly/FILES
src/Poly/Poly_Triangulation.hxx
src/Poly/Poly_TriangulationParameters.cxx [new file with mode: 0644]
src/Poly/Poly_TriangulationParameters.hxx [new file with mode: 0644]
tests/bugs/heal/bug26244
tests/bugs/mesh/bug22778
tests/bugs/mesh/bug23105
tests/bugs/mesh/bug23513
tests/bugs/mesh/bug24127
tests/bugs/mesh/bug24938
tests/bugs/mesh/bug25042
tests/bugs/mesh/bug25287
tests/bugs/mesh/bug25519
tests/bugs/mesh/bug27693
tests/bugs/mesh/bug27845
tests/bugs/mesh/bug29149
tests/bugs/mesh/bug29205
tests/bugs/mesh/bug29685
tests/bugs/mesh/bug29751
tests/bugs/mesh/bug29962
tests/bugs/mesh/bug30008_1
tests/bugs/mesh/bug30008_2
tests/bugs/mesh/bug30167
tests/bugs/mesh/bug31251
tests/bugs/mesh/bug32471 [new file with mode: 0644]
tests/bugs/moddata_1/bug15519
tests/bugs/moddata_1/bug21122
tests/bugs/moddata_1/bug22759
tests/bugs/moddata_3/bug24959_2
tests/perf/mesh/bug23795
tests/perf/mesh/bug26889_1
tests/perf/mesh/bug26889_2
tests/perf/mesh/bug26889_3
tests/perf/mesh/bug26965
tests/perf/mesh/bug27119
tests/v3d/bugs/buc60857

index 574959578f459df4ef0536228fd3ae81a4588462..9079366ffccb4dd2e047ec6a96df5c3faf4dd4a9 100644 (file)
@@ -2434,6 +2434,174 @@ Standard_Boolean BRepLib::
   return aRetVal;
 }
 
+//=======================================================================
+//function : UpdateDeflection
+//purpose  : 
+//=======================================================================
+namespace
+{
+  //! Tool to estimate deflection of the given UV point
+  //! with regard to its representation in 3D space.
+  struct EvalDeflection
+  {
+    BRepAdaptor_Surface Surface;
+
+    //! Initializes tool with the given face.
+    EvalDeflection (const TopoDS_Face& theFace)
+      : Surface (theFace)
+    {
+    }
+
+    //! Evaluates deflection of the given 2d point from its 3d representation.
+    Standard_Real Eval (const gp_Pnt2d& thePoint2d, const gp_Pnt& thePoint3d)
+    {
+      gp_Pnt aPnt;
+      Surface.D0 (thePoint2d.X (), thePoint2d.Y (), aPnt);
+      return (thePoint3d.XYZ () - aPnt.XYZ ()).SquareModulus ();
+    }
+  };
+
+  //! Represents link of triangulation.
+  struct Link
+  {
+    Standard_Integer Node[2];
+
+    //! Constructor
+    Link (const Standard_Integer theNode1, const Standard_Integer theNode2)
+    {
+      Node[0] = theNode1;
+      Node[1] = theNode2;
+    }
+
+    //! Computes a hash code for the this link
+    Standard_Integer HashCode (const Standard_Integer theUpperBound) const
+    {
+      return ::HashCode (Node[0] + Node[1], theUpperBound);
+    }
+
+    //! Returns true if this link has the same nodes as the other.
+    Standard_Boolean IsEqual (const Link& theOther) const
+    {
+      return ((Node[0] == theOther.Node[0] && Node[1] == theOther.Node[1]) ||
+              (Node[0] == theOther.Node[1] && Node[1] == theOther.Node[0]));
+    }
+
+    //! Alias for IsEqual.
+    Standard_Boolean operator ==(const Link& theOther) const
+    {
+      return IsEqual (theOther);
+    }
+  };
+
+  //! Computes a hash code for the given link
+  inline Standard_Integer HashCode (const Link& theLink, const Standard_Integer theUpperBound)
+  {
+    return theLink.HashCode (theUpperBound);
+  }
+}
+
+void BRepLib::UpdateDeflection (const TopoDS_Shape& theShape)
+{
+  TopExp_Explorer anExpFace (theShape, TopAbs_FACE);
+  for (; anExpFace.More(); anExpFace.Next())
+  {
+    const TopoDS_Face& aFace = TopoDS::Face (anExpFace.Current());
+    const Handle(Geom_Surface) aSurf = BRep_Tool::Surface (aFace);
+    if (aSurf.IsNull())
+    {
+      continue;
+    }
+
+    TopLoc_Location aLoc;
+    const Handle(Poly_Triangulation)& aPT = BRep_Tool::Triangulation (aFace, aLoc);
+    if (aPT.IsNull() || !aPT->HasUVNodes())
+    {
+      continue;
+    }
+
+    // Collect all nodes of degenerative edges and skip elements
+    // build upon them due to huge distortions introduced by passage
+    // from UV space to 3D.
+    NCollection_Map<Standard_Integer> aDegNodes;
+    TopExp_Explorer anExpEdge (aFace, TopAbs_EDGE);
+    for (; anExpEdge.More(); anExpEdge.Next())
+    {
+      const TopoDS_Edge& aEdge = TopoDS::Edge (anExpEdge.Current());
+      if (BRep_Tool::Degenerated (aEdge))
+      {
+        const Handle(Poly_PolygonOnTriangulation)& aPolygon = BRep_Tool::PolygonOnTriangulation (aEdge, aPT, aLoc);
+        if (aPolygon.IsNull ())
+        {
+          continue;
+        }
+
+        for (Standard_Integer aNodeIt = aPolygon->Nodes().Lower(); aNodeIt <= aPolygon->Nodes().Upper(); ++aNodeIt)
+        {
+          aDegNodes.Add (aPolygon->Node (aNodeIt));
+        }
+      }
+    }
+
+    EvalDeflection aTool (aFace);
+    NCollection_Map<Link> aLinks;
+    Standard_Real aSqDeflection = 0.;
+    const gp_Trsf& aTrsf = aLoc.Transformation();
+    for (Standard_Integer aTriIt = 1; aTriIt <= aPT->NbTriangles(); ++aTriIt)
+    {
+      const Poly_Triangle& aTriangle = aPT->Triangle (aTriIt);
+
+      int aNode[3];
+      aTriangle.Get (aNode[0], aNode[1], aNode[2]);
+      if (aDegNodes.Contains (aNode[0]) ||
+          aDegNodes.Contains (aNode[1]) ||
+          aDegNodes.Contains (aNode[2]))
+      {
+        continue;
+      }
+
+      const gp_Pnt aP3d[3] = {
+        aPT->Node (aNode[0]).Transformed (aTrsf),
+        aPT->Node (aNode[1]).Transformed (aTrsf),
+        aPT->Node (aNode[2]).Transformed (aTrsf)
+      };
+
+      const gp_Pnt2d aP2d[3] = {
+        aPT->UVNode (aNode[0]),
+        aPT->UVNode (aNode[1]),
+        aPT->UVNode (aNode[2])
+      };
+
+      // Check midpoint of triangle.
+      const gp_Pnt   aMid3d_t = (aP3d[0].XYZ() + aP3d[1].XYZ() + aP3d[2].XYZ()) / 3.;
+      const gp_Pnt2d aMid2d_t = (aP2d[0].XY () + aP2d[1].XY () + aP2d[2].XY ()) / 3.;
+
+      aSqDeflection = Max (aSqDeflection, aTool.Eval (aMid2d_t, aMid3d_t));
+
+      for (Standard_Integer i = 0; i < 3; ++i)
+      {
+        const Standard_Integer j = (i + 1) % 3;
+        const Link aLink (aNode[i], aNode[j]);
+        if (!aLinks.Add (aLink))
+        {
+          // Do not estimate boundary links due to high distortions at the edge.
+          const gp_Pnt&   aP3d1 = aP3d[i];
+          const gp_Pnt&   aP3d2 = aP3d[j];
+
+          const gp_Pnt2d& aP2d1 = aP2d[i];
+          const gp_Pnt2d& aP2d2 = aP2d[j];
+
+          const gp_Pnt   aMid3d_l = (aP3d1.XYZ() + aP3d2.XYZ()) / 2.;
+          const gp_Pnt2d aMid2d_l = (aP2d1.XY () + aP2d2.XY ()) / 2.;
+
+          aSqDeflection = Max (aSqDeflection, aTool.Eval (aMid2d_l, aMid3d_l));
+        }
+      }
+    }
+
+    aPT->Deflection (Sqrt (aSqDeflection));
+  }
+}
+
 //=======================================================================
 //function : SortFaces
 //purpose  : 
index 3f585a89b22a51650601171766a76709a1d91b53..6f8c0b7d2e848ad642adc2c622f4768505ac987f 100644 (file)
@@ -250,6 +250,10 @@ public:
   //! Returns TRUE if any correction is done.
   Standard_EXPORT static Standard_Boolean EnsureNormalConsistency (const TopoDS_Shape& S, const Standard_Real theAngTol = 0.001, const Standard_Boolean ForceComputeNormals = Standard_False);
 
+  //! Updates value of deflection in Poly_Triangulation of faces
+  //! by the maximum deviation measured on existing triangulation.
+  Standard_EXPORT static void UpdateDeflection (const TopoDS_Shape& S);
+
   //! Calculates the bounding sphere around the set of vertexes from the theLV list.
   //! Returns the center (theNewCenter) and the radius (theNewTol) of this sphere.
   //! This can be used to construct the new vertex which covers the given set of
index 85ec667798c9db20f239b6f272af0daba331551e..81e318a0166da3ef6d127629df58b06e06094582 100644 (file)
@@ -243,7 +243,6 @@ void BRepMesh_BaseMeshAlgo::commitSurfaceTriangulation()
 
   collectNodes(aTriangulation);
 
-  aTriangulation->Deflection(myDFace->GetDeflection());
   BRepMesh_ShapeTool::AddInFace(myDFace->GetFace(), aTriangulation);
 }
 
index 4a2a8b080b6c01aa85a7d12e111e05a5b8ddfabd..b6253542c44a4868cf2d997e841a5ba4842d47c9 100644 (file)
@@ -19,6 +19,8 @@
 #include <IMeshData_Edge.hxx>
 #include <IMeshData_PCurve.hxx>
 #include <OSD_Parallel.hxx>
+#include <BRepLib.hxx>
+#include <Poly_TriangulationParameters.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_ModelPostProcessor, IMeshTools_ModelAlgo)
 
@@ -157,6 +159,47 @@ namespace
 
     Handle(IMeshData_Model) myModel;
   };
+
+  //! Estimates and updates deflection of triangulations for corresponding faces.
+  class DeflectionEstimator
+  {
+  public:
+    //! Constructor
+    DeflectionEstimator (const Handle(IMeshData_Model)& theModel,
+                         const IMeshTools_Parameters&   theParams)
+      : myModel  (theModel)
+      , myParams (new Poly_TriangulationParameters (
+          theParams.Deflection, theParams.Angle, theParams.MinSize))
+    {
+    }
+
+    //! Main functor.
+    void operator()(const Standard_Integer theFaceIndex) const
+    {
+      const IMeshData::IFaceHandle& aDFace = myModel->GetFace (theFaceIndex);
+      if (aDFace->IsSet (IMeshData_Failure) ||
+          aDFace->IsSet (IMeshData_Reused))
+      {
+        return;
+      }
+
+      BRepLib::UpdateDeflection (aDFace->GetFace());
+
+      TopLoc_Location aLoc;
+      const Handle(Poly_Triangulation)& aTriangulation =
+        BRep_Tool::Triangulation (aDFace->GetFace(), aLoc);
+      
+      if (!aTriangulation.IsNull())
+      {
+        aTriangulation->Parameters (myParams);
+      }
+    }
+
+  private:
+
+    Handle(IMeshData_Model)              myModel;
+    Handle(Poly_TriangulationParameters) myParams;
+  };
 }
 
 //=======================================================================
@@ -181,7 +224,7 @@ BRepMesh_ModelPostProcessor::~BRepMesh_ModelPostProcessor()
 //=======================================================================
 Standard_Boolean BRepMesh_ModelPostProcessor::performInternal(
   const Handle(IMeshData_Model)& theModel,
-  const IMeshTools_Parameters&   /*theParameters*/,
+  const IMeshTools_Parameters&   theParameters,
   const Message_ProgressRange&   theRange)
 {
   (void )theRange;
@@ -191,6 +234,10 @@ Standard_Boolean BRepMesh_ModelPostProcessor::performInternal(
   }
 
   // TODO: Force single threaded solution due to data races on edges sharing the same TShape
-  OSD_Parallel::For(0, theModel->EdgesNb(), PolygonCommitter(theModel), Standard_True/*!theParameters.InParallel*/);
+  OSD_Parallel::For (0, theModel->EdgesNb(), PolygonCommitter (theModel), Standard_True/*!theParameters.InParallel*/);
+
+  // Estimate deflection here due to BRepLib::EstimateDeflection requires
+  // existence of both Poly_Triangulation and Poly_PolygonOnTriangulation.
+  OSD_Parallel::For (0, theModel->FacesNb(), DeflectionEstimator (theModel, theParameters), !theParameters.InParallel);
   return Standard_True;
 }
index 07f080d20d80e92225e7298dacd938e53f96b59b..8fdd1335776739afd08008c98e841acd9f04c7d9 100644 (file)
@@ -23,6 +23,7 @@
 #include <IMeshData_PCurve.hxx>
 #include <OSD_Parallel.hxx>
 #include <BRepMesh_ConeRangeSplitter.hxx>
+#include <Poly_TriangulationParameters.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_ModelPreProcessor, IMeshTools_ModelAlgo)
 
@@ -55,8 +56,15 @@ namespace
 
       if (!aTriangulation.IsNull())
       {
+        // If there is an info about initial parameters, use it due to deflection kept
+        // by Poly_Triangulation is generally an estimation upon generated mesh and can
+        // be either less or even greater than specified value.
+        const Handle(Poly_TriangulationParameters)& aSourceParams = aTriangulation->Parameters();
+        const Standard_Real aDeflection = (!aSourceParams.IsNull() && aSourceParams->HasDeflection()) ?
+          aSourceParams->Deflection() : aTriangulation->Deflection();
+
         Standard_Boolean isTriangulationConsistent = 
-          BRepMesh_Deflection::IsConsistent (aTriangulation->Deflection(),
+          BRepMesh_Deflection::IsConsistent (aDeflection,
                                              aDFace->GetDeflection(),
                                              myAllowQualityDecrease);
 
index 32383f29d6fb26e73db622c8651bd9633bb5ee55..ca4cdf3de8a1e581a5e1cd5e9fbe56bfc3e4a830 100755 (executable)
@@ -29,5 +29,7 @@ Poly_Polygon3D.hxx
 Poly_PolygonOnTriangulation.cxx
 Poly_PolygonOnTriangulation.hxx
 Poly_Triangle.hxx
+Poly_TriangulationParameters.hxx
+Poly_TriangulationParameters.cxx
 Poly_Triangulation.cxx
 Poly_Triangulation.hxx
index ae976947f488f5cba72a8796cf3033002605fb96..28a26dec71e0202b146be27284480dc973fbfa86 100644 (file)
@@ -29,6 +29,8 @@
 
 class OSD_FileSystem;
 class Poly_Triangulation;
+class Poly_TriangulationParameters;
+
 DEFINE_STANDARD_HANDLE(Poly_Triangulation, Standard_Transient)
 
 //! Provides a triangulation for a surface, a set of surfaces, or
@@ -107,6 +109,12 @@ public:
   //! See more on deflection in Polygon2D
   void Deflection (const Standard_Real theDeflection) { myDeflection = theDeflection; }
 
+  //! Returns initial set of parameters used to generate this triangulation.
+  const Handle(Poly_TriangulationParameters)& Parameters() const { return myParams; }
+
+  //! Updates initial set of parameters used to generate this triangulation.
+  void Parameters (const Handle(Poly_TriangulationParameters)& theParams) { myParams = theParams; }
+
   //! Clears internal arrays of nodes and all attributes.
   Standard_EXPORT virtual void Clear();
 
@@ -378,6 +386,7 @@ protected:
   NCollection_Array1<gp_Vec3f> myNormals;
   Poly_MeshPurpose             myPurpose;
 
+  Handle(Poly_TriangulationParameters) myParams;
 };
 
 #endif // _Poly_Triangulation_HeaderFile
diff --git a/src/Poly/Poly_TriangulationParameters.cxx b/src/Poly/Poly_TriangulationParameters.cxx
new file mode 100644 (file)
index 0000000..55b7ec0
--- /dev/null
@@ -0,0 +1,18 @@
+// Created on: 2021-07-20
+// Copyright (c) 2021 OPEN CASCADE SAS
+// Created by: Oleg AGASHIN
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <Poly_TriangulationParameters.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT (Poly_TriangulationParameters, Standard_Transient)
diff --git a/src/Poly/Poly_TriangulationParameters.hxx b/src/Poly/Poly_TriangulationParameters.hxx
new file mode 100644 (file)
index 0000000..176d0ab
--- /dev/null
@@ -0,0 +1,93 @@
+// Created on: 2021-07-20
+// Copyright (c) 2021 OPEN CASCADE SAS
+// Created by: Oleg AGASHIN
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _Poly_TriangulationParameters_HeaderFile
+#define _Poly_TriangulationParameters_HeaderFile
+
+#include <Standard_Transient.hxx>
+#include <Standard_DefineHandle.hxx>
+
+//! Represents initial set of parameters triangulation is built for.
+class Poly_TriangulationParameters : public Standard_Transient
+{
+public:
+
+  //! Constructor.
+  //! Initializes object with the given parameters.
+  //! @param theDeflection linear deflection
+  //! @param theAngle angular deflection
+  //! @param theMinSize minimum size
+  Poly_TriangulationParameters (const Standard_Real theDeflection = -1.,
+                                const Standard_Real theAngle      = -1.,
+                                const Standard_Real theMinSize    = -1.)
+    : myDeflection (theDeflection)
+    , myAngle      (theAngle)
+    , myMinSize    (theMinSize)
+  {
+  }
+
+  //! Destructor.
+  virtual ~Poly_TriangulationParameters()
+  {
+  }
+
+  //! Returns true if linear deflection is defined.
+  Standard_Boolean HasDeflection() const
+  {
+    return !(myDeflection < 0.);
+  }
+
+  //! Returns true if angular deflection is defined.
+  Standard_Boolean HasAngle() const
+  {
+    return !(myAngle < 0.);
+  }
+
+  //! Returns true if minimum size is defined.
+  Standard_Boolean HasMinSize() const
+  {
+    return !(myMinSize < 0.);
+  }
+
+  //! Returns linear deflection or -1 if undefined.
+  Standard_Real Deflection() const
+  {
+    return myDeflection;
+  }
+
+  //! Returns angular deflection or -1 if undefined.
+  Standard_Real Angle() const
+  {
+    return myAngle;
+  }
+
+  //! Returns minimum size or -1 if undefined.
+  Standard_Real MinSize() const
+  {
+    return myMinSize;
+  }
+
+  DEFINE_STANDARD_RTTIEXT (Poly_TriangulationParameters, Standard_Transient)
+
+private:
+
+  Standard_Real myDeflection;
+  Standard_Real myAngle;
+  Standard_Real myMinSize;
+};
+
+DEFINE_STANDARD_HANDLE (Poly_TriangulationParameters, Standard_Transient)
+
+#endif
index 9e10697c170d4ee66acd09c88512d683591f32d1..b75e5f953177cd378795bfef166e9218c06e0a36 100644 (file)
@@ -268,7 +268,7 @@ unifysamedom r res
 incmesh r 0.1
 trinfo r
 
-checktrinfo r -defl 0.1 -tol_abs_defl 0.01 -tol_rel_defl 0.01
+checktrinfo r -defl 0.049761016978299343 -tol_abs_defl 0.01 -tol_rel_defl 0.01
 
 vinit
 vsetdispmode 1
index 3ae04b10b1ef523b4524ff53c8e73d7994005208..f0ace0936c47e9670e4e9c3a9e0c72947142e6ff 100644 (file)
@@ -20,7 +20,7 @@ regexp {([0-9]+) triangles} $trinfo_r str nbtri_r
 
 
 # check deflections
-checktrinfo s -tri -defl 0.001 -tol_abs_defl 1e-6
+checktrinfo s -tri -defl 0.00072921907260989653 -tol_abs_defl 1e-6
 checktrinfo r -tri -max_defl 0.001 -tol_abs_defl 1e-6
 
 # compare number of triangles, allow twice more
index 2a730295c75254d790042e2844d79dd34101525f..8d211a82e9092530353648cf627a563203899119 100755 (executable)
@@ -10,4 +10,4 @@ restore [locate_data_file bug23105_f372.brep] result
 checkshape result
 
 incmesh result 0.1
-checktrinfo result -tri -defl 0.1 -tol_abs_defl 1e-6
+checktrinfo result -tri -defl 1.6315061764065284 -tol_abs_defl 1e-6
index fa1c1aa12f03be56ee7404165ca50ecd5a6164f9..c1e0a1005959b72e6b3f8ac75460bab031cb88d2 100644 (file)
@@ -12,7 +12,7 @@ vfit
  
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
 
-checktrinfo result -tri 62936 -nod 31509 -defl 0.00096399964870812682
+checktrinfo result -tri 62936 -nod 31509 -defl 0.01006437767331419 -tol_abs_defl 1e-6
 
 set log [tricheck result]
 if { [llength $log] != 0 } {
index 88c9adefb95e85d1c21cdde033363d257ada1cb2..430d1158f291e6204087d510cb3a7e0364ce5641 100755 (executable)
@@ -14,7 +14,7 @@ incmesh f 1
 
 trinfo f
 
-checktrinfo f -tri 20 -nod 21 -defl 0.3345840532742983 -tol_abs_defl 1.e-3 -tol_rel_defl 0.01
+checktrinfo f -tri 20 -nod 21 -defl 0.70238336519888955 -tol_abs_defl 1.e-3 -tol_rel_defl 0.01
 
 vinit
 vdisplay f
index 6e692c6d5e101534c0fadad8b3fac7170d2fb71f..157a898aad146f874347a0bb381f645154f81b52 100644 (file)
@@ -10,7 +10,7 @@ restore [locate_data_file bug24938_27773.brep] result
 tclean result
 incmesh result 1.5 -relative
 
-checktrinfo result -tri 8 -nod 10 -defl 3.1950444624834377e-05
+checktrinfo result -tri 8 -nod 10 -defl 3.3489133970888776e-05 -tol_abs_defl 1e-6
 
 vinit
 vsetdispmode 1
index b44908d565ab478c1766225b869014493a1c2ff7..8f53da4b87653bf50e2d31e242ee3c617f6cf153 100644 (file)
@@ -14,7 +14,7 @@ vviewparams -scale 1.81755 -proj 0.88572 0.104526 0.452299 -up -0.0339444 0.9862
  
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
 
-checktrinfo result -tri 957 -nod 558 -defl 50.000000020000009
+checktrinfo result -tri 957 -nod 558 -defl 1.1088499641289298 -tol_abs_defl 1e-6
 
 set log [tricheck result]
 if { [llength $log] != 0 } {
index e39394046691c69201caee281592164602bbd104..5b51eeeb95da63b2d59b627274e88a39186b9db1 100644 (file)
@@ -11,7 +11,7 @@ renamevar a_1 result
 
 incmesh result 0.0001 -a 30 -force_face_def -parallel
 
-checktrinfo result -tri 13854 -nod 9190 -defl 0.00012495021746395917
+checktrinfo result -tri 13854 -nod 9190 -defl 0.00028360162213471898 -tol_abs_defl 1e-6
 
 vinit
 vsetdispmode 1
index f0cbe48aaad98a18f1d09cd1b5026453601d24eb..60f9a6e77d3b06617191f602cba6d90435bb36ae 100755 (executable)
@@ -15,5 +15,5 @@ fit
 isos a 0
 triangles a
 
-checktrinfo a -tri 2971 -nod 1592 -defl 0.091190343620839553 -tol_rel_defl 0.05 -tol_rel_tri 0.05 -tol_rel_nod 0.05
+checktrinfo a -tri 2971 -nod 1592 -defl 0.25443792426360728 -tol_rel_defl 0.05 -tol_rel_tri 0.05 -tol_rel_nod 0.05
 checkview -screenshot -2d -path ${imagedir}/${test_image}.png
index 930af5450e8fd6c5ceff258c996f22bb0ed1a9cb..f82d6fd73cddbb3ca12263452442a55a64c9bfbf 100644 (file)
@@ -15,7 +15,7 @@ incmesh f 0.01 -a 90
 isos f 0
 triangles f
 
-checktrinfo f -tri 2220 -nod 1232 -defl 0.0093553610383019445
+checktrinfo f -tri 2220 -nod 1232 -defl 0.0099011902071009586 -tol_abs_defl 1e-6
 smallview +X+Y
 fit
 checkview -screenshot -2d -path ${imagedir}/${test_image}.png
index d10d88b6e57aed95bb2a7e04f2855a434bb642e3..ce91dc3ea4e5aea117df8db78a28c3e45bf21d78 100644 (file)
@@ -14,7 +14,7 @@ vdisplay result
 vfit 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
 
-checktrinfo result -tri 3006 -nod 4360 -defl 10
+checktrinfo result -tri 3006 -nod 4360 -defl 3.0544822246414993 -tol_abs_defl 1e-6
 
 set log [tricheck result]
 if { [llength $log] != 0 } {
index 9ceba0b4433b0b37cca1307e8f7bc445abb93e2a..dacd0d686cc492ff7999d96687afc00abc9c632b 100644 (file)
@@ -7,7 +7,7 @@ restore [locate_data_file bug29149.brep] result
 tclean result
 incmesh result 0.1
 
-checktrinfo result -tri 7998 -nod 4931 -defl 1.2277233425620309
+checktrinfo result -tri 7998 -nod 4931 -defl 1.9852316024615062 -tol_abs_defl 1e-6
 
 # Reduce shape tolerance in order to hard check of mesh quality
 settolerance result 1.0e-7
index 74ae63ffd2e341cb69d0be4624c6053033c6d75d..b4ec9dab66553fdc44a40d13ec445b646a8e31af 100644 (file)
@@ -14,7 +14,7 @@ vviewparams -scale 67.9853 -proj 0.680425 -0.732509 -0.0212714 -up -0.0316277 -0
  
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
 
-checktrinfo result -tri 8 -nod 10 -defl 6.8481042509220045e-05
+checktrinfo result -tri 8 -nod 10 -defl 0.16816650423537197 -tol_abs_defl 1e-6
 
 set log [tricheck result]
 if { [llength $log] != 0 } {
index a4b37b589961c9efbe554eaf8ca0a9fb94676522..a8cfc3e5a3648cf6065dc875960028b05a1a8d63 100644 (file)
@@ -16,6 +16,6 @@ if { [llength $log] != 0 } {
   puts "Mesh is OK"
 }
 
-checktrinfo result -tri 148 -nod 103 -defl 0.27179801813852145
+checktrinfo result -tri 148 -nod 103 -defl 0.34778084099529977 -tol_abs_defl 1e-6
 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index ac02e7d46bca174e27163f01fe971745167e34b3..50395c96d14509b96c39e61903eebdf97a4fb0cc 100644 (file)
@@ -25,6 +25,6 @@ if { [llength $log] != 0 } {
   puts "Mesh is OK"
 }
 
-checktrinfo result -tri 1013 -nod 578 -defl 0.1
+checktrinfo result -tri 1013 -nod 578 -defl 0.1164052220738387 -tol_abs_defl 1e-6
 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 19f65eb8ce293e37b6983cdb14a593efd8b4c532..be507083ddc3761c156a12c53eee63d3ea16317a 100644 (file)
@@ -15,7 +15,7 @@ if { [llength $log1] != 0 } {
   puts "Mesh is OK"
 }
 
-checktrinfo result -tri 2 -nod 4 -defl 0.0
+checktrinfo result -tri 2 -nod 4 -defl 5.5579174982152475 -tol_abs_defl 1e-6
 
 tclean result
 incmesh result 0.01
@@ -27,7 +27,7 @@ if { [llength $log2] != 0 } {
   puts "Mesh is OK"
 }
 
-checktrinfo result -tri 78200 -nod 39103 -defl 0.035123046705520911
+checktrinfo result -tri 78200 -nod 39103 -defl 5.8003351598212323 -tol_abs_defl 1e-6
 
 don result
 isos result 0
index 1143910dad6c137e9df795dae2554758b9d80831..16804a4c3d0239ed307dfebb37e69a874d3d5c05 100644 (file)
@@ -12,6 +12,6 @@ vdisplay result
 vviewparams -scale 8.46292 -proj 0.653203 -0.644806 0.396926 -up -0.0109833 0.51609 0.856464 -at 347.559 1026.89 219.262 -eye 2080.75 -684.022 1272.45
 
 tricheck result
-checktrinfo result -tri 6978 -nod 4890 -defl 7.6167024939147652
+checktrinfo result -tri 6978 -nod 4890 -defl 8.4394056682382157 -tol_abs_defl 1e-6
 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 4c2467a352b21159f61a753648fdd4d61a34d165..7a57ceff91356788600f23af6eebeaa32a6db8b1 100644 (file)
@@ -19,7 +19,7 @@ nurbsconvert result result
 incmesh result 0.15 -a 20
 
 tricheck result
-checktrinfo result -tri 191 -nod 146 -defl 0.0362596 -tol_abs_defl 1.0e-6
+checktrinfo result -tri 191 -nod 146 -defl 0.052300780129031083 -tol_abs_defl 1.0e-6
 
 vinit
 
index 4fd42ad6e5e3923070ad8dff2f8fe7ac313fb3eb..74edff3f44e61476de7ff06cf37fdbd588fa3ad2 100644 (file)
@@ -12,6 +12,6 @@ vdisplay result
 vfit
 
 tricheck result
-checktrinfo result -tri 3424 -nod 1801 -max_defl 0.52
+checktrinfo result -tri 3424 -nod 1801 -max_defl 0.55846824898476011 -tol_abs_defl 1.0e-6
 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 2ef84b14ebcbff65cca856f99ac1e73f9ed92cb7..923d621ba884b27035fdab58ce396fa374d463f0 100644 (file)
@@ -15,7 +15,7 @@ vdefaults -autoTriang 0
 
 tclean result
 incmesh result 0.004 -a 14
-checktrinfo result -tri 70556 -nod 39944 -defl 0.22962869401103247
+checktrinfo result -tri 70556 -nod 39944 -defl 0.24607185555570676 -tol_abs_defl 1e-6
 
 vdisplay result -redisplay
 vfit
@@ -23,7 +23,7 @@ checkview -screenshot -3d -path ${imagedir}/${test_image}_default.png
 
 tclean result
 incmesh result 0.004 -a 14 -force_face_def
-checktrinfo result -tri 292556 -nod 150944 -defl 0.04579460790575135
+checktrinfo result -tri 292556 -nod 150944 -defl 0.16388671063364907 -tol_abs_defl 1e-6
 
 vdisplay result -redisplay
 vfit
diff --git a/tests/bugs/mesh/bug32471 b/tests/bugs/mesh/bug32471
new file mode 100644 (file)
index 0000000..520a7d5
--- /dev/null
@@ -0,0 +1,17 @@
+puts "======="
+puts "0032471: Mesh - Deflection of the triangulation is not recomputed for planar face"
+puts "======="
+puts ""
+
+restore [locate_data_file bug32471.brep] result
+
+incmesh result 0.01
+
+checktrinfo result -tri 2 -nod 4 -defl 0 -tol_rel_defl 1e-7
+
+vinit
+vdefaults -autoTriang 0
+vsetdispmode 1
+vdisplay result
+vfit
+checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 4ea7a145c93b5876c26311b875e8a45e12f3396e..4474ff3231faed2df77d4852de40689fbde8663b 100755 (executable)
@@ -14,5 +14,5 @@ tclean result
 set Deflection 1.
 catch {incmesh result ${Deflection} }
 
-checktrinfo result -tri 52956 -nod 46525 -defl 1.0 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
+checktrinfo result -tri 52956 -nod 46525 -defl 1.2592398118022043 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 87c92141483f3aca2ce0714a92039107b5ab2e31..606762befae6c11c5092039dee591fe91144266b 100755 (executable)
@@ -15,7 +15,7 @@ tclean result
 set Deflection 0.1
 catch {incmesh result ${Deflection} }
 
-checktrinfo result -tri 4204 -nod 4206 -defl 1.9388020580310417e-07 -tol_rel_defl 0.1 -tol_rel_tri 0.001 -tol_rel_nod 0.001
+checktrinfo result -tri 4204 -nod 4206 -defl 2.3419011146460291e-07 -tol_rel_defl 0.1 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 checkprops result -s 275.426
 checknbshapes result -vertex 964 -edge 964 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 1931
 
index f03ac3e0a1716b362f10c86df115b8b8a043f08d..e4f497619332e7d031f2d6bcde73869e0a1c12c6 100755 (executable)
@@ -19,7 +19,7 @@ tclean result
 set Deflection 0.001
 incmesh result ${Deflection}
 
-checktrinfo result -tri 375392 -nod 190670 -defl 0.0092442421472206764 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
+checktrinfo result -tri 375392 -nod 190670 -defl 0.080199363667810539 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 
 vinit
 vdisplay result
index 374c582a90789524fb2fbb56a81a5ac509f07e81..ff1465e669072c37f569049f000446035b4207cd 100644 (file)
@@ -10,7 +10,7 @@ bsplinesurf s 2 12 0.0 3 0.1 1 0.2 1 0.3 1 0.4 1 0.5 1 0.525 1 0.55 1 0.575 1 0.
 mkface result s
 incmesh result 1
 
-checktrinfo result -max_defl 1
+checktrinfo result -max_defl 2.4039063417856825 -tol_abs_defl 1e-6
 
 vdisplay result
 vsetdispmode 1
index e9f18e1fd6dfaaeed30d0de222463ab0a4245ff8..469d504d1221db6a8ee9157d308e057b9352209f 100644 (file)
@@ -9,7 +9,7 @@ dchrono t restart
 incmesh result 0.1
 dchrono t stop counter MeshBug23795
 
-checktrinfo result -tri 10992 -nod 11016 -defl 0.1
+checktrinfo result -tri 10992 -nod 11016 -defl 0.99900001814148409 -tol_abs_defl 1e-6
 
 vinit
 vdefaults -autoTriang 0
index 10b03c6a373c750044859235d050799fee974ffa..6d358fdb491ee1350f7c7ca31ee62ee7ea20afa1 100644 (file)
@@ -11,7 +11,7 @@ dchrono t restart
 incmesh a_1 0.01 1
 dchrono t stop counter incmesh
 
-checktrinfo a_1 -tri 525271 -nod 263456 -defl 0.081028355715069861
+checktrinfo a_1 -tri 525271 -nod 263456 -defl 0.069482224632795617 -tol_abs_defl 1e-6
 
 set log [tricheck a_1]
 if { [llength $log] != 0 } {
index 878f636c123c758763d90528e39d20689023f6b8..d1ae16a3454fbc43c6e4537ddb43fa5059852d27 100644 (file)
@@ -11,7 +11,7 @@ dchrono t restart
 incmesh a_1 0.1 1
 dchrono t stop counter incmesh
 
-checktrinfo a_1 -tri 68779 -nod 34737 -defl 0.11671770612283024
+checktrinfo a_1 -tri 68779 -nod 34737 -defl 0.24900556935704937 -tol_abs_defl 1e-6
 
 set log [tricheck a_1]
 if { [llength $log] != 0 } {
index d4525bb9b3e9ed29e27c701e0c4f91d6d2244c7d..e87d2483e9e308372e72cc22bb0dfbbef790d44a 100644 (file)
@@ -11,7 +11,7 @@ dchrono t restart
 incmesh a_1 1.0 1
 dchrono t stop counter incmesh
 
-checktrinfo a_1 -tri 12469 -nod 6503 -defl 1.0
+checktrinfo a_1 -tri 12469 -nod 6503 -defl 1.2783003174746328 -tol_abs_defl 1e-6
 
 set log [tricheck a_1]
 if { [llength $log] != 0 } {
index 8203f5ed545b920dcb33e9e2b0312593bce3b495..6adc45da7c5ede06e47463b403f7c2b8361afbbc 100644 (file)
@@ -16,4 +16,4 @@ dchrono h
 vfit
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
 
-checktrinfo a -tri 14764 -nod 7587 -defl 0.098772787476728782
\ No newline at end of file
+checktrinfo a -tri 14764 -nod 7587 -defl 0.29573935005082458 -tol_abs_defl 1e-6
index 853cdadd2d556bbcbfd24e01a264cba044f5a530..bb10a30d10d516417cca79ba3553041ca43e6e89 100644 (file)
@@ -25,7 +25,7 @@ regexp { deflection +([-0-9.+eE]+)} $tri_info full def
 
 set ref_tri 7857
 set ref_nod 7859
-set ref_def 1e-5
+set ref_def 1.5252689837551246e-12
 set tol_rel 0.01
 
 # Computes deviation of the value from specified one
index a82b3f2c1683768feeae8aef30703c70a4816ecc..69fc64e2399ff59f62735dde84de12d82c6e0108 100644 (file)
@@ -7,6 +7,10 @@ vinit View1
 BUC60857
 vfit
 
+sewing BUC60857_BLUE  1e-7 BUC60857_BLUE
+sewing BUC60857_RED   1e-7 BUC60857_RED
+sewing BUC60857_GREEN 1e-7 BUC60857_GREEN
+
 set Property_BLUE [sprops BUC60857_BLUE]
 set area_BLUE [lindex ${Property_BLUE} 2]