geo3d.visualization.utils

Utility helpers for Open3D visualization workflows.

Functions

validate_colors(→ None)

Validate that a color array matches the given point count.

apply_colors(→ None)

Apply RGB colors to an Open3D point cloud.

compute_default_colors(...)

Compute default point colors from point cloud data.

to_point_cloud(→ open3d.geometry.PointCloud)

Convert raw points and colors into an Open3D point cloud.

compute_label_position(...)

Compute a label placement position above the combined geometries.

serialize_geometries(→ list[dict])

Convert Open3D geometries into serializable dictionaries.

deserialize_geometries(→ list[open3d.geometry.PointCloud])

Create Open3D PointCloud geometries from serialized data.

Module Contents

geo3d.visualization.utils.validate_colors(points: numpy.ndarray, colors: numpy.ndarray | None) None

Validate that a color array matches the given point count.

Parameters:
  • points – Points array used for visualization.

  • colors – RGB colors to apply to each point.

Raises:

ValueError – If the number of colors does not match the number of points or if the colors array does not have shape (N, 3).

geo3d.visualization.utils.apply_colors(pcd: open3d.geometry.PointCloud, colors: numpy.ndarray | None) None

Apply RGB colors to an Open3D point cloud.

Parameters:
  • pcd – Open3D PointCloud to color.

  • colors – RGB color values for each point.

geo3d.visualization.utils.compute_default_colors(pcd_array: numpy.ndarray, xyz: numpy.ndarray, mode: str = 'z', colormap: str = 'jet') numpy.typing.NDArray[numpy.float32]

Compute default point colors from point cloud data.

Parameters:
  • pcd_array – Structured numpy array representing the point cloud.

  • xyz – Extracted XYZ coordinates.

  • mode – Color mode to compute (“z”, “intensity”, “classification”).

  • colormap – Matplotlib colormap name.

Returns:

RGB colors as a float32 array of shape (N, 3).

Raises:

ValueError – If the requested mode is unknown or required fields are missing.

geo3d.visualization.utils.to_point_cloud(points: numpy.ndarray, colors: numpy.ndarray | None = None) open3d.geometry.PointCloud

Convert raw points and colors into an Open3D point cloud.

Parameters:
  • points – Nx3 coordinate array.

  • colors – Optional per-point RGB values.

Returns:

An Open3D PointCloud instance.

geo3d.visualization.utils.compute_label_position(geometries: list[open3d.geometry.PointCloud]) numpy.typing.NDArray[numpy.float32]

Compute a label placement position above the combined geometries.

Parameters:

geometries – List of Open3D geometries.

Returns:

A 3D point suitable for placing an on-screen label.

geo3d.visualization.utils.serialize_geometries(geometries: list[open3d.geometry.PointCloud]) list[dict]

Convert Open3D geometries into serializable dictionaries.

Parameters:

geometries – List of Open3D PointCloud geometries.

Returns:

A list of dictionaries containing points and optional colors.

geo3d.visualization.utils.deserialize_geometries(data: list[dict]) list[open3d.geometry.PointCloud]

Create Open3D PointCloud geometries from serialized data.

Parameters:

data – Serialized geometry dictionaries.

Returns:

List of reconstructed Open3D PointCloud objects.