Skip to content

Filter Point Cloud Using Cylinder Base Removal

SUMMARY

Filter Point Cloud Using Cylinder Base Removal identifies and extracts one or both base points of a cylindrical structure by finding the pair of points farthest apart along the cylinder’s axis.

This Skill is useful in industrial, mobile, and humanoid robotics pipelines for tasks such as object alignment, cylinder pose estimation, or grasp planning. For example, in industrial settings it helps a robot locate pipes or rods for assembly; in mobile robotics, it can aid in detecting cylindrical obstacles or markers; and in humanoid robotics, it assists in manipulating cylindrical objects like bottles or handles.

Use this Skill when you want to detect and isolate the ends of cylindrical objects to support 3D detection, pose estimation, or targeted manipulation.

The Skill

python
from telekinesis import vitreous

filtered_mesh = vitreous.filter_point_cloud_using_cylinder_base_removal(
    mesh=mesh,
    distance_threshold=0.01,
    compute_vertex_normals=True,
)

API Reference

Data Transfer Notice

There is no longer a fixed limit of 1 million points per request. However, very large datasets may result in slower data transfer and processing times. We are continuously optimizing performance as part of our beta program, with ongoing improvements to enhance speed and reliability.

Example

Raw Sensor Input

Unprocessed point cloud captured directly from the sensor.

Filtered Point Cloud

Input point cloud overlayed with the plane for extraction.

The Code

python
from telekinesis import vitreous
from datatypes import datatypes, io
import pathlib

# Optional for logging
from loguru import logger

DATA_DIR = pathlib.Path("path/to/telekinesis-data")

# Load mesh
filepath = str(DATA_DIR / "meshes" / "beer_can.glb")
mesh = io.load_mesh(filepath=filepath)
logger.success("Loaded mesh")

# Execute operation
filtered_mesh = vitreous.filter_point_cloud_using_cylinder_base_removal(
  mesh=mesh,
  distance_threshold=0.01,
  compute_vertex_normals=True,
)

logger.success("Filtered mesh using cylinder base removal")

The Explanation of the Code

The example begins by importing the necessary modules: vitreous for point cloud and mesh operations, datatypes and io for data handling, pathlib for file paths, and loguru for optional logging.

python
from telekinesis import vitreous
from datatypes import datatypes, io
import pathlib

# Optional for logging
from loguru import logger

Next, a 3D mesh is loaded from a .glb file. This mesh represents the object to be processed, such as a cylindrical object in an industrial robotics setting. Logging confirms that the mesh was successfully loaded.

python
DATA_DIR = pathlib.Path("path/to/telekinesis-data")

# Load mesh
filepath = str(DATA_DIR / "meshes" / "beer_can.glb")
mesh = io.load_mesh(filepath=filepath)
logger.success("Loaded mesh")

Finally, the filter_point_cloud_using_cylinder_base_removal Skill is applied. This operation identifies and removes points corresponding to the circular base(s) of a cylinder, based on a distance threshold. The resulting mesh contains only the relevant object geometry without the base, which is useful in robotics pipelines for tasks like object manipulation, pose estimation, or grasp planning, where base points may interfere with detection or alignment.

python

# Execute operation
filtered_mesh = vitreous.filter_point_cloud_using_cylinder_base_removal(
  mesh=mesh,
  distance_threshold=0.01,
  compute_vertex_normals=True,
)

logger.success("Filtered mesh using cylinder base removal")

Running the Example

Runnable examples are available in the Telekinesis examples repository. Follow the README in that repository to set up the environment. Once set up, you can run this specific example with:

bash
cd telekinesis-examples
python examples/vitreous_examples.py --example filter_point_cloud_using_cylinder_base_removal

How to Tune the Parameters

The filter_point_cloud_using_cylinder_base_removal Skill has two parameters that control the base removal:

distance_threshold (default: 0.01):

  • The maximum distance from the detected base to remove vertices
  • Units: Uses the same units as your mesh (e.g., if mesh is in meters, threshold is in meters; if in millimeters, threshold is in millimeters)
  • Increase (0.01-0.1) to remove more of the base region (thicker cut)
  • Decrease (0.001-0.01) to remove less (thinner cut)
  • Should be set based on the cylinder's size and desired cut depth
  • Typical range: 0.001-0.1 in mesh units
  • Use 0.001-0.01 for precise removal, 0.01-0.05 for moderate, 0.05-0.1 for aggressive

compute_vertex_normals (default: True):

  • Whether to compute vertex normals for the filtered mesh
  • True: Computes vertex normals, which is useful for lighting and rendering
  • False: Does not compute normals, which may be acceptable for non-rendering uses

TIP

Best practice: Start with the default distance_threshold and adjust based on the cylinder's size. For small cylinders, use smaller thresholds. For large cylinders, use larger thresholds.

Where to Use the Skill in a Pipeline

Cylinder base removal is commonly used in the following pipelines:

  • Cylindrical object processing
  • Pose estimation for rods and pipes
  • Grasp planning for cylindrical objects
  • Object alignment and registration

A typical pipeline for cylindrical object processing looks as follows:

python
# Example pipeline using cylinder base removal (parameters omitted).

from telekinesis import vitreous

# 1. Load mesh
mesh = vitreous.load_mesh(...)

# 2. Optional: Preprocess mesh if needed
# filtered_mesh = vitreous.filter_mesh(...)

# 3. Remove cylinder base regions
filtered_mesh = vitreous.filter_point_cloud_using_cylinder_base_removal(
    mesh=mesh,
    distance_threshold=0.01,
    compute_vertex_normals=True,
)

# 4. Use filtered mesh for pose estimation or manipulation
# pose = vitreous.estimate_pose(...)

Related skills to build such a pipeline:

  • create_cylinder_mesh: create cylindrical meshes for testing
  • estimate_principal_axes: estimate cylinder axis for pose estimation
  • register_point_clouds_using_point_to_point_icp: align cylindrical objects

Alternative Skills

There are no direct alternative skills for removing cylinder base regions. This Skill is specifically designed for cylindrical objects.

When Not to Use the Skill

Do not use filter point cloud using cylinder base removal when:

  • The mesh is not cylindrical (this Skill is designed specifically for cylindrical objects like rods or pipes)
  • You need to remove other parts of the mesh (this Skill only removes base regions)
  • The mesh is a point cloud (this Skill works on meshes, not point clouds)
  • You need to preserve the base (this Skill removes the base regions)
  • The cylinder is very short (base removal may remove too much of the object)