]> OCCT Git - occt.git/commitdiff
SENR-22-107 "Visualization - Isoparametric lines rendered out of a face"
authormzernova <mzernova@opencascade.com>
Wed, 7 Dec 2022 07:15:54 +0000 (07:15 +0000)
committermzernova <mzernova@opencascade.com>
Wed, 7 Dec 2022 07:19:11 +0000 (07:19 +0000)
src/StdPrs/StdPrs_Isolines.cxx

index 6df065af5de932edaa3c7e57700aa0b464e15d0e..3b5f93369ccd0eaf8f7309905f58f65bb02dd6e6 100644 (file)
@@ -370,12 +370,12 @@ void StdPrs_Isolines::addOnSurface (const Handle(BRepAdaptor_HSurface)& theSurfa
                                     Prs3d_NListOfSequenceOfPnt&         theVPolylines)
 {
   // Choose a deflection for sampling edge uv curves.
-  Standard_Real aUVLimit = theDrawer->MaximalParameterValue();
-  Standard_Real aUmin  = Max (theSurface->FirstUParameter(), -aUVLimit);
-  Standard_Real aUmax  = Min (theSurface->LastUParameter(),   aUVLimit);
-  Standard_Real aVmin  = Max (theSurface->FirstVParameter(), -aUVLimit);
-  Standard_Real aVmax  = Min (theSurface->LastVParameter(),   aUVLimit);
-  Standard_Real aSamplerDeflection = Max (aUmax - aUmin, aVmax - aVmin) * theDrawer->DeviationCoefficient();
+  const Standard_Real aUVLimit = theDrawer->MaximalParameterValue();
+  const Standard_Real aUmin  = Max (theSurface->FirstUParameter(), -aUVLimit);
+  const Standard_Real aUmax  = Min (theSurface->LastUParameter(),   aUVLimit);
+  const Standard_Real aVmin  = Max (theSurface->FirstVParameter(), -aUVLimit);
+  const Standard_Real aVmax  = Min (theSurface->LastVParameter(),   aUVLimit);
+  const Standard_Real aSamplerDeflection = Max (aUmax - aUmin, aVmax - aVmin) * theDrawer->DeviationCoefficient();
   Standard_Real aHatchingTolerance = RealLast();
 
   try
@@ -515,12 +515,10 @@ void StdPrs_Isolines::addOnSurface (const Handle(BRepAdaptor_HSurface)& theSurfa
         Standard_Real aSegmentP1 = aHatcher.Start (anI, aJ);
         Standard_Real aSegmentP2 = aHatcher.End (anI, aJ);
 
-        if (!aBSurface.IsNull())
+        if (aBSurface.IsNull())
         {
-          aBSurfaceCurve.Load (isIsoU ? aBSurface->UIso (anIsoParam) : aBSurface->VIso (anIsoParam));
-
-          findLimits (aBSurfaceCurve, aUVLimit, aSegmentP1, aSegmentP2);
-
+          aCanonicalCurve.Load (isIsoU ? GeomAbs_IsoU : GeomAbs_IsoV, anIsoParam, aSegmentP1, aSegmentP2);
+          findLimits (aCanonicalCurve, aUVLimit, aSegmentP1, aSegmentP2);
           if (aSegmentP2 - aSegmentP1 <= Precision::Confusion())
           {
             continue;
@@ -528,17 +526,23 @@ void StdPrs_Isolines::addOnSurface (const Handle(BRepAdaptor_HSurface)& theSurfa
         }
         else
         {
-          aCanonicalCurve.Load (isIsoU ? GeomAbs_IsoU : GeomAbs_IsoV, anIsoParam, aSegmentP1, aSegmentP2);
-
-          findLimits (aCanonicalCurve, aUVLimit, aSegmentP1, aSegmentP2);
-
+          if (isIsoU)
+          {
+            aBSurfaceCurve.Load (aBSurface->UIso (anIsoParam), aVmin, aVmax);
+          }
+          else
+          {
+            aBSurfaceCurve.Load (aBSurface->VIso (anIsoParam), aUmin, aUmax);
+          }
+          findLimits (aBSurfaceCurve, aUVLimit, aSegmentP1, aSegmentP2);
           if (aSegmentP2 - aSegmentP1 <= Precision::Confusion())
           {
             continue;
           }
         }
-        Adaptor3d_Curve* aCurve = aBSurface.IsNull() ? (Adaptor3d_Curve*) &aCanonicalCurve
-          : (Adaptor3d_Curve*) &aBSurfaceCurve;
+        Adaptor3d_Curve* aCurve = aBSurface.IsNull()
+                                ? (Adaptor3d_Curve*) &aCanonicalCurve
+                                : (Adaptor3d_Curve*) &aBSurfaceCurve;
 
         Handle(TColgp_HSequenceOfPnt) aPoints = new TColgp_HSequenceOfPnt();
         StdPrs_DeflectionCurve::Add (Handle(Prs3d_Presentation)(),