Point Cloud
Point clouds have all the basic properties described in Object Instructions.
Data
The point cloud object has a data property that can be updated via instructions.
The provided data overrides the previous data of the point cloud.
Example:
1 visu = Visu(voraus_3d_visu, clear_all=True)
2
3 points_material = visu.add_points_material(size=0.1, color=[0.882, 0.2, 1])
4 point_cloud = visu.add_point_cloud(data_format="ply", material=points_material)
5
6 with visu.connection():
7 byte_data = point_cloud_path.read_bytes()
8 visu.update(
9 point_cloud.data(byte_data),
10 )
1let mut visu = Visu::new(url, false, false, true, None)?;
2
3let points_material = visu.add_points_material(
4 [0.882, 0.2, 1.0],
5 PointsMaterialOptions {
6 size: 0.1,
7 ..Default::default()
8 },
9)?;
10let point_cloud = visu.add_point_cloud(
11 PointCloudFormat::Ply,
12 PointCloudOptions {
13 material: Some(points_material.identifier.clone()),
14 ..Default::default()
15 },
16)?;
17
18let mut connection = visu.connection()?;
19let byte_data = std::fs::read(&point_cloud_0_ply)?;
20connection.update(vec![point_cloud.data(&byte_data)])?;
Note
The maximum payload size for the point cloud update is 12 MB. For performance reasons, binary point cloud data is preferred over ASCII and should not exceed 1 MB. Benchmark your server and client hardware to find the optimal payload size for your use case.
Points Material
The Point Cloud object specifies the material as PointsMaterial which has
the same properties as MeshStandardMaterial which are described in Geometric Primitives
and in Model.