Mesh¶
-
class
pyrender.Mesh(primitives, name=None, weights=None, is_visible=True)[source]¶ Bases:
objectA set of primitives to be rendered.
Parameters: Attributes Summary
boundsThe axis-aligned bounds of the mesh. centroidThe centroid of the mesh’s axis-aligned bounding box (AABB). extentsThe lengths of the axes of the mesh’s AABB. is_transparentIf True, the mesh is partially-transparent. is_visibleWhether the mesh is visible. nameThe user-defined name of this object. primitivesThe primitives associated with this mesh. scaleThe length of the diagonal of the mesh’s AABB. weightsWeights to be applied to morph targets. Methods Summary
from_points(points[, colors, normals, …])Create a Mesh from a set of points. from_trimesh(mesh[, material, is_visible, …])Create a Mesh from a Trimesh.Attributes Documentation
Methods Documentation
-
static
from_points(points, colors=None, normals=None, is_visible=True, poses=None)[source]¶ Create a Mesh from a set of points.
Parameters: - points ((n,3) float) – The point positions.
- colors ((n,3) or (n,4) float, optional) – RGB or RGBA colors for each point.
- normals ((n,3) float, optionals) – The normal vectors for each point.
- is_visible (bool) – If False, the points will not be rendered.
- poses ((x,4,4)) – Array of 4x4 transformation matrices for instancing this object.
Returns: mesh – The created mesh.
Return type:
-
static
from_trimesh(mesh, material=None, is_visible=True, poses=None, wireframe=False, smooth=True)[source]¶ Create a Mesh from a
Trimesh.Parameters: - mesh (
Trimeshor list of them) – A triangular mesh or a list of meshes. - material (
Material) – The material of the object. Overrides any mesh material. If not specified and the mesh has no material, a default material will be used. - is_visible (bool) – If False, the mesh will not be rendered.
- poses ((n,4,4) float) – Array of 4x4 transformation matrices for instancing this object.
- wireframe (bool) – If True, the mesh will be rendered as a wireframe object
- smooth (bool) – If True, the mesh will be rendered with interpolated vertex normals. Otherwise, the mesh edges will stay sharp.
Returns: mesh – The created mesh.
Return type: - mesh (
-
static