sdurw_geometry module
- class sdurw_geometry.sdurw_geometry.AABB(*args)
Bases:
BvAABB
Axis Aligned Bounding Box class
- __init__(*args)
- Overload 1:
constructor
Overload 2:
Construct an AABB by defining the two oposit corners :type corner1: rw::math::Vector3D< double > :param corner1: [in] the first corner :type corner2: rw::math::Vector3D< double > :param corner2: [in] the second corner
- calcArea()
calculates the total area of the box
- calcVolume()
calculate the volume of this OBB
- diagonal()
returns the diagonal of the box :rtype: rw::math::Vector3D< double > :return: Vector3D<double>
- getHalfLengths()
get halflengths of this box
- getPosition()
position of this AABB
- setHalfLengths(pos)
set half lengths
- setPosition(pos)
set position
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.AnalyticUtil(*args, **kwargs)
Bases:
object
Utility functions for functions dealing with analytic geometry.
- __init__(*args, **kwargs)
- static combinePolygons(border, subborder, curves, stepsPerRevolution)
Combine discretized borders with curves to form polygons.
The curves are themselves discretized to form the polygon.
- Parameters
border (std::vector< rw::math::Vector3D< double > >) – [in] the full list of points.
subborder (std::list< std::vector< std::size_t > >) – [in] a list of border sections. Each section is a vector of indices into border.
curves (std::vector< rw::geometry::QuadraticCurve >) – [in] the curves to combine with the border sections.
stepsPerRevolution (float) – [in] the resolution for discretization of the curves.
- Return type
std::list< std::vector< rw::math::Vector3D< double > > >
- Returns
a list of polygons. Each polygon is a list of points.
- property thisown
The membership flag
- sdurw_geometry.sdurw_geometry.AnalyticUtil_combinePolygons(border, subborder, curves, stepsPerRevolution)
Combine discretized borders with curves to form polygons.
The curves are themselves discretized to form the polygon.
- Parameters
border (std::vector< rw::math::Vector3D< double > >) – [in] the full list of points.
subborder (std::list< std::vector< std::size_t > >) – [in] a list of border sections. Each section is a vector of indices into border.
curves (std::vector< rw::geometry::QuadraticCurve >) – [in] the curves to combine with the border sections.
stepsPerRevolution (float) – [in] the resolution for discretization of the curves.
- Return type
std::list< std::vector< rw::math::Vector3D< double > > >
- Returns
a list of polygons. Each polygon is a list of points.
- class sdurw_geometry.sdurw_geometry.BREP(*args, **kwargs)
Bases:
GeometryData
Boundary representation (or B-Rep) of a geometric shape, using a collection of connected surfaces, edges and vertices.
In the Shell representation, the geometric shape is formed as a collection of disconnected faces. The BREP representation adds more information about the topology, as surface and curve elements are connected. For a certain surface, curve or vertex, it is possible to find information about the directly connected neighbouring surfaces, edges and vertices. From a BREP it is also possible to retrieve a Shell representation, but in the Shell representation information about connectedness is lost.
The half-edge data structure is used internally to store the topological information about the faces, edges and vertices, and how they are connected. Subtypes of BREP implements the concrete Surface and Curve geometries that can be attached to the faces and edges.
In general, the procedure for forming a BREP is the following:
1. Add all the needed vertices by using the addVertex function. Each vertex is given an index starting, increasing from zero.
2. Add the edges. An edge is added between two vertices using their vertex indexes. Addition of edges is documented under the specific BREP implementation (depending on the type of Curve that is expected). The edge is in general added with a Curve and two vertex indices. Notice that the curve must have limits, such that it starts in the first vertex and ends in the second vertex (the curve has a direction). Each edge is given an index, increasing from zero.
3. Use the makeLoop function to form loops, based on the edges just added. The makeLoop takes an arbitrary number of edge indices. Notice that makeLoop expects the edge indexing to start at 1, and supports negative indices to indicate opposite direction of the edge. To form a loop, a list of these indexes is given, to form a counter clockwise loop of edges. Each loop is given a loop index, increasing from zero.
4. Attach a Surface to each loop. Again, the addition of surfaces is documented under the specific BREP implementation (depending on the type of Surface that is expected). Each surface is given an increasing surface index, starting from zero. Notice that this index is not necessarily the same as the loop index.
- __init__(*args, **kwargs)
- addVertex(point)
Add a vertex to the BREP. :type point: rw::math::Vector3D< double > :param point: [in] the vertex to add.
- clone()
Make a deep copy of the BREP. :rtype:
Ptr
:return: a copy of the BREP.
- edgeCount()
The number of edges. :rtype: int :return: the number of edges.
- edgeOBR(edge)
Create Oriented Bounding Rectangle for an edge. :type edge: int :param edge: [in] the edge index, which should be less than edgeCount(). :rtype: rw::geometry::OBB< double > :return: OBB for the given edge (with third half-length set to zero).
- faceCount()
The number of faces.
The number of faces is the number of loops, where a surface has been attached.
- Return type
int
- Returns
the number of faces.
- faceExtremums(faceIndex, dir)
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
faceIndex (int) – [in] the face index, which should be less than loopCount().
dir (rw::math::Vector3D< double >) – [in] a normalized direction vector.
- Return type
std::pair< double,double >
- Returns
the minimum and maximum values along the given direction.
- faceOBB(faceIndex)
Create Oriented Bounding Box for a face. :type faceIndex: int :param faceIndex: [in] the face index, which should be less than loopCount(). :rtype: rw::geometry::OBB< double > :return: OBB for the given face.
- faceTriMesh(faceIndex)
Construct a Triangle Mesh for a face. :type faceIndex: int :param faceIndex: [in] the face index, which should be less than loopCount(). :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: a triangle mesh.
- getCommonCurves(faces)
Get a set of common curves between a set of faces. :type faces: std::set< std::size_t > :param faces: [in] loop indexes for the faces to consider. :rtype: rw::geometry::BREP::CommonCurveSet::CPtr :return: set of common curves as a CommonCurveSet.
- getCurve(curveIndex)
Get curve. :type curveIndex: int :param curveIndex: [in] index of the curve. Should be less than the number returned by
edgeCount().
- Return type
- Returns
a reference to the curve.
- getCurves(loopIdx)
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.
- Parameters
loopIdx (int) – [in] the loop index.
- Return type
std::vector< rw::core::Ptr< rw::geometry::Curve > >
- Returns
an ordered vector of curves.
- getSurface(surfaceIndex)
Get surface. :type surfaceIndex: int :param surfaceIndex: [in] the index of the surface. Should be less than the number
returned by size().
- Return type
- Returns
a reference to the surface.
- getSurfaceIndex(loop)
Get the surface index of a loop. :type loop: int :param loop: [in] the loop index. :rtype: int :return: the corresponding surface index.
- getTriMesh(forceCopy=True)
Create a TriMesh representation from this boundary representation.
This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.
- Parameters
forceCopy (boolean, optional) – [in] generate a new copy, or use a cached TriMesh.
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh if forceCopy is true, or a shared cached TriMesh if forceCopy is false.
- getType()
the type of this primitive
- getVertex(vertexIndex)
Get vertex. :type vertexIndex: int :param vertexIndex: [in] index of the vertex. Should be less than the number returned by
vertices().
- Return type
rw::math::Vector3D< double >
- Returns
reference to the vertex.
- getVertices(loopIdx)
Get the vertices in a given loop.
The curves will be traversed in an ordered way around the loop.
- Parameters
loopIdx (int) – [in] the loop index.
- Return type
std::vector< rw::math::Vector3D< double > >
- Returns
a collection of vertices.
- hasSurfaceSet(loop)
Check if a certain loop has a surface set. :type loop: int :param loop: [in] index of the loop, which should be less than loopCount(). :rtype: boolean :return: true if a surface is set, false otherwise.
- isConvex(*args)
Overload 1:
Overload 2:
- loopCount()
The number of loops. :rtype: int :return: the number of loops.
- makeLoop(singleEdgeId)
Create a loop containing a single edge (typically for circles and ellipses and similar).
The half-edge structure requires that an edge must start and end in a vertex. Sometimes it is possible to have an edge without any vertices. This is, for example, the case for a circular or elliptic cylinder, where there will be two circular or elliptic edges. It is necessary to place one vertex on the circle or ellipse that can act as both the start and end vertex for the curve.
- Parameters
singleEdgeId (int) – [in] id of the edge to create loop for. 1-indexing is expected, with a sign that indicates the edge direction.
- obb(*args)
Overload 1:
Create Oriented Bounding Box with certain principal directions. :type R: rw::math::Rotation3D< > :param R: [in] the directions for the bounding box. :rtype: rw::geometry::OBB< double > :return: an OBB around the BREP.
Overload 2:
Create Oriented Bounding Box where the directions are estimated.
This method is more expensive than obb(const rw::math::Rotation3D<>&), because a TriMesh is formed to estimated the principal directions of the OBB.
- Return type
rw::geometry::OBB< double >
- Returns
an OBB around the BREP.
- printObj()
Print the structure of the BREP for debugging purposes.
- scale(factor)
Scale the object. :type factor: float :param factor: [in] the factor to scale with.
- setMeshResolution(resolution=10)
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float, optional) – [in] the resolution parameter.
- shellProxy()
Get a Shell representation as a proxy to the BREP. :rtype: rw::core::Ptr< rw::geometry::Shell const > :return: smart pointer to a Shell proxy object.
- stitchAuto(eps)
Try to stitch edges automatically. :type eps: float :param eps: [in] distance threshold for vertices and curves.
- stitchEdges(first, second)
Connect two half-edges. :type first: int :param first: [in] id of the first edge. 0-indexing is expected, with a sign that
indicates the edge direction.
- Parameters
second (int) – [in] id of the second edge. 0-indexing is expected, with a sign that indicates the edge direction.
Notes: Implementations calling this function should remember to delete the curve associated to the second half-edge if it is different than the curve set for the first half-edge. :raises: rw::core::Exception if one of the given half-edges is already connected to
another half-edge.
- property thisown
The membership flag
- verticeCount()
The number of vertices. :rtype: int :return: the number of vertices.
- class sdurw_geometry.sdurw_geometry.BREPCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- clone()
Make a deep copy of the BREP. :rtype:
Ptr
:return: a copy of the BREP.
- deref()
The pointer stored in the object.
- edgeCount()
The number of edges. :rtype: int :return: the number of edges.
- edgeOBR(edge)
Create Oriented Bounding Rectangle for an edge. :type edge: int :param edge: [in] the edge index, which should be less than edgeCount(). :rtype: rw::geometry::OBB< double > :return: OBB for the given edge (with third half-length set to zero).
- faceCount()
The number of faces.
The number of faces is the number of loops, where a surface has been attached.
- Return type
int
- Returns
the number of faces.
- faceExtremums(faceIndex, dir)
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
faceIndex (int) – [in] the face index, which should be less than loopCount().
dir (rw::math::Vector3D< double >) – [in] a normalized direction vector.
- Return type
std::pair< double,double >
- Returns
the minimum and maximum values along the given direction.
- getCommonCurves(faces)
Get a set of common curves between a set of faces. :type faces: std::set< std::size_t > :param faces: [in] loop indexes for the faces to consider. :rtype: rw::geometry::BREP::CommonCurveSet::CPtr :return: set of common curves as a CommonCurveSet.
- getCurve(curveIndex)
Get curve. :type curveIndex: int :param curveIndex: [in] index of the curve. Should be less than the number returned by
edgeCount().
- Return type
- Returns
a reference to the curve.
- getCurves(loopIdx)
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.
- Parameters
loopIdx (int) – [in] the loop index.
- Return type
std::vector< rw::core::Ptr< rw::geometry::Curve > >
- Returns
an ordered vector of curves.
- getDeref()
Member access operator.
- getSurface(surfaceIndex)
Get surface. :type surfaceIndex: int :param surfaceIndex: [in] the index of the surface. Should be less than the number
returned by size().
- Return type
- Returns
a reference to the surface.
- getType()
- getVertex(vertexIndex)
Get vertex. :type vertexIndex: int :param vertexIndex: [in] index of the vertex. Should be less than the number returned by
vertices().
- Return type
rw::math::Vector3D< double >
- Returns
reference to the vertex.
- getVertices(loopIdx)
Get the vertices in a given loop.
The curves will be traversed in an ordered way around the loop.
- Parameters
loopIdx (int) – [in] the loop index.
- Return type
std::vector< rw::math::Vector3D< double > >
- Returns
a collection of vertices.
- isConvex(*args)
Overload 1:
Overload 2:
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- loopCount()
The number of loops. :rtype: int :return: the number of loops.
- shellProxy()
Get a Shell representation as a proxy to the BREP. :rtype: rw::core::Ptr< rw::geometry::Shell const > :return: smart pointer to a Shell proxy object.
- property thisown
The membership flag
- verticeCount()
The number of vertices. :rtype: int :return: the number of vertices.
- class sdurw_geometry.sdurw_geometry.BREPPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- addVertex(point)
Add a vertex to the BREP. :type point: rw::math::Vector3D< double > :param point: [in] the vertex to add.
- clone()
Make a deep copy of the BREP. :rtype:
Ptr
:return: a copy of the BREP.
- cptr()
- deref()
The pointer stored in the object.
- edgeCount()
The number of edges. :rtype: int :return: the number of edges.
- edgeOBR(edge)
Create Oriented Bounding Rectangle for an edge. :type edge: int :param edge: [in] the edge index, which should be less than edgeCount(). :rtype: rw::geometry::OBB< double > :return: OBB for the given edge (with third half-length set to zero).
- faceCount()
The number of faces.
The number of faces is the number of loops, where a surface has been attached.
- Return type
int
- Returns
the number of faces.
- faceExtremums(faceIndex, dir)
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
faceIndex (int) – [in] the face index, which should be less than loopCount().
dir (rw::math::Vector3D< double >) – [in] a normalized direction vector.
- Return type
std::pair< double,double >
- Returns
the minimum and maximum values along the given direction.
- faceOBB(faceIndex)
Create Oriented Bounding Box for a face. :type faceIndex: int :param faceIndex: [in] the face index, which should be less than loopCount(). :rtype: rw::geometry::OBB< double > :return: OBB for the given face.
- faceTriMesh(faceIndex)
Construct a Triangle Mesh for a face. :type faceIndex: int :param faceIndex: [in] the face index, which should be less than loopCount(). :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: a triangle mesh.
- getCommonCurves(faces)
Get a set of common curves between a set of faces. :type faces: std::set< std::size_t > :param faces: [in] loop indexes for the faces to consider. :rtype: rw::geometry::BREP::CommonCurveSet::CPtr :return: set of common curves as a CommonCurveSet.
- getCurve(curveIndex)
Get curve. :type curveIndex: int :param curveIndex: [in] index of the curve. Should be less than the number returned by
edgeCount().
- Return type
- Returns
a reference to the curve.
- getCurves(loopIdx)
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.
- Parameters
loopIdx (int) – [in] the loop index.
- Return type
std::vector< rw::core::Ptr< rw::geometry::Curve > >
- Returns
an ordered vector of curves.
- getDeref()
Member access operator.
- getSurface(surfaceIndex)
Get surface. :type surfaceIndex: int :param surfaceIndex: [in] the index of the surface. Should be less than the number
returned by size().
- Return type
- Returns
a reference to the surface.
- getSurfaceIndex(loop)
Get the surface index of a loop. :type loop: int :param loop: [in] the loop index. :rtype: int :return: the corresponding surface index.
- getTriMesh(forceCopy=True)
Create a TriMesh representation from this boundary representation.
This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.
- Parameters
forceCopy (boolean, optional) – [in] generate a new copy, or use a cached TriMesh.
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh if forceCopy is true, or a shared cached TriMesh if forceCopy is false.
- getType()
- getVertex(vertexIndex)
Get vertex. :type vertexIndex: int :param vertexIndex: [in] index of the vertex. Should be less than the number returned by
vertices().
- Return type
rw::math::Vector3D< double >
- Returns
reference to the vertex.
- getVertices(loopIdx)
Get the vertices in a given loop.
The curves will be traversed in an ordered way around the loop.
- Parameters
loopIdx (int) – [in] the loop index.
- Return type
std::vector< rw::math::Vector3D< double > >
- Returns
a collection of vertices.
- hasSurfaceSet(loop)
Check if a certain loop has a surface set. :type loop: int :param loop: [in] index of the loop, which should be less than loopCount(). :rtype: boolean :return: true if a surface is set, false otherwise.
- isConvex(*args)
Overload 1:
Overload 2:
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- loopCount()
The number of loops. :rtype: int :return: the number of loops.
- makeLoop(singleEdgeId)
Create a loop containing a single edge (typically for circles and ellipses and similar).
The half-edge structure requires that an edge must start and end in a vertex. Sometimes it is possible to have an edge without any vertices. This is, for example, the case for a circular or elliptic cylinder, where there will be two circular or elliptic edges. It is necessary to place one vertex on the circle or ellipse that can act as both the start and end vertex for the curve.
- Parameters
singleEdgeId (int) – [in] id of the edge to create loop for. 1-indexing is expected, with a sign that indicates the edge direction.
- obb(*args)
Overload 1:
Create Oriented Bounding Box with certain principal directions. :type R: rw::math::Rotation3D< > :param R: [in] the directions for the bounding box. :rtype: rw::geometry::OBB< double > :return: an OBB around the BREP.
Overload 2:
Create Oriented Bounding Box where the directions are estimated.
This method is more expensive than obb(const rw::math::Rotation3D<>&), because a TriMesh is formed to estimated the principal directions of the OBB.
- Return type
rw::geometry::OBB< double >
- Returns
an OBB around the BREP.
- printObj()
Print the structure of the BREP for debugging purposes.
- scale(factor)
Scale the object. :type factor: float :param factor: [in] the factor to scale with.
- setMeshResolution(resolution=10)
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float, optional) – [in] the resolution parameter.
- shellProxy()
Get a Shell representation as a proxy to the BREP. :rtype: rw::core::Ptr< rw::geometry::Shell const > :return: smart pointer to a Shell proxy object.
- stitchAuto(eps)
Try to stitch edges automatically. :type eps: float :param eps: [in] distance threshold for vertices and curves.
- stitchEdges(first, second)
Connect two half-edges. :type first: int :param first: [in] id of the first edge. 0-indexing is expected, with a sign that
indicates the edge direction.
- Parameters
second (int) – [in] id of the second edge. 0-indexing is expected, with a sign that indicates the edge direction.
Notes: Implementations calling this function should remember to delete the curve associated to the second half-edge if it is different than the curve set for the first half-edge. :raises: rw::core::Exception if one of the given half-edges is already connected to
another half-edge.
- property thisown
The membership flag
- toString(type)
format GeometryType to string :type type: int :param type:
- verticeCount()
The number of vertices. :rtype: int :return: the number of vertices.
- class sdurw_geometry.sdurw_geometry.BSphere(*args)
Bases:
BVBSphere
class representing an Bounding sphere
- __init__(*args)
Overload 1:
constructor using sphere center of (0, 0, 0) :type radius: float, optional :param radius: [in] set the radius of the sphere
Overload 2:
constructor setting both sphere center and radius :type pos: rw::math::Vector3D< double > :param pos: [in] the position of the center of the sphere :type radius: float, optional :param radius: [in] set the radius of the sphere
Overload 3:
constructor setting both sphere center and radius :type pos: rw::math::Vector3D< double > :param pos: [in] the position of the center of the sphere :param radius: [in] set the radius of the sphere
Overload 4:
Copy constroctor :type bs: rw::geometry::BSphere< double > :param bs: [in] object to copy
- calcArea()
get the surface area :rtype: float :return: surface area
- calcVolume()
get the volume :rtype: float :return: volume
- static fitEigen(*args)
- getPosition()
get the position of the sphere center :rtype: rw::math::Vector3D< double > :return: a Vector3D with the center coordinates
- getRadius()
get the sphere radius :rtype: float :return: sphere radius
- getRadiusSqr()
get the sphere radius^2 :rtype: float :return: sphere radius^2
- setPosition(p3d)
set the sphere center coordinate :type p3d: rw::math::Vector3D< double > :param p3d: [in] the new center coordinates
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BSphereCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- calcArea()
get the surface area :rtype: float :return: surface area
- calcVolume()
get the volume :rtype: float :return: volume
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getPosition()
get the position of the sphere center :rtype: rw::math::Vector3D< double > :return: a Vector3D with the center coordinates
- getRadius()
get the sphere radius :rtype: float :return: sphere radius
- getRadiusSqr()
get the sphere radius^2 :rtype: float :return: sphere radius^2
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BSpherePtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- calcArea()
get the surface area :rtype: float :return: surface area
- calcVolume()
get the volume :rtype: float :return: volume
- cptr()
- deref()
The pointer stored in the object.
- fitEigen(*args)
- getDeref()
Member access operator.
- getPosition()
get the position of the sphere center :rtype: rw::math::Vector3D< double > :return: a Vector3D with the center coordinates
- getRadius()
get the sphere radius :rtype: float :return: sphere radius
- getRadiusSqr()
get the sphere radius^2 :rtype: float :return: sphere radius^2
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- setPosition(p3d)
set the sphere center coordinate :type p3d: rw::math::Vector3D< double > :param p3d: [in] the new center coordinates
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BSphere_f(*args)
Bases:
BVBSphere_f
class representing an Bounding sphere
- __init__(*args)
Overload 1:
constructor using sphere center of (0, 0, 0) :type radius: float, optional :param radius: [in] set the radius of the sphere
Overload 2:
constructor setting both sphere center and radius :type pos: rw::math::Vector3D< float > :param pos: [in] the position of the center of the sphere :type radius: float, optional :param radius: [in] set the radius of the sphere
Overload 3:
constructor setting both sphere center and radius :type pos: rw::math::Vector3D< float > :param pos: [in] the position of the center of the sphere :param radius: [in] set the radius of the sphere
Overload 4:
Copy constroctor :type bs: rw::geometry::BSphere< float > :param bs: [in] object to copy
- calcArea()
get the surface area :rtype: float :return: surface area
- calcVolume()
get the volume :rtype: float :return: volume
- static fitEigen(*args)
- getPosition()
get the position of the sphere center :rtype: rw::math::Vector3D< float > :return: a Vector3D with the center coordinates
- getRadius()
get the sphere radius :rtype: float :return: sphere radius
- getRadiusSqr()
get the sphere radius^2 :rtype: float :return: sphere radius^2
- setPosition(p3d)
set the sphere center coordinate :type p3d: rw::math::Vector3D< float > :param p3d: [in] the new center coordinates
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BSphere_fCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- calcArea()
get the surface area :rtype: float :return: surface area
- calcVolume()
get the volume :rtype: float :return: volume
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getPosition()
get the position of the sphere center :rtype: rw::math::Vector3D< float > :return: a Vector3D with the center coordinates
- getRadius()
get the sphere radius :rtype: float :return: sphere radius
- getRadiusSqr()
get the sphere radius^2 :rtype: float :return: sphere radius^2
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BSphere_fPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- calcArea()
get the surface area :rtype: float :return: surface area
- calcVolume()
get the volume :rtype: float :return: volume
- cptr()
- deref()
The pointer stored in the object.
- fitEigen(*args)
- getDeref()
Member access operator.
- getPosition()
get the position of the sphere center :rtype: rw::math::Vector3D< float > :return: a Vector3D with the center coordinates
- getRadius()
get the sphere radius :rtype: float :return: sphere radius
- getRadiusSqr()
get the sphere radius^2 :rtype: float :return: sphere radius^2
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- setPosition(p3d)
set the sphere center coordinate :type p3d: rw::math::Vector3D< float > :param p3d: [in] the new center coordinates
- property thisown
The membership flag
- sdurw_geometry.sdurw_geometry.BSphere_f_fitEigen(*args)
- sdurw_geometry.sdurw_geometry.BSphere_fitEigen(*args)
- class sdurw_geometry.sdurw_geometry.BVBSphere
Bases:
object
a general bounding volume class for template inheritance. This class defines methods that a deriving class must implement.
This defines a bounding volume to have a position.
- __init__()
- calcArea()
- calcVolume()
- getPosition()
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BVBSphere_f
Bases:
object
a general bounding volume class for template inheritance. This class defines methods that a deriving class must implement.
This defines a bounding volume to have a position.
- __init__()
- calcArea()
- calcVolume()
- getPosition()
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BVColliderOBBColiderOBB
Bases:
object
abstract class describing interface of a bounding volume collision detector. The inheritance is template based to reduce virtual method overhead
- __init__()
constructor
- inCollision(bvA, bvB, aTb)
test if two bounding volumes are colliding :type bvA: rw::geometry::OBB< double > :param bvA: [in] bounding volume A :type bvB: rw::geometry::OBB< double > :param bvB: [in] bounding volume B :type aTb: rw::math::Transform3D< rw::geometry::BVCollider< rw::geometry::OBBCollider< double >,rw::geometry::OBB< double > >::value_type > :param aTb: [in] transform from bvA to bvB :rtype: boolean :return: true if in collision
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BVColliderOBBColiderOBB_f
Bases:
object
abstract class describing interface of a bounding volume collision detector. The inheritance is template based to reduce virtual method overhead
- __init__()
constructor
- inCollision(bvA, bvB, aTb)
test if two bounding volumes are colliding :type bvA: rw::geometry::OBB< float > :param bvA: [in] bounding volume A :type bvB: rw::geometry::OBB< float > :param bvB: [in] bounding volume B :type aTb: rw::math::Transform3D< rw::geometry::BVCollider< rw::geometry::OBBCollider< float >,rw::geometry::OBB< float > >::value_type > :param aTb: [in] transform from bvA to bvB :rtype: boolean :return: true if in collision
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BVColliderOBBToleranceCollider
Bases:
object
abstract class describing interface of a bounding volume collision detector. The inheritance is template based to reduce virtual method overhead
- __init__()
constructor
- inCollision(bvA, bvB, aTb)
test if two bounding volumes are colliding :type bvA: rw::geometry::OBB< double > :param bvA: [in] bounding volume A :type bvB: rw::geometry::OBB< double > :param bvB: [in] bounding volume B :type aTb: rw::math::Transform3D< rw::geometry::BVCollider< rw::geometry::OBBToleranceCollider< double >,rw::geometry::OBB< double > >::value_type > :param aTb: [in] transform from bvA to bvB :rtype: boolean :return: true if in collision
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BVColliderOBBToleranceCollider_f
Bases:
object
abstract class describing interface of a bounding volume collision detector. The inheritance is template based to reduce virtual method overhead
- __init__()
constructor
- inCollision(bvA, bvB, aTb)
test if two bounding volumes are colliding :type bvA: rw::geometry::OBB< float > :param bvA: [in] bounding volume A :type bvB: rw::geometry::OBB< float > :param bvB: [in] bounding volume B :type aTb: rw::math::Transform3D< rw::geometry::BVCollider< rw::geometry::OBBToleranceCollider< float >,rw::geometry::OBB< float > >::value_type > :param aTb: [in] transform from bvA to bvB :rtype: boolean :return: true if in collision
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BVDistanceCalcSphereDistanceCalc
Bases:
object
- __init__()
- distance(*args)
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BVDistanceCalcSphereDistanceCalc_f
Bases:
object
- __init__()
- distance(*args)
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BVFactoryOBB(*args, **kwargs)
Bases:
object
interface of bounding volume factory
- __init__(*args, **kwargs)
- makeBV(*args)
Overload 1:
Create a bounding volume for a triangle mesh. :type geom:
TriMesh
:param geom: [in/out] the mesh to create bounding volume for. :rtype: rw::geometry::OBB< double > :return: the bounding volume.Overload 2:
Create a bounding volume for any type of geometry. :type geom:
GeometryData
:param geom: [in/out] the geometry to create bounding volume for. :rtype: rw::geometry::OBB< double > :return: the bounding volume.Overload 3:
Create a bounding volume for a primitive. :type geom:
Primitive
:param geom: [in/out] the primitive to create bounding volume for. :rtype: rw::geometry::OBB< double > :return: the bounding volume.Overload 4:
Create a bounding volume for a shell. :type geom:
Shell
:param geom: [in/out] the shell to create bounding volume for. :rtype: rw::geometry::OBB< double > :return: the bounding volume.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BVFactoryOBB_f(*args, **kwargs)
Bases:
object
interface of bounding volume factory
- __init__(*args, **kwargs)
- makeBV(*args)
Overload 1:
Create a bounding volume for a triangle mesh. :type geom:
TriMesh
:param geom: [in/out] the mesh to create bounding volume for. :rtype: rw::geometry::OBB< float > :return: the bounding volume.Overload 2:
Create a bounding volume for any type of geometry. :type geom:
GeometryData
:param geom: [in/out] the geometry to create bounding volume for. :rtype: rw::geometry::OBB< float > :return: the bounding volume.Overload 3:
Create a bounding volume for a primitive. :type geom:
Primitive
:param geom: [in/out] the primitive to create bounding volume for. :rtype: rw::geometry::OBB< float > :return: the bounding volume.Overload 4:
Create a bounding volume for a shell. :type geom:
Shell
:param geom: [in/out] the shell to create bounding volume for. :rtype: rw::geometry::OBB< float > :return: the bounding volume.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.Box(*args)
Bases:
Primitive
a box primitive, origin is in center of box
- __init__(*args)
Overload 1:
constructor - creates a 1x1x1 sided box
Overload 2:
constructor :type x: float :param x: [in] width in x axis :type y: float :param y: [in] width in y axis :type z: float :param z: [in] width in z axis
Overload 3:
constructor :type initQ:
Q
:param initQ: [in] vector with (x,y,z)
- createMesh(resolution)
make a trimesh from this primitive. Use granularity to specify minimum number of line segments a half circle is split into :type resolution: int :param resolution: [in]
- getParameters()
get the parameters that define this primitive
- getType()
the type of this primitive
- setParameters(q)
set the parameters that define this primitive
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BoxCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- createMesh(resolution)
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getParameters()
- getType()
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.BoxPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- createMesh(resolution)
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getParameters()
- getTriMesh(forceCopy=True)
Notes: primitives allways return a new trimesh
- getType()
- isConvex()
- isInside(point)
test if a point is on the border or inside this primitive
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- setParameters(q)
- property thisown
The membership flag
- toString(type)
format GeometryType to string :type type: int :param type:
- class sdurw_geometry.sdurw_geometry.BvAABB
Bases:
object
a general bounding volume class for template inheritance. This class defines methods that a deriving class must implement.
This defines a bounding volume to have a position.
- __init__()
- calcArea()
- calcVolume()
- getPosition()
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.CommonCurveSet(*args, **kwargs)
Bases:
object
Convenience type for a set of curves in a BREP.
- __init__(*args, **kwargs)
- curve(index)
Get a curve in the set. :type index: int :param index: [in] the curve index, which should be less than size(). :rtype:
Curve
:return: a reference to the curve data.
- size()
Get the number of curves in the set. :rtype: int :return: the number of curves.
- surfaceLeft(index)
Get one of the neighbour surfaces to the curve. :type index: int :param index: [in] the curve index, which should be less than size(). :rtype:
Surface
:return: a reference to the surface.
- surfaceRight(index)
Get the other neighbour surfaces to the curve. :type index: int :param index: [in] the curve index, which should be less than size(). :rtype:
Surface
:return: a reference to the surface.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.CommonParametricCurveSet(*args, **kwargs)
Bases:
object
Convenience type for a set of curves in a BREP.
- __init__(*args, **kwargs)
- curve(index)
- size()
- surfaceLeft(index)
- surfaceRight(index)
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.CommonQuadraticCurveSet(*args, **kwargs)
Bases:
CommonCurveSet
Convenience type for a set of curves in a QuadraticBREP.
- __init__(*args, **kwargs)
- curve(index)
Get a curve in the set. :type index: int :param index: [in] the curve index, which should be less than size(). :rtype:
Curve
:return: a reference to the curve data.
- size()
Get the number of curves in the set. :rtype: int :return: the number of curves.
- surfaceLeft(index)
Get one of the neighbour surfaces to the curve. :type index: int :param index: [in] the curve index, which should be less than size(). :rtype:
Surface
:return: a reference to the surface.
- surfaceRight(index)
Get the other neighbour surfaces to the curve. :type index: int :param index: [in] the curve index, which should be less than size(). :rtype:
Surface
:return: a reference to the surface.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.Cone(*args)
Bases:
Primitive
cone primitive. Like a cylinder though where a radius can be specified for both ends.
The cone is aligned with the z-axis such that top is in the positive z-axis and the bottom is in the negative z-axis. The center of the cone will be in (0,0,0) which is inside the cone.
- __init__(*args)
- Overload 1:
constructor
Overload 2:
constructor :type height: float :param height: [in] height of cone :type radiusTop: float :param radiusTop: [in] radius of the top end :type radiusBot: float :param radiusBot: [in] radius of the bottom end :type levels: int, optional :param levels: [in] granularity of the mesh
Overload 3:
constructor :type height: float :param height: [in] height of cone :type radiusTop: float :param radiusTop: [in] radius of the top end :type radiusBot: float :param radiusBot: [in] radius of the bottom end :param levels: [in] granularity of the mesh
- createMesh(resolution)
make a trimesh from this primitive. Use granularity to specify minimum number of line segments a half circle is split into :type resolution: int :param resolution: [in]
- getBottomRadius()
the bottom radius
- getHeight()
the height
- getParameters()
get the parameters that define this primitive
- getTopRadius()
the top radius
- getType()
the type of this primitive
- setParameters(q)
set the parameters that define this primitive
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.ConeCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- createMesh(resolution)
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getParameters()
- getType()
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.ConePtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- createMesh(resolution)
- deref()
The pointer stored in the object.
- getBottomRadius()
the bottom radius
- getDeref()
Member access operator.
- getHeight()
the height
- getParameters()
- getTopRadius()
the top radius
- getTriMesh(forceCopy=True)
Notes: primitives allways return a new trimesh
- getType()
- isConvex()
- isInside(point)
test if a point is on the border or inside this primitive
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- setParameters(q)
- property thisown
The membership flag
- toString(type)
format GeometryType to string :type type: int :param type:
- class sdurw_geometry.sdurw_geometry.Contour2D(*args)
Bases:
object
class representing a 2d contour
- __init__(*args)
Overload 1:
constructor
Overload 2:
constructor :type center: rw::math::Vector2D< double > :param center: :type contour: std::vector< rw::geometry::Contour2D::Point > :param contour:
- calcArea()
calculates the area of this contour
- static calcCentralMoments(contour, c, r)
calculates the r’th central moments of the contour :type contour:
Contour2D
:param contour: :type c: rw::math::Vector2D< double > :param c: [in] center :type r: int :param r: [in] :rtype: float :return: the moment
- static calcCentroid(contour)
calculates the centroid or the mean of the points in the contour.
- static calcCovarianceMatrix(contour, c)
Calculates the covariance of the contour “contour” with mean coordinate c :type contour:
Contour2D
:param contour: [in] the contour :type c: rw::math::Vector2D< double > :param c: [in] the mean of the contour points/coordinates :rtype: rw::geometry::Covariance< > :return: the 2x2 covariance matrix of the contour
- static calcNormal(idx, pixelStep, contour, counterClock=True)
calculate normals of a contour :type idx: int :param idx: :type pixelStep: int :param pixelStep: :type contour:
Contour2D
:param contour: :type counterClock: boolean, optional :param counterClock: :rtype: rw::math::Vector2D< double > :return: contour normal
- static calcOrientation(contour, c)
calculates the orientation of a contour where the first axis is the longest principal axis posible.
- static calcSequenceMoment(contour, c, r)
calculates the r’th sequence moment of an ordered contour :type contour:
Contour2D
:param contour: [in] :type c: rw::math::Vector2D< double > :param c: [in] center :type r: int :param r: [in]
- center(*args)
Overload 1: get contour center
Overload 2: get contour center
- static getCurvature(idx, pixelStep, contour)
extracts the local curvature around the contour point defined by idx.
- static getOuterContour(contour, resolution)
extracts the outer contour of a contour :type contour:
Contour2D
:param contour: [in] contour to find outer contour of. :type resolution: float :param resolution: [in] the resolution. :rtype:Ptr
:return: new contour
- points(*args)
Overload 1: get contour point list
Overload 2: get contour point list
- static read(file)
reads a contour from file :type file: string :param file: :rtype:
Contour2D
:return: a contour
- static recalcNormal(contour)
recalculate normals of a contour :type contour:
Contour2D
:param contour:
- size()
get nr of conout points on this contour :rtype: int :return: number of points
- property thisown
The membership flag
- toTriMesh(height)
A 3D geometry for a 2D contour of height height.
2D points (x,y) end up as (x, y, 0) in 3D.
- class sdurw_geometry.sdurw_geometry.Contour2DCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- center(*args)
Overload 1: get contour center
Overload 2: get contour center
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- points(*args)
Overload 1: get contour point list
Overload 2: get contour point list
- size()
get nr of conout points on this contour :rtype: int :return: number of points
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.Contour2DPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- calcArea()
calculates the area of this contour
- calcCentralMoments(contour, c, r)
calculates the r’th central moments of the contour :type contour:
Contour2D
:param contour: :type c: rw::math::Vector2D< double > :param c: [in] center :type r: int :param r: [in] :rtype: float :return: the moment
- calcCentroid(contour)
calculates the centroid or the mean of the points in the contour.
- calcCovarianceMatrix(contour, c)
Calculates the covariance of the contour “contour” with mean coordinate c :type contour:
Contour2D
:param contour: [in] the contour :type c: rw::math::Vector2D< double > :param c: [in] the mean of the contour points/coordinates :rtype: rw::geometry::Covariance< > :return: the 2x2 covariance matrix of the contour
- calcNormal(idx, pixelStep, contour, counterClock=True)
calculate normals of a contour :type idx: int :param idx: :type pixelStep: int :param pixelStep: :type contour:
Contour2D
:param contour: :type counterClock: boolean, optional :param counterClock: :rtype: rw::math::Vector2D< double > :return: contour normal
- calcOrientation(contour, c)
calculates the orientation of a contour where the first axis is the longest principal axis posible.
- calcSequenceMoment(contour, c, r)
calculates the r’th sequence moment of an ordered contour :type contour:
Contour2D
:param contour: [in] :type c: rw::math::Vector2D< double > :param c: [in] center :type r: int :param r: [in]
- center(*args)
Overload 1: get contour center
Overload 2: get contour center
- cptr()
- deref()
The pointer stored in the object.
- getCurvature(idx, pixelStep, contour)
extracts the local curvature around the contour point defined by idx.
- getDeref()
Member access operator.
- getOuterContour(contour, resolution)
extracts the outer contour of a contour :type contour:
Contour2D
:param contour: [in] contour to find outer contour of. :type resolution: float :param resolution: [in] the resolution. :rtype:Ptr
:return: new contour
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- points(*args)
Overload 1: get contour point list
Overload 2: get contour point list
- read(file)
reads a contour from file :type file: string :param file: :rtype:
Contour2D
:return: a contour
- size()
get nr of conout points on this contour :rtype: int :return: number of points
- property thisown
The membership flag
- toTriMesh(height)
A 3D geometry for a 2D contour of height height.
2D points (x,y) end up as (x, y, 0) in 3D.
- sdurw_geometry.sdurw_geometry.Contour2D_calcCentralMoments(contour, c, r)
calculates the r’th central moments of the contour :type contour:
Contour2D
:param contour: :type c: rw::math::Vector2D< double > :param c: [in] center :type r: int :param r: [in] :rtype: float :return: the moment
- sdurw_geometry.sdurw_geometry.Contour2D_calcCentroid(contour)
calculates the centroid or the mean of the points in the contour.
- sdurw_geometry.sdurw_geometry.Contour2D_calcCovarianceMatrix(contour, c)
Calculates the covariance of the contour “contour” with mean coordinate c :type contour:
Contour2D
:param contour: [in] the contour :type c: rw::math::Vector2D< double > :param c: [in] the mean of the contour points/coordinates :rtype: rw::geometry::Covariance< > :return: the 2x2 covariance matrix of the contour
- sdurw_geometry.sdurw_geometry.Contour2D_calcNormal(idx, pixelStep, contour, counterClock=True)
calculate normals of a contour :type idx: int :param idx: :type pixelStep: int :param pixelStep: :type contour:
Contour2D
:param contour: :type counterClock: boolean, optional :param counterClock: :rtype: rw::math::Vector2D< double > :return: contour normal
- sdurw_geometry.sdurw_geometry.Contour2D_calcOrientation(contour, c)
calculates the orientation of a contour where the first axis is the longest principal axis posible.
- sdurw_geometry.sdurw_geometry.Contour2D_calcSequenceMoment(contour, c, r)
calculates the r’th sequence moment of an ordered contour :type contour:
Contour2D
:param contour: [in] :type c: rw::math::Vector2D< double > :param c: [in] center :type r: int :param r: [in]
- sdurw_geometry.sdurw_geometry.Contour2D_getCurvature(idx, pixelStep, contour)
extracts the local curvature around the contour point defined by idx.
- sdurw_geometry.sdurw_geometry.Contour2D_getOuterContour(contour, resolution)
extracts the outer contour of a contour :type contour:
Contour2D
:param contour: [in] contour to find outer contour of. :type resolution: float :param resolution: [in] the resolution. :rtype:Ptr
:return: new contour
- sdurw_geometry.sdurw_geometry.Contour2D_read(file)
reads a contour from file :type file: string :param file: :rtype:
Contour2D
:return: a contour
- sdurw_geometry.sdurw_geometry.Contour2D_recalcNormal(contour)
recalculate normals of a contour :type contour:
Contour2D
:param contour:
- sdurw_geometry.sdurw_geometry.Contour2D_write(objC, file)
writes a contour to file :type objC:
Contour2D
:param objC: [in] contour to write to file :type file: string :param file: [in] name of file
- class sdurw_geometry.sdurw_geometry.ConvexHull2D(*args, **kwargs)
Bases:
object
interface for convexhull calculators on 2d point sets
- __init__(*args, **kwargs)
- getMinDist(vertex)
if the vertex is inside the convex hull the minimum distance to any of the half-spaces of the hull is returned. If its not inside 0 is returned. :type vertex: rw::math::Vector2D< double > :param vertex: :rtype: float :return: minimum distance to vertex
- isInside(vertex)
test if the given vertex is inside the convex hull
- rebuild(vertices)
rebuilts the hull :type vertices: std::vector< rw::math::Vector2D< double > > :param vertices:
- property thisown
The membership flag
- toContour()
create a plain trimesh from the hull facets :rtype: std::vector< rw::math::Vector2D< double > > :return: the hull facets as a plain triangle mesh with normal information
- class sdurw_geometry.sdurw_geometry.ConvexHull2DCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.ConvexHull2DPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getMinDist(vertex)
if the vertex is inside the convex hull the minimum distance to any of the half-spaces of the hull is returned. If its not inside 0 is returned. :type vertex: rw::math::Vector2D< double > :param vertex: :rtype: float :return: minimum distance to vertex
- isInside(vertex)
test if the given vertex is inside the convex hull
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- rebuild(vertices)
rebuilts the hull :type vertices: std::vector< rw::math::Vector2D< double > > :param vertices:
- property thisown
The membership flag
- toContour()
create a plain trimesh from the hull facets :rtype: std::vector< rw::math::Vector2D< double > > :return: the hull facets as a plain triangle mesh with normal information
- class sdurw_geometry.sdurw_geometry.ConvexHull3D(*args, **kwargs)
Bases:
object
interface for convexhull calculators on 3d point sets
- __init__(*args, **kwargs)
- getMinDistInside(vertex)
If the vertex is inside the convex hull the minimum distance to any of the half-spaces of the hull is returned. If its not inside 0 is returned. :type vertex: rw::math::Vector3D< double > :param vertex: :rtype: float :return: minimum distance to vertex
- getMinDistOutside(vertex)
If the vertex is outside the convex hull the minimum distance to the convex hull is returned. If its not outside 0 is returned. :type vertex: rw::math::Vector3D< double > :param vertex: :rtype: float :return: minimum distance to vertex
- isInside(vertex)
test if the given vertex is inside the convex hull
- rebuild(vertices)
rebuilts the hull :type vertices: std::vector< rw::math::Vector3D< double > > :param vertices:
- property thisown
The membership flag
- toTriMesh()
create a plain trimesh from the hull facets :rtype: rw::core::Ptr< rw::geometry::PlainTriMesh< rw::geometry::TriangleN1< double > > > :return: the hull facets as a plain triangle mesh with normal information
- class sdurw_geometry.sdurw_geometry.ConvexHull3DCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.ConvexHull3DPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getMinDistInside(vertex)
If the vertex is inside the convex hull the minimum distance to any of the half-spaces of the hull is returned. If its not inside 0 is returned. :type vertex: rw::math::Vector3D< double > :param vertex: :rtype: float :return: minimum distance to vertex
- getMinDistOutside(vertex)
If the vertex is outside the convex hull the minimum distance to the convex hull is returned. If its not outside 0 is returned. :type vertex: rw::math::Vector3D< double > :param vertex: :rtype: float :return: minimum distance to vertex
- isInside(vertex)
test if the given vertex is inside the convex hull
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- rebuild(vertices)
rebuilts the hull :type vertices: std::vector< rw::math::Vector3D< double > > :param vertices:
- property thisown
The membership flag
- toTriMesh()
create a plain trimesh from the hull facets :rtype: rw::core::Ptr< rw::geometry::PlainTriMesh< rw::geometry::TriangleN1< double > > > :return: the hull facets as a plain triangle mesh with normal information
- class sdurw_geometry.sdurw_geometry.Covariance(*args)
Bases:
object
class for estimating the covariance of different data
- __init__(*args)
- Overload 1:
Default constructor.
Overload 2:
Constructor. :type matrix: Eigen::Matrix< double,Eigen::Dynamic,Eigen::Dynamic > :param matrix: [in] Eigen matrix.
- eigenDecompose()
Do eigen decomposition. :rtype: rw::math::EigenDecomposition< double > :return: the EigenDecomposition.
- getMatrix()
Get the covariance matrix. :rtype: Eigen::Matrix< double,Eigen::Dynamic,Eigen::Dynamic > :return: Eigen matrix.
- initialize(*args)
Overload 1:
initialize covariance using a geometry object. :type geom:
Geometry
:param geom: [in] the geometry.Overload 2:
Initialize covariance from points. :type points: std::vector< rw::math::Vector3D< double > > :param points: [in] the points.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.Curve(*args, **kwargs)
Bases:
object
Curve is an abstract representation of a smooth curve geometry in 3D.
The interface provides functions for affine transformations, such as scaling, rotation and translation. In case of a limited curve segment, it is also possible to make a discretization of the curve into line segments.
- __init__(*args, **kwargs)
- clone()
Make a copy of the curve. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new copy of the curve.
- closestPoints(p)
Get the closest points on the curve to a point p.
Notice that the limits are taken into account.
- Parameters
p (rw::math::Vector3D< double >) – [in] the point to find closest values for.
- Return type
std::vector< rw::math::Vector3D< double > >
- Returns
a vector of closest points to p.
- discretizeAdaptive(stepsPerRevolution)
Make a discretization of the curve.
The curve must be limited. The discretization is based on the curvature, such that the sampling starts at maximum curvature points (or in limits). The step size to the next point is based on the curvature in the current point.
A line will always give to points, regardless of the chosen number of steps per revolution.
- Parameters
stepsPerRevolution (float) – [in] the number of points to sample if the curve is a perfect circle.
- Return type
std::list< rw::math::Vector3D< double > >
- Returns
a list of points on the curve.
- equals(curve, eps)
Check if this curve is equal to another curve. :type curve: rw::core::Ptr< rw::geometry::Curve const > :param curve: [in] other curve. :type eps: float :param eps: [in] distance threshold. :rtype: boolean :return: true if curves are identical, false otherwise.
- extremums(dir)
Get extremums of curve in given direction.
Notice that the limits are taken into account.
- Parameters
dir (rw::math::Vector3D< double >) – [in] direction to get extremums for.
- Return type
std::pair< double,double >
- Returns
the minimum and maximum value of the curve in the given direction.
- obr()
Bounding rectangle of curve.
The curve must be limited.
- Return type
rw::geometry::OBB< >
- Returns
the bounding rectangle.
- reverse()
Make a curve where time variable runs in opposite direction. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: reversed curve.
- scale(factor)
Get a scaled version of the curve. :type factor: float :param factor: [in] the factor to scale with. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new scaled curve.
- property thisown
The membership flag
- transform(*args)
Overload 1:
Transform curve. :type T: rw::math::Transform3D< double > :param T: [in] transformation of curve. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new transformed curve.
Overload 2:
Transform curve. :type P: rw::math::Vector3D< double > :param P: [in] positional offset. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new transformed curve.
- class sdurw_geometry.sdurw_geometry.CurveCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- clone()
Make a copy of the curve. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new copy of the curve.
- closestPoints(p)
Get the closest points on the curve to a point p.
Notice that the limits are taken into account.
- Parameters
p (rw::math::Vector3D< double >) – [in] the point to find closest values for.
- Return type
std::vector< rw::math::Vector3D< double > >
- Returns
a vector of closest points to p.
- deref()
The pointer stored in the object.
- discretizeAdaptive(stepsPerRevolution)
Make a discretization of the curve.
The curve must be limited. The discretization is based on the curvature, such that the sampling starts at maximum curvature points (or in limits). The step size to the next point is based on the curvature in the current point.
A line will always give to points, regardless of the chosen number of steps per revolution.
- Parameters
stepsPerRevolution (float) – [in] the number of points to sample if the curve is a perfect circle.
- Return type
std::list< rw::math::Vector3D< double > >
- Returns
a list of points on the curve.
- equals(curve, eps)
Check if this curve is equal to another curve. :type curve: rw::core::Ptr< rw::geometry::Curve const > :param curve: [in] other curve. :type eps: float :param eps: [in] distance threshold. :rtype: boolean :return: true if curves are identical, false otherwise.
- extremums(dir)
Get extremums of curve in given direction.
Notice that the limits are taken into account.
- Parameters
dir (rw::math::Vector3D< double >) – [in] direction to get extremums for.
- Return type
std::pair< double,double >
- Returns
the minimum and maximum value of the curve in the given direction.
- getDeref()
Member access operator.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obr()
Bounding rectangle of curve.
The curve must be limited.
- Return type
rw::geometry::OBB< >
- Returns
the bounding rectangle.
- reverse()
Make a curve where time variable runs in opposite direction. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: reversed curve.
- scale(factor)
Get a scaled version of the curve. :type factor: float :param factor: [in] the factor to scale with. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new scaled curve.
- property thisown
The membership flag
- transform(*args)
Overload 1:
Transform curve. :type T: rw::math::Transform3D< double > :param T: [in] transformation of curve. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new transformed curve.
Overload 2:
Transform curve. :type P: rw::math::Vector3D< double > :param P: [in] positional offset. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new transformed curve.
- class sdurw_geometry.sdurw_geometry.CurvePtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- clone()
Make a copy of the curve. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new copy of the curve.
- closestPoints(p)
Get the closest points on the curve to a point p.
Notice that the limits are taken into account.
- Parameters
p (rw::math::Vector3D< double >) – [in] the point to find closest values for.
- Return type
std::vector< rw::math::Vector3D< double > >
- Returns
a vector of closest points to p.
- cptr()
- deref()
The pointer stored in the object.
- discretizeAdaptive(stepsPerRevolution)
Make a discretization of the curve.
The curve must be limited. The discretization is based on the curvature, such that the sampling starts at maximum curvature points (or in limits). The step size to the next point is based on the curvature in the current point.
A line will always give to points, regardless of the chosen number of steps per revolution.
- Parameters
stepsPerRevolution (float) – [in] the number of points to sample if the curve is a perfect circle.
- Return type
std::list< rw::math::Vector3D< double > >
- Returns
a list of points on the curve.
- equals(curve, eps)
Check if this curve is equal to another curve. :type curve: rw::core::Ptr< rw::geometry::Curve const > :param curve: [in] other curve. :type eps: float :param eps: [in] distance threshold. :rtype: boolean :return: true if curves are identical, false otherwise.
- extremums(dir)
Get extremums of curve in given direction.
Notice that the limits are taken into account.
- Parameters
dir (rw::math::Vector3D< double >) – [in] direction to get extremums for.
- Return type
std::pair< double,double >
- Returns
the minimum and maximum value of the curve in the given direction.
- getDeref()
Member access operator.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obr()
Bounding rectangle of curve.
The curve must be limited.
- Return type
rw::geometry::OBB< >
- Returns
the bounding rectangle.
- reverse()
Make a curve where time variable runs in opposite direction. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: reversed curve.
- scale(factor)
Get a scaled version of the curve. :type factor: float :param factor: [in] the factor to scale with. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new scaled curve.
- property thisown
The membership flag
- transform(*args)
Overload 1:
Transform curve. :type T: rw::math::Transform3D< double > :param T: [in] transformation of curve. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new transformed curve.
Overload 2:
Transform curve. :type P: rw::math::Vector3D< double > :param P: [in] positional offset. :rtype: rw::core::Ptr< rw::geometry::Curve > :return: a new transformed curve.
- class sdurw_geometry.sdurw_geometry.Cylinder(*args)
Bases:
Primitive
a cylinder primitive. By default the radius is in the x-y plane and height is along the z-axis
- __init__(*args)
Overload 1:
constructor
Overload 2:
Constructs cylinder primitive with the specified setup
The cylinder is aligned with the height in the z-direction.
- Parameters
radius (float) – [in] radius of the cylinder.
height (float) – [in] height of the cylinder.
levels (int, optional) – [in] granularity of the mesh
Overload 3:
Constructs cylinder primitive with the specified setup
The cylinder is aligned with the height in the z-direction.
- Parameters
radius (float) – [in] radius of the cylinder.
height (float) – [in] height of the cylinder.
levels – [in] granularity of the mesh
Overload 4:
Constructor. :type initQ:
Q
:param initQ: [in] vector with (height, radius) :type levels: int, optional :param levels: [in] granularity of the meshOverload 5:
Constructor. :type initQ:
Q
:param initQ: [in] vector with (height, radius) :param levels: [in] granularity of the meshOverload 6:
Construct cylinder primitive with specified radius and height and with the given transform.
The cylinder will be centered in the position of transform and oriented in the direction of the third column of the rotation matrix of transform. :type transform: rw::math::Transform3D< double > :param transform: [in] The transform specifying how the pose of the cylinder :type radius: float :param radius: [in] radius of the cylinder. :type height: float :param height: [in] height of the cylinder. :type levels: int, optional :param levels: [in] granularity of the mesh
Overload 7:
Construct cylinder primitive with specified radius and height and with the given transform.
The cylinder will be centered in the position of transform and oriented in the direction of the third column of the rotation matrix of transform. :type transform: rw::math::Transform3D< double > :param transform: [in] The transform specifying how the pose of the cylinder :type radius: float :param radius: [in] radius of the cylinder. :type height: float :param height: [in] height of the cylinder. :param levels: [in] granularity of the mesh
- createMesh(resolution)
make a trimesh from this primitive. Use granularity to specify minimum number of line segments a half circle is split into :type resolution: int :param resolution: [in]
- getHeight()
Get the height of the cylinder. :rtype: float :return: the height.
- getParameters()
get the parameters that define this primitive
- getRadius()
Get the radius of the cylinder. :rtype: float :return: the radius.
- getTransform()
Returns the transform of the cylinder.
Default is the identity matrix unless a transform has been specified. :rtype: rw::math::Transform3D< float > :return: Transform of the cylinder
- getType()
the type of this primitive
- setParameters(q)
set the parameters that define this primitive
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.CylinderCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- createMesh(resolution)
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getHeight()
Get the height of the cylinder. :rtype: float :return: the height.
- getParameters()
- getRadius()
Get the radius of the cylinder. :rtype: float :return: the radius.
- getTransform()
Returns the transform of the cylinder.
Default is the identity matrix unless a transform has been specified. :rtype: rw::math::Transform3D< float > :return: Transform of the cylinder
- getType()
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.CylinderPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- createMesh(resolution)
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getHeight()
Get the height of the cylinder. :rtype: float :return: the height.
- getParameters()
- getRadius()
Get the radius of the cylinder. :rtype: float :return: the radius.
- getTransform()
Returns the transform of the cylinder.
Default is the identity matrix unless a transform has been specified. :rtype: rw::math::Transform3D< float > :return: Transform of the cylinder
- getTriMesh(forceCopy=True)
Notes: primitives allways return a new trimesh
- getType()
- isConvex()
- isInside(point)
test if a point is on the border or inside this primitive
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- setParameters(q)
- property thisown
The membership flag
- toString(type)
format GeometryType to string :type type: int :param type:
- class sdurw_geometry.sdurw_geometry.Delaunay(*args, **kwargs)
Bases:
object
Utility functions for doing Delaunay triangulations.
- __init__(*args, **kwargs)
- property thisown
The membership flag
- static triangulate(*args)
Do the Delaunay triangulation of a set of 2D points.
The border of the triangulation will be the convex hull of the vertices. It is possible to attach a value to each of the vertices, which will be the third coordinate in the returned 3D triangle mesh. If no values are given, the third coordinate will simply be zero.
- Parameters
vertices (std::vector< rw::math::Vector2D< double > >) – [in] the set of 2D points to triangulate.
values (std::vector< double >, optional) – [in] (optional) attach a value to each of the vertices.
- Return type
rw::geometry::IndexedTriMesh< double >::Ptr
- Returns
an indexed triangle mesh in 3D, where the first two coordinates gives the triangulation and the third coordinate holds corresponding values if given.
- sdurw_geometry.sdurw_geometry.Delaunay_triangulate(*args)
Do the Delaunay triangulation of a set of 2D points.
The border of the triangulation will be the convex hull of the vertices. It is possible to attach a value to each of the vertices, which will be the third coordinate in the returned 3D triangle mesh. If no values are given, the third coordinate will simply be zero.
- Parameters
vertices (std::vector< rw::math::Vector2D< double > >) – [in] the set of 2D points to triangulate.
values (std::vector< double >, optional) – [in] (optional) attach a value to each of the vertices.
- Return type
rw::geometry::IndexedTriMesh< double >::Ptr
- Returns
an indexed triangle mesh in 3D, where the first two coordinates gives the triangulation and the third coordinate holds corresponding values if given.
- class sdurw_geometry.sdurw_geometry.DistanceUtil
Bases:
object
a class for performing distance calculations between different geometric primitives
- __init__()
- static distanceLineLine(p1, p2, q1, q2)
computes the euclidean distance between line segments (line(p1,p2),line(q1,q2)) :type p1: rw::math::Vector3D< double > :param p1: [in] start point on line segment 1 :type p2: rw::math::Vector3D< double > :param p2: [in] end point on line segment 1 :type q1: rw::math::Vector3D< double > :param q1: [in] start point on line segment 2 :type q2: rw::math::Vector3D< double > :param q2: [in] end point on line segment 2 :rtype: float :return: distance between line segments
- static distanceLineLineSqr(p1, p2, q1, q2)
computes the squared euclidean distance between line segments (line(p1,p2),line(q1,q2)) :type p1: rw::math::Vector3D< double > :param p1: [in] start point on line segment 1 :type p2: rw::math::Vector3D< double > :param p2: [in] end point on line segment 1 :type q1: rw::math::Vector3D< double > :param q1: [in] start point on line segment 2 :type q2: rw::math::Vector3D< double > :param q2: [in] end point on line segment 2 :rtype: float :return: distance between line segments
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.DistanceUtilCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.DistanceUtilPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- deref()
The pointer stored in the object.
- distanceLineLine(p1, p2, q1, q2)
computes the euclidean distance between line segments (line(p1,p2),line(q1,q2)) :type p1: rw::math::Vector3D< double > :param p1: [in] start point on line segment 1 :type p2: rw::math::Vector3D< double > :param p2: [in] end point on line segment 1 :type q1: rw::math::Vector3D< double > :param q1: [in] start point on line segment 2 :type q2: rw::math::Vector3D< double > :param q2: [in] end point on line segment 2 :rtype: float :return: distance between line segments
- distanceLineLineSqr(p1, p2, q1, q2)
computes the squared euclidean distance between line segments (line(p1,p2),line(q1,q2)) :type p1: rw::math::Vector3D< double > :param p1: [in] start point on line segment 1 :type p2: rw::math::Vector3D< double > :param p2: [in] end point on line segment 1 :type q1: rw::math::Vector3D< double > :param q1: [in] start point on line segment 2 :type q2: rw::math::Vector3D< double > :param q2: [in] end point on line segment 2 :rtype: float :return: distance between line segments
- getDeref()
Member access operator.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- sdurw_geometry.sdurw_geometry.DistanceUtil_distanceLineLine(p1, p2, q1, q2)
computes the euclidean distance between line segments (line(p1,p2),line(q1,q2)) :type p1: rw::math::Vector3D< double > :param p1: [in] start point on line segment 1 :type p2: rw::math::Vector3D< double > :param p2: [in] end point on line segment 1 :type q1: rw::math::Vector3D< double > :param q1: [in] start point on line segment 2 :type q2: rw::math::Vector3D< double > :param q2: [in] end point on line segment 2 :rtype: float :return: distance between line segments
- sdurw_geometry.sdurw_geometry.DistanceUtil_distanceLineLineSqr(p1, p2, q1, q2)
computes the squared euclidean distance between line segments (line(p1,p2),line(q1,q2)) :type p1: rw::math::Vector3D< double > :param p1: [in] start point on line segment 1 :type p2: rw::math::Vector3D< double > :param p2: [in] end point on line segment 1 :type q1: rw::math::Vector3D< double > :param q1: [in] start point on line segment 2 :type q2: rw::math::Vector3D< double > :param q2: [in] end point on line segment 2 :rtype: float :return: distance between line segments
- class sdurw_geometry.sdurw_geometry.Face(*args, **kwargs)
Bases:
object
Abstract interface for geometric faces.
A face consist of a surface and curves that form the boundary of the face.
For all faces there must be the same number of vertices and curves. The order of vertices and curves are ordered such that a curve at a certain index will have a corresponding start vertex at the same vertex index.
- __init__(*args, **kwargs)
- curveCount()
Get the number of curves in the face. :rtype: int :return: the number of curves.
- extremums(dir)
Find the extent of the surface along a specific direction. :type dir: rw::math::Vector3D< double > :param dir: [in] a normalized direction vector. :rtype: std::pair< double,double > :return: the minimum and maximum values along the given direction.
- getCurve(i)
Get a curve of the face. :type i: int :param i: [in] the curve index, which should be less than the number returned by
curveCount().
- Return type
- Returns
a reference to the curve data.
- getTriMesh(forceCopy=True)
Create a TriMesh representation of the face.
This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.
- Parameters
forceCopy (boolean, optional) – [in] (not currently used in default implementation)
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh.
- obb()
Create Oriented Bounding Box.
The default implementation forms a TriMesh in order to estimate the directions for the OBB.
- Return type
rw::geometry::OBB< double >
- Returns
an OBB around the Face.
- setMeshResolution(resolution)
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float) – [in] the resolution parameter.
- property thisown
The membership flag
- transform(*args)
Overload 1:
Transform the face. :type T: rw::math::Transform3D< double > :param T: [in] transform.
Overload 2:
Translation of face. :type P: rw::math::Vector3D< double > :param P: [in] translation vector.
- vertices()
Get the vertices of the face. :rtype: std::vector< rw::math::Vector3D< double > > :return: a reference to the vertex vector.
- class sdurw_geometry.sdurw_geometry.FaceCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- curveCount()
Get the number of curves in the face. :rtype: int :return: the number of curves.
- deref()
The pointer stored in the object.
- extremums(dir)
Find the extent of the surface along a specific direction. :type dir: rw::math::Vector3D< double > :param dir: [in] a normalized direction vector. :rtype: std::pair< double,double > :return: the minimum and maximum values along the given direction.
- getCurve(i)
Get a curve of the face. :type i: int :param i: [in] the curve index, which should be less than the number returned by
curveCount().
- Return type
- Returns
a reference to the curve data.
- getDeref()
Member access operator.
- getTriMesh(forceCopy=True)
Create a TriMesh representation of the face.
This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.
- Parameters
forceCopy (boolean, optional) – [in] (not currently used in default implementation)
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- vertices()
Get the vertices of the face. :rtype: std::vector< rw::math::Vector3D< double > > :return: a reference to the vertex vector.
- class sdurw_geometry.sdurw_geometry.FacePtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- curveCount()
Get the number of curves in the face. :rtype: int :return: the number of curves.
- deref()
The pointer stored in the object.
- extremums(dir)
Find the extent of the surface along a specific direction. :type dir: rw::math::Vector3D< double > :param dir: [in] a normalized direction vector. :rtype: std::pair< double,double > :return: the minimum and maximum values along the given direction.
- getCurve(i)
Get a curve of the face. :type i: int :param i: [in] the curve index, which should be less than the number returned by
curveCount().
- Return type
- Returns
a reference to the curve data.
- getDeref()
Member access operator.
- getTriMesh(forceCopy=True)
Create a TriMesh representation of the face.
This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.
- Parameters
forceCopy (boolean, optional) – [in] (not currently used in default implementation)
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obb()
Create Oriented Bounding Box.
The default implementation forms a TriMesh in order to estimate the directions for the OBB.
- Return type
rw::geometry::OBB< double >
- Returns
an OBB around the Face.
- setMeshResolution(resolution)
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float) – [in] the resolution parameter.
- property thisown
The membership flag
- transform(*args)
Overload 1:
Transform the face. :type T: rw::math::Transform3D< double > :param T: [in] transform.
Overload 2:
Translation of face. :type P: rw::math::Vector3D< double > :param P: [in] translation vector.
- vertices()
Get the vertices of the face. :rtype: std::vector< rw::math::Vector3D< double > > :return: a reference to the vertex vector.
- class sdurw_geometry.sdurw_geometry.GenericFace(*args)
Bases:
Face
The GenericFace implementation is a type of Face that consist of abstract Surfaces and Curves.
- __init__(*args)
- Overload 1:
Constructor.
Overload 2:
Copy constructor. :type face:
Face
:param face: [in] other face to copy.
- curveCount()
Get the number of curves in the face. :rtype: int :return: the number of curves.
- getCurve(i)
Get a curve of the face. :type i: int :param i: [in] the curve index, which should be less than the number returned by
curveCount().
- Return type
- Returns
a reference to the curve data.
- setCurve(vertex, curve)
Set curve (a curve has direction) :type vertex: int :param vertex: [in] the start vertex. :type curve: rw::core::Ptr< rw::geometry::Curve const > :param curve: [in] the curve.
- setCurves(curves)
Set the curves. :type curves: std::vector< rw::core::Ptr< rw::geometry::Curve const > > :param curves: [in] vector of directed curves.
- setSurface(*args)
Overload 1:
Set surface. :type surface: rw::core::Ptr< rw::geometry::Surface const > :param surface: [in] the surface.
Overload 2:
Set surface. :type surface:
Surface
:param surface: [in] the surface.
- setVertex(index, vertex)
Set vertex. :type index: int :param index: [in] vertex index to set. :type vertex: rw::math::Vector3D< double > :param vertex: [in] the vertex point.
- setVertices(vertices)
Set the vertices. :type vertices: std::vector< rw::math::Vector3D< double > > :param vertices: [in] vector of vertices.
- property thisown
The membership flag
- transform(*args)
Overload 1: rw::math::Vector3D<double>&)
Overload 2: rw::math::Transform3D<>&)
- vertices()
Get the vertices of the face. :rtype: std::vector< rw::math::Vector3D< double > > :return: a reference to the vertex vector.
- class sdurw_geometry.sdurw_geometry.GenericFaceCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- curveCount()
- deref()
The pointer stored in the object.
- extremums(dir)
Find the extent of the surface along a specific direction. :type dir: rw::math::Vector3D< double > :param dir: [in] a normalized direction vector. :rtype: std::pair< double,double > :return: the minimum and maximum values along the given direction.
- getCurve(i)
- getDeref()
Member access operator.
- getTriMesh(forceCopy=True)
Create a TriMesh representation of the face.
This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.
- Parameters
forceCopy (boolean, optional) – [in] (not currently used in default implementation)
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- surface()
- property thisown
The membership flag
- vertices()
- class sdurw_geometry.sdurw_geometry.GenericFacePtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- curveCount()
- deref()
The pointer stored in the object.
- extremums(dir)
Find the extent of the surface along a specific direction. :type dir: rw::math::Vector3D< double > :param dir: [in] a normalized direction vector. :rtype: std::pair< double,double > :return: the minimum and maximum values along the given direction.
- getCurve(i)
- getDeref()
Member access operator.
- getTriMesh(forceCopy=True)
Create a TriMesh representation of the face.
This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.
- Parameters
forceCopy (boolean, optional) – [in] (not currently used in default implementation)
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obb()
Create Oriented Bounding Box.
The default implementation forms a TriMesh in order to estimate the directions for the OBB.
- Return type
rw::geometry::OBB< double >
- Returns
an OBB around the Face.
- setCurve(vertex, curve)
Set curve (a curve has direction) :type vertex: int :param vertex: [in] the start vertex. :type curve: rw::core::Ptr< rw::geometry::Curve const > :param curve: [in] the curve.
- setCurves(curves)
Set the curves. :type curves: std::vector< rw::core::Ptr< rw::geometry::Curve const > > :param curves: [in] vector of directed curves.
- setMeshResolution(resolution)
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float) – [in] the resolution parameter.
- setSurface(*args)
Overload 1:
Set surface. :type surface: rw::core::Ptr< rw::geometry::Surface const > :param surface: [in] the surface.
Overload 2:
Set surface. :type surface:
Surface
:param surface: [in] the surface.
- setVertex(index, vertex)
Set vertex. :type index: int :param index: [in] vertex index to set. :type vertex: rw::math::Vector3D< double > :param vertex: [in] the vertex point.
- setVertices(vertices)
Set the vertices. :type vertices: std::vector< rw::math::Vector3D< double > > :param vertices: [in] vector of vertices.
- surface()
- property thisown
The membership flag
- transform(*args)
Overload 1: rw::math::Vector3D<double>&)
Overload 2: rw::math::Transform3D<>&)
- vertices()
- class sdurw_geometry.sdurw_geometry.Geometry(*args)
Bases:
object
a class for representing a geometry that is scaled and transformed, and which is attached to a frame.
Each geometry must have a unique ID. This is either auto generated or specified by user. The ids are used in collision detection and other algorithms where the object need an association other than its memory address.
- ALL = -1
- CollisionGroup = 8
An object that is “just” a drawable
- DrawableGroup = 4
A virtual object, e.g. lines showing camera view angle
- PhysicalGroup = 1
- User1Group = 1024
An object that is also a CollisionObject
- User2Group = 2048
User defined group 1… User2
- User3Group = 4096
User3
- User4Group = 8096
User4
- VirtualGroup = 2
A physical object in the scene
- __init__(*args)
Overload 1:
constructor - autogenerated id from geometry type. :type data:
Ptr
:param data: :type scale: float, optional :param scale:Overload 2:
constructor giving a specified id. :type data:
Ptr
:param data: [in] pointer to geometry data :type name: string :param name: [in] Unique name to be assigned for the geometry :type scale: float, optional :param scale: [in] scaling factorOverload 3:
constructor giving a specified id. :type data:
Ptr
:param data: [in] pointer to geometry data :type name: string :param name: [in] Unique name to be assigned for the geometry :param scale: [in] scaling factorOverload 4:
constructor - autogenerated id from geometry type. :type data:
Ptr
:param data: [in] pointer to geometry data :type t3d: rw::math::Transform3D< double > :param t3d: [in] transform :type scale: float, optional :param scale: [in] scaling factorOverload 5:
constructor - autogenerated id from geometry type. :type data:
Ptr
:param data: [in] pointer to geometry data :type t3d: rw::math::Transform3D< double > :param t3d: [in] transform :param scale: [in] scaling factor
- getColor(color)
get the color stored for the object :type color: float :param color: [out] the array to store the color in
- getFilePath()
get file path of this geometry :rtype: string :return: the file path as string
- getFrame(*args)
Overload 1:
Get the reference frame. :rtype:
Frame
:return: the reference frame.Overload 2:
- getGeometryData(*args)
Overload 1:
get geometry data :rtype:
Ptr
:return: the geometry data storedOverload 2:
get geometry data
- getId()
get identifier of this geometry :rtype: string :return: the id of the geometry
- getMask()
Get the draw mask. :rtype: int :return: the draw mask.
- getName()
get name of this geometry :rtype: string :return: name as string
- getScale()
gets the scaling factor applied when using this geometry :rtype: float :return: the scale as double
- getTransform()
get transformation :rtype: rw::math::Transform3D< double > :return: the Current transform
- static makeBox(x, y, z)
util function for creating a Box geometry
- static makeCone(height, radiusTop, radiusBot)
util function for creating a Cone geometry
- static makeCylinder(radius, height)
util function for creating a Cylinder geometry
- static makeGrid(*args)
Construct a grid. :type dim_x: int :param dim_x: [in] number of cells in first direction. :type dim_y: int :param dim_y: [in] number of cells in second direction. :type size_x: float, optional :param size_x: [in] size of one cell. :type size_y: float, optional :param size_y: [in] size of one cell. :type xdir: rw::math::Vector3D< double >, optional :param xdir: [in] the direction of the first dimension. :type ydir: rw::math::Vector3D< double >, optional :param ydir: [in] the direction of the second dimension. :rtype:
Ptr
:return: a new grid geometry.
- static makeSphere(radi)
util function for creating a Sphere geometry
- setColor(*args)
Overload 1:
set the color of the geometry :type red: unsigned char :param red: [in] the amount of red color 0-255 :type green: unsigned char :param green: [in] the amount of green color 0-255 :type blue: unsigned char :param blue: [in] the amount of red color 0-255
Overload 2:
set the color of the geometry :type red: float :param red: [in] the amount of red color 0-1 :type green: float :param green: [in] the amount of green color 0-1 :type blue: float :param blue: [in] the amount of red color 0-1
- setFilePath(name)
set file path this geometry :type name: string :param name: [in] path to a geometry file
- setFrame(frame)
Set the reference frame. :type frame: rw::core::Ptr< rw::kinematics::Frame > :param frame: [in] new reference frame.
- setGeometryData(data)
set transformation :type data:
Ptr
:param data: [in] the new geometry data
- setId(id)
set identifier of this geometry :type id: string :param id: [in] new id
- setMask(mask)
Set the draw mask. :type mask: int :param mask: [in] the draw mask.
- setName(name)
set name of this geometry :type name: string :param name: [in] the new name of the geometry
- setScale(scale)
set the scaling factor that should be applied to this geometry when used. :type scale: float :param scale: [in] scale factor
- setTransform(t3d)
set transformation :type t3d: rw::math::Transform3D< double > :param t3d: [in] the new transform
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.GeometryCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getFilePath()
get file path of this geometry :rtype: string :return: the file path as string
- getFrame(*args)
Overload 1:
Get the reference frame. :rtype:
Frame
:return: the reference frame.Overload 2:
- getGeometryData(*args)
Overload 1:
get geometry data :rtype:
Ptr
:return: the geometry data storedOverload 2:
get geometry data
- getId()
get identifier of this geometry :rtype: string :return: the id of the geometry
- getName()
get name of this geometry :rtype: string :return: name as string
- getScale()
gets the scaling factor applied when using this geometry :rtype: float :return: the scale as double
- getTransform()
get transformation :rtype: rw::math::Transform3D< double > :return: the Current transform
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.GeometryData(*args, **kwargs)
Bases:
object
an interface for geometry data.
- AABBPrim = 7
- BoxPrim = 5
- ConePrim = 11
- CylinderPrim = 13
- IdxTriMesh = 3
- Implicit = 17
- LineMesh = 1
- LinePrim = 8
- OBBPrim = 6
- PlainTriMesh = 2
- PlanePrim = 15
- PointCloud = 0
- PointPrim = 9
- PyramidPrim = 10
- Quadratic = 18
- RayPrim = 16
- SpherePrim = 4
- TrianglePrim = 12
- TubePrim = 14
- UserType = 19
- __init__(*args, **kwargs)
- getTriMesh(forceCopy=True)
gets a trimesh representation of this geometry data.
The trimesh that is returned is by default a copy, which means ownership is transfered to the caller. Specifying forceCopy to false will enable copy by reference and ownership is not necesarilly transfered. This is more efficient, though pointer is only alive as long as this GeometryData is alive.
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
TriMesh representation of this GeometryData
- getType()
the type of this primitive
- isConvex()
test if this geometry data is convex :rtype: boolean :return: true if convex
- property thisown
The membership flag
- static toString(type)
format GeometryType to string :type type: int :param type:
- class sdurw_geometry.sdurw_geometry.GeometryDataCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getType()
the type of this primitive
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.GeometryDataPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getTriMesh(forceCopy=True)
gets a trimesh representation of this geometry data.
The trimesh that is returned is by default a copy, which means ownership is transfered to the caller. Specifying forceCopy to false will enable copy by reference and ownership is not necesarilly transfered. This is more efficient, though pointer is only alive as long as this GeometryData is alive.
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
TriMesh representation of this GeometryData
- getType()
the type of this primitive
- isConvex()
test if this geometry data is convex :rtype: boolean :return: true if convex
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- toString(type)
format GeometryType to string :type type: int :param type:
- sdurw_geometry.sdurw_geometry.GeometryData_toString(type)
format GeometryType to string :type type: int :param type:
- class sdurw_geometry.sdurw_geometry.GeometryPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- deref()
The pointer stored in the object.
- getColor(color)
get the color stored for the object :type color: float :param color: [out] the array to store the color in
- getDeref()
Member access operator.
- getFilePath()
get file path of this geometry :rtype: string :return: the file path as string
- getFrame(*args)
Overload 1:
Get the reference frame. :rtype:
Frame
:return: the reference frame.Overload 2:
- getGeometryData(*args)
Overload 1:
get geometry data :rtype:
Ptr
:return: the geometry data storedOverload 2:
get geometry data
- getId()
get identifier of this geometry :rtype: string :return: the id of the geometry
- getMask()
Get the draw mask. :rtype: int :return: the draw mask.
- getName()
get name of this geometry :rtype: string :return: name as string
- getScale()
gets the scaling factor applied when using this geometry :rtype: float :return: the scale as double
- getTransform()
get transformation :rtype: rw::math::Transform3D< double > :return: the Current transform
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- makeBox(x, y, z)
util function for creating a Box geometry
- makeCone(height, radiusTop, radiusBot)
util function for creating a Cone geometry
- makeCylinder(radius, height)
util function for creating a Cylinder geometry
- makeGrid(*args)
Construct a grid. :type dim_x: int :param dim_x: [in] number of cells in first direction. :type dim_y: int :param dim_y: [in] number of cells in second direction. :type size_x: float, optional :param size_x: [in] size of one cell. :type size_y: float, optional :param size_y: [in] size of one cell. :type xdir: rw::math::Vector3D< double >, optional :param xdir: [in] the direction of the first dimension. :type ydir: rw::math::Vector3D< double >, optional :param ydir: [in] the direction of the second dimension. :rtype:
Ptr
:return: a new grid geometry.
- makeSphere(radi)
util function for creating a Sphere geometry
- setColor(*args)
Overload 1:
set the color of the geometry :type red: unsigned char :param red: [in] the amount of red color 0-255 :type green: unsigned char :param green: [in] the amount of green color 0-255 :type blue: unsigned char :param blue: [in] the amount of red color 0-255
Overload 2:
set the color of the geometry :type red: float :param red: [in] the amount of red color 0-1 :type green: float :param green: [in] the amount of green color 0-1 :type blue: float :param blue: [in] the amount of red color 0-1
- setFilePath(name)
set file path this geometry :type name: string :param name: [in] path to a geometry file
- setFrame(frame)
Set the reference frame. :type frame: rw::core::Ptr< rw::kinematics::Frame > :param frame: [in] new reference frame.
- setGeometryData(data)
set transformation :type data:
Ptr
:param data: [in] the new geometry data
- setId(id)
set identifier of this geometry :type id: string :param id: [in] new id
- setMask(mask)
Set the draw mask. :type mask: int :param mask: [in] the draw mask.
- setName(name)
set name of this geometry :type name: string :param name: [in] the new name of the geometry
- setScale(scale)
set the scaling factor that should be applied to this geometry when used. :type scale: float :param scale: [in] scale factor
- setTransform(t3d)
set transformation :type t3d: rw::math::Transform3D< double > :param t3d: [in] the new transform
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.GeometryUtil
Bases:
object
Utility functions for calculating properties of geometry
The methods for calculation of volume, inertia, and the center of gravity, is as described in [1].
[1]: Fast and Accurate Computation of Polyhedral Mass Properties, Brian Mirtich. Journal of Graphics Tools, Vol.1, pages 31-58, 1996
- __init__()
- static calcMaxDist(geoms, center, ref, state)
calculates the max distance to any triangle in the geoms, from some point center :type geoms: std::vector< rw::core::Ptr< rw::geometry::Geometry > > :param geoms: [in] the geometries containing the triangles :type center: rw::math::Vector3D< double > :param center: [in] the point to calculate the distance from :type ref: rw::core::Ptr< rw::kinematics::Frame > :param ref: [in] the reference frame. :type state:
State
:param state: :rtype: float :return: the maximum distance to any triangle in the geometries
- static estimateCOG(*args)
Overload 1:
Estimates the center of gravity (COG) of a list of geometries.
The COG will be found relative to the geometry frame.
Notes: The geometries should be defined relative to the same frame - otherwise the result will not make sense.
- Parameters
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
- Return type
rw::math::Vector3D< double >
- Returns
the center of gravity for the geometries.
Overload 2:
Estimates the center of gravity (COG) of a list of geometries.
The COG will be given relative to the given reference frame.
- Parameters
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
ref (rw::core::Ptr< rw::kinematics::Frame >) – [in] the reference frame.
state (
State
) – [in] the state which gives the position of the geometries relative to the reference frame.
- Return type
rw::math::Vector3D< double >
- Returns
the center of gravity for the geometries.
Overload 3:
Estimates the center of gravity (COG) of a triangle mesh. :type trimesh:
TriMesh
:param trimesh: [in] the triangle mesh. :type t3d: rw::math::Transform3D< double >, optional :param t3d: [in] (optional) make a transformation of the trimesh. :rtype: rw::math::Vector3D< double > :return: the center of gravity of the mesh.Overload 4:
Estimates the center of gravity (COG) of a triangle mesh. :type trimesh:
TriMesh
:param trimesh: [in] the triangle mesh. :param t3d: [in] (optional) make a transformation of the trimesh. :rtype: rw::math::Vector3D< double > :return: the center of gravity of the mesh.
- static estimateInertia(*args)
Overload 1:
Estimates the inertia of a list of geometries.
The inertia is described relative to the ref coordinate system The reftrans parameter can however be used to transform the geometries.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
ref (rw::core::Ptr< rw::kinematics::Frame >) – [in] the reference frame for the geometries (if NULL, it is assumed that the geometries are defined relative to the same frame).
state (
State
) – [in] state used to retrieve the current location of geometries relative to the reference frame (only used if ref is given).reftrans (rw::math::Transform3D< double >, optional) – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
rw::math::InertiaMatrix< double >
- Returns
the inertia around relative to the ref frame.
Overload 2:
Estimates the inertia of a list of geometries.
The inertia is described relative to the geometry reference frame. The reftrans parameter can however be used to transform the geometries.
Notes: The geometries should be defined relative to the same frame - otherwise the result will not make sense.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
reftrans (rw::math::Transform3D< double >, optional) – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
rw::math::InertiaMatrix< double >
- Returns
the inertia matrix relative to the reference frame.
Overload 3:
Estimates the inertia of a list of geometries.
The inertia is described relative to the geometry reference frame. The reftrans parameter can however be used to transform the geometries.
Notes: The geometries should be defined relative to the same frame - otherwise the result will not make sense.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
reftrans – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
rw::math::InertiaMatrix< double >
- Returns
the inertia matrix relative to the reference frame.
- static estimateInertiaCOG(*args)
Estimates the inertia and center of gravity (COG) of a list of geometries.
The inertia is described relative to the ref coordinate system translated to COG. The reftrans parameter can however be used to transform the geometries.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
ref (rw::core::Ptr< rw::kinematics::Frame >) – [in] the reference frame for the geometries (if NULL, it is assumed that the geometries are defined relative to the same frame).
state (
State
) – [in] state used to retrieve the current location of geometries relative to the reference frame (only used if ref is given).reftrans (rw::math::Transform3D< double >, optional) – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
std::pair< rw::math::Vector3D< double >,rw::math::InertiaMatrix< double > >
- Returns
the center of gravity relative to the ref frame and the inertia around the center of gravity (in the coordinate frame of the ref frame).
- static estimateVolume(*args)
Overload 1:
Estimates the volume of a list of geometries. Notes: If geometries are overlapping, the overlapping regions will count twice in the volume. :type geoms: std::vector< rw::core::Ptr< rw::geometry::Geometry > > :param geoms: [in] the list of geometries. :rtype: float :return: the total volume of the geometries.
Overload 2:
Estimates the volume of a trimesh. :type trimesh:
TriMesh
:param trimesh: [in] the trimesh. :rtype: float :return: the total volume of the trimesh.
- static getAnchoredChildFrames(parent, state)
util function that locates all frames in the sub tree of parent that is staticly connected and that has geometry information.
- static getAnchoredFrames(f, state)
util function that locates all frames that is staticly connected to f and that has geometry information.
- static getDimensions(*args)
Overload 1:
Returns the dimensions of geometry :type geometry: rw::core::Ptr< rw::geometry::Geometry > :param geometry: [in] Geometry to analyse :rtype: rw::math::Vector3D< double > :return: Dimensions in the x,y and z directions.
Overload 2:
Returns the dimensions of trimesh :type trimesh: rw::core::Ptr< rw::geometry::TriMesh > :param trimesh: [in] TriMesh to analyse :rtype: rw::math::Vector3D< double > :return: Dimensions in the x,y and z directions.
- static getExtremumDistances(*args)
Returns the extremum distances for the vertices of the TriMesh given the specified transformation :type trimesh: rw::core::Ptr< rw::geometry::TriMesh > :param trimesh: [in] TriMesh to find extremum distances for :type t3d: rw::math::Transform3D< double >, optional :param t3d: [in] Transformation of the vertices :rtype: std::pair< rw::math::Vector3D< double >,rw::math::Vector3D< double > > :return: Pair containing the lower and upper extremum distances of the vertices.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.GeometryUtilCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.GeometryUtilPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- calcMaxDist(geoms, center, ref, state)
calculates the max distance to any triangle in the geoms, from some point center :type geoms: std::vector< rw::core::Ptr< rw::geometry::Geometry > > :param geoms: [in] the geometries containing the triangles :type center: rw::math::Vector3D< double > :param center: [in] the point to calculate the distance from :type ref: rw::core::Ptr< rw::kinematics::Frame > :param ref: [in] the reference frame. :type state:
State
:param state: :rtype: float :return: the maximum distance to any triangle in the geometries
- cptr()
- deref()
The pointer stored in the object.
- estimateCOG(*args)
Overload 1:
Estimates the center of gravity (COG) of a list of geometries.
The COG will be found relative to the geometry frame.
Notes: The geometries should be defined relative to the same frame - otherwise the result will not make sense.
- Parameters
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
- Return type
rw::math::Vector3D< double >
- Returns
the center of gravity for the geometries.
Overload 2:
Estimates the center of gravity (COG) of a list of geometries.
The COG will be given relative to the given reference frame.
- Parameters
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
ref (rw::core::Ptr< rw::kinematics::Frame >) – [in] the reference frame.
state (
State
) – [in] the state which gives the position of the geometries relative to the reference frame.
- Return type
rw::math::Vector3D< double >
- Returns
the center of gravity for the geometries.
Overload 3:
Estimates the center of gravity (COG) of a triangle mesh. :type trimesh:
TriMesh
:param trimesh: [in] the triangle mesh. :type t3d: rw::math::Transform3D< double >, optional :param t3d: [in] (optional) make a transformation of the trimesh. :rtype: rw::math::Vector3D< double > :return: the center of gravity of the mesh.Overload 4:
Estimates the center of gravity (COG) of a triangle mesh. :type trimesh:
TriMesh
:param trimesh: [in] the triangle mesh. :param t3d: [in] (optional) make a transformation of the trimesh. :rtype: rw::math::Vector3D< double > :return: the center of gravity of the mesh.
- estimateInertia(*args)
Overload 1:
Estimates the inertia of a list of geometries.
The inertia is described relative to the ref coordinate system The reftrans parameter can however be used to transform the geometries.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
ref (rw::core::Ptr< rw::kinematics::Frame >) – [in] the reference frame for the geometries (if NULL, it is assumed that the geometries are defined relative to the same frame).
state (
State
) – [in] state used to retrieve the current location of geometries relative to the reference frame (only used if ref is given).reftrans (rw::math::Transform3D< double >, optional) – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
rw::math::InertiaMatrix< double >
- Returns
the inertia around relative to the ref frame.
Overload 2:
Estimates the inertia of a list of geometries.
The inertia is described relative to the geometry reference frame. The reftrans parameter can however be used to transform the geometries.
Notes: The geometries should be defined relative to the same frame - otherwise the result will not make sense.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
reftrans (rw::math::Transform3D< double >, optional) – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
rw::math::InertiaMatrix< double >
- Returns
the inertia matrix relative to the reference frame.
Overload 3:
Estimates the inertia of a list of geometries.
The inertia is described relative to the geometry reference frame. The reftrans parameter can however be used to transform the geometries.
Notes: The geometries should be defined relative to the same frame - otherwise the result will not make sense.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
reftrans – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
rw::math::InertiaMatrix< double >
- Returns
the inertia matrix relative to the reference frame.
- estimateInertiaCOG(*args)
Estimates the inertia and center of gravity (COG) of a list of geometries.
The inertia is described relative to the ref coordinate system translated to COG. The reftrans parameter can however be used to transform the geometries.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
ref (rw::core::Ptr< rw::kinematics::Frame >) – [in] the reference frame for the geometries (if NULL, it is assumed that the geometries are defined relative to the same frame).
state (
State
) – [in] state used to retrieve the current location of geometries relative to the reference frame (only used if ref is given).reftrans (rw::math::Transform3D< double >, optional) – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
std::pair< rw::math::Vector3D< double >,rw::math::InertiaMatrix< double > >
- Returns
the center of gravity relative to the ref frame and the inertia around the center of gravity (in the coordinate frame of the ref frame).
- estimateVolume(*args)
Overload 1:
Estimates the volume of a list of geometries. Notes: If geometries are overlapping, the overlapping regions will count twice in the volume. :type geoms: std::vector< rw::core::Ptr< rw::geometry::Geometry > > :param geoms: [in] the list of geometries. :rtype: float :return: the total volume of the geometries.
Overload 2:
Estimates the volume of a trimesh. :type trimesh:
TriMesh
:param trimesh: [in] the trimesh. :rtype: float :return: the total volume of the trimesh.
- getAnchoredChildFrames(parent, state)
util function that locates all frames in the sub tree of parent that is staticly connected and that has geometry information.
- getAnchoredFrames(f, state)
util function that locates all frames that is staticly connected to f and that has geometry information.
- getDeref()
Member access operator.
- getDimensions(*args)
Overload 1:
Returns the dimensions of geometry :type geometry: rw::core::Ptr< rw::geometry::Geometry > :param geometry: [in] Geometry to analyse :rtype: rw::math::Vector3D< double > :return: Dimensions in the x,y and z directions.
Overload 2:
Returns the dimensions of trimesh :type trimesh: rw::core::Ptr< rw::geometry::TriMesh > :param trimesh: [in] TriMesh to analyse :rtype: rw::math::Vector3D< double > :return: Dimensions in the x,y and z directions.
- getExtremumDistances(*args)
Returns the extremum distances for the vertices of the TriMesh given the specified transformation :type trimesh: rw::core::Ptr< rw::geometry::TriMesh > :param trimesh: [in] TriMesh to find extremum distances for :type t3d: rw::math::Transform3D< double >, optional :param t3d: [in] Transformation of the vertices :rtype: std::pair< rw::math::Vector3D< double >,rw::math::Vector3D< double > > :return: Pair containing the lower and upper extremum distances of the vertices.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- sdurw_geometry.sdurw_geometry.GeometryUtil_calcMaxDist(geoms, center, ref, state)
calculates the max distance to any triangle in the geoms, from some point center :type geoms: std::vector< rw::core::Ptr< rw::geometry::Geometry > > :param geoms: [in] the geometries containing the triangles :type center: rw::math::Vector3D< double > :param center: [in] the point to calculate the distance from :type ref: rw::core::Ptr< rw::kinematics::Frame > :param ref: [in] the reference frame. :type state:
State
:param state: :rtype: float :return: the maximum distance to any triangle in the geometries
- sdurw_geometry.sdurw_geometry.GeometryUtil_estimateCOG(*args)
Overload 1:
Estimates the center of gravity (COG) of a list of geometries.
The COG will be found relative to the geometry frame.
Notes: The geometries should be defined relative to the same frame - otherwise the result will not make sense.
- Parameters
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
- Return type
rw::math::Vector3D< double >
- Returns
the center of gravity for the geometries.
Overload 2:
Estimates the center of gravity (COG) of a list of geometries.
The COG will be given relative to the given reference frame.
- Parameters
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
ref (rw::core::Ptr< rw::kinematics::Frame >) – [in] the reference frame.
state (
State
) – [in] the state which gives the position of the geometries relative to the reference frame.
- Return type
rw::math::Vector3D< double >
- Returns
the center of gravity for the geometries.
Overload 3:
Estimates the center of gravity (COG) of a triangle mesh. :type trimesh:
TriMesh
:param trimesh: [in] the triangle mesh. :type t3d: rw::math::Transform3D< double >, optional :param t3d: [in] (optional) make a transformation of the trimesh. :rtype: rw::math::Vector3D< double > :return: the center of gravity of the mesh.Overload 4:
Estimates the center of gravity (COG) of a triangle mesh. :type trimesh:
TriMesh
:param trimesh: [in] the triangle mesh. :param t3d: [in] (optional) make a transformation of the trimesh. :rtype: rw::math::Vector3D< double > :return: the center of gravity of the mesh.
- sdurw_geometry.sdurw_geometry.GeometryUtil_estimateInertia(*args)
Overload 1:
Estimates the inertia of a list of geometries.
The inertia is described relative to the ref coordinate system The reftrans parameter can however be used to transform the geometries.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
ref (rw::core::Ptr< rw::kinematics::Frame >) – [in] the reference frame for the geometries (if NULL, it is assumed that the geometries are defined relative to the same frame).
state (
State
) – [in] state used to retrieve the current location of geometries relative to the reference frame (only used if ref is given).reftrans (rw::math::Transform3D< double >, optional) – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
rw::math::InertiaMatrix< double >
- Returns
the inertia around relative to the ref frame.
Overload 2:
Estimates the inertia of a list of geometries.
The inertia is described relative to the geometry reference frame. The reftrans parameter can however be used to transform the geometries.
Notes: The geometries should be defined relative to the same frame - otherwise the result will not make sense.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
reftrans (rw::math::Transform3D< double >, optional) – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
rw::math::InertiaMatrix< double >
- Returns
the inertia matrix relative to the reference frame.
Overload 3:
Estimates the inertia of a list of geometries.
The inertia is described relative to the geometry reference frame. The reftrans parameter can however be used to transform the geometries.
Notes: The geometries should be defined relative to the same frame - otherwise the result will not make sense.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
reftrans – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
rw::math::InertiaMatrix< double >
- Returns
the inertia matrix relative to the reference frame.
- sdurw_geometry.sdurw_geometry.GeometryUtil_estimateInertiaCOG(*args)
Estimates the inertia and center of gravity (COG) of a list of geometries.
The inertia is described relative to the ref coordinate system translated to COG. The reftrans parameter can however be used to transform the geometries.
- Parameters
mass (float) – [in] the total mass of all geometries.
geoms (std::vector< rw::core::Ptr< rw::geometry::Geometry > >) – [in] the list of geometries.
ref (rw::core::Ptr< rw::kinematics::Frame >) – [in] the reference frame for the geometries (if NULL, it is assumed that the geometries are defined relative to the same frame).
state (
State
) – [in] state used to retrieve the current location of geometries relative to the reference frame (only used if ref is given).reftrans (rw::math::Transform3D< double >, optional) – [in] (optional) used to transform the geometry before calculation of the inertia.
- Return type
std::pair< rw::math::Vector3D< double >,rw::math::InertiaMatrix< double > >
- Returns
the center of gravity relative to the ref frame and the inertia around the center of gravity (in the coordinate frame of the ref frame).
- sdurw_geometry.sdurw_geometry.GeometryUtil_estimateVolume(*args)
Overload 1:
Estimates the volume of a list of geometries. Notes: If geometries are overlapping, the overlapping regions will count twice in the volume. :type geoms: std::vector< rw::core::Ptr< rw::geometry::Geometry > > :param geoms: [in] the list of geometries. :rtype: float :return: the total volume of the geometries.
Overload 2:
Estimates the volume of a trimesh. :type trimesh:
TriMesh
:param trimesh: [in] the trimesh. :rtype: float :return: the total volume of the trimesh.
- sdurw_geometry.sdurw_geometry.GeometryUtil_getAnchoredChildFrames(parent, state)
util function that locates all frames in the sub tree of parent that is staticly connected and that has geometry information.
- sdurw_geometry.sdurw_geometry.GeometryUtil_getAnchoredFrames(f, state)
util function that locates all frames that is staticly connected to f and that has geometry information.
- sdurw_geometry.sdurw_geometry.GeometryUtil_getDimensions(*args)
Overload 1:
Returns the dimensions of geometry :type geometry: rw::core::Ptr< rw::geometry::Geometry > :param geometry: [in] Geometry to analyse :rtype: rw::math::Vector3D< double > :return: Dimensions in the x,y and z directions.
Overload 2:
Returns the dimensions of trimesh :type trimesh: rw::core::Ptr< rw::geometry::TriMesh > :param trimesh: [in] TriMesh to analyse :rtype: rw::math::Vector3D< double > :return: Dimensions in the x,y and z directions.
- sdurw_geometry.sdurw_geometry.GeometryUtil_getExtremumDistances(*args)
Returns the extremum distances for the vertices of the TriMesh given the specified transformation :type trimesh: rw::core::Ptr< rw::geometry::TriMesh > :param trimesh: [in] TriMesh to find extremum distances for :type t3d: rw::math::Transform3D< double >, optional :param t3d: [in] Transformation of the vertices :rtype: std::pair< rw::math::Vector3D< double >,rw::math::Vector3D< double > > :return: Pair containing the lower and upper extremum distances of the vertices.
- sdurw_geometry.sdurw_geometry.Geometry_makeBox(x, y, z)
util function for creating a Box geometry
- sdurw_geometry.sdurw_geometry.Geometry_makeCone(height, radiusTop, radiusBot)
util function for creating a Cone geometry
- sdurw_geometry.sdurw_geometry.Geometry_makeCylinder(radius, height)
util function for creating a Cylinder geometry
- sdurw_geometry.sdurw_geometry.Geometry_makeGrid(*args)
Construct a grid. :type dim_x: int :param dim_x: [in] number of cells in first direction. :type dim_y: int :param dim_y: [in] number of cells in second direction. :type size_x: float, optional :param size_x: [in] size of one cell. :type size_y: float, optional :param size_y: [in] size of one cell. :type xdir: rw::math::Vector3D< double >, optional :param xdir: [in] the direction of the first dimension. :type ydir: rw::math::Vector3D< double >, optional :param ydir: [in] the direction of the second dimension. :rtype:
Ptr
:return: a new grid geometry.
- sdurw_geometry.sdurw_geometry.Geometry_makeSphere(radi)
util function for creating a Sphere geometry
- class sdurw_geometry.sdurw_geometry.HyperSphere(dimensions)
Bases:
object
A hyper-sphere of K dimensions.
Functions are provided to create (almost) uniform distribution of points on a hyper-sphere as shown in [1].
The distribution of points is illustrated below for 2 and 3 dimensional hyper-spheres. Notice that the tessellation is best when \(\delta\) is small.
Image: geometry/hypersphere.gif(“Distribution of points for K=2 and K=3.”)
[1] Lovisolo, L., and E. A. B. Da Silva. “Uniform distribution of points on a hyper-sphere with applications to vector bit-plane encoding.” IEE Proceedings-Vision, Image and Signal Processing 148.3 (2001): 187-193.
- __init__(dimensions)
Construct a hyper-sphere of unit size. :type dimensions: int :param dimensions: [in] the number of dimensions.
- area()
Calculate the surface area of a hyper-sphere.
Calculated for even dimensionality as \(\frac{K \pi^{K/2}}{(K/2)!}\)
Calculated for odd dimensionality as \(\frac{K 2^K \pi^{(K-1)/2}}{K!}\)
- Return type
float
- Returns
the surface area.
- getDimensions()
Get the number of dimensions of the hyper-sphere. :rtype: int :return: the number of dimensions, \(2 \leq K \leq 6\) .
- property thisown
The membership flag
- uniformDistributionCartesian(delta)
Create a uniform distribution in Cartesian coordinates.
This uses #uniformDistributionSpherical and maps the spherical coordinates to Cartesian coordinates. The mapping is documented in [1], section 2.1.
- Parameters
delta (float) – [in] the resolution.
- Return type
std::vector< Eigen::VectorXd >
- Returns
unit vectors, \([x_1 x_2 \dots x_K]^T\) , in Cartesian coordinates with dimension K.
Notes: This function is only implemented for \(2 \leq K \leq 6\) .
- uniformDistributionSpherical(delta)
Create a uniform distribution in spherical coordinates.
This implements the algorithm in [1], section 2.1, for dimensions \(2 \leq K \leq 6\).
- Parameters
delta (float) – [in] the resolution.
- Return type
std::vector< Eigen::VectorXd >
- Returns
list of vectors, \([\theta_1 \theta_2 \dots \theta_{K-1}]^T\) , in spherical coordinates with dimension K-1.
Notes: This function is only implemented for \(2 \leq K \leq 6\) .
- volume()
The volume of a hyper-sphere.
Calculated for even dimensionality as \(\frac{\pi^{K/2}}{(K/2)!}\)
Calculated for odd dimensionality as \(\frac{2 (2 \pi)^{(K-1)/2}}{K!!}\) where the double factorial for odd K means \(1 \cdot 3 \cdot 5 \dots K\)
- Return type
float
- Returns
the volume.
- class sdurw_geometry.sdurw_geometry.HyperSphereCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- area()
Calculate the surface area of a hyper-sphere.
Calculated for even dimensionality as \(\frac{K \pi^{K/2}}{(K/2)!}\)
Calculated for odd dimensionality as \(\frac{K 2^K \pi^{(K-1)/2}}{K!}\)
- Return type
float
- Returns
the surface area.
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getDimensions()
Get the number of dimensions of the hyper-sphere. :rtype: int :return: the number of dimensions, \(2 \leq K \leq 6\) .
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- uniformDistributionCartesian(delta)
Create a uniform distribution in Cartesian coordinates.
This uses #uniformDistributionSpherical and maps the spherical coordinates to Cartesian coordinates. The mapping is documented in [1], section 2.1.
- Parameters
delta (float) – [in] the resolution.
- Return type
std::vector< Eigen::VectorXd >
- Returns
unit vectors, \([x_1 x_2 \dots x_K]^T\) , in Cartesian coordinates with dimension K.
Notes: This function is only implemented for \(2 \leq K \leq 6\) .
- uniformDistributionSpherical(delta)
Create a uniform distribution in spherical coordinates.
This implements the algorithm in [1], section 2.1, for dimensions \(2 \leq K \leq 6\).
- Parameters
delta (float) – [in] the resolution.
- Return type
std::vector< Eigen::VectorXd >
- Returns
list of vectors, \([\theta_1 \theta_2 \dots \theta_{K-1}]^T\) , in spherical coordinates with dimension K-1.
Notes: This function is only implemented for \(2 \leq K \leq 6\) .
- volume()
The volume of a hyper-sphere.
Calculated for even dimensionality as \(\frac{\pi^{K/2}}{(K/2)!}\)
Calculated for odd dimensionality as \(\frac{2 (2 \pi)^{(K-1)/2}}{K!!}\) where the double factorial for odd K means \(1 \cdot 3 \cdot 5 \dots K\)
- Return type
float
- Returns
the volume.
- class sdurw_geometry.sdurw_geometry.HyperSpherePtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- area()
Calculate the surface area of a hyper-sphere.
Calculated for even dimensionality as \(\frac{K \pi^{K/2}}{(K/2)!}\)
Calculated for odd dimensionality as \(\frac{K 2^K \pi^{(K-1)/2}}{K!}\)
- Return type
float
- Returns
the surface area.
- cptr()
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getDimensions()
Get the number of dimensions of the hyper-sphere. :rtype: int :return: the number of dimensions, \(2 \leq K \leq 6\) .
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- property thisown
The membership flag
- uniformDistributionCartesian(delta)
Create a uniform distribution in Cartesian coordinates.
This uses #uniformDistributionSpherical and maps the spherical coordinates to Cartesian coordinates. The mapping is documented in [1], section 2.1.
- Parameters
delta (float) – [in] the resolution.
- Return type
std::vector< Eigen::VectorXd >
- Returns
unit vectors, \([x_1 x_2 \dots x_K]^T\) , in Cartesian coordinates with dimension K.
Notes: This function is only implemented for \(2 \leq K \leq 6\) .
- uniformDistributionSpherical(delta)
Create a uniform distribution in spherical coordinates.
This implements the algorithm in [1], section 2.1, for dimensions \(2 \leq K \leq 6\).
- Parameters
delta (float) – [in] the resolution.
- Return type
std::vector< Eigen::VectorXd >
- Returns
list of vectors, \([\theta_1 \theta_2 \dots \theta_{K-1}]^T\) , in spherical coordinates with dimension K-1.
Notes: This function is only implemented for \(2 \leq K \leq 6\) .
- volume()
The volume of a hyper-sphere.
Calculated for even dimensionality as \(\frac{\pi^{K/2}}{(K/2)!}\)
Calculated for odd dimensionality as \(\frac{2 (2 \pi)^{(K-1)/2}}{K!!}\) where the double factorial for odd K means \(1 \cdot 3 \cdot 5 \dots K\)
- Return type
float
- Returns
the volume.
- class sdurw_geometry.sdurw_geometry.ImplicitBREP
Bases:
BREP
Type of BREP where all surfaces are of type ImplicitSurface, and edges are of type ParametricCurve.
- __init__()
Constructor.
- addEdge(curve, v1, v2)
Add a ParametricCurve 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.
- Parameters
curve (
ParametricCurve
) – [in] curve to add.v1 (int) – [in] the start vertex.
v2 (int) – [in] the end vertex.
- clone()
Make a deep copy of the BREP. :rtype:
Ptr
:return: a copy of the BREP.
- getCommonCurves(faces)
Get a set of common curves between a set of faces. :type faces: std::set< std::size_t > :param faces: [in] loop indexes for the faces to consider. :rtype: rw::geometry::BREP::CommonCurveSet::CPtr :return: set of common curves as a CommonCurveSet.
- getCurve(curveIndex)
Get curve. :type curveIndex: int :param curveIndex: [in] index of the curve. Should be less than the number returned by
edgeCount().
- Return type
- Returns
a reference to the curve.
- getCurves(loopIdx)
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.
- Parameters
loopIdx (int) – [in] the loop index.
- Return type
std::vector< rw::core::Ptr< rw::geometry::Curve > >
- Returns
an ordered vector of curves.
- getSurface(surfaceIndex)
Get surface. :type surfaceIndex: int :param surfaceIndex: [in] the index of the surface. Should be less than the number
returned by size().
- Return type
- Returns
a reference to the surface.
- getType()
the type of this primitive
- scale(factor)
Scale the object. :type factor: float :param factor: [in] the factor to scale with.
- setFace(surface, loop)
Attach an ImplicitSurface to a face of the BREP. :type surface:
ImplicitSurface
:param surface: [in] surface to add. :type loop: int :param loop: [in] the loop index for the loop to attach surface to.
- shellProxy()
Get a Shell representation as a proxy to the BREP. :rtype: rw::core::Ptr< rw::geometry::Shell const > :return: smart pointer to a Shell proxy object.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.ImplicitBREPCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- clone()
- deref()
The pointer stored in the object.
- edgeCount()
The number of edges. :rtype: int :return: the number of edges.
- edgeOBR(edge)
Create Oriented Bounding Rectangle for an edge. :type edge: int :param edge: [in] the edge index, which should be less than edgeCount(). :rtype: rw::geometry::OBB< double > :return: OBB for the given edge (with third half-length set to zero).
- faceCount()
The number of faces.
The number of faces is the number of loops, where a surface has been attached.
- Return type
int
- Returns
the number of faces.
- faceExtremums(faceIndex, dir)
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
faceIndex (int) – [in] the face index, which should be less than loopCount().
dir (rw::math::Vector3D< double >) – [in] a normalized direction vector.
- Return type
std::pair< double,double >
- Returns
the minimum and maximum values along the given direction.
- getCommonCurves(faces)
- getCurve(curveIndex)
- getCurves(loopIdx)
- getDeref()
Member access operator.
- getSurface(surfaceIndex)
- getType()
- getVertex(vertexIndex)
Get vertex. :type vertexIndex: int :param vertexIndex: [in] index of the vertex. Should be less than the number returned by
vertices().
- Return type
rw::math::Vector3D< double >
- Returns
reference to the vertex.
- getVertices(loopIdx)
Get the vertices in a given loop.
The curves will be traversed in an ordered way around the loop.
- Parameters
loopIdx (int) – [in] the loop index.
- Return type
std::vector< rw::math::Vector3D< double > >
- Returns
a collection of vertices.
- isConvex(*args)
Overload 1:
Overload 2:
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- loopCount()
The number of loops. :rtype: int :return: the number of loops.
- shellProxy()
- property thisown
The membership flag
- verticeCount()
The number of vertices. :rtype: int :return: the number of vertices.
- class sdurw_geometry.sdurw_geometry.ImplicitBREPPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- addEdge(curve, v1, v2)
Add a ParametricCurve 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.
- Parameters
curve (
ParametricCurve
) – [in] curve to add.v1 (int) – [in] the start vertex.
v2 (int) – [in] the end vertex.
- addVertex(point)
Add a vertex to the BREP. :type point: rw::math::Vector3D< double > :param point: [in] the vertex to add.
- clone()
- cptr()
- deref()
The pointer stored in the object.
- edgeCount()
The number of edges. :rtype: int :return: the number of edges.
- edgeOBR(edge)
Create Oriented Bounding Rectangle for an edge. :type edge: int :param edge: [in] the edge index, which should be less than edgeCount(). :rtype: rw::geometry::OBB< double > :return: OBB for the given edge (with third half-length set to zero).
- faceCount()
The number of faces.
The number of faces is the number of loops, where a surface has been attached.
- Return type
int
- Returns
the number of faces.
- faceExtremums(faceIndex, dir)
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
faceIndex (int) – [in] the face index, which should be less than loopCount().
dir (rw::math::Vector3D< double >) – [in] a normalized direction vector.
- Return type
std::pair< double,double >
- Returns
the minimum and maximum values along the given direction.
- faceOBB(faceIndex)
Create Oriented Bounding Box for a face. :type faceIndex: int :param faceIndex: [in] the face index, which should be less than loopCount(). :rtype: rw::geometry::OBB< double > :return: OBB for the given face.
- faceTriMesh(faceIndex)
Construct a Triangle Mesh for a face. :type faceIndex: int :param faceIndex: [in] the face index, which should be less than loopCount(). :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: a triangle mesh.
- getCommonCurves(faces)
- getCurve(curveIndex)
- getCurves(loopIdx)
- getDeref()
Member access operator.
- getSurface(surfaceIndex)
- getSurfaceIndex(loop)
Get the surface index of a loop. :type loop: int :param loop: [in] the loop index. :rtype: int :return: the corresponding surface index.
- getTriMesh(forceCopy=True)
Create a TriMesh representation from this boundary representation.
This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.
- Parameters
forceCopy (boolean, optional) – [in] generate a new copy, or use a cached TriMesh.
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh if forceCopy is true, or a shared cached TriMesh if forceCopy is false.
- getType()
- getVertex(vertexIndex)
Get vertex. :type vertexIndex: int :param vertexIndex: [in] index of the vertex. Should be less than the number returned by
vertices().
- Return type
rw::math::Vector3D< double >
- Returns
reference to the vertex.
- getVertices(loopIdx)
Get the vertices in a given loop.
The curves will be traversed in an ordered way around the loop.
- Parameters
loopIdx (int) – [in] the loop index.
- Return type
std::vector< rw::math::Vector3D< double > >
- Returns
a collection of vertices.
- hasSurfaceSet(loop)
Check if a certain loop has a surface set. :type loop: int :param loop: [in] index of the loop, which should be less than loopCount(). :rtype: boolean :return: true if a surface is set, false otherwise.
- isConvex(*args)
Overload 1:
Overload 2:
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- loopCount()
The number of loops. :rtype: int :return: the number of loops.
- makeLoop(singleEdgeId)
Create a loop containing a single edge (typically for circles and ellipses and similar).
The half-edge structure requires that an edge must start and end in a vertex. Sometimes it is possible to have an edge without any vertices. This is, for example, the case for a circular or elliptic cylinder, where there will be two circular or elliptic edges. It is necessary to place one vertex on the circle or ellipse that can act as both the start and end vertex for the curve.
- Parameters
singleEdgeId (int) – [in] id of the edge to create loop for. 1-indexing is expected, with a sign that indicates the edge direction.
- obb(*args)
Overload 1:
Create Oriented Bounding Box with certain principal directions. :type R: rw::math::Rotation3D< > :param R: [in] the directions for the bounding box. :rtype: rw::geometry::OBB< double > :return: an OBB around the BREP.
Overload 2:
Create Oriented Bounding Box where the directions are estimated.
This method is more expensive than obb(const rw::math::Rotation3D<>&), because a TriMesh is formed to estimated the principal directions of the OBB.
- Return type
rw::geometry::OBB< double >
- Returns
an OBB around the BREP.
- printObj()
Print the structure of the BREP for debugging purposes.
- scale(factor)
- setFace(surface, loop)
Attach an ImplicitSurface to a face of the BREP. :type surface:
ImplicitSurface
:param surface: [in] surface to add. :type loop: int :param loop: [in] the loop index for the loop to attach surface to.
- setMeshResolution(resolution=10)
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float, optional) – [in] the resolution parameter.
- shellProxy()
- stitchAuto(eps)
Try to stitch edges automatically. :type eps: float :param eps: [in] distance threshold for vertices and curves.
- stitchEdges(first, second)
Connect two half-edges. :type first: int :param first: [in] id of the first edge. 0-indexing is expected, with a sign that
indicates the edge direction.
- Parameters
second (int) – [in] id of the second edge. 0-indexing is expected, with a sign that indicates the edge direction.
Notes: Implementations calling this function should remember to delete the curve associated to the second half-edge if it is different than the curve set for the first half-edge. :raises: rw::core::Exception if one of the given half-edges is already connected to
another half-edge.
- property thisown
The membership flag
- toString(type)
format GeometryType to string :type type: int :param type:
- verticeCount()
The number of vertices. :rtype: int :return: the number of vertices.
- class sdurw_geometry.sdurw_geometry.ImplicitFace(*args)
Bases:
Face
Type of Face, where the surface is an ImplicitSurface and the edges are of type ParametricCurve.
- __init__(*args)
- Overload 1:
Constructor.
Overload 2:
Construct face with surface and vertices given initially.
Curves must be set afterwards.
- Parameters
surface (rw::core::Ptr< rw::geometry::ImplicitSurface const >) – [in] the surface data.
vertices (std::vector< rw::math::Vector3D< double > >) – [in] vector of vertices.
- curveCount()
Get the number of curves in the face. :rtype: int :return: the number of curves.
- getCurve(i)
Get a curve of the face. :type i: int :param i: [in] the curve index, which should be less than the number returned by
curveCount().
- Return type
- Returns
a reference to the curve data.
- getCurves()
Get the parametric curves. :rtype: std::vector< rw::core::Ptr< rw::geometry::ParametricCurve const > > :return: vector with the curves.
- setCurve(vertex, curve)
Set parametric curve (a curve has direction) :type vertex: int :param vertex: [in] the start vertex. :type curve: rw::core::Ptr< rw::geometry::ParametricCurve const > :param curve: [in] the curve.
- setCurves(curves)
Set the parametric curves. :type curves: std::vector< rw::core::Ptr< rw::geometry::ParametricCurve const > > :param curves: [in] vector of directed curves.
- setSurface(*args)
Overload 1:
Set implicit surface. :type surface: rw::core::Ptr< rw::geometry::ImplicitSurface const > :param surface: [in] the surface.
Overload 2:
Set surface. :type surface:
ImplicitSurface
:param surface: [in] the surface.
- setVertex(index, vertex)
Set vertex. :type index: int :param index: [in] vertex index to set. :type vertex: rw::math::Vector3D< double > :param vertex: [in] the vertex point.
- setVertices(vertices)
Set the vertices. :type vertices: std::vector< rw::math::Vector3D< double > > :param vertices: [in] vector of vertices.
- surface()
Get the surface of the face. :rtype:
ImplicitSurface
:return: a reference to the surface data.
- property thisown
The membership flag
- transform(*args)
Overload 1: rw::math::Vector3D<double>&)
Overload 2: rw::math::Transform3D<>&)
- vertices()
Get the vertices of the face. :rtype: std::vector< rw::math::Vector3D< double > > :return: a reference to the vertex vector.
- class sdurw_geometry.sdurw_geometry.ImplicitFaceCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- curveCount()
- deref()
The pointer stored in the object.
- extremums(dir)
Find the extent of the surface along a specific direction. :type dir: rw::math::Vector3D< double > :param dir: [in] a normalized direction vector. :rtype: std::pair< double,double > :return: the minimum and maximum values along the given direction.
- getCurve(i)
- getCurves()
Get the parametric curves. :rtype: std::vector< rw::core::Ptr< rw::geometry::ParametricCurve const > > :return: vector with the curves.
- getDeref()
Member access operator.
- getTriMesh(forceCopy=True)
Create a TriMesh representation of the face.
This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.
- Parameters
forceCopy (boolean, optional) – [in] (not currently used in default implementation)
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- surface()
Get the surface of the face. :rtype:
ImplicitSurface
:return: a reference to the surface data.
- property thisown
The membership flag
- vertices()
- class sdurw_geometry.sdurw_geometry.ImplicitFacePtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- curveCount()
- deref()
The pointer stored in the object.
- extremums(dir)
Find the extent of the surface along a specific direction. :type dir: rw::math::Vector3D< double > :param dir: [in] a normalized direction vector. :rtype: std::pair< double,double > :return: the minimum and maximum values along the given direction.
- getCurve(i)
- getCurves()
Get the parametric curves. :rtype: std::vector< rw::core::Ptr< rw::geometry::ParametricCurve const > > :return: vector with the curves.
- getDeref()
Member access operator.
- getTriMesh(forceCopy=True)
Create a TriMesh representation of the face.
This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.
- Parameters
forceCopy (boolean, optional) – [in] (not currently used in default implementation)
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obb()
Create Oriented Bounding Box.
The default implementation forms a TriMesh in order to estimate the directions for the OBB.
- Return type
rw::geometry::OBB< double >
- Returns
an OBB around the Face.
- setCurve(vertex, curve)
Set parametric curve (a curve has direction) :type vertex: int :param vertex: [in] the start vertex. :type curve: rw::core::Ptr< rw::geometry::ParametricCurve const > :param curve: [in] the curve.
- setCurves(curves)
Set the parametric curves. :type curves: std::vector< rw::core::Ptr< rw::geometry::ParametricCurve const > > :param curves: [in] vector of directed curves.
- setMeshResolution(resolution)
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float) – [in] the resolution parameter.
- setSurface(*args)
Overload 1:
Set implicit surface. :type surface: rw::core::Ptr< rw::geometry::ImplicitSurface const > :param surface: [in] the surface.
Overload 2:
Set surface. :type surface:
ImplicitSurface
:param surface: [in] the surface.
- setVertex(index, vertex)
Set vertex. :type index: int :param index: [in] vertex index to set. :type vertex: rw::math::Vector3D< double > :param vertex: [in] the vertex point.
- setVertices(vertices)
Set the vertices. :type vertices: std::vector< rw::math::Vector3D< double > > :param vertices: [in] vector of vertices.
- surface()
Get the surface of the face. :rtype:
ImplicitSurface
:return: a reference to the surface data.
- property thisown
The membership flag
- transform(*args)
Overload 1: rw::math::Vector3D<double>&)
Overload 2: rw::math::Transform3D<>&)
- vertices()
- class sdurw_geometry.sdurw_geometry.ImplicitShell(*args, **kwargs)
Bases:
Shell
Type of Shell where all surfaces are of type ImplicitSurface and all curves are of type ParametricCurve.
- __init__(*args, **kwargs)
- getFace(*args)
Overload 1:
Overload 2:
Get a surface patch. :type idx: int :param idx: [in] index of the patch. :type dst:
ImplicitFace
:param dst: [out] an existing face to write data to.
- getType()
the type of this primitive
- isConvex()
test if this geometry data is convex :rtype: boolean :return: true if convex
- setMeshResolution(resolution)
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float) – [in] the resolution parameter.
- size()
Get the number of surface patches in this shell. :rtype: int :return: the number of surface patches.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.ImplicitShellCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- extremums(dir)
Get the minimum and maximum values of the shell in a certain direction. :type dir: rw::math::Vector3D< double > :param dir: [in] the direction to find extremums for. :rtype: std::pair< double,double > :return: the minimum and maximum as a pair of values.
- getDeref()
Member access operator.
- getFace(*args)
Overload 1:
Overload 2:
Get a surface patch. :type idx: int :param idx: [in] index of the patch. :type dst:
ImplicitFace
:param dst: [out] an existing face to write data to.
- getTriMesh(*args)
Overload 1:
Overload 2:
Overload 3:
- getType()
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obb()
Create Oriented Bounding Box (OBB) as a bounding volume for the shell. :rtype: rw::geometry::OBB< > :return: the OBB.
- size()
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.ImplicitShellPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- deref()
The pointer stored in the object.
- extremums(dir)
Get the minimum and maximum values of the shell in a certain direction. :type dir: rw::math::Vector3D< double > :param dir: [in] the direction to find extremums for. :rtype: std::pair< double,double > :return: the minimum and maximum as a pair of values.
- getDeref()
Member access operator.
- getFace(*args)
Overload 1:
Overload 2:
Get a surface patch. :type idx: int :param idx: [in] index of the patch. :type dst:
ImplicitFace
:param dst: [out] an existing face to write data to.
- getTriMesh(*args)
Overload 1:
Overload 2:
Overload 3:
- getType()
- isConvex()
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obb()
Create Oriented Bounding Box (OBB) as a bounding volume for the shell. :rtype: rw::geometry::OBB< > :return: the OBB.
- setMeshResolution(resolution)
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float) – [in] the resolution parameter.
- size()
- property thisown
The membership flag
- toString(type)
format GeometryType to string :type type: int :param type:
- class sdurw_geometry.sdurw_geometry.ImplicitSurface(*args, **kwargs)
Bases:
Surface
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\).
- __init__(*args, **kwargs)
- clone()
Clone the surface. :rtype:
Ptr
:return: pointer to copy of surface.
- equals(surface, threshold)
Check if this surface is identical to other surface . :type surface:
Surface
:param surface: [in] other surface to compare to. :type threshold: float :param threshold: [in] threshold for when surfaces can be consideredidentical.
- Return type
boolean
- Returns
true if identical, false otherwise.
- extremums(direction)
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 (rw::math::Vector3D< double >) – [in] a normalized direction vector.
- Return type
std::pair< double,double >
- Returns
the minimum and maximum values along the given direction.
Notes: This function does not take trimming conditions into account. For trimmed surfaces, create a Face with the boundary curves and use Face::extremums.
- getTriMesh(*args)
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 (std::vector< rw::math::Vector3D< double > >, optional) – [in] (optional) an ordered list of points on the surface, that forms the border of the patch to triangulate.
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh.
- gradient(x)
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{\partialF}{\partial y} & \frac{\partial F}{\partial z} \end{bmatrix}^T\)
- Parameters
x (rw::math::Vector3D< double >) – [in] a point on the surface.
- Return type
rw::math::Vector3D< double >
- 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).
- insideTrimmingRegion(P)
Check if point, P, on surface lies inside the trimming region. :type P: rw::math::Vector3D< double > :param P: [in] the point to check. :rtype: boolean :return: true if the points lies inside the trimming region.
- normal(x)
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 (rw::math::Vector3D< double >) – [in] a point on the surface.
- Return type
rw::math::Vector3D< double >
- Returns
the normal to the surface at x .
See also: the gradient function to find the gradient.
- reuseTrimmingRegions(surface)
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. :type surface:
Ptr
:param surface: [in/out] the other surface.
- scale(factor)
Get a scaled version of the surface. :type factor: float :param factor: [in] the factor to scale with. :rtype:
Ptr
:return: a new scaled surface.
- setDiscretizationResolution(resolution)
Set the resolution used for discretization in the getTriMesh function.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float) – [in] the resolution parameter.
- property thisown
The membership flag
- transform(*args)
Overload 1: rw::math::Transform3D<double>&) const
Overload 2: rw::math::Vector3D<double>&) const
- class sdurw_geometry.sdurw_geometry.ImplicitSurfaceCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- clone()
- deref()
The pointer stored in the object.
- equals(surface, threshold)
- extremums(direction)
- getDeref()
Member access operator.
- getTriMesh(*args)
- gradient(x)
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{\partialF}{\partial y} & \frac{\partial F}{\partial z} \end{bmatrix}^T\)
- Parameters
x (rw::math::Vector3D< double >) – [in] a point on the surface.
- Return type
rw::math::Vector3D< double >
- 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).
- insideTrimmingRegion(P)
Check if point, P, on surface lies inside the trimming region. :type P: rw::math::Vector3D< double > :param P: [in] the point to check. :rtype: boolean :return: true if the points lies inside the trimming region.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- normal(x)
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 (rw::math::Vector3D< double >) – [in] a point on the surface.
- Return type
rw::math::Vector3D< double >
- Returns
the normal to the surface at x .
See also: the gradient function to find the gradient.
- reuseTrimmingRegions(surface)
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. :type surface:
Ptr
:param surface: [in/out] the other surface.
- scale(factor)
- property thisown
The membership flag
- transform(*args)
Overload 1: rw::math::Transform3D<double>&) const
Overload 2: rw::math::Vector3D<double>&) const
- class sdurw_geometry.sdurw_geometry.ImplicitSurfacePtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- clone()
- cptr()
- deref()
The pointer stored in the object.
- equals(surface, threshold)
- extremums(direction)
- getDeref()
Member access operator.
- getTriMesh(*args)
- gradient(x)
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{\partialF}{\partial y} & \frac{\partial F}{\partial z} \end{bmatrix}^T\)
- Parameters
x (rw::math::Vector3D< double >) – [in] a point on the surface.
- Return type
rw::math::Vector3D< double >
- 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).
- insideTrimmingRegion(P)
Check if point, P, on surface lies inside the trimming region. :type P: rw::math::Vector3D< double > :param P: [in] the point to check. :rtype: boolean :return: true if the points lies inside the trimming region.
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- normal(x)
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 (rw::math::Vector3D< double >) – [in] a point on the surface.
- Return type
rw::math::Vector3D< double >
- Returns
the normal to the surface at x .
See also: the gradient function to find the gradient.
- reuseTrimmingRegions(surface)
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. :type surface:
Ptr
:param surface: [in/out] the other surface.
- scale(factor)
- setDiscretizationResolution(resolution)
- property thisown
The membership flag
- transform(*args)
Overload 1: rw::math::Transform3D<double>&) const
Overload 2: rw::math::Vector3D<double>&) const
- class sdurw_geometry.sdurw_geometry.ImplicitTorus(*args)
Bases:
ImplicitSurface
Torus defined as an implicit surface.
The torus is described as an implicit surface of the form:
\(\left(x^T x + R^2 - r^2 \right)^2 - 4 R^2 x^T \begin{bmatrix} 1 & 0 & 0\\ 0 & 1 & 0 \\ 0& 0 & 0 \end{bmatrix} x = 0\)
or equivalently:
\(\left(x^T x - R^2 - r^2 \right)^2 - 4 R^2 (r^2 - {x_3}^2) = 0\)
where R is the distance from the center of the torus to the center of the tube, r is the radius of the tube, and \(x \in \mathbb{R}^3\).
Image: geometry/torus_circular.png(“Standard circular torus with circular tube.”)
Alternatively, a torus with an elliptic tube can be specified. This surface has the more generic form:
\(\left( x^T \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & \frac{{r_1}^2}{{r_2}^2}\end{bmatrix} x + R^2 - {r_1}^2 \right)^2 - 4 R^2 x^T \begin{bmatrix} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 0 \end{bmatrix} x = 0\)
or equivalently:
\(\left( x^T \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & \frac{{r_1}^2}{{r_2}^2}\end{bmatrix} x - R^2 - {r_1}^2 \right)^2 - 4 R^2 \left({r_1}^2 - \frac{{r_1}^2}{{r_2}^2}{x_3}^2 \right) = 0\)
Image: geometry/torus_elliptic.png(“Circular torus with elliptic tube.”)
The elliptic torus with elliptic tube has the much more complex form:
\(\left( ({R_2}^2+t){x_1}^2 + ({R_1}^2+t){x_2}^2 - ({R_1}^2+t)({R_2}^2+t) - 4 R_1 R_2 t\right)^2 - 4 t (R_2 {x_1}^2 + R_1 {x_2}^2 - (R_1+R_2)(R_1 R_2 + t))^2 = 0\)
where
\(t = {r_1}^2 (1-\frac{{x_3}^2}{{r_2}^2})\)
Image: geometry/torus_elliptic_elliptic.png(“Elliptic torus with elliptic tube.”)
Notice that many functions are not yet implemented for this last type of elliptic torus. These functions might throw an exception.
- __init__(*args)
Overload 1:
Construct circular torus. :type R: float :param R: [in] distance from center of torus to center of tube. :type r: float :param r: [in] radius of the tube.
Overload 2:
Construct elliptic torus. :type R1: float :param R1: [in] distance from center of torus to center of tube in first direction. :type R2: float :param R2: [in] distance from center of torus to center of tube in second direction. :type r1: float :param r1: [in] radius of the tube in first direction. :type r2: float :param r2: [in] radius of the tube in second direction.
- addTrimmingCondition(condition)
Add a trimming condition to this surface. :type condition:
TrimmingRegion
:param condition: [in] the condition to add.
- clone()
Clone the surface. :rtype:
Ptr
:return: pointer to copy of surface.
- equals(surface, threshold)
Check if this surface is identical to other surface . :type surface:
Surface
:param surface: [in] other surface to compare to. :type threshold: float :param threshold: [in] threshold for when surfaces can be consideredidentical.
- Return type
boolean
- Returns
true if identical, false otherwise.
- extremums(direction)
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 (rw::math::Vector3D< double >) – [in] a normalized direction vector.
- Return type
std::pair< double,double >
- Returns
the minimum and maximum values along the given direction.
Notes: This function does not take trimming conditions into account. For trimmed surfaces, create a Face with the boundary curves and use Face::extremums.
- getTriMesh(*args)
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 (std::vector< rw::math::Vector3D< double > >, optional) – [in] (optional) an ordered list of points on the surface, that forms the border of the patch to triangulate.
- Return type
rw::core::Ptr< rw::geometry::TriMesh >
- Returns
a new TriMesh.
- getTrimmingConditions()
Get the trimming conditions for the surface. :rtype: std::vector< rw::geometry::ImplicitTorus::TrimmingRegion > :return: ImplicitSurface vector specifying the boundary of the surface. If surface is
unbounded, the length of the vector is zero.
- gradient(x)
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{\partialF}{\partial y} & \frac{\partial F}{\partial z} \end{bmatrix}^T\)
- Parameters
x (rw::math::Vector3D< double >) – [in] a point on the surface.
- Return type
rw::math::Vector3D< double >
- 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).
- insideTrimmingRegion(P)
Check if point, P, on surface lies inside the trimming region. :type P: rw::math::Vector3D< double > :param P: [in] the point to check. :rtype: boolean :return: true if the points lies inside the trimming region.
- normal(x)
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 (rw::math::Vector3D< double >) – [in] a point on the surface.
- Return type
rw::math::Vector3D< double >
- Returns
the normal to the surface at x .
See also: the gradient function to find the gradient.
- reuseTrimmingRegions(surface)
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. :type surface:
Ptr
:param surface: [in/out] the other surface.
- scale(factor)
Get a scaled version of the surface. :type factor: float :param factor: [in] the factor to scale with. :rtype:
Ptr
:return: a new scaled surface.
- setDiscretizationResolution(resolution)
Set the resolution used for discretization in the getTriMesh function.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float) – [in] the resolution parameter.
- setTrimmingConditions(conditions)
Set the trimming conditions of this surface. :type conditions: std::vector< rw::geometry::ImplicitTorus::TrimmingRegion > :param conditions: [in] a vector of conditions.
- property thisown
The membership flag
- transform(*args)
Overload 1: rw::math::Transform3D<double>&) const
Overload 2: rw::math::Vector3D<double>&) const
- class sdurw_geometry.sdurw_geometry.ImplicitTorusCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- clone()
- deref()
The pointer stored in the object.
- equals(surface, threshold)
- extremums(direction)
- getDeref()
Member access operator.
- getTriMesh(*args)
- getTrimmingConditions()
Get the trimming conditions for the surface. :rtype: std::vector< rw::geometry::ImplicitTorus::TrimmingRegion > :return: ImplicitSurface vector specifying the boundary of the surface. If surface is
unbounded, the length of the vector is zero.
- gradient(x)
- insideTrimmingRegion(P)
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- normal(x)
- reuseTrimmingRegions(surface)
- scale(factor)
- property thisown
The membership flag
- transform(*args)
Overload 1: rw::math::Transform3D<double>&) const
Overload 2: rw::math::Vector3D<double>&) const
- class sdurw_geometry.sdurw_geometry.ImplicitTorusPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- addTrimmingCondition(condition)
Add a trimming condition to this surface. :type condition:
TrimmingRegion
:param condition: [in] the condition to add.
- clone()
- cptr()
- deref()
The pointer stored in the object.
- equals(surface, threshold)
- extremums(direction)
- getDeref()
Member access operator.
- getTriMesh(*args)
- getTrimmingConditions()
Get the trimming conditions for the surface. :rtype: std::vector< rw::geometry::ImplicitTorus::TrimmingRegion > :return: ImplicitSurface vector specifying the boundary of the surface. If surface is
unbounded, the length of the vector is zero.
- gradient(x)
- insideTrimmingRegion(P)
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- normal(x)
- reuseTrimmingRegions(surface)
- scale(factor)
- setDiscretizationResolution(resolution)
- setTrimmingConditions(conditions)
Set the trimming conditions of this surface. :type conditions: std::vector< rw::geometry::ImplicitTorus::TrimmingRegion > :param conditions: [in] a vector of conditions.
- property thisown
The membership flag
- transform(*args)
Overload 1: rw::math::Transform3D<double>&) const
Overload 2: rw::math::Vector3D<double>&) const
- class sdurw_geometry.sdurw_geometry.IndexedFace
Bases:
object
Structure that holds information for each face.
- __init__()
Constructor.
- property center
Center of limits used for sorting.
- property lower
Lower limit used for sorting.
- property originalID
Index of the original face.
- property thisown
The membership flag
- property upper
Upper limit used for sorting.
- class sdurw_geometry.sdurw_geometry.IndexedFaceArray(*args)
Bases:
Shell
An indexed face array is a proxy to a Shell, that makes it possible to easily sort faces and take subsets without modifying the underlying Shell.
- __init__(*args)
Overload 1:
Construct new indexed face array. :type shell: rw::core::Ptr< rw::geometry::Shell const > :param shell: [in] the underlying Shell.
Overload 2:
Construct new indexed face array. :type shell: rw::core::Ptr< rw::geometry::Shell const > :param shell: [in] the underlying Shell. :type faces: std::vector< rw::geometry::IndexedFaceArray::IndexedFace > :param faces: [in] the faces to include in the proxy. :type first: int :param first: [in] skip the first faces. :type last: int :param last: [in] last index of faces to include.
- getGlobalIndex(idx)
Get the original face index. :type idx: int :param idx: [in] the indexed face index. :rtype: int :return: the original index.
- getIndexedFace(*args)
Overload 1:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :rtype:
IndexedFace
:return: the indexed face.Overload 2:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :type dst:
IndexedFace
:param dst: [out] existing object to copy data into.
- getSubRange(first, last)
Take out a subrange of faces. :type first: int :param first: [in] first index. :type last: int :param last: [in] last index. :rtype:
IndexedFaceArray
:return: a new indexed face array.
- getType()
the type of this primitive
- isConvex()
test if this geometry data is convex :rtype: boolean :return: true if convex
- size()
Get the number of surface patches in this shell. :rtype: int :return: the number of surface patches.
- sortAxis(axis, t3d)
Sort the faces according to their extent in the direction along axis. :type axis: int :param axis: [in] axis to sort. :type t3d: rw::math::Transform3D< double > :param t3d: [in] transform giving the position and axis directions.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedFaceArrayCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- extremums(dir)
Get the minimum and maximum values of the shell in a certain direction. :type dir: rw::math::Vector3D< double > :param dir: [in] the direction to find extremums for. :rtype: std::pair< double,double > :return: the minimum and maximum as a pair of values.
- getDeref()
Member access operator.
- getFace(*args)
Overload 1:
Get a surface patch. :type idx: int :param idx: [in] index of patch. :rtype: rw::core::Ptr< rw::geometry::Face const > :return: a copy of the surface patch.
Overload 2:
Get a surface patch. :type idx: int :param idx: [in] index of patch. :type face:
GenericFace
:param face: [out] existing face to copy data into.
- getGlobalIndex(idx)
Get the original face index. :type idx: int :param idx: [in] the indexed face index. :rtype: int :return: the original index.
- getIndexedFace(*args)
Overload 1:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :rtype:
IndexedFace
:return: the indexed face.Overload 2:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :type dst:
IndexedFace
:param dst: [out] existing object to copy data into.
- getSubRange(first, last)
Take out a subrange of faces. :type first: int :param first: [in] first index. :type last: int :param last: [in] last index. :rtype:
IndexedFaceArray
:return: a new indexed face array.
- getTriMesh(*args)
Overload 1:
Overload 2:
Overload 3:
- getType()
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obb()
Create Oriented Bounding Box (OBB) as a bounding volume for the shell. :rtype: rw::geometry::OBB< > :return: the OBB.
- size()
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedFaceArrayPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- deref()
The pointer stored in the object.
- extremums(dir)
Get the minimum and maximum values of the shell in a certain direction. :type dir: rw::math::Vector3D< double > :param dir: [in] the direction to find extremums for. :rtype: std::pair< double,double > :return: the minimum and maximum as a pair of values.
- getDeref()
Member access operator.
- getFace(*args)
Overload 1:
Get a surface patch. :type idx: int :param idx: [in] index of patch. :rtype: rw::core::Ptr< rw::geometry::Face const > :return: a copy of the surface patch.
Overload 2:
Get a surface patch. :type idx: int :param idx: [in] index of patch. :type face:
GenericFace
:param face: [out] existing face to copy data into.
- getGlobalIndex(idx)
Get the original face index. :type idx: int :param idx: [in] the indexed face index. :rtype: int :return: the original index.
- getIndexedFace(*args)
Overload 1:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :rtype:
IndexedFace
:return: the indexed face.Overload 2:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :type dst:
IndexedFace
:param dst: [out] existing object to copy data into.
- getSubRange(first, last)
Take out a subrange of faces. :type first: int :param first: [in] first index. :type last: int :param last: [in] last index. :rtype:
IndexedFaceArray
:return: a new indexed face array.
- getTriMesh(*args)
Overload 1:
Overload 2:
Overload 3:
- getType()
- isConvex()
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obb()
Create Oriented Bounding Box (OBB) as a bounding volume for the shell. :rtype: rw::geometry::OBB< > :return: the OBB.
- size()
- sortAxis(axis, t3d)
Sort the faces according to their extent in the direction along axis. :type axis: int :param axis: [in] axis to sort. :type t3d: rw::math::Transform3D< double > :param t3d: [in] transform giving the position and axis directions.
- property thisown
The membership flag
- toString(type)
format GeometryType to string :type type: int :param type:
- class sdurw_geometry.sdurw_geometry.IndexedPolygon(*args, **kwargs)
Bases:
object
indexed polygon class that saves N indices to the N vertices of the polygon
- __init__(*args, **kwargs)
- getVertexIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- size()
Number of vertices of this polygon :rtype: int :return: Number of vertices
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedPolygonCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getVertexIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- size()
Number of vertices of this polygon :rtype: int :return: Number of vertices
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedPolygonN(*args)
Bases:
IndexedPolygon
Polygon with N vertice indices and 0 normals
- __init__(*args)
- Overload 1:
Constructs IndexedPolygon with space for n vertices
- Overload 2:
Constructs IndexedPolygon with space for n vertices
Overload 3:
Constructs IndexedPolygonN with the vertices specified
- addVertex(p)
Adds a vertex to the polygon
The point will be added to the end of the list of points :type p: int :param p: [in] The point to add
- getVertexIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- removeVertexIdx(i)
Removes vertex from the polygon
- Parameters
i (int) – [in] Index of the point to remove
- size()
<T>::size
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedPolygonNN(*args, **kwargs)
Bases:
IndexedPolygon
Polygon with N vertices and N normals.
- __init__(*args, **kwargs)
- addVertex(p, n)
Adds a vertex to the polygon
The point will be added to the end of the list of points :type p: int :param p: [in] The point to add :type n: int :param n: [in] Normal associated to the point
- getNormalIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- getVertexIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- removeVertexIdx(i)
Removes vertex from the polygon
- Parameters
i (int) – [in] Index of the point to remove
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedPolygonNN_32(*args, **kwargs)
Bases:
IndexedPolygon_32
Polygon with N vertices and N normals.
- __init__(*args, **kwargs)
- addVertex(p, n)
Adds a vertex to the polygon
The point will be added to the end of the list of points :type p: int :param p: [in] The point to add :type n: int :param n: [in] Normal associated to the point
- getNormalIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- getVertexIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- removeVertexIdx(i)
Removes vertex from the polygon
- Parameters
i (int) – [in] Index of the point to remove
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedPolygonN_32(*args)
Bases:
IndexedPolygon_32
Polygon with N vertice indices and 0 normals
- __init__(*args)
- Overload 1:
Constructs IndexedPolygon with space for n vertices
- Overload 2:
Constructs IndexedPolygon with space for n vertices
Overload 3:
Constructs IndexedPolygonN with the vertices specified
- addVertex(p)
Adds a vertex to the polygon
The point will be added to the end of the list of points :type p: int :param p: [in] The point to add
- getVertexIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- removeVertexIdx(i)
Removes vertex from the polygon
- Parameters
i (int) – [in] Index of the point to remove
- size()
<T>::size
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedPolygonPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getVertexIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- size()
Number of vertices of this polygon :rtype: int :return: Number of vertices
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedPolygon_32(*args, **kwargs)
Bases:
object
indexed polygon class that saves N indices to the N vertices of the polygon
- __init__(*args, **kwargs)
- getVertexIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- size()
Number of vertices of this polygon :rtype: int :return: Number of vertices
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedPolygon_32CPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getVertexIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- size()
Number of vertices of this polygon :rtype: int :return: Number of vertices
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedPolygon_32Ptr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getVertexIdx(*args)
Overload 1:
returns the index of vertex i of the triangle
Overload 2:
returns the index of vertex i of the triangle
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- size()
Number of vertices of this polygon :rtype: int :return: Number of vertices
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedQuadraticFaceArray(*args)
Bases:
QuadraticShell
Proxy class for a QuadraticShell, that allows sorting of faces without modifying the original object.
- __init__(*args)
Overload 1:
Construct new indexed face array. :type quadric: rw::core::Ptr< rw::geometry::QuadraticShell const > :param quadric: [in] the underlying Shell.
Overload 2:
Construct new indexed face array. :type quadric: rw::core::Ptr< rw::geometry::QuadraticShell const > :param quadric: [in] the underlying Shell. :type faces: std::vector< rw::geometry::IndexedQuadraticFaceArray::IndexedFace > :param faces: [in] the faces to include in the proxy. :type first: int :param first: [in] skip the first faces. :type last: int :param last: [in] last index of faces to include.
- getFace(*args)
- Overload 1:
const
Overload 2: &) const
- getGlobalIndex(idx)
Get the original face index. :type idx: int :param idx: [in] the indexed face index. :rtype: int :return: the original index.
- getIndexedFace(*args)
Overload 1:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :rtype:
IndexedFace
:return: the indexed face.Overload 2:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :type dst:
IndexedFace
:param dst: [out] existing object to copy data into.
- getSubRange(first, last)
Take out a subrange of faces. :type first: int :param first: [in] first index. :type last: int :param last: [in] last index. :rtype:
IndexedQuadraticFaceArray
:return: a new indexed face array.
- isConvex()
test if this geometry data is convex :rtype: boolean :return: true if convex
- size()
Get the number of surface patches in this shell. :rtype: int :return: the number of surface patches.
- sortAxis(axis, t3d)
Sort the faces according to their extent in the direction along axis. :type axis: int :param axis: [in] axis to sort. :type t3d: rw::math::Transform3D< double > :param t3d: [in] transform giving the position and axis directions.
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedQuadraticFaceArrayCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- deref()
The pointer stored in the object.
- extremums(dir)
Get the minimum and maximum values of the shell in a certain direction. :type dir: rw::math::Vector3D< double > :param dir: [in] the direction to find extremums for. :rtype: std::pair< double,double > :return: the minimum and maximum as a pair of values.
- getDeref()
Member access operator.
- getFace(*args)
- Overload 1:
const
Overload 2: &) const
- getGlobalIndex(idx)
Get the original face index. :type idx: int :param idx: [in] the indexed face index. :rtype: int :return: the original index.
- getIndexedFace(*args)
Overload 1:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :rtype:
IndexedFace
:return: the indexed face.Overload 2:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :type dst:
IndexedFace
:param dst: [out] existing object to copy data into.
- getSubRange(first, last)
Take out a subrange of faces. :type first: int :param first: [in] first index. :type last: int :param last: [in] last index. :rtype:
IndexedQuadraticFaceArray
:return: a new indexed face array.
- getTriMesh(*args)
Overload 1:
Overload 2:
Overload 3:
- getType()
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obb()
Create Oriented Bounding Box (OBB) as a bounding volume for the shell. :rtype: rw::geometry::OBB< > :return: the OBB.
- size()
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedQuadraticFaceArrayPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- cptr()
- deref()
The pointer stored in the object.
- extremums(dir)
Get the minimum and maximum values of the shell in a certain direction. :type dir: rw::math::Vector3D< double > :param dir: [in] the direction to find extremums for. :rtype: std::pair< double,double > :return: the minimum and maximum as a pair of values.
- getDeref()
Member access operator.
- getFace(*args)
- Overload 1:
const
Overload 2: &) const
- getGlobalIndex(idx)
Get the original face index. :type idx: int :param idx: [in] the indexed face index. :rtype: int :return: the original index.
- getIndexedFace(*args)
Overload 1:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :rtype:
IndexedFace
:return: the indexed face.Overload 2:
Get the indexed face. :type idx: int :param idx: [in] index of indexed face. :type dst:
IndexedFace
:param dst: [out] existing object to copy data into.
- getSubRange(first, last)
Take out a subrange of faces. :type first: int :param first: [in] first index. :type last: int :param last: [in] last index. :rtype:
IndexedQuadraticFaceArray
:return: a new indexed face array.
- getTriMesh(*args)
Overload 1:
Overload 2:
Overload 3:
- getType()
- isConvex()
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- obb()
Create Oriented Bounding Box (OBB) as a bounding volume for the shell. :rtype: rw::geometry::OBB< > :return: the OBB.
- setMeshResolution(resolution)
Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.
The meaning of this parameter depends on the type of surface.
- Parameters
resolution (float) – [in] the resolution parameter.
- size()
- sortAxis(axis, t3d)
Sort the faces according to their extent in the direction along axis. :type axis: int :param axis: [in] axis to sort. :type t3d: rw::math::Transform3D< double > :param t3d: [in] transform giving the position and axis directions.
- property thisown
The membership flag
- toString(type)
format GeometryType to string :type type: int :param type:
- class sdurw_geometry.sdurw_geometry.IndexedTriArray(*args)
Bases:
TriMesh
this class is a proxy to a triangle mesh where the triangles can be indirectly copied in an efficient manner.
Each “virtual” triangle index is mapped to the actual triangle index. By rearanging the mapping the order of the triangles in the mesh are rearanged to the proxy user, without changing the actual triangle mesh.
- __init__(*args)
Overload 1:
constructor - creates a proxy that initially maps triangles from [0:0,1:1,2:2,….,i:i] :type objArr:
Ptr
:param objArr: [in] the triangle mesh on which to create a proxyOverload 2:
constructor - creates a proxy where the initial mapping is determined by idxArr.
idxArr must be same length as the number of triangles.
- Parameters
objArr (
Ptr
) – [in] the triangle mesh on which to create a proxyidxArr (rw::core::Ptr< std::vector< std::size_t > >) – [in] the index mapping
- clone()
make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh
- getGlobalIndex(idx)
- getIndexes()
get the index mapping
- getSize()
gets the number of triangles in the triangle array.
- getSubRange(first, last)
- getTriangle(*args)
Overload 1:
Overload 2:
- getType()
the type of this primitive
- scale(s)
Scale all vertices in the mesh.
- size()
gets the number of triangles in the triangle array.
- sortAxis(*args)
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedTriArrayCPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- clone()
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getGlobalIndex(idx)
- getIndexes()
get the index mapping
- getSize()
- getTriMesh(*args)
Overload 1:
Overload 2:
Overload 3:
- getTriangle(*args)
Overload 1:
Overload 2:
- getType()
- getVolume()
calculate a volume of this triangle mesh
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- size()
- property thisown
The membership flag
- class sdurw_geometry.sdurw_geometry.IndexedTriArrayPtr(*args)
Bases:
object
Ptr stores a pointer and optionally takes ownership of the value.
- __init__(*args)
Overload 1:
Default constructor yielding a NULL-pointer.
Overload 2:
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
- clone()
- cptr()
- deref()
The pointer stored in the object.
- getDeref()
Member access operator.
- getGlobalIndex(idx)
- getIndexes()
get the index mapping
- getSize()
- getSubRange(first, last)
- getTriMesh(*args)
Overload 1:
Overload 2:
Overload 3:
- getTriangle(*args)
Overload 1:
Overload 2:
- getType()
- getVolume()
calculate a volume of this triangle mesh
- isConvex()
- isNull()
checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null
check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.
- scale(s)
- setConvexEnabled(isConvex)
- size()
- sortAxis(*args)
- property thisown
The membership flag
- toString(type)
format GeometryType to string :type type: int :param type:
- class sdurw_geometry.sdurw_geometry.IndexedTriMesh(*args, **kwargs)
Bases:
TriMesh
Interface for indexed triangle meshes.
An indexed triangle mesh has a list of vertices and a list of indicies. The indicies is used as reference into the vertex list. Indicies are grouped into threes such that one triangle is defined by three following indicies.
In the IndexedTriMesh classes the indice list is hidden under a list of IndexedTriangle.
- __init__(*args, **kwargs)
- getIndexPtr()
Pointer to the start of the index array. :rtype: uint8_t :return: pointer to byte array.
- getIndexSize()
The size of the index type used. :rtype: uint8_t :return: Typically 2 (uint16_t) or 4 (uint32_t).
- getIndexedTriangle(i)
get the indexed triangle at index i :type i: int :param i: [in] the index of the triangle :rtype: rw::geometry::IndexedTriangle< uint32_t > :return: an indexed triangle Warning: Using the virtual function comes with a performance penalty. If possible, use functions implemented on subtypes directly.