ct.geometry

Functions for creating and manipulating 3D geometries.

ct.geometry.create_sphere_lineset(radius=1.0, resolution=10, color=array([0, 0, 0]))[source]

Create a sphere represented as a line set.

Parameters:
  • radius (float) – Radius of the sphere.

  • resolution (int) – Resolution of the sphere mesh.

  • color (Float[ndarray, '3']) – RGB color of the sphere lines.

Returns:

Open3D LineSet representing the sphere.

Return type:

LineSet

ct.geometry.mesh_to_lineset(mesh, downsample_ratio=1.0, color=None)[source]

Convert a mesh to a line set, optionally downsampling it.

Parameters:
  • mesh (TriangleMesh) – Open3D triangle mesh to convert.

  • downsample_ratio (float) – Ratio of triangles to keep (0.0 to 1.0).

  • color (Float[ndarray, '3'] | None) – Optional RGB color for the lines. If None, uses black.

Returns:

Open3D LineSet representing the mesh edges.

Raises:

ValueError – If downsample_ratio is greater than 1.0.

Return type:

LineSet