Skip to content

cxlso/RealSense_GH_Blender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RealSense Point Cloud Capture for Grasshopper and Blender

A collection of Python scripts for capturing point cloud data from Intel RealSense cameras and integrating it into Grasshopper (Rhino 8) and Blender.

PortraitBanner

Overview

This project explores real-time and near–real-time point cloud acquisition using Python-based pipelines built around Open3D, enabling integration with computational design and 3D modeling environments.

Two parallel workflows are provided:

  • Grasshopper Python components
  • A Blender Python script with a custom UI panel

RealSense Documetation

Hardware & Compatibility

  • Camera: Intel RealSense D435 (tested)
  • Other RealSense cameras may work but have not been tested.
  • CAD Files

Disclaimer on Accuracy

Important:
The geometric accuracy of the generated point clouds has not been formally verified.

The point clouds produced by these scripts appear deformed compared to those generated directly in the RealSense Viewer. This may be related to camera intrinsics handling or projection logic, but this has not been conclusively confirmed.

If accuracy is critical, consider the verified Grasshopper plugin below.

✅ Alternative (Verified) Grasshopper Plugin

If you need a Grasshopper solution that produces point clouds identical to the RealSense Viewer output, use Radii Capture – RealSense, which directly accesses the RealSense SDK DLLs.

Installation

RealSense SDK Setup (Required)

Before using any script, you must install the official RealSense SDK 2.0.

This installation includes already include RealSense Viewer and Depth Quality Tool. Use these tools first to verify that your camera is working correctly.

Python Dependencies

open3d
pyrealsense2
numpy
matplotlib

Notes:

  • Open3D is the main library used for point cloud acquisition and processing.
  • pyrealsense2 is used to retrieve camera intrinsics, which do not appear to be accessible through Open3D alone (only used in Camera Intrinsics Inspection GH defintion)

Grasshopper

Install the required Python libraries listed above using the Grasshopper Python Script Component Package Installer.

Blender

Install the required Python libraries listed above using Luigi Pacheco’s BlenderPipInstaller

🦗 Grasshopper Definitions

File: RealSenseCapture_Examples.gh

1. Camera Configuration Check

Lists available RealSense devices and supported configurations.
Library: Open3D

2. Camera Intrinsics Inspection

Retrieves camera intrinsics related to calibration and point cloud projection.
Library: pyrealsense2

3. Capture Point Cloud (Slow)

Computes the point cloud directly inside the Grasshopper Python component.
Points are generated individually and converted into a point cloud object.
This method is slower but fully internal and can be triggered continuously.

Inputs:

  • Color Mode: 0 = no color, 1 = RGB, 2 = depth gradient
  • Min Depth (meters)
  • Max Depth (meters)
  • Voxel Size (meters)

Libraries: Open3D, NumPy

4. Capture Point Cloud (Fast)

Saves the point cloud as a .ply file in a temporary folder, then loads it using a C# script.
This method is significantly faster and suitable for real-time capture. It can be triggered continuously.

Inputs:

  • Color Mode: 0 = no color, 1 = RGB, 2 = depth gradient
  • Min Depth (meters)
  • Max Depth (meters)
  • Voxel Size (meters)

Libraries: Open3D, NumPy, Matplotlib

Grasshopper Pointcloud Utility Scripts

File: PointcloudUtilityScripts.gh

Scripts for cleaning and preprocessing point cloud geometry to prepare it for computational design and robotic fabrication workflows. Features include:

Point Cloud Operations:

  • Cull points based on a specific Z value
  • Cluster points by distance to isolate key regions
  • Merge multiple point clouds
  • Record point cloud data
  • Remove duplicate points based on proximity

Mesh Operations:

  • Mesh point clouds while preserving color
  • Clean meshes by deleting abnormal faces

🐵 Blender Script

File: RealSenseCapture.py Load the script in Blender’s Script Editor.

RealSenseCapture

User Interface

Access parameters from the RealSense Capture tab in the viewport side panel
(open with hotkey N).

Parameters

  • Color Mode: 0 = no color, 1 = RGB, 2 = depth gradient
  • Min Depth (meters)
  • Max Depth (meters)
  • Voxel Size (meters)

Libraries: Open3D, NumPy, Matplotlib

Current Limitation

The script currently creates mesh vertices instead of a native point cloud object.
As a result, point color is not displayed, although color data is still present internally.

If you know how to convert this into a proper point cloud object in Blender, contributions are welcome.

Photos & Videos

Grasshopper.mp4
Blender.mp4
Example_RobotCapture.mp4

Reference

Conceptual and technical background: Obtaining Point Cloud from Depth Images with Intel RealSense D-435 Camera.

Contributing

Contributions and suggestions are welcome.
Please submit a pull request or open an issue to discuss improvements.

License

CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0

Acknowledgements

Special thanks to Luigi Pacheco director of the Interactive Machines Lab at School of Architecture of Florida Atlantic University for lending me his RealSense Camera.

About

A collection of Python scripts for capturing point cloud data from RealSense cameras, with integrations Grasshopper (Rhino 8) and Blender. The project focuses on real-time acquisition, data handling, and interoperability between depth sensing and computational design environments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors