Uranium
Application Framework
UM.Mesh.MeshData.MeshData Class Reference

Public Member Functions

def __init__ (self, vertices=None, normals=None, indices=None, colors=None, uvs=None, file_name=None, center_position=None, zero_position=None, type=MeshType.faces, attributes=None)
 
def __del__ (self)
 
def set (self, vertices=Reuse, normals=Reuse, indices=Reuse, colors=Reuse, uvs=Reuse, file_name=Reuse, center_position=Reuse, zero_position=Reuse, attributes=Reuse)
 
def getHash (self)
 
def getCenterPosition (self)
 
def getZeroPosition (self)
 
def getType (self)
 
def getFaceCount (self)
 
def getVertices (self)
 
def getVertexCount (self)
 
def getVertex (self, index)
 
def hasNormals (self)
 
def getNormals (self)
 
def hasIndices (self)
 
def getIndices (self)
 
def hasColors (self)
 
def getColors (self)
 
def hasUVCoordinates (self)
 
def getFileName (self)
 
def getTransformed
 
def getExtents
 
def getVerticesAsByteArray (self)
 
def getNormalsAsByteArray (self)
 
def getIndicesAsByteArray (self)
 
def getColorsAsByteArray (self)
 
def getUVCoordinatesAsByteArray (self)
 
def getConvexHull (self)
 
def getConvexHullVertices (self)
 
def getConvexHullTransformedVertices
 
def getFacePlane
 
def getFaceNodes
 
def hasAttribute
 
def getAttribute
 
def getCachedUserValue
 
def setCachedUserValue
 
def attributeNames (self)
 
def invertNormals (self)
 
def toString (self)
 

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

Constructor & Destructor Documentation

◆ __del__()

def UM.Mesh.MeshData.MeshData.__del__ (   self)
Triggered when this file is deleted.

The file will then no longer be watched for changes.

Member Function Documentation

◆ attributeNames()

def UM.Mesh.MeshData.MeshData.attributeNames (   self,
  List,
  str 
)
Return attribute names in alphabetical order

The sorting assures that the order is always the same.

◆ getConvexHull()

def UM.Mesh.MeshData.MeshData.getConvexHull (   self,
  Optional,
  scipy,
  spatial,
  ConvexHull 
)
Gets the Convex Hull of this mesh

:return: :type{scipy.spatial.ConvexHull}

◆ getConvexHullVertices()

def UM.Mesh.MeshData.MeshData.getConvexHullVertices (   self,
  Optional,
  numpy,
  ndarray 
)
Gets the convex hull points

:return: :type{numpy.ndarray} the vertices which describe the convex hull

◆ getIndices()

def UM.Mesh.MeshData.MeshData.getIndices (   self,
  numpy,
  ndarray 
)
Get the array of indices

:return: :type{numpy.ndarray}

◆ getIndicesAsByteArray()

def UM.Mesh.MeshData.MeshData.getIndicesAsByteArray (   self,
  Optional,
  bytes 
)
Get all indices as a bytearray

:return: A bytearray object with 3 ints per face.

◆ getNormals()

def UM.Mesh.MeshData.MeshData.getNormals (   self,
  numpy,
  ndarray 
)
Return the list of vertex normals.

◆ getNormalsAsByteArray()

def UM.Mesh.MeshData.MeshData.getNormalsAsByteArray (   self,
  Optional,
  bytes 
)
Get all normals of this mesh as a bytearray

:return: A bytearray object with 3 floats per normal.

◆ getVertex()

def UM.Mesh.MeshData.MeshData.getVertex (   self,
  index 
)
Get a vertex by index

◆ getVertexCount()

def UM.Mesh.MeshData.MeshData.getVertexCount (   self,
  int 
)
Get the number of vertices

◆ getVertices()

def UM.Mesh.MeshData.MeshData.getVertices (   self,
  numpy,
  ndarray 
)
Get the array of vertices

◆ getVerticesAsByteArray()

def UM.Mesh.MeshData.MeshData.getVerticesAsByteArray (   self,
  Optional,
  bytes 
)
Get all vertices of this mesh as a bytearray

:return: A bytearray object with 3 floats per vertex.

◆ hasIndices()

def UM.Mesh.MeshData.MeshData.hasIndices (   self,
  bool 
)
Return whether this mesh has indices.

◆ hasNormals()

def UM.Mesh.MeshData.MeshData.hasNormals (   self,
  bool 
)
Return whether this mesh has vertex normals.

◆ set()

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,
  MeshData 
)
Create a new MeshData with specified changes

:return: :type{MeshData}

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