Saturday, March 22, 2008

API Usage

How do I use the API to write code for dealing with Bezier curves ?

/////////////////////
// Created On: Aug 15 2004
//////////////////////

#include
#include
#include "nbpoint.h"
#include "nbbezier.h"

void printTVal(NBBezier & bez, double tval);
void processBezierCurves();

int main() {
processBezierCurves();
return EXIT_SUCCESS;
}

void processBezierCurves() {
NBPoint pt1(-5, 0);
NBPoint pt2( 0, 5);
NBPoint pt3(10, 0);

VPOINT controlpts;
controlpts.push_back( pt1 );
controlpts.push_back( pt2 );
controlpts.push_back( pt3 );

NBBezier bez(controlpts);
printTVal(bez, 0.25);
printTVal(bez, 0.75);
printTVal(bez, 0.99);
}

void printTVal(NBBezier & bez, double tval) {
NBPoint res = bez.GetPoint(tval);
std::cout << "t = " <<>
}