Changeset 97:c5242c8527b7 in rrlib_geometry


Ignore:
Timestamp:
01.10.2020 12:45:42 (2 months ago)
Author:
Tobias Föhst <foehst@…>
Branch:
14.08
Children:
98:9e58ddff5d59, 99:25f6b5cb56d5, 100:dd8f739121ee
Phase:
public
Message:

Using a non-normalized knot vector to avoid numerical issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • curves/tBSplineCurve.hpp

    r96 r97  
    151151    { 
    152152      // inner knot vector (uniform) 
    153       this->knots.push_back(1.0 / (this->NumberOfControlPoints() - Tdegree) * (i - Tdegree)); 
     153      this->knots.push_back(i - Tdegree); 
    154154    } 
    155155    else if (i > cNUMBER_OF_CONTROL_POINTS) 
    156156    { 
    157       this->knots.push_back(1.0); 
     157      this->knots.push_back(this->knots.back()); 
    158158    } 
    159159  } 
     
    247247unsigned int tBSplineCurve<Tdimension, TElement, Tdegree>::GetSegmentForParameter(typename tSplineCurve::tParameter t) const 
    248248{ 
    249   t /= this->NumberOfSegments() + this->knots.front() * (this->knots.back() - this->knots.front()); 
    250249  assert((this->Knots().front() <= t) && (t <= this->Knots().back())); 
    251250  assert(this->NumberOfSegments() > 0); 
     
    272271typename tSplineCurve<Tdimension, TElement, Tdegree>::tParameter tBSplineCurve<Tdimension, TElement, Tdegree>::GetLocalParameter(typename tSplineCurve::tParameter t) const 
    273272{ 
    274   t /= this->NumberOfSegments() + this->knots.front() * (this->knots.back() - this->knots.front()); 
    275273  assert((this->Knots().front() <= t) && (t <= this->Knots().back())); 
    276274  assert(this->NumberOfSegments() > 0); 
Note: See TracChangeset for help on using the changeset viewer.