From 35df88a593acbf196981c3a85b96c533a868708a Mon Sep 17 00:00:00 2001 From: Dzmitry Razmyslovich Date: Sat, 27 Mar 2021 19:38:16 +0100 Subject: [PATCH] 0032253: Fix the incorrect parameters for end points - get parameters directly from curve instead of relying on the parameter provider --- src/BRepMesh/BRepMesh_EdgeDiscret.cxx | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) 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); + } } } -- 2.39.5