// Gnurbs - A curve and surface library
// Copyright (C) 2008-2026 Eric Bechet
//
// See the LICENSE file for contributions and license information.
// Please report all bugs and problems to <bechet@cadxfem.org>.
//

#include <iostream>
#include <fstream>
#include "nclothoid.h"
#include "nspline.h"
#include "ndisplay.h"
#include "nutil.h"
#include "gnurbscallbacks.h"
#include <iostream>
#define pi (3.1415926536)

int main(void)
{
  npoint2 p1(0,0);
  npoint2 p2(1,0);
  double th1(pi/2);
  double th2(0);
  nclothoid courbe(p1,th1,p2,th2);
  nspline courbe2(2);
  courbe2.u(0)=0;
  courbe2.u(1)=courbe.max_u();
  courbe2.set_CP(0,p1);
  courbe2.set_CP(1,p2);
  courbe2.set_der(0,npoint(cos(th1)*1.3,sin(th1)*1.3,0,0));
  courbe2.set_der(1,npoint(cos(th2)*0.7,sin(th2)*0.7,0,0));

  data_container data;
  ndisplay display;
  gnurbscallbacks CB;
  CB.add_entity(&courbe);
  CB.add_entity(&courbe2);
  display.setcallbacks(&CB);
  CB.draw();
  display.init_data(CB.datas);
  display.display();
  return 0;
}



