#pragma once

#include "npoint.h"
#include <vector>

void get_center(const std::vector<npoint3> &pts,npoint3 &center, npoint3 &vec);
bool get_cyl(const std::vector<npoint3> &pts,npoint3 &center, npoint3 &vec,double &radius,std::vector<npoint3> &ptsout,bool outliers=true);
bool get_cyl_fine(const std::vector<npoint3> &pts,npoint3 &center, npoint3 &vec,double &radius,std::vector<npoint3> &ptsout,bool hint=false,bool outliers=true);
void get_plane(const std::vector<npoint3> &pts,npoint3 &orig, npoint3 &norm,std::vector<npoint3> &ptsout,bool outliers=true);
bool get_cone(const std::vector<npoint3> &pts,npoint3 &center, npoint3 &vec,double & angle,std::vector<npoint3> &ptsout);
void int_line_plane(const npoint3 &origl, const npoint3 &vecl, const npoint3 &origp, const npoint3 &normp, npoint3 &intersec);
void adjustsb(std::vector<std::pair<npoint3,npoint3> > &sb,const std::vector<std::pair<npoint3,npoint3> > &sbr);
