PointCloud#
- class vivid3d.PointCloud#
Bases:
vivid3d._core.BaseMesh
PointCloud class for both surface and volumetric point clouds.
Can be analyzed with 3D Voronoi for iso-surface extraction.
- label#
Optional name of the object, not required to be unique.
- Type
str
- n_polygons#
# of vertices
- Type
number
- n_vertices#
# of vertices
- Type
number
- material#
The material instance used by 3D renderers
- Type
- colormap#
The Colormap instance used to map scalar data to colors. See https://matplotlib.org/stable/gallery/color/colormap_reference for list of all supported colormaps.
- Type
matplotlib.colors.ColorMap, default: “plasma”
- opacity#
Float in the range of 0.0 - 1.0 indicating how transparent the material is. A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
- Type
number
- add_noise(self: vivid3d._core.PointCloud, max_displacement: float) None #
Moves particles randomly by uniform distribution[-max_displacement, max_displacement] along x,y,z axes.
Useful for breaking up grid-like appearance of PointClouds generated with grid based data.
- Parameters
max_displacement (float) – Maximum amount to move in along axes. It is recommended to keep below the cell size.
- add_points(self: vivid3d._core.PointCloud, points: Point3DList, color_field: List[float] = [], color_field_min: float = 0, color_field_max: float = 0) None #
Add Points to the Point Cloud
- export(self: vivid3d._core.BaseMesh, output_file: str = 'Vivid3dModel', file_type: str = 'glb') None #
Exports Mesh to output_file with given file_type format. For full list of supported file formats, see: https://vivid.readthedocs.io/en/latest/userguide/basics.html#supported-file-types
- Parameters
output_file (str, default: "Vivid3dModel") – File Directory to export to
file_type (str, default: 'glb') – File format to export to
- export_to_blob(self: vivid3d._core.BaseMesh, file_type: str = 'glb') vivid3d._core.BlobData #
Exports Mesh to Blob with given file_type format. For full list of supported file formats, see: https://vivid.readthedocs.io/en/latest/userguide/basics.html#supported-file-types
- Parameters
file_type (str, default: 'glb') – File format to export to
- Returns
blob (vivid3d.BlobData) – Object containing exported model file blobs
- move(self: vivid3d._core.BaseMesh, direction: Point3D) None #
Moves Mesh in X,Y,Z by direction(X,Y,Z)
- Parameters
direction (Point3D) – The vector to move by
- rotate(self: vivid3d._core.BaseMesh, norm_vec: Point3D, radians_angle: float) None #
Rotate the Mesh points around a normal vector by an angle in radians
- Parameters
norm_vec (Point3D (normalized)) – Unit vector from (0,0,0) of the BaseMesh
radians_angle (float) – The angle to rotate in radians
- scale(self: vivid3d._core.BaseMesh, scale: Point3D) None #
Scales Mesh in X,Y,Z by scale(X,Y,Z)
- Parameters
scale (Point3D) – The vector to scale by
- set_color(self: vivid3d._core.BaseMesh, color: str) None #
Set the mesh texture to a single color.
- Parameters
color (str) – See https://htmlcolorcodes.com/color-names/ for list of all available colors.
- show(self: vivid3d._core.BaseMesh, height: int = 600) object #
Render and view the mesh in a viewer window.
- Parameters
height (int, default: 600) – height in pixels to open the viewer
- Returns
html (str or IPython.display.HTML) – The html with embedded model.
- to_voronoi(self: vivid3d._core.PointCloud, noise_displacement: float = 0) vivid3d._core.VoronoiVolume #
Generate 3D Volume using the Voronoi algorithm.
See https://en.wikipedia.org/wiki/Voronoi_diagram for explanation.
- Parameters
noise_displacement (float, default: 0.0) – Sometimes helps fix edge cases where the algorithm fails. Use sparingly.
- Returns
volume (vivid3d.VoronoiVolume) – The calculated 3D Cell volume
- transform(self: vivid3d._core.BaseMesh, matrix: List[Point3D[3]]) None #
Transform Mesh by transformation matrix