From 4c6b1fcd7cb67fe285fefa0a06fee9ebadd82ad9 Mon Sep 17 00:00:00 2001 From: oan Date: Sat, 19 Oct 2019 19:07:14 +0300 Subject: [PATCH] # generate number of points according to the specified minimum value --- src/GCPnts/GCPnts_TangentialDeflection.pxx | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/GCPnts/GCPnts_TangentialDeflection.pxx b/src/GCPnts/GCPnts_TangentialDeflection.pxx index c32e4a0808..f6476bab5e 100644 --- a/src/GCPnts/GCPnts_TangentialDeflection.pxx +++ b/src/GCPnts/GCPnts_TangentialDeflection.pxx @@ -196,10 +196,12 @@ void GCPnts_TangentialDeflection::PerformLinear (const TheCurve& C) { D0 (C, firstu, P); parameters.Append (firstu); points .Append (P); - if (minNbPnts > 2) { + if (minNbPnts > 2) + { Standard_Real Du = (lastu - firstu) / minNbPnts; Standard_Real U = firstu + Du; - for (Standard_Integer i = 2; i <= minNbPnts; i++) { + for (Standard_Integer i = 2; i < minNbPnts; i++) + { D0 (C, U, P); parameters.Append (U); points .Append (P); @@ -226,7 +228,7 @@ void GCPnts_TangentialDeflection::PerformCircular (const TheCurve& C) const Standard_Real aDiff = lastu - firstu; // Round up number of points to satisfy curvatureDeflection more precisely Standard_Integer NbPoints = (Standard_Integer)Min(Ceiling(aDiff / Du), 1.0e+6); - NbPoints = Max(NbPoints, minNbPnts - 1); + NbPoints = Max(NbPoints, minNbPnts) - 1; Du = aDiff / NbPoints; gp_Pnt P; @@ -571,14 +573,14 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C) //-- On rajoute des points aux milieux des segments si le nombre //-- mini de points n'est pas atteint //-- - Standard_Integer Nbp = points.Length(); - Standard_Integer MinNb= (9*minNbPnts)/10; - //if(MinNb<4) MinNb=4; - - //-- if(Nbp < MinNb) { cout<<"\n*"; } else { cout<<"\n."; } - while(Nbp < MinNb) { - //-- cout<<" \nGCPnts TangentialDeflection : Ajout de Points ("<