← Back to list

Open3D tips — Create outline borders for point clouds

In this post, I will show different ways how to create outline borders for a point cloud using Open3D. It can be useful for visualization…

Vladprivalov · 2025-11-06 15:06 · 0 claps · 1.5 min read
#point-cloud #3d-modeling #visualization #open3d
Open on Medium ↗
Wiki topics: 3D · Motion & 3D Design

Open3D tips — Create outline borders for point clouds

In this post, I will show different ways how to create outline borders for a point cloud using Open3D. It can be useful for visualization of multiple points clouds overlapping each other (e.g walls of a room in BIM applications).

First way — by computing its convex hull and then visualizing the hull’s edges as a LineSet.

Code:

import open3d as o3d
import numpy as np

# 1. Load or create a point cloud
# For this example, we use the Stanford bunny provided in the Open3D examples
bunny = o3d.data.BunnyMesh()
mesh = o3d.io.read_triangle_mesh(bunny.path)
pcd = mesh.sample_points_poisson_disk(number_of_points=2000)

# You can also use your own point cloud, e.g.:
# pcd = o3d.io.read_point_cloud("your_point_cloud.pcd")

print(f"Point cloud with {len(pcd.points)} points loaded.")

# 2. Compute the convex hull
# The convex hull is returned as a TriangleMesh
hull, _ = pcd.compute_convex_hull()
print(f"Convex hull computed, with {len(hull.vertices)} vertices and {len(hull.triangles)} triangles.")

# 3. Create a LineSet from the convex hull mesh
# This converts the triangular faces into a set of connecting lines (edges)
hull_ls = o3d.geometry.LineSet.create_from_triangle_mesh(hull)

# 4. Color the outline borders (optional)
# This will make the borders red for better visibility
hull_ls.paint_uniform_color((1, 0, 0))

# 5. Visualize the original point cloud and the borders together
print("Visualizing point cloud with red outline borders.")
o3d.visualization.draw_geometries([pcd, hull_ls])

Result:

This kind of visualization can look quite dirty due to many edges between points.

Second way — build bounding box.

Code

import open3d as o3d
import numpy as np

# Load your point cloud (replace with your data)
pcd = o3d.io.read_point_cloud("your_point_cloud.pcd") 

# Create an axis-aligned bounding box and set its color
aabb = pcd.get_axis_aligned_bounding_box()
aabb.color = (1, 0, 0) # Red color

# Visualize the point cloud and the bounding box
o3d.visualization.draw_geometries([pcd, aabb])

Result:

That’s all. Good luck in using Open3D.


메타데이터
post_id
c62d94426a95
slug
open3d-tips-create-outline-borders-for-point-clouds-c62d94426a95
url
https://medium.com/@sigmoid90/open3d-tips-create-outline-borders-for-point-clouds-c62d94426a95
canonical_url
https://medium.com/@sigmoid90/open3d-tips-create-outline-borders-for-point-clouds-c62d94426a95
author_url
https://medium.com/@sigmoid90
status
ok
fetched_at
2026-07-15 15:51:19