RobWorkProject  22.2.21-
Public Types | Public Member Functions | List of all members
ImplicitSurface Class Referenceabstract

Interface for implicit surfaces. An implicit surface is given by an expression of the form \( F(\mathbf{x})=0, \mathbf{x} \in \mathbb{R}^3\). More...

#include <ImplicitSurface.hpp>

Inherits Surface.

Inherited by ImplicitTorus, and QuadraticSurface.

Public Types

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

 ImplicitSurface ()
 Constructor.
 
virtual ~ImplicitSurface ()
 Destructor.
 
ImplicitSurface::Ptr transform (const rw::math::Transform3D<> &T) const
 
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...
 
virtual std::pair< double, double > extremums (const rw::math::Vector3D< double > &direction) const =0
 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 =0
 Discretize the surface into a triangle mesh representation. More...
 
virtual void setDiscretizationResolution (double resolution)=0
 Set the resolution used for discretization in the getTriMesh function. More...
 
virtual bool equals (const Surface &surface, double threshold) const =0
 Check if this surface is identical to other surface . More...
 
virtual double operator() (const rw::math::Vector3D< double > &x) const =0
 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 =0
 Get the gradient, \(\nabla \mathbf{F}\), of the surface at a specific point, x, lying on the surface. More...
 
virtual void reuseTrimmingRegions (ImplicitSurface::Ptr surface) const
 Let other surface reuse this surfaces trimming regions, if there are identical region definitions. 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...
 

Detailed Description

Interface for implicit surfaces. An implicit surface is given by an expression of the form \( F(\mathbf{x})=0, \mathbf{x} \in \mathbb{R}^3\).

Member Function Documentation

◆ clone()

ImplicitSurface::Ptr clone ( ) const
inline

Clone the surface.

Returns
pointer to copy of surface.

◆ equals()

virtual bool equals ( const Surface surface,
double  threshold 
) const
pure 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 Surface.

Implemented in QuadraticSurface, and ImplicitTorus.

◆ extremums()

virtual std::pair< double, double > extremums ( const rw::math::Vector3D< double > &  direction) const
pure 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 Surface.

Implemented in QuadraticSurface, and ImplicitTorus.

◆ getTriMesh()

virtual rw::core::Ptr< TriMesh > getTriMesh ( const std::vector< rw::math::Vector3D< double > > &  border = std::vector< rw::math::Vector3D< double > >()) const
pure 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 Surface.

Implemented in QuadraticSurface, and ImplicitTorus.

◆ gradient()

virtual rw::math::Vector3D<double> gradient ( const rw::math::Vector3D< double > &  x) const
pure 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).

Implemented in QuadraticSurface, and ImplicitTorus.

◆ insideTrimmingRegion()

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

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 in QuadraticSurface, and ImplicitTorus.

◆ normal()

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

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 in QuadraticSurface, and ImplicitTorus.

◆ operator()()

virtual double operator() ( const rw::math::Vector3D< double > &  x) const
pure 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.

Implemented in QuadraticSurface, and ImplicitTorus.

◆ reuseTrimmingRegions()

virtual void reuseTrimmingRegions ( ImplicitSurface::Ptr  surface) const
inlinevirtual

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 in QuadraticSurface, and ImplicitTorus.

◆ scale()

ImplicitSurface::Ptr scale ( double  factor) const
inline

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)
pure virtual

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 Surface.

Implemented in QuadraticSurface, and ImplicitTorus.

◆ transform() [1/2]

ImplicitSurface::Ptr transform ( const rw::math::Transform3D<> &  T) const
inline

◆ transform() [2/2]

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

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: