fiftyone.core.threed.meshÂ¶
Mesh definitions for 3D visualization.
Classes:

Represents an abstract 3D mesh. 

Represents an OBJ mesh. 

Represents an FBX mesh. 

Represents a gLTF mesh. 

Represents a PLY mesh. 

Represents an STL mesh. 

class
fiftyone.core.threed.mesh.
Mesh
(name: str, material: Optional[fiftyone.core.threed.material_3d.MeshMaterial] = None, visible=True, position: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, scale: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, quaternion: Optional[fiftyone.core.threed.transformation.Quaternion] = None)Â¶ Bases:
fiftyone.core.threed.object_3d.Object3D
Represents an abstract 3D mesh.
 Parameters
name â€“ the name of the mesh
material (
fiftyone.core.threed.MeshMaterial
, optional) â€“ the default material for the mesh. Defaults tofiftyone.core.threed.MeshStandardMaterial
if not providedvisible (True) â€“ default visibility of the mesh in the scene
position (None) â€“ the position of the mesh in object space
quaternion (None) â€“ the quaternion of the mesh in object space
scale (None) â€“ the scale of the mesh in object space
Methods:
set_default_material
(material)Sets the material of the mesh.
add
(*objs)Add one or more objects as children of this one.
as_dict
()Converts the object to a dict.
clear
()Remove all children from this object.
traverse
([include_self])Traverse the scene graph.
Attributes:
The local transform matrix of the object.
The position of the object in object space.
The quaternion of the object in object space.
The rotation of the object in object space.
The scale of the object in object space.
The unique ID of the object.

set_default_material
(material: fiftyone.core.threed.material_3d.MeshMaterial)Â¶ Sets the material of the mesh.
 Parameters
material (MeshMaterial) â€“ the material to set as the default

add
(*objs: fiftyone.core.threed.object_3d.Object3D) → NoneÂ¶ Add one or more objects as children of this one.

as_dict
()Â¶ Converts the object to a dict.

clear
() → NoneÂ¶ Remove all children from this object.

property
local_transform_matrix
Â¶ The local transform matrix of the object.
Setting this property also decomposes the matrix into its constituent position, quaternion, and scale components. However, decomposition of matrices with skew / shear components (nonuniform scaling) might have unexpected results.

property
position
Â¶ The position of the object in object space.

property
quaternion
Â¶ The quaternion of the object in object space.

property
rotation
Â¶ The rotation of the object in object space.

property
scale
Â¶ The scale of the object in object space.

traverse
(include_self=True)Â¶ Traverse the scene graph.

property
uuid
Â¶ The unique ID of the object.

class
fiftyone.core.threed.mesh.
ObjMesh
(name: str, obj_path: str, mtl_path: Optional[str] = None, default_material: Optional[fiftyone.core.threed.material_3d.MeshMaterial] = None, visible=True, position: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, scale: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, quaternion: Optional[fiftyone.core.threed.transformation.Quaternion] = None)Â¶ Bases:
fiftyone.core.threed.mesh.Mesh
Represents an OBJ mesh.
 Parameters
name (str) â€“ the name of the mesh
obj_path (str) â€“ the path to the
.obj
file. The path may be either absolute or relative to the directory containing the.fo3d
filemtl_path (str, optional) â€“ the path to the
.mtl
file. Defaults toNone
. The path may be either absolute or relative to the directory containing the.fo3d
filematerial (
fiftyone.core.threed.MeshMaterial
, optional) â€“ the default material for the mesh ifmtl_path
is not provided or if material inmtl_path
is not found. Defaults tofiftyone.core.threed.MeshStandardMaterial
visible (True) â€“ default visibility of the mesh in the scene
position (None) â€“ the position of the mesh in object space
quaternion (None) â€“ the quaternion of the mesh in object space
scale (None) â€“ the scale of the mesh in object space
 Raises
ValueError â€“ if
obj_path
does not end with.obj
ValueError â€“ if
mtl_path
does not end with.mtl
Methods:
add
(*objs)Add one or more objects as children of this one.
as_dict
()Converts the object to a dict.
clear
()Remove all children from this object.
set_default_material
(material)Sets the material of the mesh.
traverse
([include_self])Traverse the scene graph.
Attributes:
The local transform matrix of the object.
The position of the object in object space.
The quaternion of the object in object space.
The rotation of the object in object space.
The scale of the object in object space.
The unique ID of the object.

add
(*objs: fiftyone.core.threed.object_3d.Object3D) → NoneÂ¶ Add one or more objects as children of this one.

as_dict
()Â¶ Converts the object to a dict.

clear
() → NoneÂ¶ Remove all children from this object.

property
local_transform_matrix
Â¶ The local transform matrix of the object.
Setting this property also decomposes the matrix into its constituent position, quaternion, and scale components. However, decomposition of matrices with skew / shear components (nonuniform scaling) might have unexpected results.

property
position
Â¶ The position of the object in object space.

property
quaternion
Â¶ The quaternion of the object in object space.

property
rotation
Â¶ The rotation of the object in object space.

property
scale
Â¶ The scale of the object in object space.

set_default_material
(material: fiftyone.core.threed.material_3d.MeshMaterial)Â¶ Sets the material of the mesh.
 Parameters
material (MeshMaterial) â€“ the material to set as the default

traverse
(include_self=True)Â¶ Traverse the scene graph.

property
uuid
Â¶ The unique ID of the object.

class
fiftyone.core.threed.mesh.
FbxMesh
(name: str, fbx_path: str, default_material: Optional[fiftyone.core.threed.material_3d.MeshMaterial] = None, visible=True, position: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, scale: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, quaternion: Optional[fiftyone.core.threed.transformation.Quaternion] = None)Â¶ Bases:
fiftyone.core.threed.mesh.Mesh
Represents an FBX mesh.
 Parameters
name (str) â€“ the name of the mesh
fbx_path (str) â€“ the path to the
.fbx
file. Path may be either absolute or relative to the directory containing the.fo3d
filematerial (
fiftyone.core.threed.MeshMaterial
, optional) â€“ the default material for the mesh if FBX file does not contain material information. Defaults tofiftyone.core.threed.MeshStandardMaterial
visible (True) â€“ default visibility of the mesh in the scene
position (None) â€“ the position of the mesh in object space
quaternion (None) â€“ the quaternion of the mesh in object space
scale (None) â€“ the scale of the mesh in object space
 Raises
ValueError â€“ If
fbx_path
does not end with.fbx
Methods:
add
(*objs)Add one or more objects as children of this one.
as_dict
()Converts the object to a dict.
clear
()Remove all children from this object.
set_default_material
(material)Sets the material of the mesh.
traverse
([include_self])Traverse the scene graph.
Attributes:
The local transform matrix of the object.
The position of the object in object space.
The quaternion of the object in object space.
The rotation of the object in object space.
The scale of the object in object space.
The unique ID of the object.

add
(*objs: fiftyone.core.threed.object_3d.Object3D) → NoneÂ¶ Add one or more objects as children of this one.

as_dict
()Â¶ Converts the object to a dict.

clear
() → NoneÂ¶ Remove all children from this object.

property
local_transform_matrix
Â¶ The local transform matrix of the object.
Setting this property also decomposes the matrix into its constituent position, quaternion, and scale components. However, decomposition of matrices with skew / shear components (nonuniform scaling) might have unexpected results.

property
position
Â¶ The position of the object in object space.

property
quaternion
Â¶ The quaternion of the object in object space.

property
rotation
Â¶ The rotation of the object in object space.

property
scale
Â¶ The scale of the object in object space.

set_default_material
(material: fiftyone.core.threed.material_3d.MeshMaterial)Â¶ Sets the material of the mesh.
 Parameters
material (MeshMaterial) â€“ the material to set as the default

traverse
(include_self=True)Â¶ Traverse the scene graph.

property
uuid
Â¶ The unique ID of the object.

class
fiftyone.core.threed.mesh.
GltfMesh
(name: str, gltf_path: str, default_material: Optional[fiftyone.core.threed.material_3d.MeshMaterial] = None, visible=True, position: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, scale: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, quaternion: Optional[fiftyone.core.threed.transformation.Quaternion] = None)Â¶ Bases:
fiftyone.core.threed.mesh.Mesh
Represents a gLTF mesh.
 Parameters
name (str) â€“ the name of the mesh
gltf_path (str) â€“ the path to the
.gltf
or.glb
file. The path may be either absolute or relative to the directory containing the.fo3d
filematerial (
fiftyone.core.threed.MeshMaterial
, optional) â€“ the default material for the mesh if gLTF file does not contain material information. Defaults tofiftyone.core.threed.MeshStandardMaterial
visible (True) â€“ default visibility of the mesh in the scene
position (None) â€“ the position of the mesh in object space
quaternion (None) â€“ the quaternion of the mesh in object space
scale (None) â€“ the scale of the mesh in object space
 Raises
ValueError â€“ if
gltf_path
does not end with â€˜.gltfâ€™ or.glb
Methods:
add
(*objs)Add one or more objects as children of this one.
as_dict
()Converts the object to a dict.
clear
()Remove all children from this object.
set_default_material
(material)Sets the material of the mesh.
traverse
([include_self])Traverse the scene graph.
Attributes:
The local transform matrix of the object.
The position of the object in object space.
The quaternion of the object in object space.
The rotation of the object in object space.
The scale of the object in object space.
The unique ID of the object.

add
(*objs: fiftyone.core.threed.object_3d.Object3D) → NoneÂ¶ Add one or more objects as children of this one.

as_dict
()Â¶ Converts the object to a dict.

clear
() → NoneÂ¶ Remove all children from this object.

property
local_transform_matrix
Â¶ The local transform matrix of the object.
Setting this property also decomposes the matrix into its constituent position, quaternion, and scale components. However, decomposition of matrices with skew / shear components (nonuniform scaling) might have unexpected results.

property
position
Â¶ The position of the object in object space.

property
quaternion
Â¶ The quaternion of the object in object space.

property
rotation
Â¶ The rotation of the object in object space.

property
scale
Â¶ The scale of the object in object space.

set_default_material
(material: fiftyone.core.threed.material_3d.MeshMaterial)Â¶ Sets the material of the mesh.
 Parameters
material (MeshMaterial) â€“ the material to set as the default

traverse
(include_self=True)Â¶ Traverse the scene graph.

property
uuid
Â¶ The unique ID of the object.

class
fiftyone.core.threed.mesh.
PlyMesh
(name: str, ply_path: str, is_point_cloud: bool = False, center_geometry: bool = True, default_material: Optional[fiftyone.core.threed.material_3d.MeshMaterial] = None, visible=True, position: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, scale: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, quaternion: Optional[fiftyone.core.threed.transformation.Quaternion] = None)Â¶ Bases:
fiftyone.core.threed.mesh.Mesh
Represents a PLY mesh. A PLY mesh can be a point cloud or a mesh.
 Parameters
name (str) â€“ the name of the mesh
ply_path (str) â€“ the path to the
.ply
file. The path may be either absolute or relative to the directory containing the.fo3d
fileis_point_cloud (bool) â€“ whether the PLY file is a point cloud. Defaults to
False
center_geometry (bool) â€“ whether to center the geometry. Defaults to
True
material (
fiftyone.core.threed.MeshMaterial
, optional) â€“ default material for the mesh if PLY file does not contain vertex colors. Defaults tofiftyone.core.threed.MeshStandardMaterial
. If the PLY file contains vertex colors, the material is ignored and vertex colors are usedvisible (True) â€“ default visibility of the mesh in the scene
position (None) â€“ the position of the mesh in object space
quaternion (None) â€“ the quaternion of the mesh in object space
scale (None) â€“ the scale of the mesh in object space
 Raises
ValueError â€“ if
ply_path
does not end with.ply
Methods:
add
(*objs)Add one or more objects as children of this one.
as_dict
()Converts the object to a dict.
clear
()Remove all children from this object.
set_default_material
(material)Sets the material of the mesh.
traverse
([include_self])Traverse the scene graph.
Attributes:
The local transform matrix of the object.
The position of the object in object space.
The quaternion of the object in object space.
The rotation of the object in object space.
The scale of the object in object space.
The unique ID of the object.

add
(*objs: fiftyone.core.threed.object_3d.Object3D) → NoneÂ¶ Add one or more objects as children of this one.

as_dict
()Â¶ Converts the object to a dict.

clear
() → NoneÂ¶ Remove all children from this object.

property
local_transform_matrix
Â¶ The local transform matrix of the object.
Setting this property also decomposes the matrix into its constituent position, quaternion, and scale components. However, decomposition of matrices with skew / shear components (nonuniform scaling) might have unexpected results.

property
position
Â¶ The position of the object in object space.

property
quaternion
Â¶ The quaternion of the object in object space.

property
rotation
Â¶ The rotation of the object in object space.

property
scale
Â¶ The scale of the object in object space.

set_default_material
(material: fiftyone.core.threed.material_3d.MeshMaterial)Â¶ Sets the material of the mesh.
 Parameters
material (MeshMaterial) â€“ the material to set as the default

traverse
(include_self=True)Â¶ Traverse the scene graph.

property
uuid
Â¶ The unique ID of the object.

class
fiftyone.core.threed.mesh.
StlMesh
(name: str, stl_path: str, default_material: Optional[fiftyone.core.threed.material_3d.MeshMaterial] = None, visible=True, position: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, scale: Optional[Union[fiftyone.core.threed.transformation.Vector3, List[float], Tuple[float], numpy.array]] = None, quaternion: Optional[fiftyone.core.threed.transformation.Quaternion] = None)Â¶ Bases:
fiftyone.core.threed.mesh.Mesh
Represents an STL mesh.
 Parameters
name (str) â€“ the name of the mesh
stl_path (str) â€“ the path to the
.stl
file. The path may be either absolute or relative to the directory containing the.fo3d
filematerial (
fiftyone.core.threed.MeshMaterial
, optional) â€“ default material for the mesh. Defaults tofiftyone.core.threed.MeshStandardMaterial
visible (True) â€“ default visibility of the mesh in the scene
position (None) â€“ the position of the mesh in object space
quaternion (None) â€“ the quaternion of the mesh in object space
scale (None) â€“ the scale of the mesh in object space
 Raises
ValueError â€“ if
stl_path
does not end with.stl
Methods:
add
(*objs)Add one or more objects as children of this one.
as_dict
()Converts the object to a dict.
clear
()Remove all children from this object.
set_default_material
(material)Sets the material of the mesh.
traverse
([include_self])Traverse the scene graph.
Attributes:
The local transform matrix of the object.
The position of the object in object space.
The quaternion of the object in object space.
The rotation of the object in object space.
The scale of the object in object space.
The unique ID of the object.

add
(*objs: fiftyone.core.threed.object_3d.Object3D) → NoneÂ¶ Add one or more objects as children of this one.

as_dict
()Â¶ Converts the object to a dict.

clear
() → NoneÂ¶ Remove all children from this object.

property
local_transform_matrix
Â¶ The local transform matrix of the object.
Setting this property also decomposes the matrix into its constituent position, quaternion, and scale components. However, decomposition of matrices with skew / shear components (nonuniform scaling) might have unexpected results.

property
position
Â¶ The position of the object in object space.

property
quaternion
Â¶ The quaternion of the object in object space.

property
rotation
Â¶ The rotation of the object in object space.

property
scale
Â¶ The scale of the object in object space.

set_default_material
(material: fiftyone.core.threed.material_3d.MeshMaterial)Â¶ Sets the material of the mesh.
 Parameters
material (MeshMaterial) â€“ the material to set as the default

traverse
(include_self=True)Â¶ Traverse the scene graph.

property
uuid
Â¶ The unique ID of the object.