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

Represents an abstract 3D shape. 

Represents a 3D box. 

Represents a 3D cylinder. 

Represents a 3D sphere. 

Represents a 3D plane. 

class
fiftyone.core.threed.shape_3d.
Shape3D
(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.mesh.Mesh
Represents an abstract 3D shape.
 Parameters
name – the name of the mesh
material (
fiftyone.core.threed.MeshMaterial
, optional) – default material for the shape 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:
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.shape_3d.
BoxGeometry
(name: str, width: float = 1, height: float = 1, depth: float = 1, 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.shape_3d.Shape3D
Represents a 3D box.
 Parameters
name (str) – name of the box
width (float) – the width of the box. Defaults to 1
height (float) – the height of the box. Defaults to 1
depth (float) – the depth of the box. Defaults to 1
material (
fiftyone.core.threed.MeshMaterial
, optional) – default material for the box. 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
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.shape_3d.
CylinderGeometry
(name: str, radius_top: float = 1, radius_bottom: float = 1, height: float = 1, radial_segments: int = 32, height_segments: int = 1, open_ended: bool = False, theta_start: float = 0, theta_length: float = 6.283185307179586, 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.shape_3d.Shape3D
Represents a 3D cylinder.
 Parameters
name (str) – name of the cylinder
radius_top (float) – the radius of the top of the cylinder. Defaults to 1
radius_bottom (float) – the radius of the bottom of the cylinder. Defaults to 1
height (float) – the height of the cylinder. Defaults to 1
radial_segments (int) – number of segmented faces around the circumference of the cylinder. Defaults to 32
height_segments (int) – number of rows of faces around the circumference of the cylinder. Defaults to 1
open_ended (bool) – whether the cylinder is openended. Defaults to
False
theta_start (float) – the start angle for the vertical sweep. Defaults to 0
theta_length (float) – the angle for the vertical sweep. Defaults to 2*Math.PI, which makes for a complete cylinder
material (
fiftyone.core.threed.MeshMaterial
, optional) – default material for the cylinder. 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
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.shape_3d.
SphereGeometry
(name: str, radius: float = 1, width_segments: int = 32, height_segments: int = 16, phi_start: float = 0, phi_length: float = 6.283185307179586, theta_start: float = 0, theta_length: float = 3.141592653589793, 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.shape_3d.Shape3D
Represents a 3D sphere.
 Parameters
name (str) – the name of the sphere
radius (float) – the radius of the sphere. Defaults to 1
width_segments (int) – the number of segmented faces around the circumference of the sphere. Defaults to 32
height_segments (int) – the number of rows of faces around the circumference of the sphere. Defaults to 16
phi_start (float) – the start angle for the horizontal sweep. Defaults to 0
phi_length (float) – the angle for the horizontal sweep. Defaults to
2*math.pi
, which makes for a complete spheretheta_start (float) – the start angle for the vertical sweep. Defaults to 0
theta_length (float) – the angle for the vertical sweep. Defaults to
math.pi
, which makes for a complete spherematerial (
fiftyone.core.threed.MeshMaterial
, optional) – the default material for the sphere. 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
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.shape_3d.
PlaneGeometry
(name: str, width: float = 1, height: float = 1, 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.shape_3d.Shape3D
Represents a 3D plane.
 Parameters
name (str) – name of the plane
width (float) – the width of the plane. Defaults to 1
height (float) – the height of the plane. Defaults to 1
material (
fiftyone.core.threed.MeshMaterial
, optional) – the default material for the plane. 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
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.