]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
bos #43483 [CEA 42969] Viscous Layers generation issue eksu/43483 59/head
authorEsukhareva <ekaterina.sukhareva@opencascade.com>
Tue, 19 Nov 2024 18:10:56 +0000 (18:10 +0000)
committerEsukhareva <ekaterina.sukhareva@opencascade.com>
Wed, 20 Nov 2024 10:11:11 +0000 (10:11 +0000)
src/StdMeshers/StdMeshers_ViscousLayers2D.cxx

index c25d0d05b4e029e724e2d576444d53d6cfc0041a..e6797ca15a6726ae75b0b26d8195ade2a85df666 100644 (file)
@@ -1867,26 +1867,30 @@ bool _ViscousBuilder2D::shrink()
         Geom2dAdaptor_Curve edgeCurve( pcurve, Min( uf, ul ), Max( uf, ul ));
         Geom2dAdaptor_Curve seg2Curve( seg2Line );
         Geom2dInt_GInter     curveInt( edgeCurve, seg2Curve, 1e-7, 1e-7 );
+
+        // In the older version length2D was set to this value only inside the !convex if block
+        // But it seems that length2D can be set here anyway, because if not set valid value of length2D here,
+        // it will be calculated later using length1D, and it can be not valid in cases if length1D is too large or too small.
+        length2D = L2->_lEdges[iFSeg2]._length2D;
+
+        /*  convex VERTEX
+         *                     L  seg2
+         *                    |  o---o---
+         *                    | /    |
+         *                    |/     |  L2
+         *                    x------x---      */
+        /* concave VERTEX
+         *                     o-----o---
+         *                      \    |
+         *                       \   |  L2
+         *                        x--x---
+         *                       /
+         *                    L /               */
         isConvex = ( curveInt.IsDone() && !curveInt.IsEmpty() );
-        if ( isConvex ) {
-          /*                   convex VERTEX */
+        if ( isConvex )
+        {
           length1D = Abs( u - curveInt.Point( 1 ).ParamOnFirst() );
-          double maxDist2d = 2 * L2->_lEdges[ iLSeg2 ]._length2D;
-          isConvex = ( length1D < maxDist2d * len1dTo2dRatio );
-          /*                                          |L  seg2
-           *                                          |  o---o---
-           *                                          | /    |
-           *                                          |/     |  L2
-           *                                          x------x---      */
-        }
-        if ( !isConvex ) { /* concave VERTEX */   /*  o-----o---
-                                                   *   \    |
-                                                   *    \   |  L2
-                                                   *     x--x---
-                                                   *    /
-                                                   * L /               */
-          length2D = L2->_lEdges[ iFSeg2 ]._length2D;
-          //if ( L2->_advancable ) continue;
+          length2D = Max(length2D, length1D / len1dTo2dRatio);
         }
       }
       else // L2 is advancable but in the face adjacent by L