RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
Surface Class Referenceabstract

Surface is an abstract representation of a smooth surface geometry. More...

#include <Surface.hpp>

Inherited by ImplicitSurface.

Public Types

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

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

Detailed Description

Surface is an abstract representation of a smooth surface geometry.

The interface provides functions for affine transformations, such as scaling, rotation and translation. In case of a trimmed surface, it is also possible to make a discretization of the surface to triangle mesh.

Member Function Documentation

◆ clone()

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

Implemented in ImplicitSurface, 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.

Implemented in ImplicitSurface, 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.

Implemented in ImplicitSurface, QuadraticSurface, and ImplicitTorus.

◆ scale()

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

Implemented in ImplicitSurface, QuadraticSurface, and ImplicitTorus.

◆ transform() [1/2]

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

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]

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