2009-01-13 04:40:13 +05:00
|
|
|
#ifndef FILE_EXPLICITCURVE2D
|
|
|
|
#define FILE_EXPLICITCURVE2D
|
|
|
|
|
|
|
|
/**************************************************************************/
|
|
|
|
/* File: explicitcurve2d.hh */
|
|
|
|
/* Author: Joachim Schoeberl */
|
|
|
|
/* Date: 14. Oct. 96 */
|
|
|
|
/**************************************************************************/
|
|
|
|
|
|
|
|
|
2009-09-07 17:50:13 +06:00
|
|
|
namespace netgen
|
2009-01-13 04:40:13 +05:00
|
|
|
{
|
|
|
|
|
2009-09-07 17:50:13 +06:00
|
|
|
/*
|
2009-01-13 04:40:13 +05:00
|
|
|
|
Fix various typos
Found via `codespell -q 3 -S ./external_dependencies/pybind11 -L alledges,allright,ane,anormal,ans,apoints,ba,boxs,cancle,childs,co-ordinate,co-ordinates,daty,enty,filld,hel,identifyable,ist,linz,lod,ned,nd,selt,statics,suround,thev,thist,thisy,timere,upto,wel`
2022-03-26 03:21:48 +05:00
|
|
|
Explicit 2D Curve representation
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-09-07 17:50:13 +06:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
class ExplicitCurve2d : public Curve2d
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
ExplicitCurve2d ();
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual void Project (Point<2> & p) const;
|
|
|
|
///
|
|
|
|
virtual double ProjectParam (const Point<2> & p) const = 0;
|
|
|
|
///
|
|
|
|
virtual double NumericalProjectParam (const Point<2> & p, double lb, double ub) const;
|
|
|
|
///
|
|
|
|
virtual double MinParam () const = 0;
|
|
|
|
///
|
|
|
|
virtual double MaxParam () const = 0;
|
|
|
|
///
|
|
|
|
virtual Point<2> Eval (double t) const = 0;
|
|
|
|
///
|
|
|
|
virtual Vec<2> EvalPrime (double t) const = 0;
|
|
|
|
///
|
|
|
|
virtual Vec<2> Normal (double t) const;
|
|
|
|
///
|
|
|
|
virtual void NormalVector (const Point<2> & p, Vec<2> & n) const;
|
|
|
|
///
|
|
|
|
virtual Vec<2> EvalPrimePrime (double t) const = 0;
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual double MaxCurvature () const;
|
|
|
|
///
|
|
|
|
virtual double MaxCurvatureLoc (const Point<2> & p, double rad) const;
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual Point<2> CurvCircle (double t) const;
|
|
|
|
///
|
|
|
|
virtual void Print (ostream & /* str */) const { };
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-09-07 17:50:13 +06:00
|
|
|
///
|
|
|
|
virtual int SectionUsed (double /* t */) const { return 1; }
|
|
|
|
///
|
|
|
|
virtual void Reduce (const Point<2> & /* p */, double /* rad */) { };
|
|
|
|
///
|
|
|
|
virtual void UnReduce () { };
|
|
|
|
};
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
|
|
|
|
///
|
2009-09-07 17:50:13 +06:00
|
|
|
class BSplineCurve2d : public ExplicitCurve2d
|
|
|
|
{
|
|
|
|
///
|
2019-07-09 13:39:16 +05:00
|
|
|
NgArray<Point<2> > points;
|
2009-09-07 17:50:13 +06:00
|
|
|
///
|
2019-07-09 13:39:16 +05:00
|
|
|
NgArray<int> intervallused;
|
2009-09-07 17:50:13 +06:00
|
|
|
///
|
|
|
|
int redlevel;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-09-07 17:50:13 +06:00
|
|
|
public:
|
|
|
|
///
|
|
|
|
BSplineCurve2d ();
|
|
|
|
///
|
|
|
|
void AddPoint (const Point<2> & apoint);
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-09-07 17:50:13 +06:00
|
|
|
bool Inside (const Point<2> & p, double & dist) const;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-09-07 17:50:13 +06:00
|
|
|
///
|
|
|
|
virtual double ProjectParam (const Point<2> & p) const;
|
|
|
|
///
|
|
|
|
virtual double MinParam () const { return 0; }
|
|
|
|
///
|
|
|
|
virtual double MaxParam () const { return points.Size(); }
|
|
|
|
///
|
|
|
|
virtual Point<2> Eval (double t) const;
|
|
|
|
///
|
|
|
|
virtual Vec<2> EvalPrime (double t) const;
|
|
|
|
///
|
|
|
|
virtual Vec<2> EvalPrimePrime (double t) const;
|
|
|
|
///
|
|
|
|
virtual void Print (ostream & str) const;
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual int SectionUsed (double t) const;
|
|
|
|
///
|
|
|
|
virtual void Reduce (const Point<2> & p, double rad);
|
|
|
|
///
|
|
|
|
virtual void UnReduce ();
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|