RobWorkProject
24.8.23-
|
A boundary representation where the geometry of a face is a QuadraticSurface, and an edge curve is a QuadraticCurve. More...
#include <QuadraticBREP.hpp>
Inherits BREP.
Classes | |
class | CommonQuadraticCurveSet |
Convenience type for a set of curves in a QuadraticBREP. More... | |
Public Types | |
typedef rw::core::Ptr< QuadraticBREP > | Ptr |
Smart pointer type to QuadraticBREP. | |
Public Types inherited from BREP | |
typedef rw::core::Ptr< BREP > | Ptr |
Smart pointer type to BREP. | |
typedef rw::core::Ptr< const BREP > | CPtr |
Smart pointer type to const BREP. | |
Public Types inherited from GeometryData | |
enum | GeometryType { PointCloud , LineMesh , PlainTriMesh , IdxTriMesh , SpherePrim , BoxPrim , OBBPrim , AABBPrim , LinePrim , PointPrim , PyramidPrim , ConePrim , TrianglePrim , CylinderPrim , TubePrim , PlanePrim , RayPrim , Implicit , Quadratic , UserType } |
geometry data types | |
typedef rw::core::Ptr< GeometryData > | Ptr |
smart pointer type to this class | |
typedef rw::core::Ptr< const GeometryData > | CPtr |
const smart pointer type to this class | |
Public Member Functions | |
QuadraticBREP () | |
Constructor. | |
virtual | ~QuadraticBREP () |
Destructor. | |
virtual GeometryType | getType () const |
the type of this primitive More... | |
virtual const rw::geometry::QuadraticSurface & | getSurface (std::size_t surfaceIndex) const |
Get surface. More... | |
virtual const rw::geometry::QuadraticCurve & | getCurve (std::size_t curveIndex) const |
Get curve. More... | |
virtual void | scale (double factor) |
Scale the object. More... | |
QuadraticBREP::Ptr | clone () const |
Make a deep copy of the BREP. More... | |
rw::core::Ptr< const QuadraticShell > | shellProxy () const |
Get a Shell representation as a proxy to the BREP. More... | |
rw::core::Ptr< PlainQuadraticShell > | shell () const |
Get a QuadraticShell representation by copying geometric information to a concrete PlainQuadraticShell object. More... | |
std::vector< rw::core::Ptr< rw::geometry::QuadraticCurve > > | getCurves (std::size_t loopIdx) const |
Get the curves in a given loop. More... | |
CommonQuadraticCurveSet::CPtr | getCommonCurves (const std::set< std::size_t > &faces) const |
Get a set of common curves between a set of faces. More... | |
void | addEdge (const rw::geometry::QuadraticCurve &curve, std::size_t v1, std::size_t v2) |
Add a QuadraticCurve to the BREP. More... | |
void | setFace (const rw::geometry::QuadraticSurface &surface, std::size_t loop) |
Attach a QuadraticSurface to a face of the BREP. More... | |
Public Member Functions inherited from BREP | |
virtual | ~BREP () |
Destructor. | |
virtual rw::core::Ptr< TriMesh > | getTriMesh (bool forceCopy=true) |
Create a TriMesh representation from this boundary representation. More... | |
virtual bool | isConvex () |
test if this geometry data is convex More... | |
virtual bool | isConvex () const |
test if this geometry data is convex More... | |
BREP::Ptr | clone () const |
Make a deep copy of the BREP. More... | |
rw::core::Ptr< const rw::geometry::Shell > | shellProxy () const |
Get a Shell representation as a proxy to the BREP. More... | |
std::vector< rw::core::Ptr< rw::geometry::Curve > > | getCurves (std::size_t loopIdx) const |
Get the curves in a given loop. More... | |
CommonCurveSet::CPtr | getCommonCurves (const std::set< std::size_t > &faces) const |
Get a set of common curves between a set of faces. More... | |
std::size_t | faceCount () const |
The number of faces. More... | |
std::size_t | loopCount () const |
The number of loops. More... | |
std::size_t | edgeCount () const |
The number of edges. More... | |
std::size_t | verticeCount () const |
The number of vertices. More... | |
const rw::math::Vector3D< double > & | getVertex (std::size_t vertexIndex) const |
Get vertex. More... | |
std::vector< rw::math::Vector3D< double > > | getVertices (std::size_t loopIdx) const |
Get the vertices in a given loop. More... | |
bool | hasSurfaceSet (std::size_t loop) |
Check if a certain loop has a surface set. More... | |
std::size_t | getSurfaceIndex (std::size_t loop) |
Get the surface index of a loop. More... | |
rw::geometry::OBB | obb (const rw::math::Rotation3D<> &R) |
Create Oriented Bounding Box with certain principal directions. More... | |
rw::geometry::OBB | obb () |
Create Oriented Bounding Box where the directions are estimated. More... | |
void | addVertex (const rw::math::Vector3D< double > &point) |
Add a vertex to the BREP. More... | |
void | makeLoop (int singleEdgeId) |
Create a loop containing a single edge (typically for circles and ellipses and similar). More... | |
template<typename T > | |
int | makeLoop (T first, T second) |
Create a loop containing two edges. More... | |
template<typename T , typename... Args> | |
int | makeLoop (T first, Args... args) |
Create a loop with a variable number of edges. More... | |
void | stitchEdges (std::size_t first, std::size_t second) |
Connect two half-edges. More... | |
void | stitchAuto (double eps) |
Try to stitch edges automatically. More... | |
rw::geometry::OBB | faceOBB (std::size_t faceIndex) |
Create Oriented Bounding Box for a face. More... | |
rw::geometry::OBB | edgeOBR (std::size_t edge) const |
Create Oriented Bounding Rectangle for an edge. More... | |
std::pair< double, double > | faceExtremums (std::size_t faceIndex, const rw::math::Vector3D< double > &dir) const |
Find the extent of the surface along a specific direction. More... | |
rw::core::Ptr< rw::geometry::TriMesh > | faceTriMesh (std::size_t faceIndex) |
Construct a Triangle Mesh for a face. More... | |
void | setMeshResolution (double resolution=10) |
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions. More... | |
virtual void | print () |
Print the structure of the BREP for debugging purposes. | |
Public Member Functions inherited from GeometryData | |
virtual | ~GeometryData () |
Destructor. | |
Additional Inherited Members | |
Static Public Member Functions inherited from GeometryData | |
static std::string | toString (GeometryType type) |
format GeometryType to string More... | |
Protected Member Functions inherited from BREP | |
BREP () | |
Constructor. | |
void | copyTopologyTo (BREP::Ptr brep) const |
Copy the topology of this BREP to another brep. More... | |
void | addBREPEdge (std::size_t curveIndex, std::size_t vertex1, std::size_t vertex2) |
Add a edge (will insert a pair of half-edges). More... | |
void | setBREPFace (std::size_t surfaceIndex, std::size_t loop) |
Attach a surface to a loop. More... | |
Protected Attributes inherited from BREP | |
std::vector< Vertex * > | _vertices |
The vertices in the BREP. | |
std::vector< std::pair< HalfEdge *, HalfEdge * > > | _edges |
The half-edges in the BREP. | |
std::vector< Face * > | _faces |
The faces in the BREP. A face is added for each loop constructed. | |
double | _resolution |
Resolution used for discretization functions. | |
A boundary representation where the geometry of a face is a QuadraticSurface, and an edge curve is a QuadraticCurve.
This implementation adds the geometry related to Quadrics, based on BREP which handles the topology.
To build a geometry composed of Quadratic surfaces and curves, follow the following procedure:
Together this forms a connected set of surfaces, curves and vertices, that forms a closed geometry. Functions are provided that makes it easy to search for various neighbouring primitives in the boundary representation.
It is also possible to retrieve a non-connected shell representation, either by making a PlainQuadraticShell with all information fully copied, or by using a the more lightweight shellProxy which retrieves its information from the underlying QuadraticBREP.
void addEdge | ( | const rw::geometry::QuadraticCurve & | curve, |
std::size_t | v1, | ||
std::size_t | v2 | ||
) |
Add a QuadraticCurve to the BREP.
Notice that the curve has direction. It is expected to have limits such that it starts in vertex v1 and end in v2.
curve | [in] curve to add. |
v1 | [in] the start vertex. |
v2 | [in] the end vertex. |
QuadraticBREP::Ptr clone | ( | ) | const |
CommonQuadraticCurveSet::CPtr getCommonCurves | ( | const std::set< std::size_t > & | faces | ) | const |
Get a set of common curves between a set of faces.
faces | [in] loop indexes for the faces to consider. |
|
virtual |
Get curve.
curveIndex | [in] index of the curve. Should be less than the number returned by edgeCount(). |
Implements BREP.
std::vector<rw::core::Ptr<rw::geometry::QuadraticCurve> > getCurves | ( | std::size_t | loopIdx | ) | const |
Get the curves in a given loop.
The curves will be traversed in an ordered way, and curves will have a direction that leads to the next curve.
loopIdx | [in] the loop index. |
|
virtual |
Get surface.
surfaceIndex | [in] the index of the surface. Should be less than the number returned by size(). |
Implements BREP.
|
virtual |
the type of this primitive
Implements BREP.
|
virtual |
void setFace | ( | const rw::geometry::QuadraticSurface & | surface, |
std::size_t | loop | ||
) |
Attach a QuadraticSurface to a face of the BREP.
surface | [in] surface to add. |
loop | [in] the loop index for the loop to attach surface to. |
rw::core::Ptr<PlainQuadraticShell> shell | ( | ) | const |
Get a QuadraticShell representation by copying geometric information to a concrete PlainQuadraticShell object.
rw::core::Ptr<const QuadraticShell> shellProxy | ( | ) | const |