Skip to content

feat: PointCloud.disp(notebook=True) draws in the notebook cell with Plotly - #279

Merged
petercorke merged 1 commit into
mainfrom
feat/pointcloud-notebook-display
Nov 24, 2026
Merged

petercorke merged 1 commit into
mainfrom
feat/pointcloud-notebook-display

Conversation

@petercorke

Copy link
Copy Markdown
Owner

In a notebook, PointCloud.disp() opens an external Open3D window. With notebook=True it now draws in the output of the cell, as a Plotly figure that can be rotated and zoomed. This matches Swift's launch(notebook=True). The default is False, so scripts and the external window behave as before.

Plotly is optional and is not added as a dependency. Without it, notebook=True raises an ImportError that says pip install plotly. The view options front, lookat, up and zoom, and width, height and point_sample_factor, are passed to Open3D. file= with notebook=True raises ValueError.

The figure is built with get_plotly_fig and shown once. open3d.visualization.draw_plotly shows the figure and also returns it, so a cell that ends with that call shows two live views.

VoxelGrid.disp() is not changed. Open3D's Plotly drawing gives an empty figure for a voxel grid.

Tests: shown once with no return value, the points, title and size, point_sample_factor, the missing-Plotly message, and the file= error. I ran a one-cell notebook headless, and it gave one figure in the cell output. I ran the full suite and mypy, and both are clean. I did not look at the figure in VS Code.

AI-assisted: written with Claude Code.

🤖 Generated with Claude Code

…Plotly

Plotly is optional: without it, notebook=True raises an ImportError that says
how to install it.  The figure is built with get_plotly_fig and shown once,
because open3d's draw_plotly shows the figure and also returns it, which puts
two views in a cell that ends with the call.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 6 complexity · 2 duplication

Metric Results
Complexity 6
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke
petercorke merged commit 829668b into main Nov 24, 2026
34 checks passed
@petercorke
petercorke deleted the feat/pointcloud-notebook-display branch November 24, 2026 05:13
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant