API

class OBB.api.OBB(meshName=None, method=0)[source]

OBB Oriented Bounding Box Class.

Requires an input meshName.

build_from_covariance_matrix(cvMatrix=None)[source]

Build eigen vectors from covariance matrix.

Parameters:of lists) (matrix(list) – covariance matrix
Raises:
None
Returns:
None
build_from_hull()[source]

Test oriented bounding box algorithm using convex hull points.

Raises:
None
Returns:
EigenVectors(OpenMaya.MVector) CenterPoint(OpenMaya.MVector) BoundingExtents(OpenMaya.MVector)
build_from_points()[source]

Bounding box algorithm using vertex points.

Raises:
None
Returns:
EigenVectors(OpenMaya.MVector) CenterPoint(OpenMaya.MVector) BoundingExtents(OpenMaya.MVector)
build_from_triangles(points=None, triangles=None)[source]

Test oriented bounding box algorithm using triangles.

Parameters:
  • points(OpenMaya.MVectorArray) – points to represent geometry.
  • triangles(OpenMaya.MIntArray) – points to represent geometry.
Raises:
None
Returns:
EigenVectors(OpenMaya.MVector) CenterPoint(OpenMaya.MVector) BoundingExtents(OpenMaya.MVector)
center

Property center of the bounding box.

Returns:
(OpenMaya.MVector)
create_bounding_box(meshName='bounding_GEO')[source]

Create the bounding box mesh.

Parameters:meshName(string) – Name of created mesh.
Raises:
None
Returns:
(string) Cube Transform
depth

Property depth of the bounding box.

classmethod from_hull(meshName=None)[source]

Bounding box algorithm using triangles points.

Raises:
None
Returns:
(OBB Instance)
classmethod from_points(meshName=None)[source]

Bounding box algorithm using vertex points.

Raises:
None
Returns:
(OBB Instance)
classmethod from_triangles(meshName=None)[source]

Bounding box algorithm using triangles points.

Raises:
None
Returns:
(OBB Instance)
getMFnMesh(mesh)[source]

Gets the MFnMesh of the input mesh.

Parameters:(str) (mesh) – string name of input mesh.
Raises:
RuntimeError if not a mesh.
Returns:
(OpenMaya.MFnMesh) MFnMesh mesh object.
getMatrix()[source]

Gets the matrix representing the transformation of the bounding box.

Raises:
None
Returns:
(list of floats) Matrix
getPoints(fnMesh)[source]

Get the points of each vertex.

Parameters:(OpenMaya.MFnMesh) (fnMesh) – mesh function set.
Raises:
None
Returns:
(OpenMaya.MVectorArray) list of points.
getShape(node)[source]

Gets the shape node from the input node.

Parameters:(str) (node) – string name of input node
Raises:
RuntimeError if no shape node.
Returns:
(str) shape node name
getTriangles(fnMesh)[source]

Get the triangles indices.

Parameters:(OpenMaya.MFnMesh) (fnMesh) – mesh function set.
Raises:
None
Returns:
(OpenMaya.MIntArray) indices of triangles.
get_bounding_points()[source]

Gets the bounding box points from the build.

Raises:
None
Returns:
(list of MVectors) Bounding box points.
height

Property height of the bounding box.

matrix

Property matrix of the bounding box.

volume

Property volume of bounding box.

width

Property width of the bounding box.

OBB.api.timeit(method)[source]

Decorator to time function evaluation. Prints “method (args, kwargs) time.sec”