- double dU = Ul - *itU; // parametric length of the last but one segment
- double dUn = dLn * ( Un - U1 ) / length; // modificator of the last parameter
- if ( dUn < 0.5 * dU ) { // last segment is a bit shorter than dU
+ double dU = Abs( Ul - *itU ); // parametric length of the last but one segment
+ double dUn = dLn * Abs( Un - U1 ) / length; // parametric error of <an>
+ if ( dUn < 0.5 * dU ) { // last segment is a bit shorter than it should
- else { // last segment is much shorter than dU -> remove the last param and
- theParams.pop_back(); // move the rest points toward the edge end
+ else { // last segment is much shorter than it should -> remove the last param and
+ theParams.pop_back(); nPar--; // move the rest points toward the edge end
double q = dUn / ( nPar - 1 );
for ( itU = theParams.rbegin(), i = 1; i < nPar; itU++, i++ ) {
(*itU) += dUn;
double q = dUn / ( nPar - 1 );
for ( itU = theParams.rbegin(), i = 1; i < nPar; itU++, i++ ) {
(*itU) += dUn;
int i, NbPoints = 1 + (int) _value[ NB_SEGMENTS_IND ];
for ( i = 2; i < NbPoints; i++ )
{
int i, NbPoints = 1 + (int) _value[ NB_SEGMENTS_IND ];
for ( i = 2; i < NbPoints; i++ )
{
- double a1 = theReverse ? _value[ END_LENGTH_IND ] : _value[ BEG_LENGTH_IND ];
- double an = theReverse ? _value[ BEG_LENGTH_IND ] : _value[ END_LENGTH_IND ];
+ double a1 = _value[ BEG_LENGTH_IND ];
+ double an = _value[ END_LENGTH_IND ];
- double U1 = Min ( f, l );
- double Un = Max ( f, l );
+ double U1 = theReverse ? l : f;
+ double Un = theReverse ? f : l;
while ( 1 ) {
// computes a point on a curve <C3d> at the distance <eltSize>
// from the point of parameter <param>.
GCPnts_AbscissaPoint Discret( C3d, eltSize, param );
if ( !Discret.IsDone() ) break;
param = Discret.Parameter();
while ( 1 ) {
// computes a point on a curve <C3d> at the distance <eltSize>
// from the point of parameter <param>.
GCPnts_AbscissaPoint Discret( C3d, eltSize, param );
if ( !Discret.IsDone() ) break;
param = Discret.Parameter();
- double a1 = theReverse ? _value[ END_LENGTH_IND ] : _value[ BEG_LENGTH_IND ];
- double an = theReverse ? _value[ BEG_LENGTH_IND ] : _value[ END_LENGTH_IND ];
+ double a1 = _value[ BEG_LENGTH_IND ];
+ double an = _value[ END_LENGTH_IND ];
- double U1 = Min ( f, l );
- double Un = Max ( f, l );
+ double U1 = theReverse ? l : f;
+ double Un = theReverse ? f : l;
// computes a point on a curve <C3d> at the distance <eltSize>
// from the point of parameter <param>.
GCPnts_AbscissaPoint Discret( C3d, eltSize, param );
if ( !Discret.IsDone() ) break;
param = Discret.Parameter();
// computes a point on a curve <C3d> at the distance <eltSize>
// from the point of parameter <param>.
GCPnts_AbscissaPoint Discret( C3d, eltSize, param );
if ( !Discret.IsDone() ) break;
param = Discret.Parameter();
}
compensateError( a1, an, U1, Un, length, C3d, theParams );
}
compensateError( a1, an, U1, Un, length, C3d, theParams );