Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | List of all members
CDPL.Vis.TriangleMesh3D Class Reference

Data structure for describing the geometric shape of 3D objects by means of a triangle mesh. More...

+ Inheritance diagram for CDPL.Vis.TriangleMesh3D:

Public Member Functions

None __init__ ()
 Initializes the TriangleMesh3D instance.
 
None __init__ (TriangleMesh3D mesh)
 Initializes a copy of the TriangleMesh3D instance mesh. More...
 
TriangleMesh3D assign (TriangleMesh3D mesh)
 Replaces the current state of self with a copy of the state of the TriangleMesh3D instance mesh. More...
 
Math.Vector3DArray getVertices ()
 Returns a reference to the array storing the mesh vertices. More...
 
None addVertex (float x, float y, float z)
 Appends a new vertex at the position (x, y, z). More...
 
int getNumVertices ()
 Returns the number of stored vertices. More...
 
Math.Vector3DArray getVertexNormals ()
 Returns a reference to the array storing the per-vertex normals. More...
 
None addVertexNormal (float x, float y, float z)
 Appends a new vertex normal with the components (x, y, z). More...
 
int getNumVertexNormals ()
 Returns the number of stored vertex normals. More...
 
Math.Vector3ULArray getFaces ()
 Returns a reference to the array storing the triangle faces (vertex-index triplets). More...
 
None addFace (int v1_idx, int v2_idx, int v3_idx)
 Appends a new triangle face defined by the three vertex indices v1_idx, v2_idx and v3_idx. More...
 
int getNumFaces ()
 Returns the number of stored triangle faces. More...
 
bool isClosed ()
 Tells whether the mesh has been flagged as a closed surface. More...
 
None setClosed (bool closed=True)
 Sets the flag that marks the mesh as a closed surface. More...
 
None clear ()
 Removes all vertices, vertex normals and faces and resets the closed-surface flag.
 
TriangleMesh3D swap (TriangleMesh3D mesh)
 Swaps the contents of this mesh with those of mesh. More...
 
TriangleMesh3D __iadd__ (TriangleMesh3D mesh)
 Performs the in-place addition operation self += mesh. More...
 
- Public Member Functions inherited from CDPL.Vis.Shape3D
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
Shape3D clone ()
 Creates a dynamically allocated copy of the graphics primitive. More...
 
None accept (Shape3DVisitor visitor)
 Vis.Shape3DVisitor implementation accept method [VPTN]. More...
 

Properties

 vertices = property(getVertices)
 
 numVertices = property(getNumVertices)
 
 vertexNormals = property(getVertexNormals)
 
 numVertexNormals = property(getNumVertexNormals)
 
 faces = property(getFaces)
 
 numFaces = property(getNumFaces)
 
 closed = property(isClosed, setClosed)
 
- Properties inherited from CDPL.Vis.Shape3D
 objectID = property(getObjectID)
 

Detailed Description

Data structure for describing the geometric shape of 3D objects by means of a triangle mesh.

Since
1.3

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Vis.TriangleMesh3D.__init__ ( TriangleMesh3D  mesh)

Initializes a copy of the TriangleMesh3D instance mesh.

Parameters
meshThe TriangleMesh3D instance to copy.

Member Function Documentation

◆ assign()

TriangleMesh3D CDPL.Vis.TriangleMesh3D.assign ( TriangleMesh3D  mesh)

Replaces the current state of self with a copy of the state of the TriangleMesh3D instance mesh.

Parameters
meshThe TriangleMesh3D instance to copy.
Returns
self

◆ getVertices()

Math.Vector3DArray CDPL.Vis.TriangleMesh3D.getVertices ( )

Returns a reference to the array storing the mesh vertices.

Returns
A reference to the vertex array.

◆ addVertex()

None CDPL.Vis.TriangleMesh3D.addVertex ( float  x,
float  y,
float  z 
)

Appends a new vertex at the position (x, y, z).

Parameters
xThe x-coordinate of the vertex.
yThe y-coordinate of the vertex.
zThe z-coordinate of the vertex.

◆ getNumVertices()

int CDPL.Vis.TriangleMesh3D.getNumVertices ( )

Returns the number of stored vertices.

Returns
The vertex count.

◆ getVertexNormals()

Math.Vector3DArray CDPL.Vis.TriangleMesh3D.getVertexNormals ( )

Returns a reference to the array storing the per-vertex normals.

Returns
A reference to the vertex-normal array.

◆ addVertexNormal()

None CDPL.Vis.TriangleMesh3D.addVertexNormal ( float  x,
float  y,
float  z 
)

Appends a new vertex normal with the components (x, y, z).

Parameters
xThe x-component of the normal vector.
yThe y-component of the normal vector.
zThe z-component of the normal vector.

◆ getNumVertexNormals()

int CDPL.Vis.TriangleMesh3D.getNumVertexNormals ( )

Returns the number of stored vertex normals.

Returns
The vertex-normal count.

◆ getFaces()

Math.Vector3ULArray CDPL.Vis.TriangleMesh3D.getFaces ( )

Returns a reference to the array storing the triangle faces (vertex-index triplets).

Returns
A reference to the face array.

◆ addFace()

None CDPL.Vis.TriangleMesh3D.addFace ( int  v1_idx,
int  v2_idx,
int  v3_idx 
)

Appends a new triangle face defined by the three vertex indices v1_idx, v2_idx and v3_idx.

Parameters
v1_idxThe index of the first vertex.
v2_idxThe index of the second vertex.
v3_idxThe index of the third vertex.

◆ getNumFaces()

int CDPL.Vis.TriangleMesh3D.getNumFaces ( )

Returns the number of stored triangle faces.

Returns
The face count.

◆ isClosed()

bool CDPL.Vis.TriangleMesh3D.isClosed ( )

Tells whether the mesh has been flagged as a closed surface.

Returns
True if the mesh is flagged as closed, and False otherwise.

◆ setClosed()

None CDPL.Vis.TriangleMesh3D.setClosed ( bool   closed = True)

Sets the flag that marks the mesh as a closed surface.

Parameters
closedTrue to flag the mesh as closed, and False otherwise.

◆ swap()

TriangleMesh3D CDPL.Vis.TriangleMesh3D.swap ( TriangleMesh3D  mesh)

Swaps the contents of this mesh with those of mesh.

Parameters
meshThe mesh to swap with.

◆ __iadd__()

TriangleMesh3D CDPL.Vis.TriangleMesh3D.__iadd__ ( TriangleMesh3D  mesh)

Performs the in-place addition operation self += mesh.

Parameters
meshSpecifies the second addend.
Returns
The updated TriangleMesh3D instance self.