AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::primal::BezierPatch< T, NDIMS > Class Template Reference

Represents a 3D Bezier patch defined by a 2D array of control points. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/primal/geometry/BezierPatch.hpp>

Public Types

using PointType = Point< T, NDIMS >
 
using VectorType = Vector< T, NDIMS >
 
using PlaneType = Plane< T, NDIMS >
 
using CoordsVec = axom::Array< PointType, 1 >
 
using CoordsMat = axom::Array< PointType, 2 >
 
using WeightsVec = axom::Array< T, 1 >
 
using WeightsMat = axom::Array< T, 2 >
 
using BoundingBoxType = BoundingBox< T, NDIMS >
 
using OrientedBoundingBoxType = OrientedBoundingBox< T, NDIMS >
 
using BezierCurveType = primal::BezierCurve< T, NDIMS >
 

Public Member Functions

 AXOM_STATIC_ASSERT_MSG ((NDIMS==1)||(NDIMS==2)||(NDIMS==3), "A Bezier Patch object may be defined in 1-, 2-, or 3-D")
 
 AXOM_STATIC_ASSERT_MSG (std::is_arithmetic< T >::value, "A Bezier Patch must be defined using an arithmetic type")
 
 BezierPatch (int ord_u=-1, int ord_v=-1)
 Constructor for a nonrational Bezier Patch that reserves space for the given order of the surface. More...
 
 BezierPatch (PointType *pts, int ord_u, int ord_v)
 Constructor for a Bezier Patch from an array of coordinates. More...
 
 BezierPatch (PointType *pts, T *weights, int ord_u, int ord_v)
 Constructor for a Rational Bezier Patch from arrays of coordinates and weights. More...
 
 BezierPatch (const CoordsVec &pts, int ord_u, int ord_v)
 Constructor for a Bezier Patch from a 1D Axom array of coordinates. More...
 
 BezierPatch (const CoordsVec &pts, const WeightsVec &weights, int ord_u, int ord_v)
 Constructor for a Rational Bezier Patch from 1D Axom arrays of coordinates and weights. More...
 
 BezierPatch (const CoordsMat &pts, int ord_u, int ord_v)
 Constructor for a Bezier Patch from an Axom array of coordinates. More...
 
 BezierPatch (const CoordsMat &pts, const WeightsMat &weights, int ord_u, int ord_v)
 Constructor for a rational Bezier Patch from a 2D Axom array of weights and coordinates. More...
 
void setOrder (int ord_u, int ord_v)
 Sets the order of Bezier patch. More...
 
int getOrder_u () const
 Returns the order of the Bezier Patch on the first axis. More...
 
int getOrder_v () const
 Returns the order of the Bezier Patch on the second axis. More...
 
void makeRational ()
 Make trivially rational. If already rational, do nothing. More...
 
void makeNonrational ()
 Make nonrational by shrinking array of weights. More...
 
bool isRational () const
 Use array size as flag for rationality. More...
 
void clear ()
 Clears the list of control points, make nonrational. More...
 
PointTypeoperator() (int ui, int vi)
 Retrieves the control point at index (idx_p, idx_q) More...
 
const PointTypeoperator() (int ui, int vi) const
 Retrieves the vector of control points at index idx. More...
 
const T & getWeight (int ui, int vi) const
 Get a specific weight. More...
 
void setWeight (int ui, int vi, T weight)
 Set the weight at a specific index. More...
 
CoordsMat getControlPoints () const
 Returns a copy of the Bezier patch's control points. More...
 
WeightsMat getWeights () const
 Returns a copy of the Bezier patch's weights. More...
 
void reverseOrientation (int axis)
 Reverses the order of one direction of the Bezier patch's control points and weights. More...
 
void reverseOrientation_u ()
 Reverses the order of the Bezier patch's control points and weights on the first axis. More...
 
void reverseOrientation_v ()
 Reverses the order of the Bezier patch's control points and weights on the second axis. More...
 
void swapAxes ()
 Swap the axes such that s(u, v) becomes s(v, u) More...
 
BoundingBoxType boundingBox () const
 Returns an axis-aligned bounding box containing the Bezier patch. More...
 
OrientedBoundingBoxType orientedBoundingBox () const
 Returns an oriented bounding box containing the Bezier patch. More...
 
BezierCurveType isocurve (T uv, int axis) const
 Evaluates a slice Bezier patch for a fixed parameter value of u or v. More...
 
BezierCurveType isocurve_u (T u) const
 Returns an isocurve with a fixed value of u. More...
 
BezierCurveType isocurve_v (T v) const
 Returns an isocurve with a fixed value of v. More...
 
PointType evaluate (T u, T v) const
 Evaluates a Bezier patch at a particular parameter value (u, v) More...
 
void evaluate_first_derivatives (T u, T v, Point< T, NDIMS > &eval, Vector< T, NDIMS > &Du, Vector< T, NDIMS > &Dv) const
 Evaluates all first derivatives Bezier patch at (u, v) More...
 
void evaluate_linear_derivatives (T u, T v, Point< T, NDIMS > &eval, Vector< T, NDIMS > &Du, Vector< T, NDIMS > &Dv, Vector< T, NDIMS > &DuDv) const
 Evaluates all linear derivatives Bezier patch at (u, v) More...
 
void evaluate_second_derivatives (T u, T v, Point< T, NDIMS > &eval, Vector< T, NDIMS > &Du, Vector< T, NDIMS > &Dv, Vector< T, NDIMS > &DuDu, Vector< T, NDIMS > &DvDv, Vector< T, NDIMS > &DuDv) const
 Evaluates all second derivatives Bezier patch at (u, v) More...
 
VectorType du (T u, T v) const
 Computes a tangent of a Bezier patch at a particular parameter value (u, v) along the u axis. More...
 
VectorType dudu (T u, T v) const
 Computes the second derivative of a Bezier patch at (u, v) along the u axis. More...
 
VectorType dv (T u, T v) const
 Computes a tangent of a Bezier patch at a particular parameter value (u, v) along the v axis. More...
 
VectorType dvdv (T u, T v) const
 Computes the second derivative of a Bezier patch at (u, v) along the v axis. More...
 
VectorType dudv (T u, T v) const
 Computes the mixed second derivative of a Bezier patch at (u, v) More...
 
VectorType dvdu (T u, T v) const
 Computes the mixed second derivative of a Bezier patch at (u, v) More...
 
VectorType normal (T u, T v) const
 Computes the normal vector of a Bezier patch at a particular parameter value (u, v) More...
 
void split (T uv, int axis, BezierPatch &p1, BezierPatch &p2) const
 Splits a Bezier patch into two Bezier patches. More...
 
void split_u (T u, BezierPatch &p1, BezierPatch &p2) const
 Split the patch along a fixed value of u. More...
 
void split_v (T v, BezierPatch &p1, BezierPatch &p2) const
 
void split (T u, T v, BezierPatch &p1, BezierPatch &p2, BezierPatch &p3, BezierPatch &p4) const
 Splits a Bezier patch into four Bezier patches. More...
 
bool isPlanar (double tol=1E-8) const
 Predicate to check if the Bezier patch is approximately planar. More...
 
bool isPolygonal (double tol=1E-8) const
 Predicate to check if the patch can be approximated by a polygon. More...
 
std::ostream & print (std::ostream &os) const
 Simple formatted print of a Bezier Patch instance. More...
 

Friends

bool operator== (const BezierPatch< T, NDIMS > &lhs, const BezierPatch< T, NDIMS > &rhs)
 Checks equality of two Bezier Patches. More...
 
bool operator!= (const BezierPatch< T, NDIMS > &lhs, const BezierPatch< T, NDIMS > &rhs)
 

Detailed Description

template<typename T, int NDIMS>
class axom::primal::BezierPatch< T, NDIMS >

Represents a 3D Bezier patch defined by a 2D array of control points.

Template Parameters
Tthe coordinate type, e.g., double, float, etc.

The order of a Bezier patch with (N+1)(M+1) control points is (N, M). The patch is approximated by the control points, parametrized from u=0 to u=1 and v=0 to v=1.

Contains a 2D array of positive weights to represent a rational Bezier patch. Nonrational Bezier patches are identified by an empty weights array. Algorithms for Rational Bezier curves derived from Gerald Farin, "Algorithms for rational Bezier curves" Computer-Aided Design, Volume 15, Number 2, 1983,

Member Typedef Documentation

◆ PointType

template<typename T , int NDIMS>
using axom::primal::BezierPatch< T, NDIMS >::PointType = Point<T, NDIMS>

◆ VectorType

template<typename T , int NDIMS>
using axom::primal::BezierPatch< T, NDIMS >::VectorType = Vector<T, NDIMS>

◆ PlaneType

template<typename T , int NDIMS>
using axom::primal::BezierPatch< T, NDIMS >::PlaneType = Plane<T, NDIMS>

◆ CoordsVec

template<typename T , int NDIMS>
using axom::primal::BezierPatch< T, NDIMS >::CoordsVec = axom::Array<PointType, 1>

◆ CoordsMat

template<typename T , int NDIMS>
using axom::primal::BezierPatch< T, NDIMS >::CoordsMat = axom::Array<PointType, 2>

◆ WeightsVec

template<typename T , int NDIMS>
using axom::primal::BezierPatch< T, NDIMS >::WeightsVec = axom::Array<T, 1>

◆ WeightsMat

template<typename T , int NDIMS>
using axom::primal::BezierPatch< T, NDIMS >::WeightsMat = axom::Array<T, 2>

◆ BoundingBoxType

template<typename T , int NDIMS>
using axom::primal::BezierPatch< T, NDIMS >::BoundingBoxType = BoundingBox<T, NDIMS>

◆ OrientedBoundingBoxType

template<typename T , int NDIMS>
using axom::primal::BezierPatch< T, NDIMS >::OrientedBoundingBoxType = OrientedBoundingBox<T, NDIMS>

◆ BezierCurveType

template<typename T , int NDIMS>
using axom::primal::BezierPatch< T, NDIMS >::BezierCurveType = primal::BezierCurve<T, NDIMS>

Constructor & Destructor Documentation

◆ BezierPatch() [1/7]

template<typename T , int NDIMS>
axom::primal::BezierPatch< T, NDIMS >::BezierPatch ( int  ord_u = -1,
int  ord_v = -1 
)
inline

Constructor for a nonrational Bezier Patch that reserves space for the given order of the surface.

Constructs an empty patch by default (no nodes/weights on either axis)

Parameters
[in]ord_uThe patch's polynomial order on the first axis
[in]ord_vThe patch's polynomial order on the second axis
Precondition
ord_u, ord_v greater than or equal to -1.

References axom::primal::BezierPatch< T, NDIMS >::makeNonrational(), axom::utilities::max(), axom::Array< T, DIM, SPACE >::resize(), and SLIC_ASSERT.

◆ BezierPatch() [2/7]

template<typename T , int NDIMS>
axom::primal::BezierPatch< T, NDIMS >::BezierPatch ( PointType pts,
int  ord_u,
int  ord_v 
)
inline

Constructor for a Bezier Patch from an array of coordinates.

Parameters
[in]ptsA 1D C-style array of (ord_u+1)*(ord_v+1) control points
[in]ord_uThe patch's polynomial order on the first axis
[in]ord_vThe patch's polynomial order on the second axis
Precondition
order in both directions is greater than or equal to zero

Elements of pts[k] are mapped to control nodes (p, q) lexicographically, i.e. pts[0] -> nodes[0, 0], ..., pts[ord_v] -> nodes[0, ord_v] pts[ord_v+1] -> nodes[1, 0], ..., pts[2*ord_v] -> nodes[1, ord_v] ... pts[ord_u*(ord_v-1)] -> nodes[ord_u, 0], ..., pts[ord_u*ord_v] -> nodes[ord_u, ord_v]

References axom::ArrayBase< T, DIM, ArrayType >::flatIndex(), axom::primal::BezierPatch< T, NDIMS >::makeNonrational(), axom::utilities::max(), axom::Array< T, DIM, SPACE >::resize(), and SLIC_ASSERT.

◆ BezierPatch() [3/7]

template<typename T , int NDIMS>
axom::primal::BezierPatch< T, NDIMS >::BezierPatch ( PointType pts,
T *  weights,
int  ord_u,
int  ord_v 
)
inline

Constructor for a Rational Bezier Patch from arrays of coordinates and weights.

Parameters
[in]ptsA 1D C-style array of (ord_u+1)*(ord_v+1) control points
[in]weightsA 1D C-style array of (ord_u+1)*(ord_v+1) positive weights
[in]ord_uThe patch's polynomial order on the first axis
[in]ord_vThe patch's polynomial order on the second axis
Precondition
order is greater than or equal to zero in each direction

Elements of pts and weights are mapped to control nodes (p, q) lexicographically

If weights is the null pointer, creates a nonrational curve

References axom::ArrayBase< T, DIM, ArrayType >::flatIndex(), axom::primal::BezierPatch< T, NDIMS >::makeNonrational(), axom::utilities::max(), axom::Array< T, DIM, SPACE >::resize(), and SLIC_ASSERT.

◆ BezierPatch() [4/7]

template<typename T , int NDIMS>
axom::primal::BezierPatch< T, NDIMS >::BezierPatch ( const CoordsVec pts,
int  ord_u,
int  ord_v 
)
inline

Constructor for a Bezier Patch from a 1D Axom array of coordinates.

Parameters
[in]ptsA 1D Axom array of (ord_u+1)*(ord_v+1) control points
[in]ord_uThe patch's polynomial order on the first axis
[in]ord_vThe patch's polynomial order on the second axis
Precondition
order in both directions is greater than or equal to zero

Elements of pts are mapped to control nodes (p, q) lexicographically

References axom::ArrayBase< T, DIM, ArrayType >::flatIndex(), axom::primal::BezierPatch< T, NDIMS >::makeNonrational(), axom::utilities::max(), axom::Array< T, DIM, SPACE >::resize(), and SLIC_ASSERT.

◆ BezierPatch() [5/7]

template<typename T , int NDIMS>
axom::primal::BezierPatch< T, NDIMS >::BezierPatch ( const CoordsVec pts,
const WeightsVec weights,
int  ord_u,
int  ord_v 
)
inline

Constructor for a Rational Bezier Patch from 1D Axom arrays of coordinates and weights.

Parameters
[in]ptsA 1D Axom array of (ord_u+1)*(ord_v+1) control points
[in]weightsA 1D Axom array of (ord_u+1)*(ord_v+1) positive weights
[in]ord_uThe patch's polynomial order on the first axis
[in]ord_vThe patch's polynomial order on the second axis
Precondition
order is greater than or equal to zero in each direction

Elements of pts and weights are mapped to control nodes (p, q) lexicographically.

References axom::ArrayBase< T, DIM, ArrayType >::flatIndex(), axom::utilities::max(), axom::Array< T, DIM, SPACE >::resize(), axom::Array< T, DIM, SPACE >::size(), and SLIC_ASSERT.

◆ BezierPatch() [6/7]

template<typename T , int NDIMS>
axom::primal::BezierPatch< T, NDIMS >::BezierPatch ( const CoordsMat pts,
int  ord_u,
int  ord_v 
)
inline

Constructor for a Bezier Patch from an Axom array of coordinates.

Parameters
[in]ptsA 2D Axom array with (ord_u+1, ord_v+1) control points
[in]ord_uThe patch's polynomial order on the first axis
[in]ord_vThe patch's polynomial order on the second axis
Precondition
order is greater than or equal to zero in each direction

References axom::primal::BezierPatch< T, NDIMS >::makeNonrational(), axom::utilities::max(), axom::Array< T, DIM, SPACE >::resize(), and SLIC_ASSERT.

◆ BezierPatch() [7/7]

template<typename T , int NDIMS>
axom::primal::BezierPatch< T, NDIMS >::BezierPatch ( const CoordsMat pts,
const WeightsMat weights,
int  ord_u,
int  ord_v 
)
inline

Constructor for a rational Bezier Patch from a 2D Axom array of weights and coordinates.

Parameters
[in]ptsA 2D Axom array with (ord_u+1, ord_v+1) control points
[in]weightsA 2D Axom array with (ord_u+1, ord_v+1) weights
[in]ord_uThe patch's polynomial order on the first axis
[in]ord_vThe patch's polynomial order on the second axis
Precondition
order is greater than or equal to zero in each direction

References axom::utilities::max(), axom::Array< T, DIM, SPACE >::resize(), axom::ArrayBase< T, DIM, ArrayType >::shape(), and SLIC_ASSERT.

Member Function Documentation

◆ AXOM_STATIC_ASSERT_MSG() [1/2]

template<typename T , int NDIMS>
axom::primal::BezierPatch< T, NDIMS >::AXOM_STATIC_ASSERT_MSG ( (NDIMS==1)||(NDIMS==2)||(NDIMS==3)  ,
"A Bezier Patch object may be defined in 1-  ,
2-  ,
or 3-D"   
)

◆ AXOM_STATIC_ASSERT_MSG() [2/2]

template<typename T , int NDIMS>
axom::primal::BezierPatch< T, NDIMS >::AXOM_STATIC_ASSERT_MSG ( std::is_arithmetic< T >::value  ,
"A Bezier Patch must be defined using an arithmetic type"   
)

◆ setOrder()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::setOrder ( int  ord_u,
int  ord_v 
)
inline

Sets the order of Bezier patch.

Parameters
[in]ord_uThe patch's polynomial order on the first axis
[in]ord_vThe patch's polynomial order on the second axis
Note
Will only resize the arrays, and likely make the patch invalid

References axom::primal::BezierPatch< T, NDIMS >::isRational(), and axom::Array< T, DIM, SPACE >::resize().

◆ getOrder_u()

template<typename T , int NDIMS>
int axom::primal::BezierPatch< T, NDIMS >::getOrder_u ( ) const
inline

Returns the order of the Bezier Patch on the first axis.

References axom::ArrayBase< T, DIM, ArrayType >::shape().

◆ getOrder_v()

template<typename T , int NDIMS>
int axom::primal::BezierPatch< T, NDIMS >::getOrder_v ( ) const
inline

Returns the order of the Bezier Patch on the second axis.

References axom::ArrayBase< T, DIM, ArrayType >::shape().

◆ makeRational()

◆ makeNonrational()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::makeNonrational ( )
inline

Make nonrational by shrinking array of weights.

References axom::Array< T, DIM, SPACE >::clear().

◆ isRational()

template<typename T , int NDIMS>
bool axom::primal::BezierPatch< T, NDIMS >::isRational ( ) const
inline

Use array size as flag for rationality.

References axom::Array< T, DIM, SPACE >::empty().

◆ clear()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::clear ( )
inline

Clears the list of control points, make nonrational.

References axom::Array< T, DIM, SPACE >::clear(), and axom::primal::BezierPatch< T, NDIMS >::makeNonrational().

◆ operator()() [1/2]

template<typename T , int NDIMS>
PointType& axom::primal::BezierPatch< T, NDIMS >::operator() ( int  ui,
int  vi 
)
inline

Retrieves the control point at index (idx_p, idx_q)

◆ operator()() [2/2]

template<typename T , int NDIMS>
const PointType& axom::primal::BezierPatch< T, NDIMS >::operator() ( int  ui,
int  vi 
) const
inline

Retrieves the vector of control points at index idx.

◆ getWeight()

template<typename T , int NDIMS>
const T& axom::primal::BezierPatch< T, NDIMS >::getWeight ( int  ui,
int  vi 
) const
inline

Get a specific weight.

Parameters
[in]uiThe index of the weight on the first axis
[in]viThe index of the weight on the second axis
Precondition
Requires that the surface be rational

References axom::primal::BezierPatch< T, NDIMS >::isRational(), and SLIC_ASSERT.

◆ setWeight()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::setWeight ( int  ui,
int  vi,
weight 
)
inline

Set the weight at a specific index.

Parameters
[in]uiThe index of the weight in on the first axis
[in]viThe index of the weight in on the second axis
[in]weightThe updated value of the weight
Precondition
Requires that the surface be rational
Requires that the weight be positive

References axom::primal::BezierPatch< T, NDIMS >::isRational(), and SLIC_ASSERT.

◆ getControlPoints()

template<typename T , int NDIMS>
CoordsMat axom::primal::BezierPatch< T, NDIMS >::getControlPoints ( ) const
inline

Returns a copy of the Bezier patch's control points.

◆ getWeights()

template<typename T , int NDIMS>
WeightsMat axom::primal::BezierPatch< T, NDIMS >::getWeights ( ) const
inline

Returns a copy of the Bezier patch's weights.

◆ reverseOrientation()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::reverseOrientation ( int  axis)
inline

Reverses the order of one direction of the Bezier patch's control points and weights.

Parameters
[in]axisorientation of patch. 0 to reverse in u, 1 for reverse in v

References axom::primal::BezierPatch< T, NDIMS >::reverseOrientation_u(), and axom::primal::BezierPatch< T, NDIMS >::reverseOrientation_v().

◆ reverseOrientation_u()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::reverseOrientation_u ( )
inline

◆ reverseOrientation_v()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::reverseOrientation_v ( )
inline

◆ swapAxes()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::swapAxes ( )
inline

◆ boundingBox()

template<typename T , int NDIMS>
BoundingBoxType axom::primal::BezierPatch< T, NDIMS >::boundingBox ( ) const
inline

Returns an axis-aligned bounding box containing the Bezier patch.

References axom::Array< T, DIM, SPACE >::data(), and axom::Array< T, DIM, SPACE >::size().

◆ orientedBoundingBox()

template<typename T , int NDIMS>
OrientedBoundingBoxType axom::primal::BezierPatch< T, NDIMS >::orientedBoundingBox ( ) const
inline

Returns an oriented bounding box containing the Bezier patch.

References axom::Array< T, DIM, SPACE >::data(), and axom::Array< T, DIM, SPACE >::size().

◆ isocurve()

template<typename T , int NDIMS>
BezierCurveType axom::primal::BezierPatch< T, NDIMS >::isocurve ( uv,
int  axis 
) const
inline

Evaluates a slice Bezier patch for a fixed parameter value of u or v.

Parameters
[in]uparameter value at which to evaluate the first axis
[in]vparameter value at which to evaluate the second axis
[in]axisorientation of curve. 0 for fixed u, 1 for fixed v
Returns
p the value of the Bezier patch at (u, v)
Note
We typically evaluate the patch at u or v between 0 and 1

References axom::primal::BezierPatch< T, NDIMS >::isocurve_u(), axom::primal::BezierPatch< T, NDIMS >::isocurve_v(), and SLIC_ASSERT.

◆ isocurve_u()

◆ isocurve_v()

◆ evaluate()

template<typename T , int NDIMS>
PointType axom::primal::BezierPatch< T, NDIMS >::evaluate ( u,
v 
) const
inline

Evaluates a Bezier patch at a particular parameter value (u, v)

Parameters
[in]uparameter value at which to evaluate on the first axis
[in]vparameter value at which to evaluate on the second axis
Returns
p the value of the Bezier patch at (u, v)
Note
We typically evaluate the patch at u and v between 0 and 1

References axom::primal::BezierCurve< T, NDIMS >::evaluate(), axom::primal::BezierPatch< T, NDIMS >::getOrder_u(), axom::primal::BezierPatch< T, NDIMS >::getOrder_v(), axom::primal::BezierPatch< T, NDIMS >::isocurve_u(), and axom::primal::BezierPatch< T, NDIMS >::isocurve_v().

◆ evaluate_first_derivatives()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::evaluate_first_derivatives ( u,
v,
Point< T, NDIMS > &  eval,
Vector< T, NDIMS > &  Du,
Vector< T, NDIMS > &  Dv 
) const
inline

Evaluates all first derivatives Bezier patch at (u, v)

Parameters
[in]uParameter value at which to evaluate on the first axis
[in]vParameter value at which to evaluate on the second axis
[out]evalThe point value of the Bezier patch at (u, v)
[out]DuThe vector value of S_u(u, v)
[out]DvThe vector value of S_v(u, v)
Note
We typically evaluate the patch at u and v between 0 and 1

References axom::primal::BezierPatch< T, NDIMS >::evaluate_second_derivatives(), axom::primal::BezierPatch< T, NDIMS >::getOrder_u(), axom::primal::BezierPatch< T, NDIMS >::getOrder_v(), axom::primal::BezierPatch< T, NDIMS >::isRational(), and axom::utilities::lerp().

◆ evaluate_linear_derivatives()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::evaluate_linear_derivatives ( u,
v,
Point< T, NDIMS > &  eval,
Vector< T, NDIMS > &  Du,
Vector< T, NDIMS > &  Dv,
Vector< T, NDIMS > &  DuDv 
) const
inline

Evaluates all linear derivatives Bezier patch at (u, v)

Parameters
[in]uParameter value at which to evaluate on the first axis
[in]vParameter value at which to evaluate on the second axis
[out]evalThe point value of the Bezier patch at (u, v)
[out]DuThe vector value of S_u(u, v)
[out]DvThe vector value of S_v(u, v)
[out]DuDvThe vector value of S_uv(u, v) == S_vu(u, v)
Note
We typically evaluate the patch at u and v between 0 and 1

References axom::primal::BezierPatch< T, NDIMS >::evaluate_second_derivatives(), axom::primal::BezierPatch< T, NDIMS >::getOrder_u(), axom::primal::BezierPatch< T, NDIMS >::getOrder_v(), axom::primal::BezierPatch< T, NDIMS >::isRational(), and axom::utilities::lerp().

◆ evaluate_second_derivatives()

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::evaluate_second_derivatives ( u,
v,
Point< T, NDIMS > &  eval,
Vector< T, NDIMS > &  Du,
Vector< T, NDIMS > &  Dv,
Vector< T, NDIMS > &  DuDu,
Vector< T, NDIMS > &  DvDv,
Vector< T, NDIMS > &  DuDv 
) const
inline

Evaluates all second derivatives Bezier patch at (u, v)

Parameters
[in]uParameter value at which to evaluate on the first axis
[in]vParameter value at which to evaluate on the second axis
[out]evalThe point value of the Bezier patch at (u, v)
[out]DuThe vector value of S_u(u, v)
[out]DvThe vector value of S_v(u, v)
[out]DuDuThe vector value of S_uu(u, v)
[out]DvDvThe vector value of S_vv(u, v)
[out]DuDvThe vector value of S_uv(u, v) == S_vu(u, v)
Note
We typically evaluate the patch at u and v between 0 and 1

References axom::primal::BezierPatch< T, NDIMS >::evaluate_second_derivatives(), axom::primal::BezierPatch< T, NDIMS >::getOrder_u(), axom::primal::BezierPatch< T, NDIMS >::getOrder_v(), axom::primal::BezierPatch< T, NDIMS >::isRational(), and axom::utilities::lerp().

◆ du()

template<typename T , int NDIMS>
VectorType axom::primal::BezierPatch< T, NDIMS >::du ( u,
v 
) const
inline

Computes a tangent of a Bezier patch at a particular parameter value (u, v) along the u axis.

Parameters
[in]uparameter value at which to evaluate on the first axis
[in]vparameter value at which to evaluate on the second axis
Returns
vec a tangent vector in u of the Bezier patch at (u, v)
Note
We typically find the tangent of the patch at u and v between 0 and 1

References axom::primal::BezierCurve< T, NDIMS >::dt(), and axom::primal::BezierPatch< T, NDIMS >::isocurve_v().

◆ dudu()

template<typename T , int NDIMS>
VectorType axom::primal::BezierPatch< T, NDIMS >::dudu ( u,
v 
) const
inline

Computes the second derivative of a Bezier patch at (u, v) along the u axis.

Parameters
[in]uParameter value at which to evaluate on the first axis
[in]vParameter value at which to evaluate on the second axis
Returns
vec The vector value of S_uu(u, v)
Note
We typically find the tangent of the patch at u and v between 0 and 1

References axom::primal::BezierCurve< T, NDIMS >::dtdt(), and axom::primal::BezierPatch< T, NDIMS >::isocurve_v().

◆ dv()

template<typename T , int NDIMS>
VectorType axom::primal::BezierPatch< T, NDIMS >::dv ( u,
v 
) const
inline

Computes a tangent of a Bezier patch at a particular parameter value (u, v) along the v axis.

Parameters
[in]uparameter value at which to evaluate on the first axis
[in]vparameter value at which to evaluate on the second axis
Returns
vec a tangent vector in v of the Bezier patch at (u, v)
Note
We typically find the tangent of the patch at u and v between 0 and 1

References axom::primal::BezierCurve< T, NDIMS >::dt(), and axom::primal::BezierPatch< T, NDIMS >::isocurve_u().

◆ dvdv()

template<typename T , int NDIMS>
VectorType axom::primal::BezierPatch< T, NDIMS >::dvdv ( u,
v 
) const
inline

Computes the second derivative of a Bezier patch at (u, v) along the v axis.

Parameters
[in]uParameter value at which to evaluate on the first axis
[in]vParameter value at which to evaluate on the second axis
Returns
vec The vector value of S_vv(u, v)
Note
We typically find the tangent of the patch at u and v between 0 and 1

References axom::primal::BezierCurve< T, NDIMS >::dtdt(), and axom::primal::BezierPatch< T, NDIMS >::isocurve_u().

◆ dudv()

template<typename T , int NDIMS>
VectorType axom::primal::BezierPatch< T, NDIMS >::dudv ( u,
v 
) const
inline

Computes the mixed second derivative of a Bezier patch at (u, v)

Parameters
[in]uParameter value at which to evaluate on the first axis
[in]vParameter value at which to evaluate on the second axis
Returns
vec The vector value of S_uv(u, v) == S_vu(u, v)
Note
We typically find the tangent of the patch at u and v between 0 and 1

References axom::primal::BezierPatch< T, NDIMS >::evaluate_linear_derivatives(), axom::primal::BezierPatch< T, NDIMS >::getOrder_u(), axom::primal::BezierPatch< T, NDIMS >::getOrder_v(), axom::primal::BezierPatch< T, NDIMS >::isRational(), and axom::utilities::lerp().

◆ dvdu()

template<typename T , int NDIMS>
VectorType axom::primal::BezierPatch< T, NDIMS >::dvdu ( u,
v 
) const
inline

Computes the mixed second derivative of a Bezier patch at (u, v)

Parameters
[in]uParameter value at which to evaluate on the first axis
[in]vParameter value at which to evaluate on the second axis
Returns
vec The vector value of S_uv(u, v) == S_vu(u, v)
Note
We typically find the tangent of the patch at u and v between 0 and 1

References axom::primal::BezierPatch< T, NDIMS >::dudv().

◆ normal()

template<typename T , int NDIMS>
VectorType axom::primal::BezierPatch< T, NDIMS >::normal ( u,
v 
) const
inline

Computes the normal vector of a Bezier patch at a particular parameter value (u, v)

Parameters
[in]uparameter value at which to evaluate on the first axis
[in]vparameter value at which to evaluate on the second axis
Returns
vec the normal vector of the Bezier patch at (u, v)
Note
We typically find the normal of the patch at u and v between 0 and 1

References axom::primal::Vector< T, NDIMS >::cross_product(), and axom::primal::BezierPatch< T, NDIMS >::evaluate_first_derivatives().

◆ split() [1/2]

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::split ( uv,
int  axis,
BezierPatch< T, NDIMS > &  p1,
BezierPatch< T, NDIMS > &  p2 
) const
inline

Splits a Bezier patch into two Bezier patches.

Parameters
[in]uvparameter value between 0 and 1 at which to bisect the patch
[in]axisorientation of split. 0 for fixed u, 1 for fixed v
[out]p1First output Bezier patch
[out]p2Second output Bezier patch
Precondition
Parameter uv must be between 0 and 1

References SLIC_ASSERT, axom::primal::BezierPatch< T, NDIMS >::split_u(), and axom::primal::BezierPatch< T, NDIMS >::split_v().

◆ split_u()

◆ split_v()

◆ split() [2/2]

template<typename T , int NDIMS>
void axom::primal::BezierPatch< T, NDIMS >::split ( u,
v,
BezierPatch< T, NDIMS > &  p1,
BezierPatch< T, NDIMS > &  p2,
BezierPatch< T, NDIMS > &  p3,
BezierPatch< T, NDIMS > &  p4 
) const
inline

Splits a Bezier patch into four Bezier patches.

Parameters
[in]uparameter value between 0 and 1 at which to bisect on the first axis
[in]vparameter value between 0 and 1 at which to bisect on the second axis
[out]p1First output Bezier patch
[out]p2Second output Bezier patch
[out]p3Third output Bezier patch
[out]p4Fourth output Bezier patch

v = 1

| | | | p3 | p4 | | | | -----—(u,v)------— | | | | p1 | p2 | | | | -------------------— u = 1

Precondition
Parameter u and v must be between 0 and 1

References axom::primal::BezierPatch< T, NDIMS >::split_u(), and axom::primal::BezierPatch< T, NDIMS >::split_v().

◆ isPlanar()

template<typename T , int NDIMS>
bool axom::primal::BezierPatch< T, NDIMS >::isPlanar ( double  tol = 1E-8) const
inline

Predicate to check if the Bezier patch is approximately planar.

This function checks if all control points of the BezierPatch are approximately on the plane defined by its four corners

Parameters
[in]tolThreshold for sum of squared distances
Returns
True if c1 is near-planar

References axom::primal::Vector< T, NDIMS >::cross_product(), axom::primal::Vector< T, NDIMS >::dot(), axom::primal::BezierPatch< T, NDIMS >::getOrder_u(), axom::primal::BezierPatch< T, NDIMS >::getOrder_v(), axom::utilities::isNearlyEqual(), axom::primal::Vector< T, NDIMS >::norm(), axom::primal::Vector< T, NDIMS >::scalar_triple_product(), and axom::primal::Vector< T, NDIMS >::unitVector().

◆ isPolygonal()

template<typename T , int NDIMS>
bool axom::primal::BezierPatch< T, NDIMS >::isPolygonal ( double  tol = 1E-8) const
inline

Predicate to check if the patch can be approximated by a polygon.

This function checks if a BezierPatch lies in a plane and that the edged are linear up to tolerance tol

Parameters
[in]tolThreshold for sum of squared distances
Returns
True if c1 is near-planar-polygonal

References axom::primal::BezierPatch< T, NDIMS >::getOrder_u(), axom::primal::BezierPatch< T, NDIMS >::getOrder_v(), axom::primal::BezierPatch< T, NDIMS >::isocurve_u(), axom::primal::BezierPatch< T, NDIMS >::isocurve_v(), and axom::primal::BezierPatch< T, NDIMS >::isPlanar().

◆ print()

template<typename T , int NDIMS>
std::ostream& axom::primal::BezierPatch< T, NDIMS >::print ( std::ostream &  os) const
inline

Simple formatted print of a Bezier Patch instance.

Parameters
osThe output stream to write to
Returns
A reference to the modified ostream

References axom::primal::BezierPatch< T, NDIMS >::getOrder_u(), axom::primal::BezierPatch< T, NDIMS >::getOrder_v(), and axom::primal::BezierPatch< T, NDIMS >::isRational().

Friends And Related Function Documentation

◆ operator==

template<typename T , int NDIMS>
bool operator== ( const BezierPatch< T, NDIMS > &  lhs,
const BezierPatch< T, NDIMS > &  rhs 
)
friend

Checks equality of two Bezier Patches.

◆ operator!=

template<typename T , int NDIMS>
bool operator!= ( const BezierPatch< T, NDIMS > &  lhs,
const BezierPatch< T, NDIMS > &  rhs 
)
friend

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