]> OCCT Git - occt-copy.git/commitdiff
0032253: Fix the incorrect parameters for end points - get parameters directly from... CR0032253
authorDzmitry Razmyslovich <razmyslovich@volumegraphics.com>
Sat, 27 Mar 2021 18:38:16 +0000 (19:38 +0100)
committerDzmitry Razmyslovich <razmyslovich@volumegraphics.com>
Sat, 27 Mar 2021 18:38:16 +0000 (19:38 +0100)
src/BRepMesh/BRepMesh_EdgeDiscret.cxx

index 6fe4463fb462abe3576d384ee7b8bb8be3679bf9..bee0f4283aa683a009d395676ae8f2b9eb6bb25f 100644 (file)
@@ -310,19 +310,17 @@ void BRepMesh_EdgeDiscret::Tessellate2d(
 
     const Handle(Adaptor2d_Curve2d)& aGeomPCurve = aProvider.GetPCurve();
 
-    Standard_Integer aParamIdx, aParamNb;
     if (theUpdateEnds)
     {
-      aParamIdx = 0;
-      aParamNb  = aCurve->ParametersNb();
-    }
-    else
-    {
-      aParamIdx = 1;
-      aParamNb  = aCurve->ParametersNb() - 1;
+      const Standard_Real aParam = aCurve->GetParameter(0);
+
+      gp_Pnt2d aPoint2d;
+      aGeomPCurve->D0(aParam, aPoint2d);
+
+      aPCurve->AddPoint(aPoint2d, aParam);
     }
 
-    for (; aParamIdx < aParamNb; ++aParamIdx)
+    for (Standard_Integer aParamIdx = 1; aParamIdx < aCurve->ParametersNb() - 1; ++aParamIdx)
     {
       const Standard_Real aParam = aProvider.Parameter(aParamIdx, aCurve->GetPoint(aParamIdx));
 
@@ -337,5 +335,15 @@ void BRepMesh_EdgeDiscret::Tessellate2d(
         aPCurve->InsertPoint(aPCurve->ParametersNb() - 1, aPoint2d, aParam);
       }
     }
+
+    if (theUpdateEnds)
+    {
+      const Standard_Real aParam = aCurve->GetParameter(aCurve->ParametersNb() - 1);
+
+      gp_Pnt2d aPoint2d;
+      aGeomPCurve->D0(aParam, aPoint2d);
+
+      aPCurve->AddPoint(aPoint2d, aParam);
+    }
   }
 }