From: Dzmitry Razmyslovich Date: Sat, 27 Mar 2021 18:38:16 +0000 (+0100) Subject: 0032253: Fix the incorrect parameters for end points - get parameters directly from... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR0032253;p=occt-copy.git 0032253: Fix the incorrect parameters for end points - get parameters directly from curve instead of relying on the parameter provider --- diff --git a/src/BRepMesh/BRepMesh_EdgeDiscret.cxx b/src/BRepMesh/BRepMesh_EdgeDiscret.cxx index 6fe4463fb4..bee0f4283a 100644 --- a/src/BRepMesh/BRepMesh_EdgeDiscret.cxx +++ b/src/BRepMesh/BRepMesh_EdgeDiscret.cxx @@ -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); + } } }