Skip to content

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

Merged
petercorke merged 2 commits into
mainfrom
feat/voxelgrid-notebook-display
Nov 24, 2026
Merged

petercorke merged 2 commits into
mainfrom
feat/voxelgrid-notebook-display

Conversation

@petercorke

Copy link
Copy Markdown
Owner

VoxelGrid.disp(notebook=True) draws the voxels in the output of the notebook cell, as a Plotly figure that can be rotated and zoomed. It does for VoxelGrid what PointCloud.disp(notebook=True) does for point clouds (PR 279, merged). The default is False, so the Open3D window behaves as before. Plotly stays optional, and without it you get an ImportError that says pip install plotly.

Open3D's Plotly drawing draws nothing for a voxel grid, so the voxels are turned into a triangle mesh, one cube of 12 triangles per voxel. The voxels keep their colors, or are gray if none has a color. A grid of many thousands of voxels is slow, and the docstring says so. The Plotly check and the single show are now one helper shared with PointCloud.disp.

Tests: one cube per voxel and the mesh bounds equal the grid bounds, gray and kept colors, shown once with the title, 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

petercorke and others added 2 commits November 25, 2026 06:49
…lotly

Open3D's Plotly drawing draws nothing for a voxel grid, so the voxels are turned
into a triangle mesh of one cube each, which it does draw.  The Plotly check and
the one-time show are shared with PointCloud.disp.

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 15 complexity · 0 duplication

Metric Results
Complexity 15
Duplication 0

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 b967cb3 into main Nov 24, 2026
34 checks passed
@petercorke
petercorke deleted the feat/voxelgrid-notebook-display branch November 24, 2026 21:09
@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