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

Curve

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

Surface

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

Curve

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

Surface

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

isShared()

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

Curve

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

Surface

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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.

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

isShared()

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

isShared()

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

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.

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

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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 mesh


Overload 5:

Constructor. :type initQ: Q :param initQ: [in] vector with (height, radius) :param levels: [in] granularity of the mesh


Overload 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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

Curve

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.

surface()

Get the surface of the face. :rtype: Surface :return: a reference to the surface data.

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

Curve

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

isShared()

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: Surface :return: a reference to the surface data.

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

Curve

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

isShared()

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.

surface()

Get the surface of the face. :rtype: Surface :return: a reference to the surface data.

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

Curve

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.

surface()

Get the surface of the face. :rtype: Surface :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.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

isShared()

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

isShared()

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 factor


Overload 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 factor


Overload 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 factor


Overload 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 stored


Overload 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 stored


Overload 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

isShared()

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

isShared()

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

isShared()

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 stored


Overload 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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

Curve

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

Surface

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

isShared()

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

isShared()

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

Curve

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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 considered

identical.

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

isShared()

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

isShared()

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 considered

identical.

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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

isShared()

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 proxy


Overload 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 proxy

  • idxArr (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

isShared()

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

isShared()

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.

getIndices()

Get pointer to first element of index array. :rtype: void :return: pointer to first element.

getNormals(*args)

Overload 1:

Get vector of normals. :rtype: std::vector< rw::math::Vector3D< double > > :return: reference to vector.


Overload 2:

const

getNrTris()

The number of triangles in the mesh :rtype: int :return: nr of triangles

getTriangleStride()

The stride of a triangle. :rtype: uint8_t :return: the stride.

getType()

the type of this primitive

getVertex(*args)

Overload 1:

Get vertex from vertex list. :type i: int :param i: [in] the vertex id (NOT the triangle id). :rtype: rw::math::Vector3D< double > :return: a reference to the vertex.


Overload 2:

Get vertex from vertex list. :type i: int :param i: [in] the vertex id (NOT the triangle id). :rtype: rw::math::Vector3D< double > :return: a reference to the vertex.


Overload 3:

get vertex vidx of triangle at index i. :type i: int :param i: [in] the index of the triangle :type vidx: int :param vidx: [in] the index of the triangle vertex :rtype: rw::math::Vector3D< double > :return: reference to vertex. Warning: Using the virtual function comes with a performance penalty. If possible, use functions implemented on subtypes directly (like IndexedTriMeshN0::getTriVertex).


Overload 4:

const

getVertexNormal(*args)

Overload 1:

Get normal of vertex vidx of triangle at index i. :type i: int :param i: [in] the index of the triangle. :type vidx: int :param vidx: [in] the triangle vertex. :rtype: rw::math::Vector3D< double > :return: reference to normal vector. Warning: Using the virtual function comes with a performance penalty. If possible, use functions implemented on subtypes directly.


Overload 2:

, VertexIdx) const

getVertices(*args)

Overload 1:

Get vector of vertices. :rtype: std::vector< rw::math::Vector3D< double > > :return: reference to vector.


Overload 2:

const

hasFaceNormals()

Check if trimesh has face normals defined. :rtype: boolean :return: true if face normals are defined.

hasVertexNormals()

Check if trimesh has vertex normals defined. :rtype: boolean :return: true if vertex normals are defined.

scale(scale)

Scale all vertices in the mesh.

size()

gets the number of triangles in the triangle array.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.IndexedTriMeshN0(*args)

Bases: IndexedTriMesh

an Indexed Triangle mesh with zero normals

__init__(*args)
Overload 1:

Constructor


Overload 2:

constructor - ownership of the vertice array is taken :type vertices: rw::geometry::IndexedTriMeshN0< double,unsigned short >::VertexArray :param vertices: [in] pointer to vector of vertices.


Overload 3:

constructor - ownership of the vertice array is taken :type vertices: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< double,unsigned short >::VertexArray > :param vertices: [in] pointer to vector of vertices. :type normals: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< double,unsigned short >::VertexArray > :param normals: [in] pointer to vector of normals.


Overload 4:

constructor :type vertices: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< double,unsigned short >::VertexArray > :param vertices: [in] pointer to vector of vertices. :type normals: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< double,unsigned short >::VertexArray > :param normals: [in] pointer to vector of normals (expects same length as either

vertices or triangles).

Parameters

triangles (rw::core::Ptr< rw::geometry::IndexedTriMeshN0< double,unsigned short >::TriangleArray >) – [in] pointer to array of triangles.


Overload 5:

constructor :type vertices: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< double,unsigned short >::VertexArray > :param vertices: [in] pointer to vector of vertices. :type triangles: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< double,unsigned short >::TriangleArray > :param triangles: [in] pointer to array of triangles.


Overload 6:

Make deep copy of mesh. :type mesh: rw::geometry::IndexedTriMeshN0< double,unsigned short > :param mesh: [in] the mesh to copy.

add(triangle)

Add indexed triangle to the triangle mesh. :type triangle: rw::geometry::IndexedTriMeshN0< double,unsigned short >::tri_type :param triangle: [in] the indexed triangle to add.

calcFaceArea(triIdx)

calculate area of triangle at index triIdx :rtype: float :return: the area.

calcFaceCentroid(triIdx)

calculate centroid of triangle at index triIdx :rtype: rw::math::Vector3D< double > :return: the centroid.

calcFaceNormal(triIdx)

calculate face normal of triangle at index triIdx :rtype: rw::math::Vector3D< double > :return: the face normal.

clone()

make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

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.

getNrTris()

The number of triangles in the mesh :rtype: int :return: nr of triangles

getSize()

gets the number of triangles in the triangle array.

getTriVertex(*args)

Overload 1:

get vertex i of triangle at index triIdx. :type i: int :param i: [in] should be in interval [0;2] :type triIdx: int :param triIdx: [in] index of triangle in the triangle mesh :rtype: rw::math::Vector3D< double > :return: a reference to the given vertex.


Overload 2:

get vertex i of triangle at index triIdx. :type i: int :param i: [in] should be in interval [0;2] :type triIdx: int :param triIdx: [in] index of triangle in the triangle mesh :rtype: rw::math::Vector3D< double > :return: a reference to the given vertex.

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles(*args)

Overload 1:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< double,unsigned short >::TriangleArray :return: vector of triangles


Overload 2:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< double,unsigned short >::TriangleArray :return: vector of triangles

getVertex(*args)

Overload 1:


Overload 2:

getVertexNormal(*args)

Overload 1:


Overload 2:

resize(nsize)

Set the number of triangles in the mesh. :type nsize: int :param nsize: [in] the new size of the mesh.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.IndexedTriMeshN0CPtr(*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.

calcFaceNormal(triIdx)

calculate face normal of triangle at index triIdx :rtype: rw::math::Vector3D< double > :return: the face normal.

clone()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getIndexSize()

The size of the index type used. :rtype: uint8_t :return: Typically 2 (uint16_t) or 4 (uint32_t).

getIndexedTriangle(i)
getNrTris()
getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangleStride()

The stride of a triangle. :rtype: uint8_t :return: the stride.

getTriangles(*args)

Overload 1:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< double,unsigned short >::TriangleArray :return: vector of triangles


Overload 2:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< double,unsigned short >::TriangleArray :return: vector of triangles

getType()
getVolume()

calculate a volume of this triangle mesh

hasFaceNormals()

Check if trimesh has face normals defined. :rtype: boolean :return: true if face normals are defined.

hasVertexNormals()

Check if trimesh has vertex normals defined. :rtype: boolean :return: true if vertex normals are defined.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.IndexedTriMeshN0Ptr(*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.

add(triangle)

Add indexed triangle to the triangle mesh. :type triangle: rw::geometry::IndexedTriMeshN0< double,unsigned short >::tri_type :param triangle: [in] the indexed triangle to add.

calcFaceArea(triIdx)

calculate area of triangle at index triIdx :rtype: float :return: the area.

calcFaceCentroid(triIdx)

calculate centroid of triangle at index triIdx :rtype: rw::math::Vector3D< double > :return: the centroid.

calcFaceNormal(triIdx)

calculate face normal of triangle at index triIdx :rtype: rw::math::Vector3D< double > :return: the face normal.

clone()
cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

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)
getIndices()

Get pointer to first element of index array. :rtype: void :return: pointer to first element.

getNormals(*args)

Overload 1:

Get vector of normals. :rtype: std::vector< rw::math::Vector3D< double > > :return: reference to vector.


Overload 2:

const

getNrTris()
getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriVertex(*args)

Overload 1:

get vertex i of triangle at index triIdx. :type i: int :param i: [in] should be in interval [0;2] :type triIdx: int :param triIdx: [in] index of triangle in the triangle mesh :rtype: rw::math::Vector3D< double > :return: a reference to the given vertex.


Overload 2:

get vertex i of triangle at index triIdx. :type i: int :param i: [in] should be in interval [0;2] :type triIdx: int :param triIdx: [in] index of triangle in the triangle mesh :rtype: rw::math::Vector3D< double > :return: a reference to the given vertex.

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangleStride()

The stride of a triangle. :rtype: uint8_t :return: the stride.

getTriangles(*args)

Overload 1:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< double,unsigned short >::TriangleArray :return: vector of triangles


Overload 2:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< double,unsigned short >::TriangleArray :return: vector of triangles

getType()
getVertex(*args)

Overload 1:


Overload 2:

getVertexNormal(*args)

Overload 1:


Overload 2:

getVertices(*args)

Overload 1:

Get vector of vertices. :rtype: std::vector< rw::math::Vector3D< double > > :return: reference to vector.


Overload 2:

const

getVolume()

calculate a volume of this triangle mesh

hasFaceNormals()

Check if trimesh has face normals defined. :rtype: boolean :return: true if face normals are defined.

hasVertexNormals()

Check if trimesh has vertex normals defined. :rtype: boolean :return: true if vertex normals are defined.

isConvex()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

resize(nsize)

Set the number of triangles in the mesh. :type nsize: int :param nsize: [in] the new size of the mesh.

scale(scale)
setConvexEnabled(isConvex)
size()
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.IndexedTriMeshN0_f(*args)

Bases: IndexedTriMesh_f

an Indexed Triangle mesh with zero normals

__init__(*args)
Overload 1:

Constructor


Overload 2:

constructor - ownership of the vertice array is taken :type vertices: rw::geometry::IndexedTriMeshN0< float,unsigned short >::VertexArray :param vertices: [in] pointer to vector of vertices.


Overload 3:

constructor - ownership of the vertice array is taken :type vertices: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< float,unsigned short >::VertexArray > :param vertices: [in] pointer to vector of vertices. :type normals: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< float,unsigned short >::VertexArray > :param normals: [in] pointer to vector of normals.


Overload 4:

constructor :type vertices: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< float,unsigned short >::VertexArray > :param vertices: [in] pointer to vector of vertices. :type normals: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< float,unsigned short >::VertexArray > :param normals: [in] pointer to vector of normals (expects same length as either

vertices or triangles).

Parameters

triangles (rw::core::Ptr< rw::geometry::IndexedTriMeshN0< float,unsigned short >::TriangleArray >) – [in] pointer to array of triangles.


Overload 5:

constructor :type vertices: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< float,unsigned short >::VertexArray > :param vertices: [in] pointer to vector of vertices. :type triangles: rw::core::Ptr< rw::geometry::IndexedTriMeshN0< float,unsigned short >::TriangleArray > :param triangles: [in] pointer to array of triangles.


Overload 6:

Make deep copy of mesh. :type mesh: rw::geometry::IndexedTriMeshN0< float,unsigned short > :param mesh: [in] the mesh to copy.

add(triangle)

Add indexed triangle to the triangle mesh. :type triangle: rw::geometry::IndexedTriMeshN0< float,unsigned short >::tri_type :param triangle: [in] the indexed triangle to add.

calcFaceArea(triIdx)

calculate area of triangle at index triIdx :rtype: float :return: the area.

calcFaceCentroid(triIdx)

calculate centroid of triangle at index triIdx :rtype: rw::math::Vector3D< float > :return: the centroid.

calcFaceNormal(triIdx)

calculate face normal of triangle at index triIdx :rtype: rw::math::Vector3D< float > :return: the face normal.

clone()

make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

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.

getNrTris()

The number of triangles in the mesh :rtype: int :return: nr of triangles

getSize()

gets the number of triangles in the triangle array.

getTriVertex(*args)

Overload 1:

get vertex i of triangle at index triIdx. :type i: int :param i: [in] should be in interval [0;2] :type triIdx: int :param triIdx: [in] index of triangle in the triangle mesh :rtype: rw::math::Vector3D< float > :return: a reference to the given vertex.


Overload 2:

get vertex i of triangle at index triIdx. :type i: int :param i: [in] should be in interval [0;2] :type triIdx: int :param triIdx: [in] index of triangle in the triangle mesh :rtype: rw::math::Vector3D< float > :return: a reference to the given vertex.

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles(*args)

Overload 1:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< float,unsigned short >::TriangleArray :return: vector of triangles


Overload 2:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< float,unsigned short >::TriangleArray :return: vector of triangles

getVertex(*args)

Overload 1:


Overload 2:

getVertexNormal(*args)

Overload 1:


Overload 2:

resize(nsize)

Set the number of triangles in the mesh. :type nsize: int :param nsize: [in] the new size of the mesh.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.IndexedTriMeshN0_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.

calcFaceNormal(triIdx)

calculate face normal of triangle at index triIdx :rtype: rw::math::Vector3D< float > :return: the face normal.

clone()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getIndexSize()

The size of the index type used. :rtype: uint8_t :return: Typically 2 (uint16_t) or 4 (uint32_t).

getIndexedTriangle(i)
getNrTris()
getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangleStride()

The stride of a triangle. :rtype: uint8_t :return: the stride.

getTriangles(*args)

Overload 1:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< float,unsigned short >::TriangleArray :return: vector of triangles


Overload 2:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< float,unsigned short >::TriangleArray :return: vector of triangles

getType()
getVolume()

calculate a volume of this triangle mesh

hasFaceNormals()

Check if trimesh has face normals defined. :rtype: boolean :return: true if face normals are defined.

hasVertexNormals()

Check if trimesh has vertex normals defined. :rtype: boolean :return: true if vertex normals are defined.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

add(triangle)

Add indexed triangle to the triangle mesh. :type triangle: rw::geometry::IndexedTriMeshN0< float,unsigned short >::tri_type :param triangle: [in] the indexed triangle to add.

calcFaceArea(triIdx)

calculate area of triangle at index triIdx :rtype: float :return: the area.

calcFaceCentroid(triIdx)

calculate centroid of triangle at index triIdx :rtype: rw::math::Vector3D< float > :return: the centroid.

calcFaceNormal(triIdx)

calculate face normal of triangle at index triIdx :rtype: rw::math::Vector3D< float > :return: the face normal.

clone()
cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

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)
getIndices()

Get pointer to first element of index array. :rtype: void :return: pointer to first element.

getNormals(*args)

Overload 1:

Get vector of normals. :rtype: std::vector< rw::math::Vector3D< float > > :return: reference to vector.


Overload 2:

const

getNrTris()
getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriVertex(*args)

Overload 1:

get vertex i of triangle at index triIdx. :type i: int :param i: [in] should be in interval [0;2] :type triIdx: int :param triIdx: [in] index of triangle in the triangle mesh :rtype: rw::math::Vector3D< float > :return: a reference to the given vertex.


Overload 2:

get vertex i of triangle at index triIdx. :type i: int :param i: [in] should be in interval [0;2] :type triIdx: int :param triIdx: [in] index of triangle in the triangle mesh :rtype: rw::math::Vector3D< float > :return: a reference to the given vertex.

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangleStride()

The stride of a triangle. :rtype: uint8_t :return: the stride.

getTriangles(*args)

Overload 1:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< float,unsigned short >::TriangleArray :return: vector of triangles


Overload 2:

get triangle list :rtype: rw::geometry::IndexedTriMeshN0< float,unsigned short >::TriangleArray :return: vector of triangles

getType()
getVertex(*args)

Overload 1:


Overload 2:

getVertexNormal(*args)

Overload 1:


Overload 2:

getVertices(*args)

Overload 1:

Get vector of vertices. :rtype: std::vector< rw::math::Vector3D< float > > :return: reference to vector.


Overload 2:

const

getVolume()

calculate a volume of this triangle mesh

hasFaceNormals()

Check if trimesh has face normals defined. :rtype: boolean :return: true if face normals are defined.

hasVertexNormals()

Check if trimesh has vertex normals defined. :rtype: boolean :return: true if vertex normals are defined.

isConvex()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

resize(nsize)

Set the number of triangles in the mesh. :type nsize: int :param nsize: [in] the new size of the mesh.

scale(scale)
setConvexEnabled(isConvex)
size()
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.IndexedTriMeshPtr(*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 clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

deref()

The pointer stored in the object.

getDeref()

Member access operator.

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.

getIndices()

Get pointer to first element of index array. :rtype: void :return: pointer to first element.

getNormals(*args)

Overload 1:

Get vector of normals. :rtype: std::vector< rw::math::Vector3D< double > > :return: reference to vector.


Overload 2:

const

getNrTris()

The number of triangles in the mesh :rtype: int :return: nr of triangles

getSize()

gets the number of triangles in the triangle array.

getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :rtype: rw::geometry::Triangle< double > :return: the triangle at index idx


Overload 2:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< double > :param dst: [out] where to store the triangle at index idx


Overload 3:

gets the triangle at index idx. Using Floating point presicion :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< float > :param dst: [out] where to store the triangle at index idx

getTriangleStride()

The stride of a triangle. :rtype: uint8_t :return: the stride.

getType()
getVertex(*args)

Overload 1:

Get vertex from vertex list. :type i: int :param i: [in] the vertex id (NOT the triangle id). :rtype: rw::math::Vector3D< double > :return: a reference to the vertex.


Overload 2:

Get vertex from vertex list. :type i: int :param i: [in] the vertex id (NOT the triangle id). :rtype: rw::math::Vector3D< double > :return: a reference to the vertex.


Overload 3:

get vertex vidx of triangle at index i. :type i: int :param i: [in] the index of the triangle :type vidx: int :param vidx: [in] the index of the triangle vertex :rtype: rw::math::Vector3D< double > :return: reference to vertex. Warning: Using the virtual function comes with a performance penalty. If possible, use functions implemented on subtypes directly (like IndexedTriMeshN0::getTriVertex).


Overload 4:

const

getVertexNormal(*args)

Overload 1:

Get normal of vertex vidx of triangle at index i. :type i: int :param i: [in] the index of the triangle. :type vidx: int :param vidx: [in] the triangle vertex. :rtype: rw::math::Vector3D< double > :return: reference to normal vector. Warning: Using the virtual function comes with a performance penalty. If possible, use functions implemented on subtypes directly.


Overload 2:

, VertexIdx) const

getVertices(*args)

Overload 1:

Get vector of vertices. :rtype: std::vector< rw::math::Vector3D< double > > :return: reference to vector.


Overload 2:

const

getVolume()

calculate a volume of this triangle mesh

hasFaceNormals()

Check if trimesh has face normals defined. :rtype: boolean :return: true if face normals are defined.

hasVertexNormals()

Check if trimesh has vertex normals defined. :rtype: boolean :return: true if vertex normals are defined.

isConvex()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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(scale)
setConvexEnabled(isConvex)
size()
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.IndexedTriMesh_f(*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.

getIndices()

Get pointer to first element of index array. :rtype: void :return: pointer to first element.

getNormals(*args)

Overload 1:

Get vector of normals. :rtype: std::vector< rw::math::Vector3D< float > > :return: reference to vector.


Overload 2:

const

getNrTris()

The number of triangles in the mesh :rtype: int :return: nr of triangles

getTriangleStride()

The stride of a triangle. :rtype: uint8_t :return: the stride.

getType()

the type of this primitive

getVertex(*args)

Overload 1:

Get vertex from vertex list. :type i: int :param i: [in] the vertex id (NOT the triangle id). :rtype: rw::math::Vector3D< float > :return: a reference to the vertex.


Overload 2:

Get vertex from vertex list. :type i: int :param i: [in] the vertex id (NOT the triangle id). :rtype: rw::math::Vector3D< float > :return: a reference to the vertex.


Overload 3:

get vertex vidx of triangle at index i. :type i: int :param i: [in] the index of the triangle :type vidx: int :param vidx: [in] the index of the triangle vertex :rtype: rw::math::Vector3D< float > :return: reference to vertex. Warning: Using the virtual function comes with a performance penalty. If possible, use functions implemented on subtypes directly (like IndexedTriMeshN0::getTriVertex).


Overload 4:

const

getVertexNormal(*args)

Overload 1:

Get normal of vertex vidx of triangle at index i. :type i: int :param i: [in] the index of the triangle. :type vidx: int :param vidx: [in] the triangle vertex. :rtype: rw::math::Vector3D< float > :return: reference to normal vector. Warning: Using the virtual function comes with a performance penalty. If possible, use functions implemented on subtypes directly.


Overload 2:

, VertexIdx) const

getVertices(*args)

Overload 1:

Get vector of vertices. :rtype: std::vector< rw::math::Vector3D< float > > :return: reference to vector.


Overload 2:

const

hasFaceNormals()

Check if trimesh has face normals defined. :rtype: boolean :return: true if face normals are defined.

hasVertexNormals()

Check if trimesh has vertex normals defined. :rtype: boolean :return: true if vertex normals are defined.

scale(scale)

Scale all vertices in the mesh.

size()

gets the number of triangles in the triangle array.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.IndexedTriMesh_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.

clone()

make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

deref()

The pointer stored in the object.

getDeref()

Member access operator.

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.

getIndices()

Get pointer to first element of index array. :rtype: void :return: pointer to first element.

getNormals(*args)

Overload 1:

Get vector of normals. :rtype: std::vector< rw::math::Vector3D< float > > :return: reference to vector.


Overload 2:

const

getNrTris()

The number of triangles in the mesh :rtype: int :return: nr of triangles

getSize()

gets the number of triangles in the triangle array.

getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :rtype: rw::geometry::Triangle< double > :return: the triangle at index idx


Overload 2:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< double > :param dst: [out] where to store the triangle at index idx


Overload 3:

gets the triangle at index idx. Using Floating point presicion :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< float > :param dst: [out] where to store the triangle at index idx

getTriangleStride()

The stride of a triangle. :rtype: uint8_t :return: the stride.

getType()
getVertex(*args)

Overload 1:

Get vertex from vertex list. :type i: int :param i: [in] the vertex id (NOT the triangle id). :rtype: rw::math::Vector3D< float > :return: a reference to the vertex.


Overload 2:

Get vertex from vertex list. :type i: int :param i: [in] the vertex id (NOT the triangle id). :rtype: rw::math::Vector3D< float > :return: a reference to the vertex.


Overload 3:

get vertex vidx of triangle at index i. :type i: int :param i: [in] the index of the triangle :type vidx: int :param vidx: [in] the index of the triangle vertex :rtype: rw::math::Vector3D< float > :return: reference to vertex. Warning: Using the virtual function comes with a performance penalty. If possible, use functions implemented on subtypes directly (like IndexedTriMeshN0::getTriVertex).


Overload 4:

const

getVertexNormal(*args)

Overload 1:

Get normal of vertex vidx of triangle at index i. :type i: int :param i: [in] the index of the triangle. :type vidx: int :param vidx: [in] the triangle vertex. :rtype: rw::math::Vector3D< float > :return: reference to normal vector. Warning: Using the virtual function comes with a performance penalty. If possible, use functions implemented on subtypes directly.


Overload 2:

, VertexIdx) const

getVertices(*args)

Overload 1:

Get vector of vertices. :rtype: std::vector< rw::math::Vector3D< float > > :return: reference to vector.


Overload 2:

const

getVolume()

calculate a volume of this triangle mesh

hasFaceNormals()

Check if trimesh has face normals defined. :rtype: boolean :return: true if face normals are defined.

hasVertexNormals()

Check if trimesh has vertex normals defined. :rtype: boolean :return: true if vertex normals are defined.

isConvex()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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(scale)
setConvexEnabled(isConvex)
size()
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.IndexedTriangle(*args)

Bases: object

indexed triangle class that has 3 indices that points to 3 vertices in an array typically used with the IndexedTriMesh class. the indice type (size) is templated.

__init__(*args)
Overload 1:

default constructor


Overload 2:

constructor :type p1: int :param p1: [in] indice to vertice 1 :type p2: int :param p2: [in] indice to vertice 2 :type p3: int :param p3: [in] indice to vertice 3


Overload 3:

copy constructor

Parameters

f (rw::geometry::IndexedTriangle< uint16_t >) – [in] - The face that is to be copied.

getVertexIdx(*args)

Overload 1:

returns the index of vertex i of the triangle


Overload 2:

returns the index of vertex i of the triangle

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.IndexedTriangleCPtr(*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

isShared()

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.IndexedTriangleN1(*args)

Bases: object

indexed triangle class with an additional index for an face normal

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor :type p1: int :param p1: [in] vertice index 1 :type p2: int :param p2: [in] vertice index 2 :type p3: int :param p3: [in] vertice index 3 :type n: int :param n: [in] normal index


Overload 3:

copy constructor

Parameters

f (rw::geometry::IndexedTriangleN1< uint16_t >) – [in] - The face that is to be copied.

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

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.IndexedTriangleN1CPtr(*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.

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

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.IndexedTriangleN1Ptr(*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.

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

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.IndexedTriangleN1_32(*args)

Bases: object

indexed triangle class with an additional index for an face normal

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor :type p1: int :param p1: [in] vertice index 1 :type p2: int :param p2: [in] vertice index 2 :type p3: int :param p3: [in] vertice index 3 :type n: int :param n: [in] normal index


Overload 3:

copy constructor

Parameters

f (rw::geometry::IndexedTriangleN1< uint32_t >) – [in] - The face that is to be copied.

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

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.IndexedTriangleN1_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.

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

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

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

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.IndexedTriangleN3(*args)

Bases: object

indexed triangle class with an additional index for 3 normals one for each vertice in the triangle

__init__(*args)

Overload 1:

constructor :type p1: int :param p1: [in] vertice index 1 :type p2: int :param p2: [in] vertice index 2 :type p3: int :param p3: [in] vertice index 3 :type n1: int :param n1: [in] normal index for vertice 1 :type n2: int :param n2: [in] normal index for vertice 2 :type n3: int :param n3: [in] normal index for vertice 3


Overload 2:

copy constructor

Parameters

f (rw::geometry::IndexedTriangleN3< uint16_t >) – [in] - The face that is to be copied.

getNormalIdx(*args)

Overload 1:

get the index of vertice normal i. :type i: int :param i: [in] vertice normal :rtype: int :return: normal index


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

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.IndexedTriangleN3CPtr(*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.

getNormalIdx(*args)

Overload 1:

get the index of vertice normal i. :type i: int :param i: [in] vertice normal :rtype: int :return: normal index


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

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.IndexedTriangleN3Ptr(*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.

getNormalIdx(*args)

Overload 1:

get the index of vertice normal i. :type i: int :param i: [in] vertice normal :rtype: int :return: normal index


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

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.IndexedTriangleN3_32(*args)

Bases: object

indexed triangle class with an additional index for 3 normals one for each vertice in the triangle

__init__(*args)

Overload 1:

constructor :type p1: int :param p1: [in] vertice index 1 :type p2: int :param p2: [in] vertice index 2 :type p3: int :param p3: [in] vertice index 3 :type n1: int :param n1: [in] normal index for vertice 1 :type n2: int :param n2: [in] normal index for vertice 2 :type n3: int :param n3: [in] normal index for vertice 3


Overload 2:

copy constructor

Parameters

f (rw::geometry::IndexedTriangleN3< uint32_t >) – [in] - The face that is to be copied.

getNormalIdx(*args)

Overload 1:

get the index of vertice normal i. :type i: int :param i: [in] vertice normal :rtype: int :return: normal index


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

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.IndexedTriangleN3_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.

getNormalIdx(*args)

Overload 1:

get the index of vertice normal i. :type i: int :param i: [in] vertice normal :rtype: int :return: normal index


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

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

getNormalIdx(*args)

Overload 1:

get the index of vertice normal i. :type i: int :param i: [in] vertice normal :rtype: int :return: normal index


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

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.IndexedTrianglePtr(*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

isShared()

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.IndexedTriangle_32(*args)

Bases: object

indexed triangle class that has 3 indices that points to 3 vertices in an array typically used with the IndexedTriMesh class. the indice type (size) is templated.

__init__(*args)
Overload 1:

default constructor


Overload 2:

constructor :type p1: int :param p1: [in] indice to vertice 1 :type p2: int :param p2: [in] indice to vertice 2 :type p3: int :param p3: [in] indice to vertice 3


Overload 3:

copy constructor

Parameters

f (rw::geometry::IndexedTriangle< uint32_t >) – [in] - The face that is to be copied.

getVertexIdx(*args)

Overload 1:

returns the index of vertex i of the triangle


Overload 2:

returns the index of vertex i of the triangle

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.IndexedTriangle_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

isShared()

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

isShared()

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.Line(*args)

Bases: Primitive

A line in 3D, described by a two points.

__init__(*args)

Overload 1:

Constructor.

Default constructor returns line segment from {0, 0, 0} to {0, 0, 1}.


Overload 2:

Constructor. :type params: Q :param params: [in] must be 6 long and contain 2 points lying on the line


Overload 3:

Constructor.

Parameters
  • p1 (rw::math::Vector3D< double >) – [in] point 1.

  • p2 (rw::math::Vector3D< double >) – [in] point 2.

closestPoint(point)

Finds a point on the line closest to specified point.

For the purposes of this calculation, the line is treated as infinitely extending geometric entity, without begining nor end.

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]

dir()

Get a direction vector u = normalize(p2 - p1).

distance(*args)

Overload 1:

Calculates the shortest distance from a point to the line.

For the purposes of this calculation, the line is treated as infinitely extending geometric entity, without begining nor end.


Overload 2:

Calculates the shortest distance to another line.

For the purposes of this calculation, the lines are treated as infinitely extending geometric entity, without begining nor end.

getParameters()

get the parameters that define this primitive

getType()

the type of this primitive

static makeGrid(*args)

Create set of lines making a grid.

static makeMetric(angToDistWeight=1.0)

create a metric that can be used to compare the difference between two lines. The distance between two lines is computed as follows:

val = 0.5*angle(l1.dir, l2.dir)*angToDistWeight + 0.5*l1.distance(l2) :rtype: rw::math::Metric< rw::geometry::Line >::Ptr :return: distance metric

p1(*args)

Overload 1: Get point 1.


Overload 2: Get point 1.

p2(*args)

Overload 1: Get point 2.


Overload 2: Get point 2.

refit(*args)

Overload 1:

Fit this line to a set of points

Uses centroid calculation and SVD analysis to determine the parameters of the line. p1 is the point on the line closest to origin {0, 0, 0}, and p2 is chosen so as (p2 - p1) is an unit vector. Error is the sum of point distances to the line squared.

Parameters

data (std::vector< rw::math::Vector3D< double > >) – [in] a set of points

Return type

float

Returns

sum of the squares of point distances to the line


Overload 2:

std::vector<rw::math::Vector3D<double> >&)

This version of refit makes it possible to fit only a subset of the points in a vector.

Parameters
  • begin (std::vector< rw::math::Vector3D< double > >::const_iterator) – [in] iterator to first element.

  • end (std::vector< rw::math::Vector3D< double > >::const_iterator) – [in] iterator to last element.

Return type

float

Returns

sum of the squares of point distances to the line.

See also: refit(const std::vector<rw::math::Vector3D<double> >&)

setParameters(q)

set the parameters that define this primitive

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.LineCPtr(*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.

closestPoint(point)

Finds a point on the line closest to specified point.

For the purposes of this calculation, the line is treated as infinitely extending geometric entity, without begining nor end.

createMesh(resolution)
deref()

The pointer stored in the object.

dir()

Get a direction vector u = normalize(p2 - p1).

distance(*args)

Overload 1:

Calculates the shortest distance from a point to the line.

For the purposes of this calculation, the line is treated as infinitely extending geometric entity, without begining nor end.


Overload 2:

Calculates the shortest distance to another line.

For the purposes of this calculation, the lines are treated as infinitely extending geometric entity, without begining nor end.

getDeref()

Member access operator.

getParameters()
getType()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

p1(*args)

Overload 1: Get point 1.


Overload 2: Get point 1.

p2(*args)

Overload 1: Get point 2.


Overload 2: Get point 2.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.LineMetric(angToDistWeight=1.0)

Bases: MetricLine

A metric for calculating line-to-line distance.

__init__(angToDistWeight=1.0)

Construct new metric. :type angToDistWeight: float, optional :param angToDistWeight: [in] (optional) weighting of the angle to distance. Default is 1.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.LinePtr(*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.

closestPoint(point)

Finds a point on the line closest to specified point.

For the purposes of this calculation, the line is treated as infinitely extending geometric entity, without begining nor end.

cptr()
createMesh(resolution)
deref()

The pointer stored in the object.

dir()

Get a direction vector u = normalize(p2 - p1).

distance(*args)

Overload 1:

Calculates the shortest distance from a point to the line.

For the purposes of this calculation, the line is treated as infinitely extending geometric entity, without begining nor end.


Overload 2:

Calculates the shortest distance to another line.

For the purposes of this calculation, the lines are treated as infinitely extending geometric entity, without begining nor end.

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

isShared()

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.

makeGrid(*args)

Create set of lines making a grid.

makeMetric(angToDistWeight=1.0)

create a metric that can be used to compare the difference between two lines. The distance between two lines is computed as follows:

val = 0.5*angle(l1.dir, l2.dir)*angToDistWeight + 0.5*l1.distance(l2) :rtype: rw::math::Metric< rw::geometry::Line >::Ptr :return: distance metric

p1(*args)

Overload 1: Get point 1.


Overload 2: Get point 1.

p2(*args)

Overload 1: Get point 2.


Overload 2: Get point 2.

refit(*args)

Overload 1:

Fit this line to a set of points

Uses centroid calculation and SVD analysis to determine the parameters of the line. p1 is the point on the line closest to origin {0, 0, 0}, and p2 is chosen so as (p2 - p1) is an unit vector. Error is the sum of point distances to the line squared.

Parameters

data (std::vector< rw::math::Vector3D< double > >) – [in] a set of points

Return type

float

Returns

sum of the squares of point distances to the line


Overload 2:

std::vector<rw::math::Vector3D<double> >&)

This version of refit makes it possible to fit only a subset of the points in a vector.

Parameters
  • begin (std::vector< rw::math::Vector3D< double > >::const_iterator) – [in] iterator to first element.

  • end (std::vector< rw::math::Vector3D< double > >::const_iterator) – [in] iterator to last element.

Return type

float

Returns

sum of the squares of point distances to the line.

See also: refit(const std::vector<rw::math::Vector3D<double> >&)

setParameters(q)
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

sdurw_geometry.sdurw_geometry.Line_makeGrid(*args)

Create set of lines making a grid.

sdurw_geometry.sdurw_geometry.Line_makeMetric(angToDistWeight=1.0)

create a metric that can be used to compare the difference between two lines. The distance between two lines is computed as follows:

val = 0.5*angle(l1.dir, l2.dir)*angToDistWeight + 0.5*l1.distance(l2) :rtype: rw::math::Metric< rw::geometry::Line >::Ptr :return: distance metric

class sdurw_geometry.sdurw_geometry.Material(*args)

Bases: object

describes material properties. A material can be either simple or “advanced” and in both cases it can be textured. A simple material is described by a 4-tuple of RGBA values. The advanced material defines multiple properties: diffuse, ambient, emissive, specular, shininess and transparency

__init__(*args)

Overload 1: default constructor


Overload 2: constructor for simple material


Overload 3: constructor for simple material

property ambient

Ambient color as RGBA

property emissive

Emissive color as RGBA

getTextureID()

Get id of the texture for this material. :rtype: int :return: the texture id.

hasTexture()

Check if material has texture. :rtype: boolean :return: true if material has texture.

property name

material name, not necesarily unique

property rgb

Red, Green, Blue and alpha color (simple) or diffues color(advanced)

property shininess

The shininess \(\in [0,128]\)

property simplergb

true if this material is a simple material

property specular

Specular color as RGB

property texId

index to a texture which is stored in Model3D, -1 if not used

property thisown

The membership flag

property transparency

Transparency \(in [0, 1]\)

class sdurw_geometry.sdurw_geometry.MaterialMapData(m, sidx, s)

Bases: object

Mapping from triangles to materials.

__init__(m, sidx, s)

Constructor. :type m: int :param m: [in] material id. :type sidx: int :param sidx: [in] start index of triangles. :type s: int :param s: [in] number of triangles that use the material.

property matId

material that is used for these triangles

property size

number of triangles from startIdx that use this material

property startIdx

the start index of the triangles

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.MaterialPolys

Bases: object

ordering polygons by material consumes more memmory but reduce switches between textures. All indices _subFaces share material _matIndex.

__init__()
property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.MetricLine(*args, **kwargs)

Bases: object

Template interface for metrics on type T.

A metric is a function that defines a scalar distance between elements.

__init__(*args, **kwargs)
distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::geometry::Line >::value_type) – [in] first element

  • b (rw::math::Metric< rw::geometry::Line >::value_type) – [in] second element

Return type

float

Returns

the distance

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.MetricLineCPtr(*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.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::geometry::Line >::value_type) – [in] first element

  • b (rw::math::Metric< rw::geometry::Line >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.MetricLinePtr(*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.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::geometry::Line >::value_type) – [in] first element

  • b (rw::math::Metric< rw::geometry::Line >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.MetricPlane(*args, **kwargs)

Bases: object

Template interface for metrics on type T.

A metric is a function that defines a scalar distance between elements.

__init__(*args, **kwargs)
distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::geometry::Plane >::value_type) – [in] first element

  • b (rw::math::Metric< rw::geometry::Plane >::value_type) – [in] second element

Return type

float

Returns

the distance

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.MetricPlaneCPtr(*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.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::geometry::Plane >::value_type) – [in] first element

  • b (rw::math::Metric< rw::geometry::Plane >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.MetricPlanePtr(*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.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::geometry::Plane >::value_type) – [in] first element

  • b (rw::math::Metric< rw::geometry::Plane >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.Model3D(*args)

Bases: object

a 3d model that has geometry but also material and color. he model can be composed of multiple objects that are connected in a hierarchical manner. The model is designed for efficient drawing and as such special structures are used to order the indexes such that efficient drawing is possible.

AVERAGED_NORMALS = 0

vertex normal is determine as an avarage of all adjacent face normals

WEIGHTED_NORMALS = 1

vertex normal is determined as AVARAGED_NORMALS, but with the face normals scaled by the face area

__init__(*args)

Overload 1:

Constructor. :type name: string :param name: [in] name of the model.


Overload 2:

Copy constructor, make a copy of the 3D object

Parameters

model (Model3D) –

addGeometry(mat, geom)

add geometry to this model3d :type mat: Material :param mat: [in] the material properties to use for the geometry. :type geom: rw::core::Ptr< rw::geometry::Geometry > :param geom: [in] the geometry to add.

addMaterial(mat)

all objects in a model use the materials defined on the model :type mat: Material :param mat: [in] material to add. :rtype: int :return: id of the newly added material.

addObject(obj)

add an Object to this Model3D :type obj: rw::geometry::Model3D::Object3DGeneric::Ptr :param obj: [in] the geometric object to add. :rtype: int :return: index of object in model3d

addTriMesh(*args)

Overload 1:

add a triangle mesh to this model3d :type mat: Material :param mat: [in] the material properties to use for the mesh. :type mesh: TriMesh :param mesh: [in] the mesh geometry.


Overload 2:

add a triangle mesh to this model3d :type mat: Material :param mat: [in] the material properties to use for the mesh. :type geom: rw::core::Ptr< rw::geometry::TriMesh const > :param geom: [in] the mesh geometry.

getFilePath()

get filePath of this model3d

getMask()

get mask of this model3d

getMaterial(matid)

get material with string id matid :type matid: string :param matid: [in] string id :rtype: Material :return: pointer to Matrial data

getMaterials()

get all materials that are available in this model

getName()

get string identifier of this model3d

getObjects()

get all objects that make out this model

getTextures()

Get/set the object Textures :rtype: std::vector< rw::core::Ptr< rw::geometry::Model3D::Texture > > :return: std::vector< rw::core::Ptr< Texture > >

getTransform()

get pose of this Model3D

hasMaterial(matid)

check if model has material with id matid :type matid: string :param matid: [in] string id of material :rtype: boolean :return: true if exists in model

isDynamic()

true if data in the model are expected to change

optimize(*args)

optimize vertices and vertice normals

removes redundant vertices and recalculates all vertice normals based on the face normals and the angle between face normals smooth_angle. :type smooth_angle: float :param smooth_angle: :type method: int, optional :param method:

removeObject(name)

remove object with string id name :type name: string :param name: [in] name of object to remove

scale(scale)
setDynamic(dynamic)

set to true if data in the model are expected to change

setFilePath(name)

set filePath this model3d

setMask(mask)

set mask of this model3d

setName(name)

set string identifier of this model3d

setTransform(t3d)

set the pose of this Model3D

property thisown

The membership flag

toGeometryData()

convert this model3d to a geometry. Notice that geometry does not hold any color information. :rtype: Ptr :return: a geometry of this model3d

class sdurw_geometry.sdurw_geometry.Model3DCPtr(*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.

isDynamic()

true if data in the model are expected to change

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.Model3DPtr(*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.

addGeometry(mat, geom)

add geometry to this model3d :type mat: Material :param mat: [in] the material properties to use for the geometry. :type geom: rw::core::Ptr< rw::geometry::Geometry > :param geom: [in] the geometry to add.

addMaterial(mat)

all objects in a model use the materials defined on the model :type mat: Material :param mat: [in] material to add. :rtype: int :return: id of the newly added material.

addObject(obj)

add an Object to this Model3D :type obj: rw::geometry::Model3D::Object3DGeneric::Ptr :param obj: [in] the geometric object to add. :rtype: int :return: index of object in model3d

addTriMesh(*args)

Overload 1:

add a triangle mesh to this model3d :type mat: Material :param mat: [in] the material properties to use for the mesh. :type mesh: TriMesh :param mesh: [in] the mesh geometry.


Overload 2:

add a triangle mesh to this model3d :type mat: Material :param mat: [in] the material properties to use for the mesh. :type geom: rw::core::Ptr< rw::geometry::TriMesh const > :param geom: [in] the mesh geometry.

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getFilePath()

get filePath of this model3d

getMask()

get mask of this model3d

getMaterial(matid)

get material with string id matid :type matid: string :param matid: [in] string id :rtype: Material :return: pointer to Matrial data

getMaterials()

get all materials that are available in this model

getName()

get string identifier of this model3d

getObjects()

get all objects that make out this model

getTextures()

Get/set the object Textures :rtype: std::vector< rw::core::Ptr< rw::geometry::Model3D::Texture > > :return: std::vector< rw::core::Ptr< Texture > >

getTransform()

get pose of this Model3D

hasMaterial(matid)

check if model has material with id matid :type matid: string :param matid: [in] string id of material :rtype: boolean :return: true if exists in model

isDynamic()

true if data in the model are expected to change

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

optimize(*args)

optimize vertices and vertice normals

removes redundant vertices and recalculates all vertice normals based on the face normals and the angle between face normals smooth_angle. :type smooth_angle: float :param smooth_angle: :type method: int, optional :param method:

removeObject(name)

remove object with string id name :type name: string :param name: [in] name of object to remove

scale(scale)
setDynamic(dynamic)

set to true if data in the model are expected to change

setFilePath(name)

set filePath this model3d

setMask(mask)

set mask of this model3d

setName(name)

set string identifier of this model3d

setTransform(t3d)

set the pose of this Model3D

property thisown

The membership flag

toGeometryData()

convert this model3d to a geometry. Notice that geometry does not hold any color information. :rtype: Ptr :return: a geometry of this model3d

class sdurw_geometry.sdurw_geometry.Model3DPtrVector(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.OBB(*args)

Bases: ObvOBB

class representing an Oriented Bounding Box (OBB)

__init__(*args)
static buildTightOBB(tris, index=0)
calcArea()

calculates the total area of the box

calcVolume()

calculate the volume of this OBB

createMesh(local=False)

Creates a TriMesh representing the OBB.

The triangles of the mesh is by default placed in the “global” frame corresponding to the frame in which the OBB is defined. In case the parameter local is set to true, the reference frame will be the frame of the OBB itself.

getHalfLengths()

get the halflengths of this OBB

getTransform()
setHalfLengths(halfLng)

set the halflengths of the OBB

setTransform(t3d)

set the transformation of this OBB

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.OBBCPtr(*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 total area of the box

calcVolume()

calculate the volume of this OBB

createMesh(local=False)

Creates a TriMesh representing the OBB.

The triangles of the mesh is by default placed in the “global” frame corresponding to the frame in which the OBB is defined. In case the parameter local is set to true, the reference frame will be the frame of the OBB itself.

deref()

The pointer stored in the object.

getDeref()

Member access operator.

getHalfLengths()

get the halflengths of this OBB

getTransform()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

Bases: BVColliderOBBColiderOBB

class for testing if two Oriented Bounding Boxes (OBBs) are overlapping. The method used is based on the seperating axis theorem. Please see the article “OBBTree: A Hierarchical Structure for Rapid Interference Detection”.

__init__()

constructor

collides(obbA, obbB, aTb)

test if obbA intersects obbB. The aTb transform describe obbB relative to obbA’s coordinate frame

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.OBBColliderCPtr(*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

isShared()

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.OBBColliderPtr(*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.

collides(obbA, obbB, aTb)

test if obbA intersects obbB. The aTb transform describe obbB relative to obbA’s coordinate frame

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

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

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

Bases: BVColliderOBBColiderOBB_f

class for testing if two Oriented Bounding Boxes (OBBs) are overlapping. The method used is based on the seperating axis theorem. Please see the article “OBBTree: A Hierarchical Structure for Rapid Interference Detection”.

__init__()

constructor

collides(obbA, obbB, aTb)

test if obbA intersects obbB. The aTb transform describe obbB relative to obbA’s coordinate frame

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.OBBFactory(*args)

Bases: BVFactoryOBB

factory for computing tight fitting Oriented Bounding Boxes.

DITO14 = 2

Ditretahedron method with 14 selected vertices.

PCA = 0

Principal Component Analysis

PCAHull = 1

Principal Component Analysis Hull

__init__(*args)

Constructor. :type method: int, optional :param method: [in] (optional) the method to use. Default is the DITO14 method.

makeBV(*args)

Overload 1: &)


Overload 2: &)


Overload 3: &)


Overload 4: &)

makeDITO(mesh)
makePCA(mesh)

computes covariance over vertices in mesh and calculates the eigen vectors of the covariance and use this as axes in the bounding box :type mesh: TriMesh :param mesh: [in] the triangle mesh to create oriented bounding box for. :rtype: rw::geometry::OBB< double > :return: a tight fitting bounding box

makePCAHull(mesh)

computes covariance over the vertices of the convex hull of the mesh and calculates the eigen vectors of the covariance and use this as axes in the bounding box :type mesh: TriMesh :param mesh: [in] the triangle mesh to create oriented bounding box for. :rtype: rw::geometry::OBB< double > :return: a tight fitting bounding box

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.OBBFactoryCPtr(*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

isShared()

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.

makeDITO(mesh)
makePCA(mesh)

computes covariance over vertices in mesh and calculates the eigen vectors of the covariance and use this as axes in the bounding box :type mesh: TriMesh :param mesh: [in] the triangle mesh to create oriented bounding box for. :rtype: rw::geometry::OBB< double > :return: a tight fitting bounding box

makePCAHull(mesh)

computes covariance over the vertices of the convex hull of the mesh and calculates the eigen vectors of the covariance and use this as axes in the bounding box :type mesh: TriMesh :param mesh: [in] the triangle mesh to create oriented bounding box for. :rtype: rw::geometry::OBB< double > :return: a tight fitting bounding box

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.OBBFactoryPtr(*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.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

makeBV(*args)

Overload 1: &)


Overload 2: &)


Overload 3: &)


Overload 4: &)

makeDITO(mesh)
makePCA(mesh)

computes covariance over vertices in mesh and calculates the eigen vectors of the covariance and use this as axes in the bounding box :type mesh: TriMesh :param mesh: [in] the triangle mesh to create oriented bounding box for. :rtype: rw::geometry::OBB< double > :return: a tight fitting bounding box

makePCAHull(mesh)

computes covariance over the vertices of the convex hull of the mesh and calculates the eigen vectors of the covariance and use this as axes in the bounding box :type mesh: TriMesh :param mesh: [in] the triangle mesh to create oriented bounding box for. :rtype: rw::geometry::OBB< double > :return: a tight fitting bounding box

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.OBBFactory_f(*args)

Bases: BVFactoryOBB_f

factory for computing tight fitting Oriented Bounding Boxes.

DITO14 = 2

Ditretahedron method with 14 selected vertices.

PCA = 0

Principal Component Analysis

PCAHull = 1

Principal Component Analysis Hull

__init__(*args)

Constructor. :type method: int, optional :param method: [in] (optional) the method to use. Default is the DITO14 method.

makeBV(*args)

Overload 1: &)


Overload 2: &)


Overload 3: &)


Overload 4: &)

makeDITO(mesh)
makePCA(mesh)

computes covariance over vertices in mesh and calculates the eigen vectors of the covariance and use this as axes in the bounding box :type mesh: TriMesh :param mesh: [in] the triangle mesh to create oriented bounding box for. :rtype: rw::geometry::OBB< float > :return: a tight fitting bounding box

makePCAHull(mesh)

computes covariance over the vertices of the convex hull of the mesh and calculates the eigen vectors of the covariance and use this as axes in the bounding box :type mesh: TriMesh :param mesh: [in] the triangle mesh to create oriented bounding box for. :rtype: rw::geometry::OBB< float > :return: a tight fitting bounding box

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.OBBPtr(*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.

buildTightOBB(tris, index=0)
calcArea()

calculates the total area of the box

calcVolume()

calculate the volume of this OBB

cptr()
createMesh(local=False)

Creates a TriMesh representing the OBB.

The triangles of the mesh is by default placed in the “global” frame corresponding to the frame in which the OBB is defined. In case the parameter local is set to true, the reference frame will be the frame of the OBB itself.

deref()

The pointer stored in the object.

getDeref()

Member access operator.

getHalfLengths()

get the halflengths of this OBB

getTransform()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

setHalfLengths(halfLng)

set the halflengths of the OBB

setTransform(t3d)

set the transformation of this OBB

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.OBBToleranceCollider

Bases: BVColliderOBBToleranceCollider

class for testing if two Oriented Bounding Boxes are overlapping

__init__()

constructor

collides(*args)

Overload 1:

test if obbA is closer than tolerance to obbB. The aTb transform describe obbB relative to obbA’s coordinate frame. This method is approximate and the obb’s may lie up to sqrt(tolerance^2+tolerance^2) away from each other.


Overload 2:

test if obbA is closer than tolerance to obbB. The aTb transform describe obbB relative to obbA’s coordinate frame. This method is approximate and the obb’s may lie up to sqrt(tolerance^2+tolerance^2) away from each other.

setTolerance(tolerance)

set the tolerance of the collider :type tolerance: float :param tolerance: [in] meters

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.OBBToleranceColliderCPtr(*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

isShared()

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.OBBToleranceColliderPtr(*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.

collides(*args)

Overload 1:

test if obbA is closer than tolerance to obbB. The aTb transform describe obbB relative to obbA’s coordinate frame. This method is approximate and the obb’s may lie up to sqrt(tolerance^2+tolerance^2) away from each other.


Overload 2:

test if obbA is closer than tolerance to obbB. The aTb transform describe obbB relative to obbA’s coordinate frame. This method is approximate and the obb’s may lie up to sqrt(tolerance^2+tolerance^2) away from each other.

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

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

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

setTolerance(tolerance)

set the tolerance of the collider :type tolerance: float :param tolerance: [in] meters

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.OBBToleranceCollider_f

Bases: BVColliderOBBToleranceCollider_f

class for testing if two Oriented Bounding Boxes are overlapping

__init__()

constructor

collides(*args)

Overload 1:

test if obbA is closer than tolerance to obbB. The aTb transform describe obbB relative to obbA’s coordinate frame. This method is approximate and the obb’s may lie up to sqrt(tolerance^2+tolerance^2) away from each other.


Overload 2:

test if obbA is closer than tolerance to obbB. The aTb transform describe obbB relative to obbA’s coordinate frame. This method is approximate and the obb’s may lie up to sqrt(tolerance^2+tolerance^2) away from each other.

setTolerance(tolerance)

set the tolerance of the collider :type tolerance: float :param tolerance: [in] meters

property thisown

The membership flag

sdurw_geometry.sdurw_geometry.OBB_buildTightOBB(tris, index=0)
class sdurw_geometry.sdurw_geometry.OBB_f(*args)

Bases: ObvOBB_f

class representing an Oriented Bounding Box (OBB)

__init__(*args)
static buildTightOBB(tris, index=0)
calcArea()

calculates the total area of the box

calcVolume()

calculate the volume of this OBB

createMesh(local=False)

Creates a TriMesh representing the OBB.

The triangles of the mesh is by default placed in the “global” frame corresponding to the frame in which the OBB is defined. In case the parameter local is set to true, the reference frame will be the frame of the OBB itself.

getHalfLengths()

get the halflengths of this OBB

getTransform()
setHalfLengths(halfLng)

set the halflengths of the OBB

setTransform(t3d)

set the transformation of this OBB

property thisown

The membership flag

sdurw_geometry.sdurw_geometry.OBB_f_buildTightOBB(tris, index=0)
class sdurw_geometry.sdurw_geometry.Object3DGeneric(*args, **kwargs)

Bases: TriMesh

An abstract 3d object consisting of geometry information, material and texture.

To reduce memory, the geometry is implemented slightly differently for different mesh sizes. One of the concrete Object3D implementations should be used in practice.

__init__(*args, **kwargs)
copy()
countFaces()

Get the number of faces. :rtype: int :return: the number of faces.

getFaceVertices(idx)

Returns vertices corresponding to the idx face :type idx: int :param idx: [in] Index of the face :rtype: std::vector< rw::math::Vector3D< float > > :return: List with vertices

getTriangle(*args)

Overload 1:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :rtype: rw::geometry::Triangle< double > :return: the triangle at index idx


Overload 2:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< double > :param dst: [out] where to store the triangle at index idx


Overload 3:

gets the triangle at index idx. Using Floating point presicion :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< float > :param dst: [out] where to store the triangle at index idx

getType()

the type of this primitive

hasTexture()

test if the object is textured

setMaterial(material)

set the material used by addTriangles :type material: int :param material:

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.ObvOBB

Bases: object

a general oriented bounding volume class

__init__()
calcArea()
calcVolume()
getTransform()
property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.ObvOBB_f

Bases: object

a general oriented bounding volume class

__init__()
calcArea()
calcVolume()
getTransform()
property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.ParametricCurve(*args, **kwargs)

Bases: Curve

Interface for parametric curves. A parametric curve, \(\mathbf{p}(t) \in\mathbb{R}^3\), has its points given as a function of a single parameter, \(t \in\mathbb{R}\).

Parametric curves have functions for evaluation of points, derivatives and curvature. A parmateric curve can be limited, and it is possible to find closest points with a given point.

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

closestTime(p)

Get the parameter value where the curve is closest 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

float

Returns

the point on the curve closest to p. If multiple points are equally close to p, only one of those points are returned.

closestTimes(p)

Get the parameter values where the curve is closest 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< double >

Returns

a list of parameter values.

curvature(t)

The curvature in a given point on the curve.

This function does not take the limits into account.

Parameters

t (float) – [in] the parameter to evaluate the curvature for.

Return type

float

Returns

the curvature.

ddx(t)

Evaluate the second derivative in a point on the curve. :type t: float :param t: [in] the parameter to find second derivative for. :rtype: rw::math::Vector3D< double > :return: a second derivative vector \(p \in \mathbb{R}^3\) .

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.

dx(t)

Evaluate the derivative in a point on the curve. :type t: float :param t: [in] the parameter to find derivative for. :rtype: rw::math::Vector3D< double > :return: a derivative vector \(p \in \mathbb{R}^3\) .

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.

hasLimits()

Check if the curve is limited. :rtype: boolean :return: true if curve is limited, false otherwise.

inLimits(t)

Check if the parameter t is inside the limits set for the curve. :type t: float :param t: [in] the parameter to check. :rtype: boolean :return: true if inside limits, false otherwise.

limits()

Get the limits of the curve segment.

The returned values are only valid when hasLimits() returns true.

Return type

std::pair< double,double >

Returns

the minimum and maximum parameter values on the curve.

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.

setLimits(limits)

Set parameter limits for the curve. :type limits: std::pair< double,double > :param limits: [in] the minimum and maximum parameter values on the curve.

property thisown

The membership flag

transform(*args)

Overload 1: rw::math::Transform3D<double>&) const


Overload 2: rw::math::Vector3D<double>&) const

x(t)

Evaluate a point on the curve. :type t: float :param t: [in] the parameter to find point for. :rtype: rw::math::Vector3D< double > :return: the vector \(p \in \mathbb{R}^3\) .

class sdurw_geometry.sdurw_geometry.ParametricCurveCPtr(*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()
closestPoints(p)
closestTime(p)

Get the parameter value where the curve is closest 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

float

Returns

the point on the curve closest to p. If multiple points are equally close to p, only one of those points are returned.

closestTimes(p)

Get the parameter values where the curve is closest 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< double >

Returns

a list of parameter values.

curvature(t)

The curvature in a given point on the curve.

This function does not take the limits into account.

Parameters

t (float) – [in] the parameter to evaluate the curvature for.

Return type

float

Returns

the curvature.

ddx(t)

Evaluate the second derivative in a point on the curve. :type t: float :param t: [in] the parameter to find second derivative for. :rtype: rw::math::Vector3D< double > :return: a second derivative vector \(p \in \mathbb{R}^3\) .

deref()

The pointer stored in the object.

discretizeAdaptive(stepsPerRevolution)
dx(t)

Evaluate the derivative in a point on the curve. :type t: float :param t: [in] the parameter to find derivative for. :rtype: rw::math::Vector3D< double > :return: a derivative vector \(p \in \mathbb{R}^3\) .

equals(curve, eps)
extremums(dir)
getDeref()

Member access operator.

hasLimits()

Check if the curve is limited. :rtype: boolean :return: true if curve is limited, false otherwise.

inLimits(t)

Check if the parameter t is inside the limits set for the curve. :type t: float :param t: [in] the parameter to check. :rtype: boolean :return: true if inside limits, false otherwise.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

limits()

Get the limits of the curve segment.

The returned values are only valid when hasLimits() returns true.

Return type

std::pair< double,double >

Returns

the minimum and maximum parameter values on the curve.

obr()
reverse()
scale(factor)
property thisown

The membership flag

transform(*args)

Overload 1: rw::math::Transform3D<double>&) const


Overload 2: rw::math::Vector3D<double>&) const

x(t)

Evaluate a point on the curve. :type t: float :param t: [in] the parameter to find point for. :rtype: rw::math::Vector3D< double > :return: the vector \(p \in \mathbb{R}^3\) .

class sdurw_geometry.sdurw_geometry.ParametricCurvePtr(*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()
closestPoints(p)
closestTime(p)

Get the parameter value where the curve is closest 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

float

Returns

the point on the curve closest to p. If multiple points are equally close to p, only one of those points are returned.

closestTimes(p)

Get the parameter values where the curve is closest 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< double >

Returns

a list of parameter values.

cptr()
curvature(t)

The curvature in a given point on the curve.

This function does not take the limits into account.

Parameters

t (float) – [in] the parameter to evaluate the curvature for.

Return type

float

Returns

the curvature.

ddx(t)

Evaluate the second derivative in a point on the curve. :type t: float :param t: [in] the parameter to find second derivative for. :rtype: rw::math::Vector3D< double > :return: a second derivative vector \(p \in \mathbb{R}^3\) .

deref()

The pointer stored in the object.

discretizeAdaptive(stepsPerRevolution)
dx(t)

Evaluate the derivative in a point on the curve. :type t: float :param t: [in] the parameter to find derivative for. :rtype: rw::math::Vector3D< double > :return: a derivative vector \(p \in \mathbb{R}^3\) .

equals(curve, eps)
extremums(dir)
getDeref()

Member access operator.

hasLimits()

Check if the curve is limited. :rtype: boolean :return: true if curve is limited, false otherwise.

inLimits(t)

Check if the parameter t is inside the limits set for the curve. :type t: float :param t: [in] the parameter to check. :rtype: boolean :return: true if inside limits, false otherwise.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

limits()

Get the limits of the curve segment.

The returned values are only valid when hasLimits() returns true.

Return type

std::pair< double,double >

Returns

the minimum and maximum parameter values on the curve.

obr()
reverse()
scale(factor)
setLimits(limits)

Set parameter limits for the curve. :type limits: std::pair< double,double > :param limits: [in] the minimum and maximum parameter values on the curve.

property thisown

The membership flag

transform(*args)

Overload 1: rw::math::Transform3D<double>&) const


Overload 2: rw::math::Vector3D<double>&) const

x(t)

Evaluate a point on the curve. :type t: float :param t: [in] the parameter to find point for. :rtype: rw::math::Vector3D< double > :return: the vector \(p \in \mathbb{R}^3\) .

class sdurw_geometry.sdurw_geometry.PlainQuadraticShell(*args)

Bases: QuadraticShell

A collection of concrete Quadratic surface patches, that together form a shell.

__init__(*args)
Overload 1:

Constructor.


Overload 2:

Construct shell from a collection of Quadratic faces. :type faces: std::vector< rw::core::Ptr< rw::geometry::QuadraticFace > > :param faces: [in] collection of Quadratic faces.


Overload 3:

Copy constructor. :type shell: PlainQuadraticShell :param shell: [in] other shell to copy.


Overload 4:

Copy constructor. :type shell: QuadraticShell :param shell: [in] other shell to copy.

add(*args)

Overload 1:

Add Quadratic face. :type face: rw::core::Ptr< rw::geometry::QuadraticFace > :param face: [in] quadratic face to add.


Overload 2:

Add faces from another shell. :type shell: PlainQuadraticShell :param shell: [in] other shell.


Overload 3:

Add faces from another shell. :type shell: QuadraticShell :param shell: [in] other shell.

clear()

Remove all faces from the shell.

clone()

Make a copy of the shell. :rtype: rw::core::Ptr< rw::geometry::PlainQuadraticShell > :return: a new copy.

getFace(*args)
Overload 1:

const


Overload 2: , QuadraticFace&) const


Overload 3: , GenericFace&) const

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.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PlainQuadraticShellCPtr(*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 shell. :rtype: rw::core::Ptr< rw::geometry::PlainQuadraticShell > :return: a new copy.

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: , QuadraticFace&) const


Overload 3: , GenericFace&) const

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

isShared()

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.PlainQuadraticShellPtr(*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.

add(*args)

Overload 1:

Add Quadratic face. :type face: rw::core::Ptr< rw::geometry::QuadraticFace > :param face: [in] quadratic face to add.


Overload 2:

Add faces from another shell. :type shell: PlainQuadraticShell :param shell: [in] other shell.


Overload 3:

Add faces from another shell. :type shell: QuadraticShell :param shell: [in] other shell.

clear()

Remove all faces from the shell.

clone()

Make a copy of the shell. :rtype: rw::core::Ptr< rw::geometry::PlainQuadraticShell > :return: a new copy.

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: , QuadraticFace&) const


Overload 3: , GenericFace&) const

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

isShared()

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.PlainTriMesh(*args)

Bases: TriMesh

a triangle mesh representation that maintains a list of simple triangles.

This class is templated and can be setup with different types of triangle storage. Mainly this concerns single or double precision but also number of normals in each Triangle. Check out Triangle.hpp to get an idea of the different types.

The PlainTriMesh can be used as follows

// create trimesh
PlainTriMesh<TriangleN1<float> > mesh;
// add data
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
 // and access the mesh
TriangleN1<float> tri_index1 = mesh[1];
Vector3D<float> normal = mesh[2].getFaceNormal();

To convert the plain trimesh to a more efficient mesh representation take a look at TriangleUtil::toIndexedTriMesh().

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::Triangle< double > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()

make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

getSize()

gets the number of triangles in the triangle array.

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::Triangle< double > > :return: a reference to the triangle vector

getType()

the type of this primitive

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)

Scale all vertices in the mesh.

size()

gets the number of triangles in the triangle array.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PlainTriMeshCPtr(*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.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

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

isShared()

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.PlainTriMeshN1(*args)

Bases: TriMesh

a triangle mesh representation that maintains a list of simple triangles.

This class is templated and can be setup with different types of triangle storage. Mainly this concerns single or double precision but also number of normals in each Triangle. Check out Triangle.hpp to get an idea of the different types.

The PlainTriMesh can be used as follows

// create trimesh
PlainTriMesh<TriangleN1<float> > mesh;
// add data
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
 // and access the mesh
TriangleN1<float> tri_index1 = mesh[1];
Vector3D<float> normal = mesh[2].getFaceNormal();

To convert the plain trimesh to a more efficient mesh representation take a look at TriangleUtil::toIndexedTriMesh().

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::TriangleN1< double > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()

make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

getSize()

gets the number of triangles in the triangle array.

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::TriangleN1< double > > :return: a reference to the triangle vector

getType()

the type of this primitive

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)

Scale all vertices in the mesh.

size()

gets the number of triangles in the triangle array.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PlainTriMeshN1CPtr(*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.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

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

isShared()

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.PlainTriMeshN1Ptr(*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.

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::TriangleN1< double > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()
cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::TriangleN1< double > > :return: a reference to the triangle vector

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

isShared()

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.

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)
setConvexEnabled(isConvex)
size()
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.PlainTriMeshN1_f(*args)

Bases: TriMesh

a triangle mesh representation that maintains a list of simple triangles.

This class is templated and can be setup with different types of triangle storage. Mainly this concerns single or double precision but also number of normals in each Triangle. Check out Triangle.hpp to get an idea of the different types.

The PlainTriMesh can be used as follows

// create trimesh
PlainTriMesh<TriangleN1<float> > mesh;
// add data
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
 // and access the mesh
TriangleN1<float> tri_index1 = mesh[1];
Vector3D<float> normal = mesh[2].getFaceNormal();

To convert the plain trimesh to a more efficient mesh representation take a look at TriangleUtil::toIndexedTriMesh().

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::TriangleN1< float > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()

make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

getSize()

gets the number of triangles in the triangle array.

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::TriangleN1< float > > :return: a reference to the triangle vector

getType()

the type of this primitive

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)

Scale all vertices in the mesh.

size()

gets the number of triangles in the triangle array.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PlainTriMeshN1_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.

clone()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

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

isShared()

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

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::TriangleN1< float > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()
cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::TriangleN1< float > > :return: a reference to the triangle vector

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

isShared()

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.

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)
setConvexEnabled(isConvex)
size()
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.PlainTriMeshN3(*args)

Bases: TriMesh

a triangle mesh representation that maintains a list of simple triangles.

This class is templated and can be setup with different types of triangle storage. Mainly this concerns single or double precision but also number of normals in each Triangle. Check out Triangle.hpp to get an idea of the different types.

The PlainTriMesh can be used as follows

// create trimesh
PlainTriMesh<TriangleN1<float> > mesh;
// add data
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
 // and access the mesh
TriangleN1<float> tri_index1 = mesh[1];
Vector3D<float> normal = mesh[2].getFaceNormal();

To convert the plain trimesh to a more efficient mesh representation take a look at TriangleUtil::toIndexedTriMesh().

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::TriangleN3< double > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()

make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

getSize()

gets the number of triangles in the triangle array.

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::TriangleN3< double > > :return: a reference to the triangle vector

getType()

the type of this primitive

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)

Scale all vertices in the mesh.

size()

gets the number of triangles in the triangle array.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PlainTriMeshN3CPtr(*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.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

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

isShared()

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.PlainTriMeshN3Ptr(*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.

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::TriangleN3< double > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()
cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::TriangleN3< double > > :return: a reference to the triangle vector

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

isShared()

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.

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)
setConvexEnabled(isConvex)
size()
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.PlainTriMeshN3_f(*args)

Bases: TriMesh

a triangle mesh representation that maintains a list of simple triangles.

This class is templated and can be setup with different types of triangle storage. Mainly this concerns single or double precision but also number of normals in each Triangle. Check out Triangle.hpp to get an idea of the different types.

The PlainTriMesh can be used as follows

// create trimesh
PlainTriMesh<TriangleN1<float> > mesh;
// add data
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
 // and access the mesh
TriangleN1<float> tri_index1 = mesh[1];
Vector3D<float> normal = mesh[2].getFaceNormal();

To convert the plain trimesh to a more efficient mesh representation take a look at TriangleUtil::toIndexedTriMesh().

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::TriangleN3< float > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()

make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

getSize()

gets the number of triangles in the triangle array.

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::TriangleN3< float > > :return: a reference to the triangle vector

getType()

the type of this primitive

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)

Scale all vertices in the mesh.

size()

gets the number of triangles in the triangle array.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PlainTriMeshN3_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.

clone()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

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

isShared()

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

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::TriangleN3< float > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()
cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::TriangleN3< float > > :return: a reference to the triangle vector

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

isShared()

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.

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)
setConvexEnabled(isConvex)
size()
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.PlainTriMeshPtr(*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.

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::Triangle< double > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()
cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::Triangle< double > > :return: a reference to the triangle vector

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

isShared()

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.

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)
setConvexEnabled(isConvex)
size()
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.PlainTriMesh_f(*args)

Bases: TriMesh

a triangle mesh representation that maintains a list of simple triangles.

This class is templated and can be setup with different types of triangle storage. Mainly this concerns single or double precision but also number of normals in each Triangle. Check out Triangle.hpp to get an idea of the different types.

The PlainTriMesh can be used as follows

// create trimesh
PlainTriMesh<TriangleN1<float> > mesh;
// add data
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
mesh.add( TriangleN1<float>(v1,v2,v3) );
 // and access the mesh
TriangleN1<float> tri_index1 = mesh[1];
Vector3D<float> normal = mesh[2].getFaceNormal();

To convert the plain trimesh to a more efficient mesh representation take a look at TriangleUtil::toIndexedTriMesh().

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::Triangle< float > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()

make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

getSize()

gets the number of triangles in the triangle array.

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::Triangle< float > > :return: a reference to the triangle vector

getType()

the type of this primitive

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)

Scale all vertices in the mesh.

size()

gets the number of triangles in the triangle array.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PlainTriMesh_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.

clone()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

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

isShared()

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

add(*args)

Overload 1:

add a triangle to the triangle mesh. :type triangle: rw::geometry::Triangle< float > :param triangle: [in] Triangle to add. The triangle is copied.


Overload 2:

Add all triangles in the mesh triangles to this :param [in]: triangles Triangle mesh for which to add triangles

clear()

Clears the list of triangles

clone()
cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()
getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangles()

the vector of triangles :rtype: std::vector< rw::geometry::Triangle< float > > :return: a reference to the triangle vector

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

isShared()

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.

resize(i)

resize the triangle mesh :type i: int :param i: [in] new size of mesh.

scale(scale)
setConvexEnabled(isConvex)
size()
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.Plane(*args)

Bases: Primitive

plane primitive represented in Hessian normal-form: a*nx+b*ny+c*nz+d=0

__init__(*args)

Overload 1:

Constructor.

Makes a plane on X-Y surface.


Overload 2:

constructor :type q: Q :param q:


Overload 3:

constructor :type n: rw::math::Vector3D< double > :param n: [in] normal of plane :type d: float :param d: [in] distance from plane to (0,0,0) in direction of normal


Overload 4:

constructor - calculates the plane from 3 vertices :type p1: rw::math::Vector3D< double > :param p1: [in] vertice 1 :type p2: rw::math::Vector3D< double > :param p2: [in] vertice 2 :type p3: rw::math::Vector3D< double > :param p3: [in] vertice 3

createMesh(*args)

Overload 1:


Overload 2:

Create a triangle mesh representing the plane.

Provides the posibility to specify the size of the plan. :type resolution: int :param resolution: [in] Resolution of the mesh (not applicable for a plane) :type size: float :param size: [in] Size of the plane.

d()

get distance to {0,0,0} from plane along normal.

distance(*args)

Overload 1:

Calculates the shortest distance from point to plane.

The distance includes the sign s.t. a negative distance corresponds to point being behind the plane and a positive distance in front of the plane.

Parameters

point (rw::math::Vector3D< double >) –


Overload 2:

Default metric for computing the difference between 2 planes :type plane: Plane :param plane: [in]

getParameters()

get the parameters that define this primitive

getType()

the type of this primitive

intersection(p1, p2)

Calculates the intersection between the line and plane.

The line defined by p1 and p2 is considered infinitely long. Throws a rw::core::Exception if the line is parallel to the plane.

Parameters
  • p1 (rw::math::Vector3D< double >) – [in] point 1 on the line

  • p2 (rw::math::Vector3D< double >) – [in] point 2 on the line

static makeMetric(angToDistWeight=1.0)

Create a metric that can be used to compare distance between two planes. The distance between two planes is computed as follows:

val = 0.5*angle(p1.normal, p2.normal)*angToDistWeight + 0.5*fabs(p1.d-p2.d); :rtype: rw::math::Metric< rw::geometry::Plane >::Ptr :return: distance metric

normal(*args)

Overload 1: get plane normal


Overload 2: get plane normal

refit(data)

Fit this plane to a set of points.

A PCA analysis of the points are made and the two axes with largest extends are used for defining the plane. The error is the sum of the squared mean of the points to the plane.

The plane normal always points in the positive z-direction.

Parameters

data (std::vector< rw::math::Vector3D< double > >) – [in] a set of points

Return type

float

Returns

fitting error

setParameters(q)

set the parameters that define this primitive

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PlaneCPtr(*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(*args)

Overload 1:


Overload 2:

Create a triangle mesh representing the plane.

Provides the posibility to specify the size of the plan. :type resolution: int :param resolution: [in] Resolution of the mesh (not applicable for a plane) :type size: float :param size: [in] Size of the plane.

deref()

The pointer stored in the object.

distance(*args)

Overload 1:

Calculates the shortest distance from point to plane.

The distance includes the sign s.t. a negative distance corresponds to point being behind the plane and a positive distance in front of the plane.

Parameters

point (rw::math::Vector3D< double >) –


Overload 2:

Default metric for computing the difference between 2 planes :type plane: Plane :param plane: [in]

getDeref()

Member access operator.

getParameters()
getType()
intersection(p1, p2)

Calculates the intersection between the line and plane.

The line defined by p1 and p2 is considered infinitely long. Throws a rw::core::Exception if the line is parallel to the plane.

Parameters
  • p1 (rw::math::Vector3D< double >) – [in] point 1 on the line

  • p2 (rw::math::Vector3D< double >) – [in] point 2 on the line

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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(*args)

Overload 1: get plane normal


Overload 2: get plane normal

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PlaneMetric(angToDistWeight=1.0)

Bases: MetricPlane

A metric for calculating plane-to-plane distance.

__init__(angToDistWeight=1.0)

Constructor. :type angToDistWeight: float, optional :param angToDistWeight: [in] weighting of angle compared to linear distance.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PlanePtr(*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(*args)

Overload 1:


Overload 2:

Create a triangle mesh representing the plane.

Provides the posibility to specify the size of the plan. :type resolution: int :param resolution: [in] Resolution of the mesh (not applicable for a plane) :type size: float :param size: [in] Size of the plane.

d()

get distance to {0,0,0} from plane along normal.

deref()

The pointer stored in the object.

distance(*args)

Overload 1:

Calculates the shortest distance from point to plane.

The distance includes the sign s.t. a negative distance corresponds to point being behind the plane and a positive distance in front of the plane.

Parameters

point (rw::math::Vector3D< double >) –


Overload 2:

Default metric for computing the difference between 2 planes :type plane: Plane :param plane: [in]

getDeref()

Member access operator.

getParameters()
getTriMesh(forceCopy=True)

Notes: primitives allways return a new trimesh

getType()
intersection(p1, p2)

Calculates the intersection between the line and plane.

The line defined by p1 and p2 is considered infinitely long. Throws a rw::core::Exception if the line is parallel to the plane.

Parameters
  • p1 (rw::math::Vector3D< double >) – [in] point 1 on the line

  • p2 (rw::math::Vector3D< double >) – [in] point 2 on the line

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

isShared()

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.

makeMetric(angToDistWeight=1.0)

Create a metric that can be used to compare distance between two planes. The distance between two planes is computed as follows:

val = 0.5*angle(p1.normal, p2.normal)*angToDistWeight + 0.5*fabs(p1.d-p2.d); :rtype: rw::math::Metric< rw::geometry::Plane >::Ptr :return: distance metric

normal(*args)

Overload 1: get plane normal


Overload 2: get plane normal

refit(data)

Fit this plane to a set of points.

A PCA analysis of the points are made and the two axes with largest extends are used for defining the plane. The error is the sum of the squared mean of the points to the plane.

The plane normal always points in the positive z-direction.

Parameters

data (std::vector< rw::math::Vector3D< double > >) – [in] a set of points

Return type

float

Returns

fitting error

setParameters(q)
property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

sdurw_geometry.sdurw_geometry.Plane_makeMetric(angToDistWeight=1.0)

Create a metric that can be used to compare distance between two planes. The distance between two planes is computed as follows:

val = 0.5*angle(p1.normal, p2.normal)*angToDistWeight + 0.5*fabs(p1.d-p2.d); :rtype: rw::math::Metric< rw::geometry::Plane >::Ptr :return: distance metric

class sdurw_geometry.sdurw_geometry.Point(*args)

Bases: object

the point description of the contour

N(*args)

Overload 1: get normal of this contour point


Overload 2: get normal of this contour point

P(*args)

Overload 1: get position of this contour point


Overload 2: get position of this contour point

__init__(*args)
Overload 1:

constructor


Overload 2:

constructor


Overload 3:

constructor :type position: rw::math::Vector2D< double > :param position: :type magnitude: float :param magnitude: :type orientation: float :param orientation:

getDirection()

Notes: deprecated

setDirection(dir)

Notes: deprecated

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PointCloud(*args)

Bases: GeometryData

A simple point cloud data structure. Points may be ordered or not. An ordered set is kept as a single array in row major order and with a width and a height. An unordered array must have height==1 and width equal to the number of points.

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor :type w: int :param w: :type h: int :param h:

getData(*args)

Overload 1:

returns a char pointer to the image data :rtype: std::vector< rw::math::Vector3D< float > > :return: char pointer to the image data


Overload 2:

returns a char pointer to the image data :rtype: std::vector< rw::math::Vector3D< float > > :return: const char pointer to the image data

getDataTransform()
getHeight()
Return type

int

Returns

height

getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getType()

the type of this primitive

getWidth()

width of the point cloud data. If the data is unordered then this will be equal to the number of points. :rtype: int :return: width of data points

isOrdered()
static loadPCD(filename)

load point cloud from PCD file :type filename: string :param filename: [in] name of PCD file :rtype: rw::core::Ptr< rw::geometry::PointCloud > :return: a point cloud

resize(w, h)

set width of point cloud. Data elements are accessed as [x+y*width].

If the current data array cannot contain the elements then it will be resized to be able to it. :type w: int :param w: [in] new width :type h: int :param h: [in] new height

static savePCD(*args)

save point cloud in PCD file format (PCL library format) :type cloud: PointCloud :param cloud: [in] the point cloud to save :type filename: string :param filename: [in] the name of the file to save to :type t3d: rw::math::Transform3D< float >, optional :param t3d: [in] the transformation of the point cloud

size()

gets the number of points in the point cloud.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PointCloudCPtr(*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.

getData(*args)

Overload 1:

returns a char pointer to the image data :rtype: std::vector< rw::math::Vector3D< float > > :return: char pointer to the image data


Overload 2:

returns a char pointer to the image data :rtype: std::vector< rw::math::Vector3D< float > > :return: const char pointer to the image data

getDataTransform()
getDeref()

Member access operator.

getHeight()
Return type

int

Returns

height

getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getType()
getWidth()

width of the point cloud data. If the data is unordered then this will be equal to the number of points. :rtype: int :return: width of data points

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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()

gets the number of points in the point cloud.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PointCloudPtr(*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.

getData(*args)

Overload 1:

returns a char pointer to the image data :rtype: std::vector< rw::math::Vector3D< float > > :return: char pointer to the image data


Overload 2:

returns a char pointer to the image data :rtype: std::vector< rw::math::Vector3D< float > > :return: const char pointer to the image data

getDataTransform()
getDeref()

Member access operator.

getHeight()
Return type

int

Returns

height

getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getType()
getWidth()

width of the point cloud data. If the data is unordered then this will be equal to the number of points. :rtype: int :return: width of data points

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

isOrdered()
isShared()

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.

loadPCD(filename)

load point cloud from PCD file :type filename: string :param filename: [in] name of PCD file :rtype: rw::core::Ptr< rw::geometry::PointCloud > :return: a point cloud

resize(w, h)

set width of point cloud. Data elements are accessed as [x+y*width].

If the current data array cannot contain the elements then it will be resized to be able to it. :type w: int :param w: [in] new width :type h: int :param h: [in] new height

savePCD(*args)

save point cloud in PCD file format (PCL library format) :type cloud: PointCloud :param cloud: [in] the point cloud to save :type filename: string :param filename: [in] the name of the file to save to :type t3d: rw::math::Transform3D< float >, optional :param t3d: [in] the transformation of the point cloud

size()

gets the number of points in the point cloud.

property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

sdurw_geometry.sdurw_geometry.PointCloud_loadPCD(filename)

load point cloud from PCD file :type filename: string :param filename: [in] name of PCD file :rtype: rw::core::Ptr< rw::geometry::PointCloud > :return: a point cloud

sdurw_geometry.sdurw_geometry.PointCloud_savePCD(*args)

save point cloud in PCD file format (PCL library format) :type cloud: PointCloud :param cloud: [in] the point cloud to save :type filename: string :param filename: [in] the name of the file to save to :type t3d: rw::math::Transform3D< float >, optional :param t3d: [in] the transformation of the point cloud

class sdurw_geometry.sdurw_geometry.Polygon

Bases: object

indexed polygon class that saves N indices to the N vertices of the polygon

__init__()
addVertex(p)

Adds a vertex to the polygon

The point will be added to the end of the list of points :type p: rw::math::Vector3D< double > :param p: [in] The point to add

computeCenter()

Computes the center of the polygon as the average of all coordinates :rtype: rw::math::Vector3D< double > :return: Center of the polygon

getVertex(*args)

Overload 1:

returns the index of vertex i of the triangle


Overload 2:

returns the index of vertex i of the triangle

removeVertex(idx)

Removes vertex from the polygon

Parameters

idx (int) – [in] Index of the vertex to remove

size()

Number of vertices of this polygon :rtype: int :return: Number of vertices

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.Polygon2D

Bases: object

indexed polygon class that saves N indices to the N vertices of the polygon

__init__()
addVertex(p)

Adds a vertex to the polygon

The point will be added to the end of the list of points :type p: rw::math::Vector2D< double > :param p: [in] The point to add

computeCenter()

Computes the center of the polygon as the average of all coordinates :rtype: rw::math::Vector2D< double > :return: Center of the polygon

getVertex(*args)

Overload 1:

returns the index of vertex i of the triangle


Overload 2:

returns the index of vertex i of the triangle

removeVertex(idx)

Removes vertex from the polygon

Parameters

idx (int) – [in] Index of the vertex to remove

size()

Number of vertices of this polygon :rtype: int :return: Number of vertices

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.Polygon2D_f

Bases: object

indexed polygon class that saves N indices to the N vertices of the polygon

__init__()
addVertex(p)

Adds a vertex to the polygon

The point will be added to the end of the list of points :type p: rw::math::Vector2D< float > :param p: [in] The point to add

computeCenter()

Computes the center of the polygon as the average of all coordinates :rtype: rw::math::Vector2D< float > :return: Center of the polygon

getVertex(*args)

Overload 1:

returns the index of vertex i of the triangle


Overload 2:

returns the index of vertex i of the triangle

removeVertex(idx)

Removes vertex from the polygon

Parameters

idx (int) – [in] Index of the vertex to remove

size()

Number of vertices of this polygon :rtype: int :return: Number of vertices

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PolygonCPtr(*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.

getVertex(*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

isShared()

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.PolygonPtr(*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(p)

Adds a vertex to the polygon

The point will be added to the end of the list of points :type p: rw::math::Vector3D< double > :param p: [in] The point to add

computeCenter()

Computes the center of the polygon as the average of all coordinates :rtype: rw::math::Vector3D< double > :return: Center of the polygon

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getVertex(*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

isShared()

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.

removeVertex(idx)

Removes vertex from the polygon

Parameters

idx (int) – [in] Index of the vertex to remove

size()

Number of vertices of this polygon :rtype: int :return: Number of vertices

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PolygonUtil(*args, **kwargs)

Bases: object

Utility functions for operations on polygons, such as convex partitioning.

The algorithm for convex partitioning of polygons has time complexity \(O(n r^2 \log r)\) where n is the number of vertices and r is the number of reflex vertices (vertices that gives an inward notch). The algorithm is due to J. Mark Keil [1]. For more information, see also [2] and [3]. The polygons must not contain holes, and no new vertices are introduced (no Steiner points).

[1] Minimum Decompostions of Polygonal Objects. J. Mark Keil. 1985.

[2] http://cgm.cs.mcgill.ca/~athens/cs644/Projects/2004/LiliSang-YunjunLiu/project/MAIN3.htm

[3] On the time bound for convex decomposition of simple polygons. Mark Keil & Jack Snoeyink. 1998. 10th Canadian Conference on Computational Geometry, Aug 1998. See http://www.cs.ubc.ca/~snoeyink/convdecomp for full version paper.

__init__(*args, **kwargs)
static area(polygon)

Get the signed area of a 2D polygon. :type polygon: rw::geometry::Polygon< rw::math::Vector2D< double > > :param polygon: [in] the polygon to find area of. :rtype: float :return: area of the polygon, with negative sign if vertices are given clockwise, or

positive sign if given counter-clockwise.

static convexDecomposition(polygon)

Convex decomposition of a polygon. :type polygon: rw::geometry::Polygon< rw::math::Vector2D< double > > :param polygon: [in] the polygon to decompose into convex subpolygons. :rtype: std::vector< rw::geometry::Polygon< rw::math::Vector2D< double > > > :return: a vector of convex polygons.

static convexDecompositionIndexed(polygon)

Convex decomposition of a polygon. :type polygon: rw::geometry::Polygon< rw::math::Vector2D< double > > :param polygon: [in] the polygon to decompose into convex subpolygons. :rtype: std::vector< std::vector< std::size_t > > :return: a vector of indexed polygons. Each indexed polygon is returned as an ordered

vector of indices.

static isInsideConvex(point, polygon, eps)

Check if point lies inside convex polygon. :type point: rw::math::Vector2D< double > :param point: [in] the point. :type polygon: rw::geometry::Polygon< rw::math::Vector2D< double > > :param polygon: [in] the polygon. :type eps: float :param eps: [in] distance threshold for when to consider a point inside the polygon. :rtype: boolean :return: true if point is strictly inside the polygon, or false if on the border or

outside.

property thisown

The membership flag

sdurw_geometry.sdurw_geometry.PolygonUtil_area(polygon)

Get the signed area of a 2D polygon. :type polygon: rw::geometry::Polygon< rw::math::Vector2D< double > > :param polygon: [in] the polygon to find area of. :rtype: float :return: area of the polygon, with negative sign if vertices are given clockwise, or

positive sign if given counter-clockwise.

sdurw_geometry.sdurw_geometry.PolygonUtil_convexDecomposition(polygon)

Convex decomposition of a polygon. :type polygon: rw::geometry::Polygon< rw::math::Vector2D< double > > :param polygon: [in] the polygon to decompose into convex subpolygons. :rtype: std::vector< rw::geometry::Polygon< rw::math::Vector2D< double > > > :return: a vector of convex polygons.

sdurw_geometry.sdurw_geometry.PolygonUtil_convexDecompositionIndexed(polygon)

Convex decomposition of a polygon. :type polygon: rw::geometry::Polygon< rw::math::Vector2D< double > > :param polygon: [in] the polygon to decompose into convex subpolygons. :rtype: std::vector< std::vector< std::size_t > > :return: a vector of indexed polygons. Each indexed polygon is returned as an ordered

vector of indices.

sdurw_geometry.sdurw_geometry.PolygonUtil_isInsideConvex(point, polygon, eps)

Check if point lies inside convex polygon. :type point: rw::math::Vector2D< double > :param point: [in] the point. :type polygon: rw::geometry::Polygon< rw::math::Vector2D< double > > :param polygon: [in] the polygon. :type eps: float :param eps: [in] distance threshold for when to consider a point inside the polygon. :rtype: boolean :return: true if point is strictly inside the polygon, or false if on the border or

outside.

class sdurw_geometry.sdurw_geometry.Polygon_f

Bases: object

indexed polygon class that saves N indices to the N vertices of the polygon

__init__()
addVertex(p)

Adds a vertex to the polygon

The point will be added to the end of the list of points :type p: rw::math::Vector3D< float > :param p: [in] The point to add

computeCenter()

Computes the center of the polygon as the average of all coordinates :rtype: rw::math::Vector3D< float > :return: Center of the polygon

getVertex(*args)

Overload 1:

returns the index of vertex i of the triangle


Overload 2:

returns the index of vertex i of the triangle

removeVertex(idx)

Removes vertex from the polygon

Parameters

idx (int) – [in] Index of the vertex to remove

size()

Number of vertices of this polygon :rtype: int :return: Number of vertices

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.Polygon_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.

deref()

The pointer stored in the object.

getDeref()

Member access operator.

getVertex(*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

isShared()

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

addVertex(p)

Adds a vertex to the polygon

The point will be added to the end of the list of points :type p: rw::math::Vector3D< float > :param p: [in] The point to add

computeCenter()

Computes the center of the polygon as the average of all coordinates :rtype: rw::math::Vector3D< float > :return: Center of the polygon

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getVertex(*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

isShared()

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.

removeVertex(idx)

Removes vertex from the polygon

Parameters

idx (int) – [in] Index of the vertex to remove

size()

Number of vertices of this polygon :rtype: int :return: Number of vertices

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.Primitive(*args, **kwargs)

Bases: GeometryData

defines an interface for a geometric shape that is defined by a set of parameters.

__init__(*args, **kwargs)
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

getTriMesh(forceCopy=True)

Notes: primitives allways return a new trimesh

isConvex()

test if this geometry data is convex :rtype: boolean :return: true if convex

isInside(point)

test if a point is on the border or inside this primitive

setParameters(q)

set the parameters that define this primitive

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.PrimitiveCPtr(*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)

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]

deref()

The pointer stored in the object.

getDeref()

Member access operator.

getParameters()

get the parameters that define this primitive

getType()

the type of this primitive

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.PrimitivePtr(*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)

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]

deref()

The pointer stored in the object.

getDeref()

Member access operator.

getParameters()

get the parameters that define this primitive

getTriMesh(forceCopy=True)

Notes: primitives allways return a new trimesh

getType()

the type of this primitive

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

isShared()

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)

set the parameters that define this primitive

property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.Pyramid(*args)

Bases: Primitive

a pyrimidal geometric primitive. The pyramid has a rectangular base in the xy-plane and its end pointed lie in the z-axis with a distance from the xy-plane.

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor :type widthx: float :param widthx: [in] width of pyramid in x axis :type widthy: float :param widthy: [in] width of pyramid in y-axis :type height: float :param height: [in] height of pyramid in z-axis

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.PyramidCPtr(*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

isShared()

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.PyramidPtr(*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

isShared()

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

Bases: ConvexHull3D

calculates the convex hull of a set of 3d points.

The GiftWrap convex hull algorithm is used, hence the class name.

Notes: It is important that there are not multiple vertices at the same coordinates. Filter these away before using this convex hull calculation.

__init__()

constructor

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

getPlaneNormals()

Returns the normals of the planes defining the convex hull

getPlaneOffsets()

Returns the offsets of the planes defining the convex hull

getVertices()

Returns the vertices defining the convex hull

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.QHull3DCPtr(*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.

getPlaneNormals()

Returns the normals of the planes defining the convex hull

getPlaneOffsets()

Returns the offsets of the planes defining the convex hull

getVertices()

Returns the vertices defining the convex hull

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.QHull3DPtr(*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)
getMinDistOutside(vertex)
getPlaneNormals()

Returns the normals of the planes defining the convex hull

getPlaneOffsets()

Returns the offsets of the planes defining the convex hull

getVertices()

Returns the vertices defining the convex hull

isInside(vertex)
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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)
property thisown

The membership flag

toTriMesh()
class sdurw_geometry.sdurw_geometry.QuadIndexedFace

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

Bases: BREP

A boundary representation where the geometry of a face is a QuadraticSurface, and an edge curve is a QuadraticCurve.

This implementation adds the geometry related to Quadrics, based on BREP which handles the topology.

To build a geometry composed of Quadratic surfaces and curves, follow the following procedure:

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 with the addEdge function. An edge is added between two vertices using their vertex indexes. The edge requires a QuadraticCurve and two vertex indicies. Notice that the curve must have limits, such that it start 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 indexes. Notice that makeLoop expects the edge indexing to start at 1, and supports negative indices to indicate 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 QuadraticSurface to a loop, by using the setSurface function. Each surface is given an increasing surface index, starting from zero. Notice that this index is not necessarily the same as the loop index.

Together this forms a connected set of surfaces, curves and vertices, that forms a closed geometry. Functions are provided that makes it easy to search for various neighbouring primitives in the boundary representation.

It is also possible to retrieve a non-connected shell representation, either by making a PlainQuadraticShell with all information fully copied, or by using a the more lightweight shellProxy which retrieves its information from the underlying QuadraticBREP.

__init__()

Constructor.

addEdge(curve, v1, v2)

Add a QuadraticCurve to the BREP.

Notice that the curve has direction. It is expected to have limits such that it starts in vertex v1 and end in v2.

Parameters
  • curve (QuadraticCurve) – [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

Curve

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

Surface

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 a QuadraticSurface to a face of the BREP. :type surface: QuadraticSurface :param surface: [in] surface to add. :type loop: int :param loop: [in] the loop index for the loop to attach surface to.

shell()

Get a QuadraticShell representation by copying geometric information to a concrete PlainQuadraticShell object. :rtype: rw::core::Ptr< rw::geometry::PlainQuadraticShell > :return: smart pointer to a PlainQuadraticShell object.

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.QuadraticBREPCPtr(*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

isShared()

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.

shell()

Get a QuadraticShell representation by copying geometric information to a concrete PlainQuadraticShell object. :rtype: rw::core::Ptr< rw::geometry::PlainQuadraticShell > :return: smart pointer to a PlainQuadraticShell object.

shellProxy()
property thisown

The membership flag

verticeCount()

The number of vertices. :rtype: int :return: the number of vertices.

class sdurw_geometry.sdurw_geometry.QuadraticBREPPtr(*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 QuadraticCurve to the BREP.

Notice that the curve has direction. It is expected to have limits such that it starts in vertex v1 and end in v2.

Parameters
  • curve (QuadraticCurve) – [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

isShared()

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 a QuadraticSurface to a face of the BREP. :type surface: QuadraticSurface :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.

shell()

Get a QuadraticShell representation by copying geometric information to a concrete PlainQuadraticShell object. :rtype: rw::core::Ptr< rw::geometry::PlainQuadraticShell > :return: smart pointer to a PlainQuadraticShell object.

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.QuadraticCurve(*args)

Bases: ParametricCurve

A quadratic curve.

A quadratic curve is given explicitly by the expression \(\mathbf{p} = \mathbf{c} + r(t)\mathbf{u} + s(t) \mathbf{v}\) where \(\mathbf{c},\mathbf{u},\mathbf{v},\mathbf{p} \in\mathbb{R}^3\) and \(\mathbf{u}^T \mathbf{v} = 0\) .

The following four types of curves are possible: - Ellipse: \((r,s)=(\sin t,\cos t)\) - Hyperbola: \((r,s)=(\sinh t,\cosh t)\) - Line: \((r,s)=(t,0)\) - Parabola: \((r,s)=(t,t^2)\)

Elliptic = 0

Ellipse \(\mathbf{p} = \mathbf{c} + \mathbf{u} \sin t + \mathbf{v} \cos t\)

Hyperbola = 1

Hyperbola \(\mathbf{p} = \mathbf{c} + \mathbf{u} \sinh t + \mathbf{v} \cosh t\)

Line = 2

Line \(\mathbf{p} = \mathbf{c} + \mathbf{u} t\)

Parabola = 3

Parabola \(\mathbf{p} = \mathbf{c} + \mathbf{u} t + \mathbf{v} t^2\)

__init__(*args)
c()

The point c. :rtype: rw::math::Vector3D< double > :return: the point \(c \in \mathbb{R}^3\).

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.

closestTime(p)

Get the parameter value where the curve is closest 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

float

Returns

the point on the curve closest to p. If multiple points are equally close to p, only one of those points are returned.

closestTimes(p)

Get the parameter values where the curve is closest 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< double >

Returns

a list of parameter values.

copy(rhs)
curvature(t)

The curvature in a given point on the curve.

This function does not take the limits into account.

Parameters

t (float) – [in] the parameter to evaluate the curvature for.

Return type

float

Returns

the curvature.

ddx(t)

Evaluate the second derivative in a point on the curve. :type t: float :param t: [in] the parameter to find second derivative for. :rtype: rw::math::Vector3D< double > :return: a second derivative vector \(p \in \mathbb{R}^3\) .

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.

dx(t)

Evaluate the derivative in a point on the curve. :type t: float :param t: [in] the parameter to find derivative for. :rtype: rw::math::Vector3D< double > :return: a derivative vector \(p \in \mathbb{R}^3\) .

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.

hasLimits()

Check if the curve is limited. :rtype: boolean :return: true if curve is limited, false otherwise.

inLimits(t)

Check if the parameter t is inside the limits set for the curve. :type t: float :param t: [in] the parameter to check. :rtype: boolean :return: true if inside limits, false otherwise.

limits()

Get the limits of the curve segment.

The returned values are only valid when hasLimits() returns true.

Return type

std::pair< double,double >

Returns

the minimum and maximum parameter values on the curve.

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.

setLimits(limits)

Set parameter limits for the curve. :type limits: std::pair< double,double > :param limits: [in] the minimum and maximum parameter values on the curve.

property thisown

The membership flag

transform(*args)

Overload 1: rw::math::Transform3D<double>&) const


Overload 2: rw::math::Vector3D<double>&) const

type()

Get the type of curve. :rtype: int :return: the type of curve.

u()

The vector u. :rtype: rw::math::Vector3D< double > :return: the vector \(u \in \mathbb{R}^3\).

v()

The vector v. :rtype: rw::math::Vector3D< double > :return: the vector \(v \in \mathbb{R}^3\).

x(t)

Evaluate a point on the curve. :type t: float :param t: [in] the parameter to find point for. :rtype: rw::math::Vector3D< double > :return: the vector \(p \in \mathbb{R}^3\) .

class sdurw_geometry.sdurw_geometry.QuadraticCurveCPtr(*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.

c()

The point c. :rtype: rw::math::Vector3D< double > :return: the point \(c \in \mathbb{R}^3\).

clone()
closestPoints(p)
closestTime(p)
closestTimes(p)
curvature(t)
ddx(t)
deref()

The pointer stored in the object.

discretizeAdaptive(stepsPerRevolution)
dx(t)
equals(curve, eps)
extremums(dir)
getDeref()

Member access operator.

hasLimits()
inLimits(t)
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

limits()
obr()
reverse()
scale(factor)
property thisown

The membership flag

transform(*args)

Overload 1: rw::math::Transform3D<double>&) const


Overload 2: rw::math::Vector3D<double>&) const

type()

Get the type of curve. :rtype: int :return: the type of curve.

u()

The vector u. :rtype: rw::math::Vector3D< double > :return: the vector \(u \in \mathbb{R}^3\).

v()

The vector v. :rtype: rw::math::Vector3D< double > :return: the vector \(v \in \mathbb{R}^3\).

x(t)
class sdurw_geometry.sdurw_geometry.QuadraticCurvePtr(*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.

c()

The point c. :rtype: rw::math::Vector3D< double > :return: the point \(c \in \mathbb{R}^3\).

clone()
closestPoints(p)
closestTime(p)
closestTimes(p)
copy(rhs)
cptr()
curvature(t)
ddx(t)
deref()

The pointer stored in the object.

discretizeAdaptive(stepsPerRevolution)
dx(t)
equals(curve, eps)
extremums(dir)
getDeref()

Member access operator.

hasLimits()
inLimits(t)
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

limits()
obr()
reverse()
scale(factor)
setLimits(limits)
property thisown

The membership flag

transform(*args)

Overload 1: rw::math::Transform3D<double>&) const


Overload 2: rw::math::Vector3D<double>&) const

type()

Get the type of curve. :rtype: int :return: the type of curve.

u()

The vector u. :rtype: rw::math::Vector3D< double > :return: the vector \(u \in \mathbb{R}^3\).

v()

The vector v. :rtype: rw::math::Vector3D< double > :return: the vector \(v \in \mathbb{R}^3\).

x(t)
class sdurw_geometry.sdurw_geometry.QuadraticFace(*args)

Bases: Face

A Quadratic surface patch bounded by Quadratic curves.

__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::QuadraticSurface 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

Curve

Returns

a reference to the curve data.

getCurves()

Get the Quadratic curves. :rtype: std::vector< rw::core::Ptr< rw::geometry::QuadraticCurve const > > :return: vector with the curves.

setCurve(vertex, curve)

Set Quadratic curve (a curve has direction) :type vertex: int :param vertex: [in] the start vertex. :type curve: rw::core::Ptr< rw::geometry::QuadraticCurve const > :param curve: [in] the curve.

setCurves(curves)

Set the Quadratic curves. :type curves: std::vector< rw::core::Ptr< rw::geometry::QuadraticCurve const > > :param curves: [in] vector of directed curves.

setSurface(*args)

Overload 1:

Set Quadratic surface. :type surface: rw::core::Ptr< rw::geometry::QuadraticSurface const > :param surface: [in] the surface.


Overload 2:

Set surface. :type surface: QuadraticSurface :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: Surface :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.QuadraticFaceCPtr(*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 Quadratic curves. :rtype: std::vector< rw::core::Ptr< rw::geometry::QuadraticCurve 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

isShared()

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.QuadraticFacePtr(*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 Quadratic curves. :rtype: std::vector< rw::core::Ptr< rw::geometry::QuadraticCurve 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

isShared()

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 Quadratic curve (a curve has direction) :type vertex: int :param vertex: [in] the start vertex. :type curve: rw::core::Ptr< rw::geometry::QuadraticCurve const > :param curve: [in] the curve.

setCurves(curves)

Set the Quadratic curves. :type curves: std::vector< rw::core::Ptr< rw::geometry::QuadraticCurve 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 Quadratic surface. :type surface: rw::core::Ptr< rw::geometry::QuadraticSurface const > :param surface: [in] the surface.


Overload 2:

Set surface. :type surface: QuadraticSurface :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.QuadraticShell(*args, **kwargs)

Bases: Shell

A collection of Quadratic surface patches, that together form a shell.

__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: QuadraticFace :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.QuadraticShellCPtr(*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: QuadraticFace :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

isShared()

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.QuadraticShellPtr(*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: QuadraticFace :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

isShared()

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.QuadraticSurface(*args)

Bases: ImplicitSurface

A quadratic surface.

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

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

where

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

A()

Get the 3 x 3 symmetric matrix for the second order term in the implicit formulation.

__init__(*args)

Overload 1:

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

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

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

Parameters
  • A (Eigen::Diagonal< Eigen::Matrix3d >) – [in] the diagonal of the A matrix.

  • a (Eigen::Vector3d) – [in] the vector \(a \in \mathbb{R}^3\) .

  • u (float) – [in] the scalar offset \(u \in \mathbb{R}\) .

  • conditions (std::vector< rw::geometry::QuadraticSurface::TrimmingRegion >, optional) – [in] (optional) list of trimming conditions.


Overload 2:

Eigen::Diagonal<Eigen::Matrix3d>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)


Overload 3:

Eigen::Diagonal<Eigen::Matrix3d>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)


Overload 4:

Construct new quadratic surface of the implicit form \(x^T A x + 2 a^T x + u =0\) when A is non-diagonal. :type A: Eigen::SelfAdjointView< Eigen::Matrix3d const,Eigen::Upper > :param A: [in] a view of the upper part of the symmetric matrix \(A \in\mathbb{R}^{3\times3}\) . Use the Eigen function A.selfadjointView<Eigen::Upper>() to

extract the upper part.

Parameters
  • a (Eigen::Vector3d) – [in] the vector \(a \in \mathbb{R}^3\) .

  • u (float) – [in] the scalar offset \(u \in \mathbb{R}\) .

  • conditions (std::vector< rw::geometry::QuadraticSurface::TrimmingRegion >, optional) – [in] (optional) list of trimming conditions.


Overload 5:

Construct new quadratic surface of the implicit form \(x^T A x + 2 a^T x + u =0\) when A is non-diagonal. :type A: Eigen::SelfAdjointView< Eigen::Matrix3d const,Eigen::Upper > :param A: [in] a view of the upper part of the symmetric matrix \(A \in\mathbb{R}^{3\times3}\) . Use the Eigen function A.selfadjointView<Eigen::Upper>() to

extract the upper part.

Parameters
  • a (Eigen::Vector3d) – [in] the vector \(a \in \mathbb{R}^3\) .

  • u (float) – [in] the scalar offset \(u \in \mathbb{R}\) .

  • conditions – [in] (optional) list of trimming conditions.


Overload 6:

Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Upper>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)


Overload 7:

Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Upper>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)


Overload 8:

Construct new quadratic surface of the implicit form \(x^T A x + 2 a^T x + u =0\) when A is non-diagonal. :type A: Eigen::SelfAdjointView< Eigen::Matrix3d const,Eigen::Lower > :param A: [in] a view of the lower part of the symmetric matrix \(A \in\mathbb{R}^{3\times3}\) . Use the Eigen function A.selfadjointView<Eigen::Lower>() to

extract the lower part.

Parameters
  • a (Eigen::Vector3d) – [in] the vector \(a \in \mathbb{R}^3\) .

  • u (float) – [in] the scalar offset \(u \in \mathbb{R}\) .

  • conditions (std::vector< rw::geometry::QuadraticSurface::TrimmingRegion >, optional) – [in] (optional) list of trimming conditions.


Overload 9:

Construct new quadratic surface of the implicit form \(x^T A x + 2 a^T x + u =0\) when A is non-diagonal. :type A: Eigen::SelfAdjointView< Eigen::Matrix3d const,Eigen::Lower > :param A: [in] a view of the lower part of the symmetric matrix \(A \in\mathbb{R}^{3\times3}\) . Use the Eigen function A.selfadjointView<Eigen::Lower>() to

extract the lower part.

Parameters
  • a (Eigen::Vector3d) – [in] the vector \(a \in \mathbb{R}^3\) .

  • u (float) – [in] the scalar offset \(u \in \mathbb{R}\) .

  • conditions – [in] (optional) list of trimming conditions.


Overload 10:

Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Lower>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)


Overload 11:

Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Lower>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)

a()

Get the 3d vector for the first order term in the implicit formulation.

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.

determinantA()

Get the determinant of the \(\mathbf{A}\) matrix. :rtype: float :return: the determinant.

diagonalize()

Get a diagonalization of the surface. :rtype: std::pair< rw::geometry::QuadraticSurface,rw::math::Rotation3D< > > :return: the diagonalized surface, and the rotation transforming this surface into the

diagonalized surface.

diagonalized()

Check if this surface is diagonalized. :rtype: boolean :return: true if A is digaonalized, false otherwise.

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 considered

identical.

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

static makeCircularCone(a, b)

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

Image: geometry/quadrics_circular_cone.gif(“Normal form of Quadratic Surface:) Circular Cone (special case of elliptic cone).”

Parameters
  • a (float) – [in] radius of the circle in the \(x_1\) and \(x_2\) directions when \(x_3=c\) .

  • b (float) – [in] rate of change for the radius.

Return type

Ptr

Returns

a QuadraticSurface representation of a circular cone.

static makeCircularCylinder(radius, outward=True)

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

Image: geometry/quadrics_circular_cylinder.gif(“Normal form of Quadratic Surface:) Circular Cylinder (special case of elliptic cylinder).”

Parameters
  • radius (float) – [in] radius in the \(x_1\) and \(x_2\) directions.

  • outward (boolean, optional) – [in] (optional) set to false to create inner surface of cylinder, with normals pointing inwards.

Return type

Ptr

Returns

a QuadraticSurface representation of a circular cylinder.

static makeCircularHyperboloidOneSheet(a, b)

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

Image: geometry/quadrics_circular_hyperboloid_onesheet.gif(“Normal form of Quadratic) Surface: Circular Hyperboloid of One Sheet (special case of elliptic hyperboloid of one sheet).”

Parameters
  • a (float) – [in] radius of the circle in the \(x_1\) and \(x_2\) directions when \(x_3=0\) .

  • b (float) – [in] radius is scaled along \(x_3\) , to \(\frac{a}{c}\sqrt{x_3^2+c^2}\) .

Return type

Ptr

Returns

a QuadraticSurface representation of a circular hyperboloid of one sheet.

static makeCircularHyperboloidTwoSheets(a, b)

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

Image: geometry/quadrics_circular_hyperboloid_twosheets.gif(“Normal form of) Quadratic Surface: Circular Hyperboloid of Two Sheets (special case of elliptic hyperboloid of two sheets).”

Parameters
  • a (float) – [in] radius of the circle in the \(x_1\) and \(x_2\) directions when \(x_3=\pm\sqrt{2}b\) .

  • b (float) – [in] distance from origo to each of the the two sheets.

Return type

Ptr

Returns

a QuadraticSurface representation of a circular hyperboloid of two sheets.

static makeCircularParaboloid(a)

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

Image: geometry/quadrics_circular_paraboloid.gif(“Normal form of Quadratic Surface:) Circular Paraboloid (special case of elliptic paraboloid).”

Parameters

a (float) – [in] radius of the circle when \(x_3=1\) .

Return type

Ptr

Returns

a QuadraticSurface representation of a circular paraboloid.

static makeEllipsoid(a, b, c)

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

Image: geometry/quadrics_ellipsoid.gif(“Normal form of Quadratic Surface:) Ellipsoid.”

Parameters
  • a (float) – [in] radius in the \(x_1\) direction.

  • b (float) – [in] radius in the \(x_2\) direction.

  • c (float) – [in] radius in the \(x_3\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of an ellipsoid.

static makeEllipticCone(a, b, c)

Create an elliptic cone.

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

Image: geometry/quadrics_elliptic_cone.gif(“Normal form of Quadratic Surface:) Elliptic Cone.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=c\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=c\) .

  • c (float) – [in] rate of change for the radius.

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic cone.

static makeEllipticCylinder(a, b)

Create an elliptic cylinder.

Image: geometry/quadrics_elliptic_cylinder.gif(“Normal form of Quadratic Surface:) Elliptic Cylinder.”

Parameters
  • a (float) – [in] radius in the \(x_1\) direction.

  • b (float) – [in] radius in the \(x_2\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic cylinder.

static makeEllipticHyperboloidOneSheet(a, b, c)

Create an elliptic hyperboloid of one sheet.

Image: geometry/quadrics_elliptic_hyperboloid_onesheet.gif(“Normal form of Quadratic) Surface: Elliptic Hyperboloid of One Sheet.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=0\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=0\) .

  • c (float) – [in] radius is scaled with the factor \(\frac{1}{c}\sqrt{x_3^2+c^2}\) .

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic hyperboloid of one sheet.

static makeEllipticHyperboloidTwoSheets(a, b, c)

Create an elliptic hyperboloid of two sheets.

Image: geometry/quadrics_elliptic_hyperboloid_twosheets.gif(“Normal form of) Quadratic Surface: Elliptic Hyperboloid of Two Sheets.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=\pm\sqrt{2}c\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=\pm\sqrt{2}c\) .

  • c (float) – [in] distance from origo to each of the the two sheets.

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic hyperboloid of two sheets.

static makeEllipticParaboloid(a, b)

Create an elliptic paraboloid.

Image: geometry/quadrics_elliptic_paraboloid.gif(“Normal form of Quadratic Surface:) Elliptic Paraboloid.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=1\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=1\) .

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic paraboloid.

static makeHyperbolicCylinder(a, b)

Create a hyperbolic cylinder.

Image: geometry/quadrics_hyperbolic_cylinder.gif(“Normal form of Quadratic Surface:) Hyperbolic Cylinder.”

Parameters
  • a (float) – [in] width in the \(x_1\) direction at \(x_2=0\) .

  • b (float) – [in] controls the rate of change in the \(x_1\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of a hyperbolic cylinder.

static makeHyperbolicParaboloid(a, b)

Create a hyperbolic paraboloid.

Image: geometry/quadrics_hyperbolic_paraboloid.gif(“Normal form of Quadratic) Surface: Hyperbolic Paraboloid.”

Parameters
  • a (float) – [in] width in the \(x_1\) direction when \(x_3=1\) .

  • b (float) – [in] width in the \(x_2\) direction when \(x_3=-1\) .

Return type

Ptr

Returns

a QuadraticSurface representation of a hyperbolic paraboloid.

static makeParabolicCylinder(a)

Create a parabolic cylinder.

Image: geometry/quadrics_parabolic_cylinder.gif(“Normal form of Quadratic Surface:) Parabolic Cylinder.”

Parameters

a (float) – [in] controls the focal length of the parabola.

Return type

Ptr

Returns

a QuadraticSurface representation of a parabolic cylinder.

static makePlane(n, d)

Represent a plane as a QuadraticSurface.

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

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

Parameters
  • n (rw::math::Vector3D< double >) – [in] the normal of the plane.

  • d (float) – [in] the distance from the plane to the origo.

Return type

Ptr

Returns

a QuadraticSurface representing a plane.

static makeSphere(radius)

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

Image: geometry/quadrics_sphere.gif(“Normal form of Quadratic Surface: Sphere) (special case of ellipsoid and spheroid).”

Parameters

radius (float) – [in] radius of the sphere.

Return type

Ptr

Returns

a QuadraticSurface representation of a sphere.

static makeSpheroid(a, b)

Create a spheroid (special case of the ellipsoid).

Image: geometry/quadrics_spheroid.gif(“Normal form of Quadratic Surface: Spheroid) (special case of ellipsoid).”

Parameters
  • a (float) – [in] radius in the \(x_1\) and \(x_2\) directions.

  • b (float) – [in] radius in the \(x_3\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of a spheroid.

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.

normalize()

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

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

Return type

Ptr

Returns

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

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

u()

Get the scalar for the zero order term in the implicit formulation.

class sdurw_geometry.sdurw_geometry.QuadraticSurfaceCPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

A()

Get the 3 x 3 symmetric matrix for the second order term in the implicit formulation.

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

a()

Get the 3d vector for the first order term in the implicit formulation.

clone()
deref()

The pointer stored in the object.

determinantA()

Get the determinant of the \(\mathbf{A}\) matrix. :rtype: float :return: the determinant.

diagonalize()

Get a diagonalization of the surface. :rtype: std::pair< rw::geometry::QuadraticSurface,rw::math::Rotation3D< > > :return: the diagonalized surface, and the rotation transforming this surface into the

diagonalized surface.

diagonalized()

Check if this surface is diagonalized. :rtype: boolean :return: true if A is digaonalized, false otherwise.

equals(surface, threshold)
extremums(direction)
getDeref()

Member access operator.

getTriMesh(*args)
getTrimmingConditions()

Get the trimming conditions for the surface. :rtype: std::vector< rw::geometry::QuadraticSurface::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

isShared()

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)
normalize()

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

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

Return type

Ptr

Returns

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

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

u()

Get the scalar for the zero order term in the implicit formulation.

class sdurw_geometry.sdurw_geometry.QuadraticSurfacePtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

A()

Get the 3 x 3 symmetric matrix for the second order term in the implicit formulation.

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

a()

Get the 3d vector for the first order term in the implicit formulation.

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.

determinantA()

Get the determinant of the \(\mathbf{A}\) matrix. :rtype: float :return: the determinant.

diagonalize()

Get a diagonalization of the surface. :rtype: std::pair< rw::geometry::QuadraticSurface,rw::math::Rotation3D< > > :return: the diagonalized surface, and the rotation transforming this surface into the

diagonalized surface.

diagonalized()

Check if this surface is diagonalized. :rtype: boolean :return: true if A is digaonalized, false otherwise.

equals(surface, threshold)
extremums(direction)
getDeref()

Member access operator.

getTriMesh(*args)
getTrimmingConditions()

Get the trimming conditions for the surface. :rtype: std::vector< rw::geometry::QuadraticSurface::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

isShared()

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.

makeCircularCone(a, b)

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

Image: geometry/quadrics_circular_cone.gif(“Normal form of Quadratic Surface:) Circular Cone (special case of elliptic cone).”

Parameters
  • a (float) – [in] radius of the circle in the \(x_1\) and \(x_2\) directions when \(x_3=c\) .

  • b (float) – [in] rate of change for the radius.

Return type

Ptr

Returns

a QuadraticSurface representation of a circular cone.

makeCircularCylinder(radius, outward=True)

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

Image: geometry/quadrics_circular_cylinder.gif(“Normal form of Quadratic Surface:) Circular Cylinder (special case of elliptic cylinder).”

Parameters
  • radius (float) – [in] radius in the \(x_1\) and \(x_2\) directions.

  • outward (boolean, optional) – [in] (optional) set to false to create inner surface of cylinder, with normals pointing inwards.

Return type

Ptr

Returns

a QuadraticSurface representation of a circular cylinder.

makeCircularHyperboloidOneSheet(a, b)

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

Image: geometry/quadrics_circular_hyperboloid_onesheet.gif(“Normal form of Quadratic) Surface: Circular Hyperboloid of One Sheet (special case of elliptic hyperboloid of one sheet).”

Parameters
  • a (float) – [in] radius of the circle in the \(x_1\) and \(x_2\) directions when \(x_3=0\) .

  • b (float) – [in] radius is scaled along \(x_3\) , to \(\frac{a}{c}\sqrt{x_3^2+c^2}\) .

Return type

Ptr

Returns

a QuadraticSurface representation of a circular hyperboloid of one sheet.

makeCircularHyperboloidTwoSheets(a, b)

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

Image: geometry/quadrics_circular_hyperboloid_twosheets.gif(“Normal form of) Quadratic Surface: Circular Hyperboloid of Two Sheets (special case of elliptic hyperboloid of two sheets).”

Parameters
  • a (float) – [in] radius of the circle in the \(x_1\) and \(x_2\) directions when \(x_3=\pm\sqrt{2}b\) .

  • b (float) – [in] distance from origo to each of the the two sheets.

Return type

Ptr

Returns

a QuadraticSurface representation of a circular hyperboloid of two sheets.

makeCircularParaboloid(a)

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

Image: geometry/quadrics_circular_paraboloid.gif(“Normal form of Quadratic Surface:) Circular Paraboloid (special case of elliptic paraboloid).”

Parameters

a (float) – [in] radius of the circle when \(x_3=1\) .

Return type

Ptr

Returns

a QuadraticSurface representation of a circular paraboloid.

makeEllipsoid(a, b, c)

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

Image: geometry/quadrics_ellipsoid.gif(“Normal form of Quadratic Surface:) Ellipsoid.”

Parameters
  • a (float) – [in] radius in the \(x_1\) direction.

  • b (float) – [in] radius in the \(x_2\) direction.

  • c (float) – [in] radius in the \(x_3\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of an ellipsoid.

makeEllipticCone(a, b, c)

Create an elliptic cone.

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

Image: geometry/quadrics_elliptic_cone.gif(“Normal form of Quadratic Surface:) Elliptic Cone.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=c\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=c\) .

  • c (float) – [in] rate of change for the radius.

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic cone.

makeEllipticCylinder(a, b)

Create an elliptic cylinder.

Image: geometry/quadrics_elliptic_cylinder.gif(“Normal form of Quadratic Surface:) Elliptic Cylinder.”

Parameters
  • a (float) – [in] radius in the \(x_1\) direction.

  • b (float) – [in] radius in the \(x_2\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic cylinder.

makeEllipticHyperboloidOneSheet(a, b, c)

Create an elliptic hyperboloid of one sheet.

Image: geometry/quadrics_elliptic_hyperboloid_onesheet.gif(“Normal form of Quadratic) Surface: Elliptic Hyperboloid of One Sheet.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=0\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=0\) .

  • c (float) – [in] radius is scaled with the factor \(\frac{1}{c}\sqrt{x_3^2+c^2}\) .

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic hyperboloid of one sheet.

makeEllipticHyperboloidTwoSheets(a, b, c)

Create an elliptic hyperboloid of two sheets.

Image: geometry/quadrics_elliptic_hyperboloid_twosheets.gif(“Normal form of) Quadratic Surface: Elliptic Hyperboloid of Two Sheets.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=\pm\sqrt{2}c\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=\pm\sqrt{2}c\) .

  • c (float) – [in] distance from origo to each of the the two sheets.

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic hyperboloid of two sheets.

makeEllipticParaboloid(a, b)

Create an elliptic paraboloid.

Image: geometry/quadrics_elliptic_paraboloid.gif(“Normal form of Quadratic Surface:) Elliptic Paraboloid.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=1\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=1\) .

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic paraboloid.

makeHyperbolicCylinder(a, b)

Create a hyperbolic cylinder.

Image: geometry/quadrics_hyperbolic_cylinder.gif(“Normal form of Quadratic Surface:) Hyperbolic Cylinder.”

Parameters
  • a (float) – [in] width in the \(x_1\) direction at \(x_2=0\) .

  • b (float) – [in] controls the rate of change in the \(x_1\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of a hyperbolic cylinder.

makeHyperbolicParaboloid(a, b)

Create a hyperbolic paraboloid.

Image: geometry/quadrics_hyperbolic_paraboloid.gif(“Normal form of Quadratic) Surface: Hyperbolic Paraboloid.”

Parameters
  • a (float) – [in] width in the \(x_1\) direction when \(x_3=1\) .

  • b (float) – [in] width in the \(x_2\) direction when \(x_3=-1\) .

Return type

Ptr

Returns

a QuadraticSurface representation of a hyperbolic paraboloid.

makeParabolicCylinder(a)

Create a parabolic cylinder.

Image: geometry/quadrics_parabolic_cylinder.gif(“Normal form of Quadratic Surface:) Parabolic Cylinder.”

Parameters

a (float) – [in] controls the focal length of the parabola.

Return type

Ptr

Returns

a QuadraticSurface representation of a parabolic cylinder.

makePlane(n, d)

Represent a plane as a QuadraticSurface.

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

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

Parameters
  • n (rw::math::Vector3D< double >) – [in] the normal of the plane.

  • d (float) – [in] the distance from the plane to the origo.

Return type

Ptr

Returns

a QuadraticSurface representing a plane.

makeSphere(radius)

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

Image: geometry/quadrics_sphere.gif(“Normal form of Quadratic Surface: Sphere) (special case of ellipsoid and spheroid).”

Parameters

radius (float) – [in] radius of the sphere.

Return type

Ptr

Returns

a QuadraticSurface representation of a sphere.

makeSpheroid(a, b)

Create a spheroid (special case of the ellipsoid).

Image: geometry/quadrics_spheroid.gif(“Normal form of Quadratic Surface: Spheroid) (special case of ellipsoid).”

Parameters
  • a (float) – [in] radius in the \(x_1\) and \(x_2\) directions.

  • b (float) – [in] radius in the \(x_3\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of a spheroid.

normal(x)
normalize()

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

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

Return type

Ptr

Returns

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

reuseTrimmingRegions(surface)
scale(factor)
setDiscretizationResolution(resolution)
setTrimmingConditions(conditions)

Set the trimming conditions of this surface. :type conditions: std::vector< rw::geometry::QuadraticSurface::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

u()

Get the scalar for the zero order term in the implicit formulation.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeCircularCone(a, b)

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

Image: geometry/quadrics_circular_cone.gif(“Normal form of Quadratic Surface:) Circular Cone (special case of elliptic cone).”

Parameters
  • a (float) – [in] radius of the circle in the \(x_1\) and \(x_2\) directions when \(x_3=c\) .

  • b (float) – [in] rate of change for the radius.

Return type

Ptr

Returns

a QuadraticSurface representation of a circular cone.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeCircularCylinder(radius, outward=True)

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

Image: geometry/quadrics_circular_cylinder.gif(“Normal form of Quadratic Surface:) Circular Cylinder (special case of elliptic cylinder).”

Parameters
  • radius (float) – [in] radius in the \(x_1\) and \(x_2\) directions.

  • outward (boolean, optional) – [in] (optional) set to false to create inner surface of cylinder, with normals pointing inwards.

Return type

Ptr

Returns

a QuadraticSurface representation of a circular cylinder.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeCircularHyperboloidOneSheet(a, b)

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

Image: geometry/quadrics_circular_hyperboloid_onesheet.gif(“Normal form of Quadratic) Surface: Circular Hyperboloid of One Sheet (special case of elliptic hyperboloid of one sheet).”

Parameters
  • a (float) – [in] radius of the circle in the \(x_1\) and \(x_2\) directions when \(x_3=0\) .

  • b (float) – [in] radius is scaled along \(x_3\) , to \(\frac{a}{c}\sqrt{x_3^2+c^2}\) .

Return type

Ptr

Returns

a QuadraticSurface representation of a circular hyperboloid of one sheet.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeCircularHyperboloidTwoSheets(a, b)

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

Image: geometry/quadrics_circular_hyperboloid_twosheets.gif(“Normal form of) Quadratic Surface: Circular Hyperboloid of Two Sheets (special case of elliptic hyperboloid of two sheets).”

Parameters
  • a (float) – [in] radius of the circle in the \(x_1\) and \(x_2\) directions when \(x_3=\pm\sqrt{2}b\) .

  • b (float) – [in] distance from origo to each of the the two sheets.

Return type

Ptr

Returns

a QuadraticSurface representation of a circular hyperboloid of two sheets.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeCircularParaboloid(a)

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

Image: geometry/quadrics_circular_paraboloid.gif(“Normal form of Quadratic Surface:) Circular Paraboloid (special case of elliptic paraboloid).”

Parameters

a (float) – [in] radius of the circle when \(x_3=1\) .

Return type

Ptr

Returns

a QuadraticSurface representation of a circular paraboloid.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeEllipsoid(a, b, c)

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

Image: geometry/quadrics_ellipsoid.gif(“Normal form of Quadratic Surface:) Ellipsoid.”

Parameters
  • a (float) – [in] radius in the \(x_1\) direction.

  • b (float) – [in] radius in the \(x_2\) direction.

  • c (float) – [in] radius in the \(x_3\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of an ellipsoid.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeEllipticCone(a, b, c)

Create an elliptic cone.

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

Image: geometry/quadrics_elliptic_cone.gif(“Normal form of Quadratic Surface:) Elliptic Cone.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=c\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=c\) .

  • c (float) – [in] rate of change for the radius.

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic cone.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeEllipticCylinder(a, b)

Create an elliptic cylinder.

Image: geometry/quadrics_elliptic_cylinder.gif(“Normal form of Quadratic Surface:) Elliptic Cylinder.”

Parameters
  • a (float) – [in] radius in the \(x_1\) direction.

  • b (float) – [in] radius in the \(x_2\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic cylinder.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeEllipticHyperboloidOneSheet(a, b, c)

Create an elliptic hyperboloid of one sheet.

Image: geometry/quadrics_elliptic_hyperboloid_onesheet.gif(“Normal form of Quadratic) Surface: Elliptic Hyperboloid of One Sheet.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=0\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=0\) .

  • c (float) – [in] radius is scaled with the factor \(\frac{1}{c}\sqrt{x_3^2+c^2}\) .

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic hyperboloid of one sheet.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeEllipticHyperboloidTwoSheets(a, b, c)

Create an elliptic hyperboloid of two sheets.

Image: geometry/quadrics_elliptic_hyperboloid_twosheets.gif(“Normal form of) Quadratic Surface: Elliptic Hyperboloid of Two Sheets.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=\pm\sqrt{2}c\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=\pm\sqrt{2}c\) .

  • c (float) – [in] distance from origo to each of the the two sheets.

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic hyperboloid of two sheets.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeEllipticParaboloid(a, b)

Create an elliptic paraboloid.

Image: geometry/quadrics_elliptic_paraboloid.gif(“Normal form of Quadratic Surface:) Elliptic Paraboloid.”

Parameters
  • a (float) – [in] radius of the ellipse in the \(x_1\) direction when \(x_3=1\) .

  • b (float) – [in] radius of the ellipse in the \(x_2\) direction when \(x_3=1\) .

Return type

Ptr

Returns

a QuadraticSurface representation of an elliptic paraboloid.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeHyperbolicCylinder(a, b)

Create a hyperbolic cylinder.

Image: geometry/quadrics_hyperbolic_cylinder.gif(“Normal form of Quadratic Surface:) Hyperbolic Cylinder.”

Parameters
  • a (float) – [in] width in the \(x_1\) direction at \(x_2=0\) .

  • b (float) – [in] controls the rate of change in the \(x_1\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of a hyperbolic cylinder.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeHyperbolicParaboloid(a, b)

Create a hyperbolic paraboloid.

Image: geometry/quadrics_hyperbolic_paraboloid.gif(“Normal form of Quadratic) Surface: Hyperbolic Paraboloid.”

Parameters
  • a (float) – [in] width in the \(x_1\) direction when \(x_3=1\) .

  • b (float) – [in] width in the \(x_2\) direction when \(x_3=-1\) .

Return type

Ptr

Returns

a QuadraticSurface representation of a hyperbolic paraboloid.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeParabolicCylinder(a)

Create a parabolic cylinder.

Image: geometry/quadrics_parabolic_cylinder.gif(“Normal form of Quadratic Surface:) Parabolic Cylinder.”

Parameters

a (float) – [in] controls the focal length of the parabola.

Return type

Ptr

Returns

a QuadraticSurface representation of a parabolic cylinder.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makePlane(n, d)

Represent a plane as a QuadraticSurface.

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

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

Parameters
  • n (rw::math::Vector3D< double >) – [in] the normal of the plane.

  • d (float) – [in] the distance from the plane to the origo.

Return type

Ptr

Returns

a QuadraticSurface representing a plane.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeSphere(radius)

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

Image: geometry/quadrics_sphere.gif(“Normal form of Quadratic Surface: Sphere) (special case of ellipsoid and spheroid).”

Parameters

radius (float) – [in] radius of the sphere.

Return type

Ptr

Returns

a QuadraticSurface representation of a sphere.

sdurw_geometry.sdurw_geometry.QuadraticSurface_makeSpheroid(a, b)

Create a spheroid (special case of the ellipsoid).

Image: geometry/quadrics_spheroid.gif(“Normal form of Quadratic Surface: Spheroid) (special case of ellipsoid).”

Parameters
  • a (float) – [in] radius in the \(x_1\) and \(x_2\) directions.

  • b (float) – [in] radius in the \(x_3\) direction.

Return type

Ptr

Returns

a QuadraticSurface representation of a spheroid.

class sdurw_geometry.sdurw_geometry.QuadraticUtil(*args, **kwargs)

Bases: object

Utility functions for operations on quadratic surfaces and curves.

Functions are provided to find approximate closest points between different combinations of quadratics surfaces and curves.

__init__(*args, **kwargs)
static closestPointsApproximation(*args)

Overload 1:

Find and approximation of the closest points between two surfaces s1 and s2.

The approximation is valid when the distance is small. Only closest points within the trimming regions will give a result.

Parameters
  • s1 (QuadraticSurface) – [in] the first surface.

  • s2 (QuadraticSurface) – [in] the second surface.

  • result (rw::geometry::QuadraticUtil::PointPair) – [out] the result (only valid if the function returns true).

  • epsIn (float) – [in] threshold for penetration depth.

  • epsOut (float) – [in] threshold for distance.

Return type

boolean

Returns

true if there is a closest point pair within the given limits.


Overload 2:

Find and approximation of the closest points between a surface s and a curve c.

The approximation is valid when the distance is small. Only closest points within the trimming region of surface s and within the limits of curve c will give a result.

Parameters
  • s (QuadraticSurface) – [in] the surface.

  • c (QuadraticCurve) – [in] the curve.

  • result (rw::geometry::QuadraticUtil::PointPair) – [out] the result (only valid if the function returns true).

  • epsIn (float) – [in] threshold for penetration depth.

  • epsOut (float) – [in] threshold for distance.

Return type

boolean

Returns

true if there is a closest point pair within the given limits.

static closestTimesApproximation(sa1, sa2, ca, cb)

Find an approximation of the curve parameter values of curves ca and cb at the closest points.

The approximation is valid when the distance is small. Only closest points within the limits of both curves will give a result.

Parameters
Return type

std::vector< std::pair< double,double > >

Returns

a list of pairs of curve parameter values at the closest points.

property thisown

The membership flag

sdurw_geometry.sdurw_geometry.QuadraticUtil_closestPointsApproximation(*args)

Overload 1:

Find and approximation of the closest points between two surfaces s1 and s2.

The approximation is valid when the distance is small. Only closest points within the trimming regions will give a result.

Parameters
  • s1 (QuadraticSurface) – [in] the first surface.

  • s2 (QuadraticSurface) – [in] the second surface.

  • result (rw::geometry::QuadraticUtil::PointPair) – [out] the result (only valid if the function returns true).

  • epsIn (float) – [in] threshold for penetration depth.

  • epsOut (float) – [in] threshold for distance.

Return type

boolean

Returns

true if there is a closest point pair within the given limits.


Overload 2:

Find and approximation of the closest points between a surface s and a curve c.

The approximation is valid when the distance is small. Only closest points within the trimming region of surface s and within the limits of curve c will give a result.

Parameters
  • s (QuadraticSurface) – [in] the surface.

  • c (QuadraticCurve) – [in] the curve.

  • result (rw::geometry::QuadraticUtil::PointPair) – [out] the result (only valid if the function returns true).

  • epsIn (float) – [in] threshold for penetration depth.

  • epsOut (float) – [in] threshold for distance.

Return type

boolean

Returns

true if there is a closest point pair within the given limits.

sdurw_geometry.sdurw_geometry.QuadraticUtil_closestTimesApproximation(sa1, sa2, ca, cb)

Find an approximation of the curve parameter values of curves ca and cb at the closest points.

The approximation is valid when the distance is small. Only closest points within the limits of both curves will give a result.

Parameters
Return type

std::vector< std::pair< double,double > >

Returns

a list of pairs of curve parameter values at the closest points.

class sdurw_geometry.sdurw_geometry.Shell(*args, **kwargs)

Bases: GeometryData

A shell represents the geometry of an object as a collection of non-connected faces.

Each face is composed of a trimmed surface, the edge curves, and vertices that connects the edges. Contrary to the BREP representation, the shell representation holds no information about how each face is connected to the neighbouring faces.

__init__(*args, **kwargs)
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.

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.

getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getType()

the type of this primitive

isConvex()

test if this geometry data is convex :rtype: boolean :return: true if convex

obb()

Create Oriented Bounding Box (OBB) as a bounding volume for the shell. :rtype: rw::geometry::OBB< > :return: the OBB.

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.ShellCPtr(*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.

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

isShared()

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()

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.ShellPtr(*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.

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

isShared()

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()

Get the number of surface patches in this shell. :rtype: int :return: the number of surface patches.

property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.Sphere(*args)

Bases: Primitive

a sphere primitive. centr in (0,0,0) and a radius.

__init__(*args)

Overload 1: constructor


Overload 2: constructor


Overload 3: constructor

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

getRadius()

get sphere 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.SphereCPtr(*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()
getRadius()

get sphere radius

getType()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

Bases: BVDistanceCalcSphereDistanceCalc

class for testing if two Oriented Bounding Boxes are overlapping

__init__()

constructor

distance(*args)

Overload 1:

Calculates the distance between two bounding spheres.


Overload 2:

Calculates the distance between two bounding spheres.

distanceSqr(a, b, aTb)

calculates the squared distance between two bounding spheres.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.SphereDistanceCalcCPtr(*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

isShared()

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.SphereDistanceCalcPtr(*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.

distance(*args)

Overload 1:

Calculates the distance between two bounding spheres.


Overload 2:

Calculates the distance between two bounding spheres.

distanceSqr(a, b, aTb)

calculates the squared distance between two bounding spheres.

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

Bases: BVDistanceCalcSphereDistanceCalc_f

class for testing if two Oriented Bounding Boxes are overlapping

__init__()

constructor

distance(*args)

Overload 1:

Calculates the distance between two bounding spheres.


Overload 2:

Calculates the distance between two bounding spheres.

distanceSqr(a, b, aTb)

calculates the squared distance between two bounding spheres.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.SpherePtr(*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()
getRadius()

get sphere 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

isShared()

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.Surface(*args, **kwargs)

Bases: object

Surface is an abstract representation of a smooth surface geometry.

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

__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 considered

identical.

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.

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:

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


Overload 2:

Move the surface without rotation.

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

Parameters

P (rw::math::Vector3D< double >) – [in] the translation vector to the new surface.

Return type

Ptr

Returns

pointer to a new surface.

class sdurw_geometry.sdurw_geometry.SurfaceCPtr(*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()

Clone the surface. :rtype: Ptr :return: pointer to copy of surface.

deref()

The pointer stored in the object.

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 considered

identical.

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.

getDeref()

Member access operator.

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.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

property thisown

The membership flag

transform(*args)

Overload 1:

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


Overload 2:

Move the surface without rotation.

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

Parameters

P (rw::math::Vector3D< double >) – [in] the translation vector to the new surface.

Return type

Ptr

Returns

pointer to a new surface.

class sdurw_geometry.sdurw_geometry.SurfacePtr(*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()

Clone the surface. :rtype: Ptr :return: pointer to copy of surface.

cptr()
deref()

The pointer stored in the object.

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 considered

identical.

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.

getDeref()

Member access operator.

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.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

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


Overload 2:

Move the surface without rotation.

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

Parameters

P (rw::math::Vector3D< double >) – [in] the translation vector to the new surface.

Return type

Ptr

Returns

pointer to a new surface.

class sdurw_geometry.sdurw_geometry.Texture(*args, **kwargs)

Bases: object

__init__(*args, **kwargs)
clone()

Clone the current texture :rtype: rw::core::Ptr< rw::geometry::Model3D::Texture > :return: rw::core::Ptr<Texture>

getImageData()

get image data :rtype: rw::core::Ptr< rw::sensor::Image > :return:

getName()

get id of texture :rtype: string :return:

getRGBData()

get RGB data :rtype: rw::math::Vector3D< float > :return:

hasImageData()

check if this texture has image data :rtype: boolean :return: true if it has image data, false otherwise

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TextureCPtr(*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()

Clone the current texture :rtype: rw::core::Ptr< rw::geometry::Model3D::Texture > :return: rw::core::Ptr<Texture>

deref()

The pointer stored in the object.

getDeref()

Member access operator.

getImageData()

get image data :rtype: rw::core::Ptr< rw::sensor::Image > :return:

getName()

get id of texture :rtype: string :return:

getRGBData()

get RGB data :rtype: rw::math::Vector3D< float > :return:

hasImageData()

check if this texture has image data :rtype: boolean :return: true if it has image data, false otherwise

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.TexturePtr(*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()

Clone the current texture :rtype: rw::core::Ptr< rw::geometry::Model3D::Texture > :return: rw::core::Ptr<Texture>

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getImageData()

get image data :rtype: rw::core::Ptr< rw::sensor::Image > :return:

getName()

get id of texture :rtype: string :return:

getRGBData()

get RGB data :rtype: rw::math::Vector3D< float > :return:

hasImageData()

check if this texture has image data :rtype: boolean :return: true if it has image data, false otherwise

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.TriCenterIterator(mesh, useAreaWeight=False)

Bases: object

struct for iterating over the centers of triangles in a mesh

__init__(mesh, useAreaWeight=False)
inc()
increment()

Increments the class :rtype: TriCenterIterator :return: The incremented class

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TriMesh(*args, **kwargs)

Bases: GeometryData

interface of a triangle mesh. The interface defines a way to get triangles from a triangle array/mesh.

__init__(*args, **kwargs)
clone()

make a clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

getSize()

gets the number of triangles in the triangle array.

getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :rtype: rw::geometry::Triangle< double > :return: the triangle at index idx


Overload 2:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< double > :param dst: [out] where to store the triangle at index idx


Overload 3:

gets the triangle at index idx. Using Floating point presicion :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< float > :param dst: [out] where to store the triangle at index idx

getVolume()

calculate a volume of this triangle mesh

isConvex()

test if this geometry data is convex :rtype: boolean :return: true if convex

scale(scale)

Scale all vertices in the mesh.

setConvexEnabled(isConvex)
size()

gets the number of triangles in the triangle array.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TriMeshCPtr(*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 clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()

gets the number of triangles in the triangle array.

getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :rtype: rw::geometry::Triangle< double > :return: the triangle at index idx


Overload 2:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< double > :param dst: [out] where to store the triangle at index idx


Overload 3:

gets the triangle at index idx. Using Floating point presicion :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< float > :param dst: [out] where to store the triangle at index idx

getType()

the type of this primitive

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

isShared()

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()

gets the number of triangles in the triangle array.

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TriMeshPtr(*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 clone of this triangle mesh :rtype: rw::core::Ptr< rw::geometry::TriMesh > :return: clone of this trimesh

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getSize()

gets the number of triangles in the triangle array.

getTriMesh(*args)

Overload 1:


Overload 2:


Overload 3:

getTriangle(*args)

Overload 1:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :rtype: rw::geometry::Triangle< double > :return: the triangle at index idx


Overload 2:

gets the triangle at index idx. :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< double > :param dst: [out] where to store the triangle at index idx


Overload 3:

gets the triangle at index idx. Using Floating point presicion :type idx: int :param idx: [in] the index of the triangle. :type dst: rw::geometry::Triangle< float > :param dst: [out] where to store the triangle at index idx

getType()

the type of this primitive

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

isShared()

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(scale)

Scale all vertices in the mesh.

setConvexEnabled(isConvex)
size()

gets the number of triangles in the triangle array.

property thisown

The membership flag

toString(type)

format GeometryType to string :type type: int :param type:

class sdurw_geometry.sdurw_geometry.TriMeshSurfaceSampler(*args)

Bases: object

random sampling of points and orientations close to the surface of a geometry.

A point p on the surface is randomly choosen.

A rotation rot is randomly generated.

A random distance d in the interval [minD, maxD] is generated

The position pos is calculated as \(pos = p - rot*(0,0,d)^T\)

The random pose X is thus \(X = (pos, rot)\) Optionally a random rotation of X can be generated such that z-axis of rot is not allways pointing toward the surface.

__init__(*args)
Overload 1:

constructor


Overload 2:

constructor :type geom: Ptr :param geom: [in] geometry representing the surface that should be sampled.


Overload 3:

constructor :type geoms: std::vector< rw::geometry::Geometry::Ptr > :param geoms: [in] list of geometries representing the surface that should be sampled.

add(*args)

Overload 1:

add surface representing geometry to this sampler :type geom: Ptr :param geom: [in] geometry representing surface to be sampled


Overload 2:

add surface mesh. :type mesh: Ptr :param mesh: [in] mesh to add to sampler.

getMesh()

return the mesh that is being sampled :rtype: Ptr :return: mesh

sample()

sample a pose on the surface of the object. :rtype: rw::math::Transform3D< double > :return: transform3d of the sampled pose

samplePoint()

sample point on surface of object Conditional comment: :param point_dst: [out] point on surface End of conditional comment.

setBoundsD(minD, maxD)

set the bounds to which the random position around the sampled surface point will be generated. See setRandomPositionEnabled :type minD: float :param minD: [in] minimum distance :type maxD: float :param maxD: [in] maximum distance.

setRandomPositionEnabled(enabled)

enables generation of a random position within the sampled surface position. The local point will be generated within a min and max distance from the sampled surface point. See setBoundsD :type enabled: boolean :param enabled: [in] true to enable local random generation around sampled surface point.

False otherwise.

setRandomRotationEnabled(enabled)

enable the generation of a random rotation instead of a rotation with the z-axis pointing in the surface normal direction. :type enabled: boolean :param enabled: [in]

setZAxisDirection(dir)

sets the direction that the z-axis must point into. this is equal to testing if the z-axis of the generated pose lies on the right side of the plane defined by the plane normal dir and (0,0,0).

Setting this also sets setZAxisDirectionEnabled( true )

Parameters

dir (rw::math::Vector3D< double >) – [in]

setZAxisDirectionEnabled(enabled)

enable z-axis direction filtering. See setZAxisDirection for information on setting the direction.

Parameters

enabled (boolean) –

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TriMeshSurfaceSamplerCPtr(*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

isShared()

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.TriMeshSurfaceSamplerPtr(*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.

add(*args)

Overload 1:

add surface representing geometry to this sampler :type geom: Ptr :param geom: [in] geometry representing surface to be sampled


Overload 2:

add surface mesh. :type mesh: Ptr :param mesh: [in] mesh to add to sampler.

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getMesh()

return the mesh that is being sampled :rtype: Ptr :return: mesh

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.

sample()

sample a pose on the surface of the object. :rtype: rw::math::Transform3D< double > :return: transform3d of the sampled pose

samplePoint()

sample point on surface of object Conditional comment: :param point_dst: [out] point on surface End of conditional comment.

setBoundsD(minD, maxD)

set the bounds to which the random position around the sampled surface point will be generated. See setRandomPositionEnabled :type minD: float :param minD: [in] minimum distance :type maxD: float :param maxD: [in] maximum distance.

setRandomPositionEnabled(enabled)

enables generation of a random position within the sampled surface position. The local point will be generated within a min and max distance from the sampled surface point. See setBoundsD :type enabled: boolean :param enabled: [in] true to enable local random generation around sampled surface point.

False otherwise.

setRandomRotationEnabled(enabled)

enable the generation of a random rotation instead of a rotation with the z-axis pointing in the surface normal direction. :type enabled: boolean :param enabled: [in]

setZAxisDirection(dir)

sets the direction that the z-axis must point into. this is equal to testing if the z-axis of the generated pose lies on the right side of the plane defined by the plane normal dir and (0,0,0).

Setting this also sets setZAxisDirectionEnabled( true )

Parameters

dir (rw::math::Vector3D< double >) – [in]

setZAxisDirectionEnabled(enabled)

enable z-axis direction filtering. See setZAxisDirection for information on setting the direction.

Parameters

enabled (boolean) –

property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TriTriIntersectDeviller

Bases: object

tests if two triangles are intersecting using devillers method.
  • very robust triangle intersection test

  • uses no divisions

  • works on coplanar triangles

__init__()
inCollision(*args)
property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TriTriIntersectDevillerCPtr(*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

isShared()

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.TriTriIntersectDevillerPtr(*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.

inCollision(*args)
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

Bases: object

tests if two triangles are intersecting using devillers method.
  • very robust triangle intersection test

  • uses no divisions

  • works on coplanar triangles

__init__()
inCollision(*args)
property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TriTriIntersectDeviller_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.

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

isShared()

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

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

inCollision(*args)
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

Bases: object

tests if two triangles are intersecting using Thomas Mollers, 1997, no div method. The code is strongly inspired (read converted to use RobWork types) from Opcode 1.3 Pierre Terdiman 2001.

__init__()
inCollision(*args)
property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TriTriIntersectMollerCPtr(*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

isShared()

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.TriTriIntersectMollerPtr(*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.

inCollision(*args)
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

Bases: object

tests if two triangles are intersecting using Thomas Mollers, 1997, no div method. The code is strongly inspired (read converted to use RobWork types) from Opcode 1.3 Pierre Terdiman 2001.

__init__()
inCollision(*args)
property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TriTriIntersectMoller_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.

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

isShared()

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

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

inCollision(*args)
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.Triangle(*args)

Bases: object

plain triangle class. The second template argument specify the number of normals associated with the triangle.

The triangle vertices should be arranged counter clock wise.

__init__(*args)
Overload 1:

default constructor


Overload 2:

constructor :type p1: rw::math::Vector3D< double > :param p1: [in] vertice 1 :type p2: rw::math::Vector3D< double > :param p2: [in] vertice 2 :type p3: rw::math::Vector3D< double > :param p3: [in] vertice 3

applyTransform(t3d)

apply a transformation to this triangle :type t3d: rw::math::Transform3D< double > :param t3d: [in] transform that is to be applied

calcArea()

calculate the area of the triangle :rtype: float :return: area in m^2

calcFaceNormal()

calculates the face normal of this triangle. It is assumed that the triangle vertices are arranged counter clock wise.

getTriangle(*args)
getVertex(*args)

Overload 1:

get vertex at index i


Overload 2:

get vertex at index i

isInside(x)

tests wheather the point x is inside the triangle

property thisown

The membership flag

transform(t3d)

Returns Triangle transformed by t3d.

class sdurw_geometry.sdurw_geometry.TriangleCPtr(*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()

calculate the area of the triangle :rtype: float :return: area in m^2

calcFaceNormal()

calculates the face normal of this triangle. It is assumed that the triangle vertices are arranged counter clock wise.

deref()

The pointer stored in the object.

getDeref()

Member access operator.

getVertex(*args)

Overload 1:

get vertex at index i


Overload 2:

get vertex at index i

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

transform(t3d)

Returns Triangle transformed by t3d.

class sdurw_geometry.sdurw_geometry.TriangleN1(*args)

Bases: object

Triangle facet. triangle class of type N1, which means that beside the plain triangle the face normal of the triangle is saved with the facenormal.

__init__(*args)

Overload 1:

constructor, calculates the face normal from vertex data


Overload 2:

constructor


Overload 3:

constructor


Overload 4:

constructor

applyTransform(t3d)
calcFaceNormal()
getFaceNormal(*args)

Overload 1:

returns the facenormal of this triangle


Overload 2:

returns the facenormal of this triangle

getTriangle(*args)
getVertex(*args)

Overload 1:


Overload 2:

halfSpaceDist(x)

calculates the distance to the halfspace of the triangle

isInside(x)

tests wheather the point x is inside the triangle

property thisown

The membership flag

transform(t3d)
class sdurw_geometry.sdurw_geometry.TriangleN1CPtr(*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.

calcFaceNormal()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getFaceNormal(*args)

Overload 1:

returns the facenormal of this triangle


Overload 2:

returns the facenormal of this triangle

getVertex(*args)

Overload 1:


Overload 2:

halfSpaceDist(x)

calculates the distance to the halfspace of the triangle

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

transform(t3d)
class sdurw_geometry.sdurw_geometry.TriangleN1Ptr(*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.

applyTransform(t3d)
calcFaceNormal()
cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getFaceNormal(*args)

Overload 1:

returns the facenormal of this triangle


Overload 2:

returns the facenormal of this triangle

getTriangle(*args)
getVertex(*args)

Overload 1:


Overload 2:

halfSpaceDist(x)

calculates the distance to the halfspace of the triangle

isInside(x)

tests wheather the point x is inside the triangle

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

transform(t3d)
class sdurw_geometry.sdurw_geometry.TriangleN1_f(*args)

Bases: object

Triangle facet. triangle class of type N1, which means that beside the plain triangle the face normal of the triangle is saved with the facenormal.

__init__(*args)

Overload 1:

constructor, calculates the face normal from vertex data


Overload 2:

constructor


Overload 3:

constructor


Overload 4:

constructor

applyTransform(t3d)
calcFaceNormal()
getFaceNormal(*args)

Overload 1:

returns the facenormal of this triangle


Overload 2:

returns the facenormal of this triangle

getTriangle(*args)
getVertex(*args)

Overload 1:


Overload 2:

halfSpaceDist(x)

calculates the distance to the halfspace of the triangle

isInside(x)

tests wheather the point x is inside the triangle

property thisown

The membership flag

transform(t3d)
class sdurw_geometry.sdurw_geometry.TriangleN3(*args)

Bases: object

Triangle facet. triangle class that stores one normal for each vertex in the triangle.

__init__(*args)

Overload 1:

constructor, with all input defined


Overload 2:

constructor from triangle and normals

calcFaceNormal()
getNormal(*args)

Overload 1:

get normal of vertice i :type i: int :param i: [in] index of vertice :rtype: rw::math::Vector3D< double > :return: normal of the i’th vertice


Overload 2:

return vertex normal of the vertex specified by i

getTriangle(*args)
getVertex(*args)

Overload 1:


Overload 2:

property thisown

The membership flag

transform(t3d)

Returns TriangleN2 transformed by t3d.

class sdurw_geometry.sdurw_geometry.TriangleN3CPtr(*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.

calcFaceNormal()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getNormal(*args)

Overload 1:

get normal of vertice i :type i: int :param i: [in] index of vertice :rtype: rw::math::Vector3D< double > :return: normal of the i’th vertice


Overload 2:

return vertex normal of the vertex specified by i

getVertex(*args)

Overload 1:


Overload 2:

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

transform(t3d)

Returns TriangleN2 transformed by t3d.

class sdurw_geometry.sdurw_geometry.TriangleN3Ptr(*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.

calcFaceNormal()
cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getNormal(*args)

Overload 1:

get normal of vertice i :type i: int :param i: [in] index of vertice :rtype: rw::math::Vector3D< double > :return: normal of the i’th vertice


Overload 2:

return vertex normal of the vertex specified by i

getTriangle(*args)
getVertex(*args)

Overload 1:


Overload 2:

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

transform(t3d)

Returns TriangleN2 transformed by t3d.

class sdurw_geometry.sdurw_geometry.TriangleN3_f(*args)

Bases: object

Triangle facet. triangle class that stores one normal for each vertex in the triangle.

__init__(*args)

Overload 1:

constructor, with all input defined


Overload 2:

constructor from triangle and normals

calcFaceNormal()
getNormal(*args)

Overload 1:

get normal of vertice i :type i: int :param i: [in] index of vertice :rtype: rw::math::Vector3D< float > :return: normal of the i’th vertice


Overload 2:

return vertex normal of the vertex specified by i

getTriangle(*args)
getVertex(*args)

Overload 1:


Overload 2:

property thisown

The membership flag

transform(t3d)

Returns TriangleN2 transformed by t3d.

class sdurw_geometry.sdurw_geometry.TrianglePtr(*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.

applyTransform(t3d)

apply a transformation to this triangle :type t3d: rw::math::Transform3D< double > :param t3d: [in] transform that is to be applied

calcArea()

calculate the area of the triangle :rtype: float :return: area in m^2

calcFaceNormal()

calculates the face normal of this triangle. It is assumed that the triangle vertices are arranged counter clock wise.

cptr()
deref()

The pointer stored in the object.

getDeref()

Member access operator.

getTriangle(*args)
getVertex(*args)

Overload 1:

get vertex at index i


Overload 2:

get vertex at index i

isInside(x)

tests wheather the point x is inside the triangle

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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

transform(t3d)

Returns Triangle transformed by t3d.

class sdurw_geometry.sdurw_geometry.TriangleUtil

Bases: object

utility for triangle manipulation

__init__()
property thisown

The membership flag

class sdurw_geometry.sdurw_geometry.TriangleUtilCPtr(*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

isShared()

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.TriangleUtilPtr(*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.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.Triangle_f(*args)

Bases: object

plain triangle class. The second template argument specify the number of normals associated with the triangle.

The triangle vertices should be arranged counter clock wise.

__init__(*args)
Overload 1:

default constructor


Overload 2:

constructor :type p1: rw::math::Vector3D< float > :param p1: [in] vertice 1 :type p2: rw::math::Vector3D< float > :param p2: [in] vertice 2 :type p3: rw::math::Vector3D< float > :param p3: [in] vertice 3

applyTransform(t3d)

apply a transformation to this triangle :type t3d: rw::math::Transform3D< float > :param t3d: [in] transform that is to be applied

calcArea()

calculate the area of the triangle :rtype: float :return: area in m^2

calcFaceNormal()

calculates the face normal of this triangle. It is assumed that the triangle vertices are arranged counter clock wise.

getTriangle(*args)
getVertex(*args)

Overload 1:

get vertex at index i


Overload 2:

get vertex at index i

isInside(x)

tests wheather the point x is inside the triangle

property thisown

The membership flag

transform(t3d)

Returns Triangle transformed by t3d.

class sdurw_geometry.sdurw_geometry.Tube(*args)

Bases: Primitive

a tube primitive. radius is in xy-plane and height is in z-axis

__init__(*args)

Overload 1:

Constructs tube primitive with the specified setup

The tube is aligned with the height in the z-direction such that tube extends height/2 above and below the xy-plane.

Parameters
  • radius (float) – [in] inner radius of the tube.

  • thickness (float) – [in] thickness of the tube.

  • height (float) – [in] height of the cylinder.

  • levels (int, optional) – [in] granularity of the mesh.


Overload 2:

Constructs tube primitive based on vector with parameters

Parameters
  • initQ (Q) – [in] vector of (radius, height)

  • levels (int, optional) – [in] granularity of the mesh


Overload 3:

Constructs tube primitive based on vector with parameters

Parameters
  • initQ (Q) – [in] vector of (radius, height)

  • 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 tube. :rtype: float :return: the height

getInnerRadius()

Get the inner radius of the tube. :rtype: float :return: the radius

getParameters()

get the parameters that define this primitive

getThickness()

Get the thickness of the tube. :rtype: float :return: the thickness.

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.TubeCPtr(*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 tube. :rtype: float :return: the height

getInnerRadius()

Get the inner radius of the tube. :rtype: float :return: the radius

getParameters()
getThickness()

Get the thickness of the tube. :rtype: float :return: the thickness.

getType()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

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.TubePtr(*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 tube. :rtype: float :return: the height

getInnerRadius()

Get the inner radius of the tube. :rtype: float :return: the radius

getParameters()
getThickness()

Get the thickness of the tube. :rtype: float :return: the thickness.

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

isShared()

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:

sdurw_geometry.sdurw_geometry.V1 = 0

The first vertex.

sdurw_geometry.sdurw_geometry.V2 = 1

The second vertex.

sdurw_geometry.sdurw_geometry.V3 = 2

The third vertex.

class sdurw_geometry.sdurw_geometry.VectorGeometryPtr(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.VectorIndexedTriangle(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.VectorLine(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.VectorQuadraticCurve(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.VectorTriangle(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.VectorTriangleN1(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.VectorTriangleN1_f(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.VectorTriangleN3(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.VectorTriangleN3_f(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.VectorTriangle_f(arg1=None, arg2=None)

Bases: list

This class is deprecated and is basically a wrapper around a list

__init__(arg1=None, arg2=None)
at(i)
back()
clear()

Remove all items from list.

empty()
front()
pop_back()
push_back(elem)
size()
class sdurw_geometry.sdurw_geometry.VerticeIterator(mesh)

Bases: object

struct for iterating over the centers of triangles in a mesh

__init__(mesh)
inc()
increment()

Increments the class :rtype: VerticeIterator :return: The incremented class

property thisown

The membership flag

sdurw_geometry.sdurw_geometry.build(*args)

Overload 1:

calclates the convex hull of a set of vertices coords each with dimension dim

Parameters
  • dim (int) – [in] nr of dimensions in each vertice

  • coords (float) – [in] array of vertices

  • nrCoords (int) – [in] the number of vertices

  • vertIdxs (std::vector< int >) –

  • faceIdxs (std::vector< int >) –

  • faceNormals (std::vector< double >) –

  • faceOffsets (std::vector< double >) –


Overload 2:

calclates the convex hull of a set of vertices coords each with dimension dim

Parameters
  • coords (std::vector< std::vector< double > >) – [in] array of vertices

  • vertIdxs (std::vector< int >) –

  • faceIdxs (std::vector< int >) –

  • faceNormals (std::vector< double >) –

  • faceOffsets (std::vector< double >) –

sdurw_geometry.sdurw_geometry.ownedPtr(*args)

Overload 1:

A Ptr that takes ownership over a raw pointer ptr.


Overload 2:

A Ptr that takes ownership over a raw pointer ptr.


Overload 3:

A Ptr that takes ownership over a raw pointer ptr.


Overload 4:

A Ptr that takes ownership over a raw pointer ptr.


Overload 5:

A Ptr that takes ownership over a raw pointer ptr.


Overload 6:

A Ptr that takes ownership over a raw pointer ptr.


Overload 7:

A Ptr that takes ownership over a raw pointer ptr.


Overload 8:

A Ptr that takes ownership over a raw pointer ptr.


Overload 9:

A Ptr that takes ownership over a raw pointer ptr.


Overload 10:

A Ptr that takes ownership over a raw pointer ptr.


Overload 11:

A Ptr that takes ownership over a raw pointer ptr.


Overload 12:

A Ptr that takes ownership over a raw pointer ptr.


Overload 13:

A Ptr that takes ownership over a raw pointer ptr.


Overload 14:

A Ptr that takes ownership over a raw pointer ptr.


Overload 15:

A Ptr that takes ownership over a raw pointer ptr.


Overload 16:

A Ptr that takes ownership over a raw pointer ptr.


Overload 17:

A Ptr that takes ownership over a raw pointer ptr.


Overload 18:

A Ptr that takes ownership over a raw pointer ptr.


Overload 19:

A Ptr that takes ownership over a raw pointer ptr.


Overload 20:

A Ptr that takes ownership over a raw pointer ptr.


Overload 21:

A Ptr that takes ownership over a raw pointer ptr.


Overload 22:

A Ptr that takes ownership over a raw pointer ptr.


Overload 23:

A Ptr that takes ownership over a raw pointer ptr.


Overload 24:

A Ptr that takes ownership over a raw pointer ptr.


Overload 25:

A Ptr that takes ownership over a raw pointer ptr.


Overload 26:

A Ptr that takes ownership over a raw pointer ptr.


Overload 27:

A Ptr that takes ownership over a raw pointer ptr.


Overload 28:

A Ptr that takes ownership over a raw pointer ptr.


Overload 29:

A Ptr that takes ownership over a raw pointer ptr.


Overload 30:

A Ptr that takes ownership over a raw pointer ptr.


Overload 31:

A Ptr that takes ownership over a raw pointer ptr.


Overload 32:

A Ptr that takes ownership over a raw pointer ptr.


Overload 33:

A Ptr that takes ownership over a raw pointer ptr.


Overload 34:

A Ptr that takes ownership over a raw pointer ptr.


Overload 35:

A Ptr that takes ownership over a raw pointer ptr.


Overload 36:

A Ptr that takes ownership over a raw pointer ptr.


Overload 37:

A Ptr that takes ownership over a raw pointer ptr.


Overload 38:

A Ptr that takes ownership over a raw pointer ptr.


Overload 39:

A Ptr that takes ownership over a raw pointer ptr.


Overload 40:

A Ptr that takes ownership over a raw pointer ptr.


Overload 41:

A Ptr that takes ownership over a raw pointer ptr.


Overload 42:

A Ptr that takes ownership over a raw pointer ptr.


Overload 43:

A Ptr that takes ownership over a raw pointer ptr.


Overload 44:

A Ptr that takes ownership over a raw pointer ptr.


Overload 45:

A Ptr that takes ownership over a raw pointer ptr.


Overload 46:

A Ptr that takes ownership over a raw pointer ptr.


Overload 47:

A Ptr that takes ownership over a raw pointer ptr.


Overload 48:

A Ptr that takes ownership over a raw pointer ptr.


Overload 49:

A Ptr that takes ownership over a raw pointer ptr.


Overload 50:

A Ptr that takes ownership over a raw pointer ptr.


Overload 51:

A Ptr that takes ownership over a raw pointer ptr.


Overload 52:

A Ptr that takes ownership over a raw pointer ptr.


Overload 53:

A Ptr that takes ownership over a raw pointer ptr.


Overload 54:

A Ptr that takes ownership over a raw pointer ptr.


Overload 55:

A Ptr that takes ownership over a raw pointer ptr.


Overload 56:

A Ptr that takes ownership over a raw pointer ptr.


Overload 57:

A Ptr that takes ownership over a raw pointer ptr.


Overload 58:

A Ptr that takes ownership over a raw pointer ptr.


Overload 59:

A Ptr that takes ownership over a raw pointer ptr.


Overload 60:

A Ptr that takes ownership over a raw pointer ptr.


Overload 61:

A Ptr that takes ownership over a raw pointer ptr.


Overload 62:

A Ptr that takes ownership over a raw pointer ptr.


Overload 63:

A Ptr that takes ownership over a raw pointer ptr.


Overload 64:

A Ptr that takes ownership over a raw pointer ptr.


Overload 65:

A Ptr that takes ownership over a raw pointer ptr.


Overload 66:

A Ptr that takes ownership over a raw pointer ptr.


Overload 67:

A Ptr that takes ownership over a raw pointer ptr.


Overload 68:

A Ptr that takes ownership over a raw pointer ptr.


Overload 69:

A Ptr that takes ownership over a raw pointer ptr.


Overload 70:

A Ptr that takes ownership over a raw pointer ptr.


Overload 71:

A Ptr that takes ownership over a raw pointer ptr.


Overload 72:

A Ptr that takes ownership over a raw pointer ptr.


Overload 73:

A Ptr that takes ownership over a raw pointer ptr.


Overload 74:

A Ptr that takes ownership over a raw pointer ptr.


Overload 75:

A Ptr that takes ownership over a raw pointer ptr.


Overload 76:

A Ptr that takes ownership over a raw pointer ptr.


Overload 77:

A Ptr that takes ownership over a raw pointer ptr.


Overload 78:

A Ptr that takes ownership over a raw pointer ptr.


Overload 79:

A Ptr that takes ownership over a raw pointer ptr.


Overload 80:

A Ptr that takes ownership over a raw pointer ptr.


Overload 81:

A Ptr that takes ownership over a raw pointer ptr.


Overload 82:

A Ptr that takes ownership over a raw pointer ptr.


Overload 83:

A Ptr that takes ownership over a raw pointer ptr.


Overload 84:

A Ptr that takes ownership over a raw pointer ptr.


Overload 85:

A Ptr that takes ownership over a raw pointer ptr.


Overload 86:

A Ptr that takes ownership over a raw pointer ptr.


Overload 87:

A Ptr that takes ownership over a raw pointer ptr.


Overload 88:

A Ptr that takes ownership over a raw pointer ptr.


Overload 89:

A Ptr that takes ownership over a raw pointer ptr.


Overload 90:

A Ptr that takes ownership over a raw pointer ptr.


Overload 91:

A Ptr that takes ownership over a raw pointer ptr.


Overload 92:

A Ptr that takes ownership over a raw pointer ptr.


Overload 93:

A Ptr that takes ownership over a raw pointer ptr.


Overload 94:

A Ptr that takes ownership over a raw pointer ptr.


Overload 95:

A Ptr that takes ownership over a raw pointer ptr.


Overload 96:

A Ptr that takes ownership over a raw pointer ptr.


Overload 97:

A Ptr that takes ownership over a raw pointer ptr.


Overload 98:

A Ptr that takes ownership over a raw pointer ptr.


Overload 99:

A Ptr that takes ownership over a raw pointer ptr.


Overload 100:

A Ptr that takes ownership over a raw pointer ptr.


Overload 101:

A Ptr that takes ownership over a raw pointer ptr.


Overload 102:

A Ptr that takes ownership over a raw pointer ptr.


Overload 103:

A Ptr that takes ownership over a raw pointer ptr.


Overload 104:

A Ptr that takes ownership over a raw pointer ptr.


Overload 105:

A Ptr that takes ownership over a raw pointer ptr.


Overload 106:

A Ptr that takes ownership over a raw pointer ptr.


Overload 107:

A Ptr that takes ownership over a raw pointer ptr.