3D Visualizer
io.github.kleinicke由 GitHub 帳號 kleinicke 發布v0.4.2更新於 Oct 25, 2026
Inspect, compare and export point clouds, meshes and calibrated depth data with inline 3D previews.
概覽
一個本機 MCP 伺服器,讓助理開啟、檢視、比較並匯出 3D 點雲、網格與深度資料,並查看算繪預覽。
- 可以做什麼
- 從點雲、網格與深度檔案,或從 NumPy 與 PyTorch 陣列開啟 3D 場景,在本機檢視器工作階段中由助理操作。檢視場景內容並擷取算繪畫面供助理查看。控制相機並就地更新場景,包括帶預測/目標疊圖與梯度箭頭的訓練預覽。使用完整工具集時,可轉換深度資料、進行選取、播放動畫、對齊場景並匯出結果。
- 適用情境
- 適合助理需要直接查看 3D 幾何而非只憑數字推斷的情況:檢查掃描、網格或深度擷取,比較前後結果或預測與目標,或在 Python、PyTorch 工作流程中產生預覽圖。
- 執行需求
- 透過 uvx 從 3d-visualizer 的 PyPI 套件以 stdio 在本機執行,需要 Python 3.10+ 與 uv。無介面算繪需要 headless 附加元件並一次性安裝 Chromium。啟動時需指定資料根目錄(--root),限定可存取的檔案範圍。未宣告帳號、API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 3D Visualizer,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
3D Visualizer — Python, CLI and MCP
Inspect point clouds, meshes and calibrated depth data in Python, notebooks or
an AI conversation. The package is 3d-visualizer, the Python import is
viz3d, and the CLI is 3d-visualizer. Python 3.10+ is required.
This checkout targets the next release. The public 0.4.2 package still uses the
older import. For the new interface before publication, build the viewer and
install ./packages/python with the extras you need.
Agent installation
These examples target 0.5.0.dev0. Development versions must be installed from this checkout until published; do not assume an unreleased version exists on PyPI.
For agents, use uv tool install or uvx; uv add is for using the library
inside a Python project. Headless mode also needs Chromium installed once.
Client configuration (replace the data directory):
Install in VS Code
The VS Code link uses the current workspace as the allowed data root.
The default --tools core exposes eight everyday tools. Use --tools full
for depth conversion, selections, animation, alignment and export.
--renderer auto uses an advertised MCP Apps host, otherwise offscreen
Chromium. Use --renderer inline to require a widget or explicit browser;
use --renderer headless for unattended work.
Unattended Python rendering
With the headless extra and Chromium installed:
This uses offscreen Chromium and the shared renderer. It requires no notebook, chat widget or visible browser window. Inspect and capture raise on renderer failure instead of returning a placeholder success.
Install with uv (recommended)
Install uv, then choose:
The Python import is from viz3d import show. Tool installation does not add
the library to a Python project or notebook kernel; use uv add or
uv pip install in that environment. No Node.js build is needed for PyPI
installs.
For local Jupyter, run uv run --with jupyter jupyter lab from your project and
select its Python kernel. Keep that kernel alive while using the viewer.
Developing from source
From the repository root, build the bundled engine with Node 24:
See publishing setup for releases.
Alternative: install with pip from this repository
After building the browser assets above:
On Windows, replace the environment's bin/ paths with Scripts/, e.g.
packages\python\.venv\Scripts\python.exe, 3d-visualizer.exe, or
jupyter.exe. After activating the environment, the command is simply:
The command prints a local URL and keeps running until Ctrl+C. --no-browser
allows an agent or another application to open that URL itself. It does not
render an image or report successful browser rendering to the caller.
Python
Coordinates must be finite float32-compatible numbers. Optional colors must match the point count and contain integer RGB values in 0..255. Point arrays are serialized to a temporary binary PLY, decoded by the existing engine, and removed when the session closes. This first implementation serializes arrays row by row; it is not a zero-copy transport for very large arrays.
NumPy and PyTorch
Pass arrays and tensors directly, including RGB colors:
- NumPy arrays can be transposed, sliced, read-only, or non-contiguous.
- PyTorch inputs can be CPU or GPU tensors, detached or attached to autograd. Both coordinates and colors are handled independently, so mixing devices or NumPy/PyTorch inputs works. Float16 and bfloat16 tensors are supported.
- Visualization detaches internally, transfers to CPU, and serializes a
snapshot. The original device, values,
requires_grad, and autograd graph are unchanged. GPU-to-CPU transfer synchronizes; avoid calling this every training step. - PyTorch conversion does not depend on NumPy. CPU rows are converted in bounded chunks rather than performing a GPU scalar read for every coordinate.
- Inputs must be real, dense
(N, 3)data. For(B, N, 3)batches, useshow(batch[0]); batches are deliberately not flattened automatically. Sparse, quantized, complex, nested, and data-free meta tensors are rejected with an error. RGB retains the integer-valued 0..255 convention, including floating-point tensors; normalized RGB can be passed as(rgb * 255).round().
Training previews
All updates reuse the same browser tab/inline view and preserve its camera. The viewer receives change notifications and loads the newest revision; intermediate revisions can be skipped. Publish at a useful training interval, not every forward pass. Serialization and GPU transfer are synchronous. Updates replace the scene; manual files added to that scene are also replaced on the next update.
Prediction is orange and target cyan. Supply colors= to override prediction
RGB. Targets may have a different number of points. This is a geometric overlay,
not a computed nearest-neighbor error metric. Visibility can be toggled in the
standard file panel. Use Pause updates to inspect one revision and Fit
scene to reset the framing explicitly.
Batch and augmentation inspection
The sample selector switches batches in one scene and retains the camera. Colors, targets, and vectors (when supplied) must match the batch size. Batch snapshots serialize every sample; select a small inspection subset for large training batches. Only the chosen sample is loaded by the browser.
Gradient and displacement arrows
Arrows are anchored at the corresponding input points. Negative learning-rate
scaling shows a plain gradient-descent direction; it is not an exact Adam or
momentum optimizer step. To inspect the actual update, pass measured coordinate
displacements instead. Nonzero arrows are magenta. Up to max_vectors evenly
spaced vectors are displayed (default 256, maximum 2000). All supplied vector
rows are validated; no autograd hooks or gradient computation are installed by
this operation.
Layer inspection with a removable forward hook
For dictionary outputs use a selector such as
lambda output: output["points"][0]. The selector must return (N, 3)
coordinates, not arbitrary feature channels. The hook captures the first forward
call and then every every calls. It returns None, preserving the model's
output. A visualization error disables the hook, emits a warning and is
accessible as inspection.error; it does not invalidate training. The context
manager removes the hook, while the caller owns the viewer session's lifetime.
inspection.close() also removes it explicitly.
Run viewer updates in the main process, on one rank in distributed training, and outside compiled model code. GPU-to-CPU transfer introduces synchronization. PyTorch forward hooks.
The server binds only to 127.0.0.1, uses a random session URL, and serves only
the explicitly supplied files and bundled viewer assets. Source files remain on
your machine; the package does not upload them. Keep file paths available for
the life of the session. Do not share the session URL with untrusted code.
Inline Jupyter notebooks
In a local Jupyter notebook, return the viewer as the last expression in a cell. Browser auto-opening is disabled when a notebook kernel is detected:
Or display explicitly, using the notebook extra:
Settings are collapsed by default. A compact toolbar keeps Settings, Fit
scene, Pause updates, and the batch selector accessible. Choose
ui="full" to show settings immediately or ui="none" for a presentation-only
canvas with mouse controls. In UI-free mode, batch selection is unavailable;
choose the sample in Python before displaying it.
viewer.update(...) updates every open view, including notebook output. Keep
the kernel running, call viewer.close() when done, and do not call
viewer.wait() in a cell. Notebook output contains a live local iframe, not an
offline saved scene. Reopen the session after restarting the kernel.
This initial inline transport requires the browser and kernel on the same machine and a notebook host that permits local iframes. Remote Jupyter, Colab, and notebook environments that block local iframe URLs need a widget/proxy transport; they are not supported by this transport yet.
For a mature widget-based alternative, K3D supports notebook point clouds and other 3D primitives. Rerun is worth considering for recorded, time-based diagnostics. This package embeds the existing 3D viewer to retain its file formats and interaction controls.
Current scope
- Supported inputs: PLY, XYZ, XYZN, XYZRGB, PCD, PTS, OBJ, STL, OFF, GLB, LAS/LAZ, E57, SPZ, SPLAT, KSPLAT, and SOG.
- Multiple files appear together in one scene.
- OBJ input currently provides geometry; automatic sidecar material/texture resolution and external-resource glTF are outside this preview.
- No separate image-viewer integration or desktop launch integration yet. The shared 3D viewer retains its existing manual controls and depth-conversion features.
Build a distributable wheel
The wheel includes the browser engine and its assets. Install that wheel on
another machine with python -m pip install /path/to/the.whl; no Node.js or
Tauri installation is necessary there. Build assets before packaging.
Verify
The browser test requires npm run build:python-viewer and the existing engine
test server assets in engine/dist (npm run build --workspace=engine). Array
tests skip optional libraries and GPU backends that are unavailable.
Available platforms
- VS Code Marketplace: Install extension
- Open VSX: Install extension
- Website: 3d.f-kleinicke.de
- PyPI (Python and CLI): 3d-visualizer
- JetBrains: Signed preview and installation
- Standalone app: Tauri desktop preview
MCP is supported: agents can open and update 3D scenes, control the camera, and inspect rendered screenshots. See the MCP setup guide.
來源:packages/python/README.md,提交 5909e36
工具
0版本歷史
1- v0.4.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分