docarray.document.mixins.mesh module#

class docarray.document.mixins.mesh.MeshEnum(value)[source]#

Bases: Enum

An enumeration.

FILE_EXTENSIONS = ['glb', 'obj', 'ply']#
VERTICES = 'vertices'#
FACES = 'faces'#
class docarray.document.mixins.mesh.PointCloudEnum(value)[source]#

Bases: Enum

An enumeration.

COLORS = 'point_cloud_colors'#
class docarray.document.mixins.mesh.MeshDataMixin[source]#

Bases: object

Provide helper functions for Document to support 3D mesh data and point cloud.

load_uri_to_point_cloud_tensor(samples, as_chunks=False)[source]#

Convert a 3d mesh-like uri into tensor

Parameters:
  • samples (int) – number of points to sample from the mesh

  • as_chunks (bool) – when multiple geometry stored in one mesh file, then store each geometry into different chunks

Return type:

T

Returns:

itself after processed

load_uri_to_vertices_and_faces()[source]#

Convert a 3d mesh-like uri into chunks as vertices and faces

Return type:

T

Returns:

itself after processed

load_vertices_and_faces_to_point_cloud(samples)[source]#

Convert a 3d mesh of vertices and faces from chunks into point cloud tensor

Parameters:

samples (int) – number of points to sample from the mesh

Return type:

T

Returns:

itself after processed

load_uris_to_rgbd_tensor()[source]#

Load RGB image from uri of chunks[0] and depth image from uri of chunks[1] and merge them into tensor.

Return type:

T

Returns:

itself after processed