bezier Class Reference

Nth order bezier curve edge. Only interior control points should be specified. The outer points are taken as start and end. Note that the calculation of each point takes 0(N^2) time, where N is the number of control points. This edge type shouldn't therefore be used for finely discretised line data; polyLine or similar will be more appropriate for such cases. Beziers are useful for simple curved shapes such as aerofoils, or when you want an edge to match a specific direction at one, or both, or its endpoints. In comparison with BSplines, the grading of bezier edges should be smoother, and the code is much simpler. The algorithmic order is worse, however, and the edge will not follow the control points as closely. More...

Inheritance diagram for bezier:
[legend]
Collaboration diagram for bezier:
[legend]

Public Member Functions

 TypeName ("bezier")
 
 bezier (const pointField &points, const edge &fromTo, const pointField &control)
 Construct from components. More...
 
 bezier (const pointField &points, const label from, const label to, const pointField &control)
 Construct from components. More...
 
 bezier (const dictionary &dict, const label index, const searchableSurfaces &, const pointField &points, Istream &is)
 Construct from Istream and point field. More...
 
virtual ~bezier ()=default
 Destructor. More...
 
point position (const scalar lambda) const
 Return the point position corresponding to the curve parameter. More...
 
scalar length () const
 Return the length of the curve. More...
 
- Public Member Functions inherited from blockEdge
 TypeName ("blockEdge")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, blockEdge, Istream,(const dictionary &dict, const label index, const searchableSurfaces &geometry, const pointField &points, Istream &is),(dict, index, geometry, points, is))
 
 blockEdge (const pointField &points, const edge &fromTo)
 Construct from components. More...
 
 blockEdge (const dictionary &dict, const label index, const pointField &points, Istream &is)
 Construct from Istream and point field. More...
 
virtual autoPtr< blockEdgeclone () const
 Clone function. More...
 
virtual ~blockEdge ()=default
 Destructor. More...
 
bool valid () const noexcept
 True if first/last indices are unique and non-negative. More...
 
label start () const noexcept
 Index of start (first) point. More...
 
label end () const noexcept
 Index of end (last) point. More...
 
const pointfirstPoint () const
 The location of the first point. More...
 
const pointlastPoint () const
 The location of the last point. More...
 
int compare (const blockEdge &e) const
 Compare the given start/end points with this block edge. More...
 
int compare (const edge &e) const
 Compare the given start/end points with this block edge. More...
 
int compare (const label start, const label end) const
 Compare the given start/end points with this block edge. More...
 
point linearPosition (const scalar lambda) const
 The point position in the straight line. More...
 
virtual point position (const scalar lambda) const =0
 The point position corresponding to the curve parameter. More...
 
virtual tmp< pointFieldposition (const scalarList &lambdas) const
 The point positions corresponding to the curve parameters. More...
 
virtual scalar length () const =0
 The length of the curve. More...
 
void write (Ostream &os, const dictionary &dict) const
 Write edge with variable back-substitution. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from blockEdge
static autoPtr< blockEdgeNew (const dictionary &dict, const label index, const searchableSurfaces &geometry, const pointField &points, Istream &is)
 New function which constructs and returns pointer to a blockEdge. More...
 
- Protected Member Functions inherited from blockEdge
 blockEdge (const pointField &points, const label from, const label to)
 Construct from components. More...
 
- Static Protected Member Functions inherited from blockEdge
static pointField appendEndPoints (const pointField &p, const label from, const label to, const pointField &intermediate)
 
- Protected Attributes inherited from blockEdge
const pointFieldpoints_
 The referenced point field. More...
 
const label start_
 Index of the first point. More...
 
const label end_
 Index of the last point. More...
 

Detailed Description

Nth order bezier curve edge. Only interior control points should be specified. The outer points are taken as start and end. Note that the calculation of each point takes 0(N^2) time, where N is the number of control points. This edge type shouldn't therefore be used for finely discretised line data; polyLine or similar will be more appropriate for such cases. Beziers are useful for simple curved shapes such as aerofoils, or when you want an edge to match a specific direction at one, or both, or its endpoints. In comparison with BSplines, the grading of bezier edges should be smoother, and the code is much simpler. The algorithmic order is worse, however, and the edge will not follow the control points as closely.

Source files

Definition at line 61 of file bezier.H.

Constructor & Destructor Documentation

◆ bezier() [1/3]

bezier ( const pointField points,
const edge fromTo,
const pointField control 
)

Construct from components.

Parameters
pointsReferenced point field
fromToStart/end in point field
controlThe control points

Definition at line 47 of file bezier.C.

◆ bezier() [2/3]

bezier ( const pointField points,
const label  from,
const label  to,
const pointField control 
)

Construct from components.

Parameters
pointsReferenced point field
fromStart point in point field
toEnd point in point field
controlThe control points

Definition at line 59 of file bezier.C.

◆ bezier() [3/3]

bezier ( const dictionary dict,
const label  index,
const searchableSurfaces ,
const pointField points,
Istream is 
)

Construct from Istream and point field.

Parameters
pointsReferenced point field

Definition at line 71 of file bezier.C.

◆ ~bezier()

virtual ~bezier ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "bezier"  )

◆ position()

Foam::point position ( const scalar  lambda) const
virtual

Return the point position corresponding to the curve parameter.

0 <= lambda <= 1

Implements blockEdge.

Definition at line 90 of file bezier.C.

References forAll, lambda(), and UList< T >::size().

Here is the call graph for this function:

◆ length()

Foam::scalar length ( ) const
virtual

Return the length of the curve.

\not NotImplemented

Implements blockEdge.

Definition at line 109 of file bezier.C.

References NotImplemented.


The documentation for this class was generated from the following files: