Uranium
Application Framework
 All Classes Namespaces Files Functions Variables Pages
UM.Mesh.MeshData.MeshData Class Reference

Class to hold a list of verts and possibly how (and if) they are connected. More...

Public Member Functions

def __init__
 
def set
 Create a new MeshData with specified changes. More...
 
def getHash
 
def getCenterPosition
 
def getZeroPosition
 
def getType
 
def getFaceCount
 
def getVertices
 Get the array of vertices.
 
def getVertexCount
 Get the number of vertices.
 
def getVertex
 Get a vertex by index.
 
def hasNormals
 Return whether this mesh has vertex normals. More...
 
def getNormals
 Return the list of vertex normals. More...
 
def hasIndices
 Return whether this mesh has indices. More...
 
def getIndices
 Get the array of indices. More...
 
def hasColors
 
def getColors
 
def hasUVCoordinates
 
def getFileName
 
def getTransformed
 Transform the meshdata, center and zero position by given Matrix. More...
 
def getExtents
 Get the extents of this mesh. More...
 
def getVerticesAsByteArray
 Get all vertices of this mesh as a bytearray. More...
 
def getNormalsAsByteArray
 Get all normals of this mesh as a bytearray. More...
 
def getIndicesAsByteArray
 Get all indices as a bytearray. More...
 
def getColorsAsByteArray
 
def getUVCoordinatesAsByteArray
 
def getConvexHull
 Gets the Convex Hull of this mesh. More...
 
def getConvexHullVertices
 Gets the convex hull points. More...
 
def getConvexHullTransformedVertices
 Gets transformed convex hull points. More...
 
def hasAttribute
 
def getAttribute
 the return value is a dict with at least keys opengl_name, opengl_type, value
 
def attributeNames
 Return attribute names in alphabetical order The sorting assures that the order is always the same. More...
 
def toString
 

Detailed Description

Class to hold a list of verts and possibly how (and if) they are connected.

This class stores three numpy arrays that contain the data for a mesh. Vertices are stored as a two-dimensional array of floats with the rows being individual vertices and the three columns being the X, Y and Z components of the vertices. Normals are stored in the same manner and kept in sync with the vertices. Indices are stored as a two-dimensional array of integers with the rows being the individual faces and the three columns being the indices that refer to the individual vertices.

attributes: a dict with {"value", "opengl_type", "opengl_name"} type in vector2f, vector3f, uniforms, ...

Member Function Documentation

def UM.Mesh.MeshData.MeshData.attributeNames (   self)

Return attribute names in alphabetical order The sorting assures that the order is always the same.

def UM.Mesh.MeshData.MeshData.getConvexHull (   self)

Gets the Convex Hull of this mesh.

Returns
scipy.spatial.qhull.ConvexHull
def UM.Mesh.MeshData.MeshData.getConvexHullTransformedVertices (   self,
  transformation 
)

Gets transformed convex hull points.

Returns
numpy.ndarray the vertices which describe the convex hull
def UM.Mesh.MeshData.MeshData.getConvexHullVertices (   self)

Gets the convex hull points.

Returns
numpy.ndarray the vertices which describe the convex hull
def UM.Mesh.MeshData.MeshData.getExtents (   self,
  matrix = None 
)

Get the extents of this mesh.

Parameters
matrixThe transformation matrix from model to world coordinates.
def UM.Mesh.MeshData.MeshData.getIndices (   self)

Get the array of indices.

Returns
numpy.ndarray
def UM.Mesh.MeshData.MeshData.getIndicesAsByteArray (   self)

Get all indices as a bytearray.

Returns
A bytearray object with 3 ints per face.
def UM.Mesh.MeshData.MeshData.getNormals (   self)

Return the list of vertex normals.

def UM.Mesh.MeshData.MeshData.getNormalsAsByteArray (   self)

Get all normals of this mesh as a bytearray.

Returns
A bytearray object with 3 floats per normal.
def UM.Mesh.MeshData.MeshData.getTransformed (   self,
  transformation 
)

Transform the meshdata, center and zero position by given Matrix.

Parameters
transformation4x4 homogenous transformation matrix
def UM.Mesh.MeshData.MeshData.getVerticesAsByteArray (   self)

Get all vertices of this mesh as a bytearray.

Returns
A bytearray object with 3 floats per vertex.
def UM.Mesh.MeshData.MeshData.hasIndices (   self)

Return whether this mesh has indices.

def UM.Mesh.MeshData.MeshData.hasNormals (   self)

Return whether this mesh has vertex normals.

def UM.Mesh.MeshData.MeshData.set (   self,
  vertices = Reuse,
  normals = Reuse,
  indices = Reuse,
  colors = Reuse,
  uvs = Reuse,
  file_name = Reuse,
  center_position = Reuse,
  zero_position = Reuse,
  attributes = Reuse 
)

Create a new MeshData with specified changes.

Returns
MeshData

The documentation for this class was generated from the following file: