RobWorkProject  23.9.11-
Public Types | Public Member Functions | Static Public Member Functions | List of all members
QuadraticSurface Class Reference

A quadratic surface. More...

#include <QuadraticSurface.hpp>

Inherits ImplicitSurface.

Public Types

typedef rw::core::Ptr< QuadraticSurfacePtr
 Smart pointer type for QuadraticSurface.
 
typedef rw::core::Ptr< const QuadraticSurfaceCPtr
 Smart pointer type for const QuadraticSurface.
 
typedef rw::geometry::ImplicitSurface::CPtr TrimmingRegion
 A trimming region is defined using an ImplicitSurface. More...
 
- Public Types inherited from ImplicitSurface
typedef rw::core::Ptr< ImplicitSurfacePtr
 Smart pointer type for ImplicitSurface.
 
typedef rw::core::Ptr< const ImplicitSurfaceCPtr
 Smart pointer type for const ImplicitSurface.
 
- Public Types inherited from Surface
typedef rw::core::Ptr< SurfacePtr
 Smart pointer type for Surface.
 
typedef rw::core::Ptr< const SurfaceCPtr
 Smart pointer type for const Surface.
 

Public Member Functions

 QuadraticSurface (const Eigen::Diagonal< Eigen::Matrix3d > &A, const Eigen::Vector3d &a, double u, const std::vector< TrimmingRegion > &conditions=std::vector< TrimmingRegion >())
 Construct new quadratic surface of the implicit form \( x^T A x + 2 a^T x + u = 0\) when A is diagonal. More...
 
 QuadraticSurface (const Eigen::DiagonalMatrix< double, 3, 3 > &A, const Eigen::Vector3d &a, double u, const std::vector< TrimmingRegion > &conditions=std::vector< TrimmingRegion >())
 
 QuadraticSurface (const Eigen::SelfAdjointView< const Eigen::Matrix3d, Eigen::Upper > &A, const Eigen::Vector3d &a, double u, const std::vector< TrimmingRegion > &conditions=std::vector< TrimmingRegion >())
 Construct new quadratic surface of the implicit form \( x^T A x + 2 a^T x + u = 0\) when A is non-diagonal. More...
 
 QuadraticSurface (const Eigen::SelfAdjointView< Eigen::Matrix3d, Eigen::Upper > &A, const Eigen::Vector3d &a, double u, const std::vector< TrimmingRegion > &conditions=std::vector< TrimmingRegion >())
 
 QuadraticSurface (const Eigen::SelfAdjointView< const Eigen::Matrix3d, Eigen::Lower > &A, const Eigen::Vector3d &a, double u, const std::vector< TrimmingRegion > &conditions=std::vector< TrimmingRegion >())
 Construct new quadratic surface of the implicit form \( x^T A x + 2 a^T x + u = 0\) when A is non-diagonal. More...
 
 QuadraticSurface (const Eigen::SelfAdjointView< Eigen::Matrix3d, Eigen::Lower > &A, const Eigen::Vector3d &a, double u, const std::vector< TrimmingRegion > &conditions=std::vector< TrimmingRegion >())
 
virtual ~QuadraticSurface ()
 Destructor.
 
QuadraticSurface::Ptr transform (const rw::math::Transform3D< double > &T) const
 Move the surface. More...
 
QuadraticSurface::Ptr transform (const rw::math::Vector3D< double > &P) const
 Move the surface without rotation. More...
 
QuadraticSurface::Ptr scale (double factor) const
 Get a scaled version of the surface. More...
 
QuadraticSurface::Ptr clone () const
 Clone the surface. More...
 
virtual std::pair< double, double > extremums (const rw::math::Vector3D< double > &direction) const
 Find the extent of the surface along a specific direction. More...
 
virtual rw::core::Ptr< TriMeshgetTriMesh (const std::vector< rw::math::Vector3D< double >> &border=std::vector< rw::math::Vector3D< double >>()) const
 Discretize the surface into a triangle mesh representation. More...
 
virtual void setDiscretizationResolution (double resolution)
 Set the resolution used for discretization in the getTriMesh function. More...
 
virtual bool equals (const Surface &surface, double threshold) const
 Check if this surface is identical to other surface . More...
 
virtual double operator() (const rw::math::Vector3D< double > &x) const
 Evaluate the implicit function, \( F(\mathbf{x}) \), for the surface. More...
 
virtual bool insideTrimmingRegion (const rw::math::Vector3D< double > &P) const
 Check if point, P, on surface lies inside the trimming region. More...
 
virtual rw::math::Vector3D< double > normal (const rw::math::Vector3D< double > &x) const
 Get the normal of the surface at a specific point, x, lying on the surface. More...
 
virtual rw::math::Vector3D< double > gradient (const rw::math::Vector3D< double > &x) const
 Get the gradient, \(\nabla \mathbf{F}\), of the surface at a specific point, x, lying on the surface. More...
 
virtual void reuseTrimmingRegions (rw::geometry::ImplicitSurface::Ptr surface) const
 Let other surface reuse this surfaces trimming regions, if there are identical region definitions. More...
 
const Eigen::Matrix3d & A () const
 Get the 3 x 3 symmetric matrix for the second order term in the implicit formulation.
 
const Eigen::Vector3d & a () const
 Get the 3d vector for the first order term in the implicit formulation.
 
double u () const
 Get the scalar for the zero order term in the implicit formulation.
 
double determinantA () const
 Get the determinant of the \( \mathbf{A} \) matrix. More...
 
QuadraticSurface::Ptr normalize () const
 Normalize the implicit expression such that the largest coefficient becomes one. More...
 
const std::vector< TrimmingRegion > & getTrimmingConditions () const
 Get the trimming conditions for the surface. More...
 
void setTrimmingConditions (const std::vector< TrimmingRegion > &conditions)
 Set the trimming conditions of this surface. More...
 
void addTrimmingCondition (const TrimmingRegion &condition)
 Add a trimming condition to this surface. More...
 
std::pair< QuadraticSurface, rw::math::Rotation3D<> > diagonalize () const
 Get a diagonalization of the surface. More...
 
bool diagonalized () const
 Check if this surface is diagonalized. More...
 
- Public Member Functions inherited from ImplicitSurface
 ImplicitSurface ()
 Constructor.
 
virtual ~ImplicitSurface ()
 Destructor.
 
ImplicitSurface::Ptr transform (const rw::math::Transform3D< double > &T) const
 Move the surface. More...
 
ImplicitSurface::Ptr transform (const rw::math::Vector3D< double > &P) const
 Move the surface without rotation. More...
 
ImplicitSurface::Ptr scale (double factor) const
 Get a scaled version of the surface. More...
 
ImplicitSurface::Ptr clone () const
 Clone the surface. More...
 
- Public Member Functions inherited from Surface
 Surface ()
 Constructor.
 
virtual ~Surface ()
 Destructor.
 
Surface::Ptr transform (const rw::math::Transform3D< double > &T) const
 Move the surface. More...
 
Surface::Ptr transform (const rw::math::Vector3D< double > &P) const
 Move the surface without rotation. More...
 
Surface::Ptr scale (double factor) const
 Get a scaled version of the surface. More...
 
Surface::Ptr clone () const
 Clone the surface. More...
 

Static Public Member Functions

static QuadraticSurface::Ptr makePlane (const rw::math::Vector3D< double > &n, double d)
 Represent a plane as a QuadraticSurface. More...
 
Normal forms of Quadratic Surfaces

Functions for creation of standard Quadratic Surfaces.

static QuadraticSurface::Ptr makeEllipsoid (double a, double b, double c)
 Create an ellipsoid with radii a, b, and c respectively. More...
 
static QuadraticSurface::Ptr makeSpheroid (double a, double b)
 Create a spheroid (special case of the ellipsoid). More...
 
static QuadraticSurface::Ptr makeSphere (double radius)
 Create a sphere (special case of the ellipsoid and spheroid). More...
 
static QuadraticSurface::Ptr makeEllipticParaboloid (double a, double b)
 Create an elliptic paraboloid. More...
 
static QuadraticSurface::Ptr makeCircularParaboloid (double a)
 Create a circular paraboloid (special case of elliptic paraboloid). More...
 
static QuadraticSurface::Ptr makeHyperbolicParaboloid (double a, double b)
 Create a hyperbolic paraboloid. More...
 
static QuadraticSurface::Ptr makeEllipticHyperboloidOneSheet (double a, double b, double c)
 Create an elliptic hyperboloid of one sheet. More...
 
static QuadraticSurface::Ptr makeCircularHyperboloidOneSheet (double a, double b)
 Create a circular hyperboloid of one sheet (special case of the elliptic hyperboloid of one sheet). More...
 
static QuadraticSurface::Ptr makeEllipticHyperboloidTwoSheets (double a, double b, double c)
 Create an elliptic hyperboloid of two sheets. More...
 
static QuadraticSurface::Ptr makeCircularHyperboloidTwoSheets (double a, double b)
 Create a circular hyperboloid of two sheets (special case of the elliptic hyperboloid of two sheets). More...
 
static QuadraticSurface::Ptr makeEllipticCone (double a, double b, double c)
 Create an elliptic cone. More...
 
static QuadraticSurface::Ptr makeCircularCone (double a, double b)
 Create a circular cone (special case of the elliptic cone). More...
 
static QuadraticSurface::Ptr makeEllipticCylinder (double a, double b)
 Create an elliptic cylinder. More...
 
static QuadraticSurface::Ptr makeCircularCylinder (double radius, bool outward=true)
 Create a circular cylinder (special case of the elliptic cylinder). More...
 
static QuadraticSurface::Ptr makeHyperbolicCylinder (double a, double b)
 Create a hyperbolic cylinder. More...
 
static QuadraticSurface::Ptr makeParabolicCylinder (double a)
 Create a parabolic cylinder. More...
 

Detailed Description

A quadratic surface.

The general quadratic surface is described as an implicit surface of the form:

\( x^T A x + 2 a^T x + u = 0\)

where

A is a symmetric matrix, \( A \in \mathbb{R}^{3\times3} \) , and \( a \in \mathbb{R}^3, u \in \mathbb{R}\)

Member Typedef Documentation

◆ TrimmingRegion

A trimming region is defined using an ImplicitSurface.

A point is only considered part of this surface, if all trimming conditions evaluate to a negative value.

Constructor & Destructor Documentation

◆ QuadraticSurface() [1/6]

QuadraticSurface ( const Eigen::Diagonal< Eigen::Matrix3d > &  A,
const Eigen::Vector3d &  a,
double  u,
const std::vector< TrimmingRegion > &  conditions = std::vector< TrimmingRegion >() 
)

Construct new quadratic surface of the implicit form \( x^T A x + 2 a^T x + u = 0\) when A is diagonal.

Some functions, such as getTriMesh and extremums, work on a diagonalized surface. When this constructor is used, some effort is saved as the surface is already known to be diagonalized.

For a diagonalized surface, all scaled, cloned and translated surfaces will also be diagonalized surfaces.

Parameters
A[in] the diagonal of the A matrix.
a[in] the vector \( a \in \mathbb{R}^3\) .
u[in] the scalar offset \( u \in \mathbb{R} \) .
conditions[in] (optional) list of trimming conditions.

◆ QuadraticSurface() [2/6]

QuadraticSurface ( const Eigen::DiagonalMatrix< double, 3, 3 > &  A,
const Eigen::Vector3d &  a,
double  u,
const std::vector< TrimmingRegion > &  conditions = std::vector< TrimmingRegion >() 
)

◆ QuadraticSurface() [3/6]

QuadraticSurface ( const Eigen::SelfAdjointView< const Eigen::Matrix3d, Eigen::Upper > &  A,
const Eigen::Vector3d &  a,
double  u,
const std::vector< TrimmingRegion > &  conditions = std::vector< TrimmingRegion >() 
)

Construct new quadratic surface of the implicit form \( x^T A x + 2 a^T x + u = 0\) when A is non-diagonal.

Parameters
A[in] a view of the upper part of the symmetric matrix \( A \in \mathbb{R}^{3\times3} \) . Use the Eigen function A.selfadjointView<Eigen::Upper>() to extract the upper part.
a[in] the vector \( a \in \mathbb{R}^3\) .
u[in] the scalar offset \( u \in \mathbb{R} \) .
conditions[in] (optional) list of trimming conditions.

◆ QuadraticSurface() [4/6]

QuadraticSurface ( const Eigen::SelfAdjointView< Eigen::Matrix3d, Eigen::Upper > &  A,
const Eigen::Vector3d &  a,
double  u,
const std::vector< TrimmingRegion > &  conditions = std::vector< TrimmingRegion >() 
)

Parameters
A[in] a view of the upper part of the symmetric matrix \( A \in \mathbb{R}^{3\times3} \) . Use the Eigen function A.selfadjointView<Eigen::Upper>() to extract the upper part.
a[in] the vector \( a \in \mathbb{R}^3\) .
u[in] the scalar offset \( u \in \mathbb{R} \) .
conditions[in] (optional) list of trimming conditions.

◆ QuadraticSurface() [5/6]

QuadraticSurface ( const Eigen::SelfAdjointView< const Eigen::Matrix3d, Eigen::Lower > &  A,
const Eigen::Vector3d &  a,
double  u,
const std::vector< TrimmingRegion > &  conditions = std::vector< TrimmingRegion >() 
)

Construct new quadratic surface of the implicit form \( x^T A x + 2 a^T x + u = 0\) when A is non-diagonal.

Parameters
A[in] a view of the lower part of the symmetric matrix \( A \in \mathbb{R}^{3\times3} \) . Use the Eigen function A.selfadjointView<Eigen::Lower>() to extract the lower part.
a[in] the vector \( a \in \mathbb{R}^3\) .
u[in] the scalar offset \( u \in \mathbb{R} \) .
conditions[in] (optional) list of trimming conditions.

◆ QuadraticSurface() [6/6]

QuadraticSurface ( const Eigen::SelfAdjointView< Eigen::Matrix3d, Eigen::Lower > &  A,
const Eigen::Vector3d &  a,
double  u,
const std::vector< TrimmingRegion > &  conditions = std::vector< TrimmingRegion >() 
)

Parameters
A[in] a view of the lower part of the symmetric matrix \( A \in \mathbb{R}^{3\times3} \) . Use the Eigen function A.selfadjointView<Eigen::Lower>() to extract the lower part.
a[in] the vector \( a \in \mathbb{R}^3\) .
u[in] the scalar offset \( u \in \mathbb{R} \) .
conditions[in] (optional) list of trimming conditions.

Member Function Documentation

◆ addTrimmingCondition()

void addTrimmingCondition ( const TrimmingRegion condition)
inline

Add a trimming condition to this surface.

Parameters
condition[in] the condition to add.

◆ clone()

QuadraticSurface::Ptr clone ( ) const

Clone the surface.

Returns
pointer to copy of surface.

◆ determinantA()

double determinantA ( ) const
inline

Get the determinant of the \( \mathbf{A} \) matrix.

Returns
the determinant.

◆ diagonalize()

std::pair<QuadraticSurface, rw::math::Rotation3D<> > diagonalize ( ) const

Get a diagonalization of the surface.

Returns
the diagonalized surface, and the rotation transforming this surface into the diagonalized surface.

◆ diagonalized()

bool diagonalized ( ) const
inline

Check if this surface is diagonalized.

Returns
true if A is digaonalized, false otherwise.

◆ equals()

virtual bool equals ( const Surface surface,
double  threshold 
) const
virtual

Check if this surface is identical to other surface .

Parameters
surface[in] other surface to compare to.
threshold[in] threshold for when surfaces can be considered identical.
Returns
true if identical, false otherwise.

Implements ImplicitSurface.

◆ extremums()

virtual std::pair<double, double> extremums ( const rw::math::Vector3D< double > &  direction) const
virtual

Find the extent of the surface along a specific direction.

If the surface has no lower bound, the value -std::numeric_limits<double>::max() can be returned to indicate that the surface has unbounded minimum value in the given direction.

If the surface has no upper bound, the value std::numeric_limits<double>::max() can be returned to indicate that the surface has unbounded maximum value in the given direction.

Parameters
direction[in] a normalized direction vector.
Returns
the minimum and maximum values along the given direction.
Note
This function does not take trimming conditions into account. For trimmed surfaces, create a Face with the boundary curves and use Face::extremums.

Implements ImplicitSurface.

◆ getTriMesh()

virtual rw::core::Ptr<TriMesh> getTriMesh ( const std::vector< rw::math::Vector3D< double >> &  border = std::vector< rw::math::Vector3D< double >>()) const
virtual

Discretize the surface into a triangle mesh representation.

If the border of a trimmed surface must fit with other surface triangulations, a discretized border must be given to this triangulation function.

If the same border points are used for different surfaces for their common edges, the triangulations will fit together.

Parameters
border[in] (optional) an ordered list of points on the surface, that forms the border of the patch to triangulate.
Returns
a new TriMesh.

Implements ImplicitSurface.

◆ getTrimmingConditions()

const std::vector<TrimmingRegion>& getTrimmingConditions ( ) const
inline

Get the trimming conditions for the surface.

Returns
ImplicitSurface vector specifying the boundary of the surface. If surface is unbounded, the length of the vector is zero.

◆ gradient()

virtual rw::math::Vector3D<double> gradient ( const rw::math::Vector3D< double > &  x) const
virtual

Get the gradient, \(\nabla \mathbf{F}\), of the surface at a specific point, x, lying on the surface.

The gradient is the vector of partial derivatives \( \nabla \mathbf{F} = \begin{bmatrix}\frac{\partial F}{\partial x} & \frac{\partial F}{\partial y} & \frac{\partial F}{\partial z} \end{bmatrix}^T \)

Parameters
x[in] a point on the surface.
Returns
the gradient, \(\nabla \mathbf{F}\), of the surface at x .
See also
the normal function to find the normal to the surface (the normalized gradient).

Implements ImplicitSurface.

◆ insideTrimmingRegion()

virtual bool insideTrimmingRegion ( const rw::math::Vector3D< double > &  P) const
virtual

Check if point, P, on surface lies inside the trimming region.

Parameters
P[in] the point to check.
Returns
true if the points lies inside the trimming region.

Reimplemented from ImplicitSurface.

◆ makeCircularCone()

static QuadraticSurface::Ptr makeCircularCone ( double  a,
double  b 
)
static

Create a circular cone (special case of the elliptic cone).

Normal form of Quadratic Surface:

Circular Cone (special case of elliptic cone)."

Parameters
a[in] radius of the circle in the \( x_1\) and \( x_2\) directions when \( x_3=c\) .
b[in] rate of change for the radius.
Returns
a QuadraticSurface representation of a circular cone.

◆ makeCircularCylinder()

static QuadraticSurface::Ptr makeCircularCylinder ( double  radius,
bool  outward = true 
)
static

Create a circular cylinder (special case of the elliptic cylinder).

Normal form of Quadratic Surface:

Circular Cylinder (special case of elliptic cylinder)."

Parameters
radius[in] radius in the \( x_1\) and \( x_2\) directions.
outward[in] (optional) set to false to create inner surface of cylinder, with normals pointing inwards.
Returns
a QuadraticSurface representation of a circular cylinder.

◆ makeCircularHyperboloidOneSheet()

static QuadraticSurface::Ptr makeCircularHyperboloidOneSheet ( double  a,
double  b 
)
static

Create a circular hyperboloid of one sheet (special case of the elliptic hyperboloid of one sheet).

Normal form of Quadratic

Surface: Circular Hyperboloid of One Sheet (special case of elliptic hyperboloid of one sheet)."

Parameters
a[in] radius of the circle in the \( x_1\) and \( x_2\) directions when \( x_3=0\) .
b[in] radius is scaled along \( x_3\) , to \( \frac{a}{c}\sqrt{x_3^2+c^2}\) .
Returns
a QuadraticSurface representation of a circular hyperboloid of one sheet.

◆ makeCircularHyperboloidTwoSheets()

static QuadraticSurface::Ptr makeCircularHyperboloidTwoSheets ( double  a,
double  b 
)
static

Create a circular hyperboloid of two sheets (special case of the elliptic hyperboloid of two sheets).

Normal form of

Quadratic Surface: Circular Hyperboloid of Two Sheets (special case of elliptic hyperboloid of two sheets)."

Parameters
a[in] radius of the circle in the \( x_1\) and \( x_2\) directions when \( x_3=\pm\sqrt{2}b\) .
b[in] distance from origo to each of the the two sheets.
Returns
a QuadraticSurface representation of a circular hyperboloid of two sheets.

◆ makeCircularParaboloid()

static QuadraticSurface::Ptr makeCircularParaboloid ( double  a)
static

Create a circular paraboloid (special case of elliptic paraboloid).

Normal form of Quadratic Surface:

Circular Paraboloid (special case of elliptic paraboloid)."

Parameters
a[in] radius of the circle when \( x_3=1\) .
Returns
a QuadraticSurface representation of a circular paraboloid.

◆ makeEllipsoid()

static QuadraticSurface::Ptr makeEllipsoid ( double  a,
double  b,
double  c 
)
static

Create an ellipsoid with radii a, b, and c respectively.

Normal form of Quadratic Surface:

Ellipsoid."

Parameters
a[in] radius in the \( x_1 \) direction.
b[in] radius in the \( x_2 \) direction.
c[in] radius in the \( x_3 \) direction.
Returns
a QuadraticSurface representation of an ellipsoid.

◆ makeEllipticCone()

static QuadraticSurface::Ptr makeEllipticCone ( double  a,
double  b,
double  c 
)
static

Create an elliptic cone.

The cone is a singular (or degenerate) surface as it has a point where the gradient vanishes. In the origo the gradient will always be zero, and no normal can be determined.

Normal form of Quadratic Surface:

Elliptic Cone."

Parameters
a[in] radius of the ellipse in the \( x_1\) direction when \( x_3=c\) .
b[in] radius of the ellipse in the \( x_2\) direction when \( x_3=c\) .
c[in] rate of change for the radius.
Returns
a QuadraticSurface representation of an elliptic cone.

◆ makeEllipticCylinder()

static QuadraticSurface::Ptr makeEllipticCylinder ( double  a,
double  b 
)
static

Create an elliptic cylinder.

Normal form of Quadratic Surface:

Elliptic Cylinder."

Parameters
a[in] radius in the \( x_1\) direction.
b[in] radius in the \( x_2\) direction.
Returns
a QuadraticSurface representation of an elliptic cylinder.

◆ makeEllipticHyperboloidOneSheet()

static QuadraticSurface::Ptr makeEllipticHyperboloidOneSheet ( double  a,
double  b,
double  c 
)
static

Create an elliptic hyperboloid of one sheet.

Normal form of Quadratic

Surface: Elliptic Hyperboloid of One Sheet."

Parameters
a[in] radius of the ellipse in the \( x_1\) direction when \( x_3=0\) .
b[in] radius of the ellipse in the \( x_2\) direction when \( x_3=0\) .
c[in] radius is scaled with the factor \( \frac{1}{c}\sqrt{x_3^2+c^2}\) .
Returns
a QuadraticSurface representation of an elliptic hyperboloid of one sheet.

◆ makeEllipticHyperboloidTwoSheets()

static QuadraticSurface::Ptr makeEllipticHyperboloidTwoSheets ( double  a,
double  b,
double  c 
)
static

Create an elliptic hyperboloid of two sheets.

Normal form of

Quadratic Surface: Elliptic Hyperboloid of Two Sheets."

Parameters
a[in] radius of the ellipse in the \( x_1\) direction when \( x_3=\pm\sqrt{2}c\) .
b[in] radius of the ellipse in the \( x_2\) direction when \( x_3=\pm\sqrt{2}c\) .
c[in] distance from origo to each of the the two sheets.
Returns
a QuadraticSurface representation of an elliptic hyperboloid of two sheets.

◆ makeEllipticParaboloid()

static QuadraticSurface::Ptr makeEllipticParaboloid ( double  a,
double  b 
)
static

Create an elliptic paraboloid.

Normal form of Quadratic Surface:

Elliptic Paraboloid."

Parameters
a[in] radius of the ellipse in the \( x_1\) direction when \( x_3=1\) .
b[in] radius of the ellipse in the \( x_2\) direction when \( x_3=1\) .
Returns
a QuadraticSurface representation of an elliptic paraboloid.

◆ makeHyperbolicCylinder()

static QuadraticSurface::Ptr makeHyperbolicCylinder ( double  a,
double  b 
)
static

Create a hyperbolic cylinder.

Normal form of Quadratic Surface:

Hyperbolic Cylinder."

Parameters
a[in] width in the \( x_1\) direction at \( x_2=0\) .
b[in] controls the rate of change in the \( x_1\) direction.
Returns
a QuadraticSurface representation of a hyperbolic cylinder.

◆ makeHyperbolicParaboloid()

static QuadraticSurface::Ptr makeHyperbolicParaboloid ( double  a,
double  b 
)
static

Create a hyperbolic paraboloid.

Normal form of Quadratic

Surface: Hyperbolic Paraboloid."

Parameters
a[in] width in the \( x_1\) direction when \( x_3=1\) .
b[in] width in the \( x_2\) direction when \( x_3=-1\) .
Returns
a QuadraticSurface representation of a hyperbolic paraboloid.

◆ makeParabolicCylinder()

static QuadraticSurface::Ptr makeParabolicCylinder ( double  a)
static

Create a parabolic cylinder.

Normal form of Quadratic Surface:

Parabolic Cylinder."

Parameters
a[in] controls the focal length of the parabola.
Returns
a QuadraticSurface representation of a parabolic cylinder.

◆ makePlane()

static QuadraticSurface::Ptr makePlane ( const rw::math::Vector3D< double > &  n,
double  d 
)
static

Represent a plane as a QuadraticSurface.

A plane is a particularly simple type of quadratic surface, where \( \mathbf{A}=\mathbf{0}\) .

Even though a plane is not strictly a quadratic surface, is is often convenient to be able to treat it like a quadratic surface.

Parameters
n[in] the normal of the plane.
d[in] the distance from the plane to the origo.
Returns
a QuadraticSurface representing a plane.

◆ makeSphere()

static QuadraticSurface::Ptr makeSphere ( double  radius)
static

Create a sphere (special case of the ellipsoid and spheroid).

Normal form of Quadratic Surface: Sphere

(special case of ellipsoid and spheroid)."

Parameters
radius[in] radius of the sphere.
Returns
a QuadraticSurface representation of a sphere.

◆ makeSpheroid()

static QuadraticSurface::Ptr makeSpheroid ( double  a,
double  b 
)
static

Create a spheroid (special case of the ellipsoid).

Normal form of Quadratic Surface: Spheroid

(special case of ellipsoid)."

Parameters
a[in] radius in the \( x_1 \) and \( x_2 \) directions.
b[in] radius in the \( x_3 \) direction.
Returns
a QuadraticSurface representation of a spheroid.

◆ normal()

virtual rw::math::Vector3D<double> normal ( const rw::math::Vector3D< double > &  x) const
virtual

Get the normal of the surface at a specific point, x, lying on the surface.

For the point on the implicit surface, where \( F(\mathbf{x})=0 \) , the normal is the direction of the gradient \(\frac{\nabla \mathbf{F}}{\|\nabla \mathbf{F}\|}\) .

Parameters
x[in] a point on the surface.
Returns
the normal to the surface at x .
See also
the gradient function to find the gradient.

Reimplemented from ImplicitSurface.

◆ normalize()

QuadraticSurface::Ptr normalize ( ) const

Normalize the implicit expression such that the largest coefficient becomes one.

For a quadratic surface, a scaling of \( \mathbf{A}, \mathbf{a} \) and u with a common factor, will give the exact same surface. This means that the numerical values can get arbitrarily big or small. This functions scales the expression such that the largest element becomes 1.

Returns
a mathematically identical surface, where the coefficients of the defining equation is normalized.

◆ operator()()

virtual double operator() ( const rw::math::Vector3D< double > &  x) const
virtual

Evaluate the implicit function, \( F(\mathbf{x}) \), for the surface.

Parameters
x[in] the point to evaluate.
Returns
the value of the implicit function. If smaller than zero, x lies inside the surface. If larger than zero, x lies outside the surface.

Implements ImplicitSurface.

◆ reuseTrimmingRegions()

virtual void reuseTrimmingRegions ( rw::geometry::ImplicitSurface::Ptr  surface) const
virtual

Let other surface reuse this surfaces trimming regions, if there are identical region definitions.

This allows for some implementations to save a small amount of memory.

Parameters
surface[in/out] the other surface.

Reimplemented from ImplicitSurface.

◆ scale()

QuadraticSurface::Ptr scale ( double  factor) const

Get a scaled version of the surface.

Parameters
factor[in] the factor to scale with.
Returns
a new scaled surface.

◆ setDiscretizationResolution()

virtual void setDiscretizationResolution ( double  resolution)
inlinevirtual

Set the resolution used for discretization in the getTriMesh function.

The meaning of this parameter depends on the type of surface.

Parameters
resolution[in] the resolution parameter.

Implements ImplicitSurface.

◆ setTrimmingConditions()

void setTrimmingConditions ( const std::vector< TrimmingRegion > &  conditions)
inline

Set the trimming conditions of this surface.

Parameters
conditions[in] a vector of conditions.

◆ transform() [1/2]

QuadraticSurface::Ptr transform ( const rw::math::Transform3D< double > &  T) const

Move the surface.

Parameters
T[in] the transform to the new surface.
Returns
pointer to a new surface.
See also
transform(const rw::math::Vector3D<double>&) const if there is no rotation. This will preserve some nice properties for certain types of surfaces.

◆ transform() [2/2]

QuadraticSurface::Ptr transform ( const rw::math::Vector3D< double > &  P) const

Move the surface without rotation.

If there is no rotation, this function is better to use than transform(const rw::math::Transform3D<>&) const for some surfaces. This is because certain properties can be preserved.

Parameters
P[in] the translation vector to the new surface.
Returns
pointer to a new surface.

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