Skip to main content

CadQuery Web Viewer

PyPI Python License CI Downloads

Preview CadQuery or build123d models in your browser and refresh the view while you edit Python — without manually exporting meshes each time.

Try it live →

CadQuery Web Viewer screenshot

Place a screenshot or short GIF of the running viewer at assets/screenshot.png. The image is referenced here so the README renders the hero once committed; until then GitHub will show a broken image. Open an issue if you'd like a starting screenshot grabbed from the live demo.

What you get

  • Browser viewer for 3D models: orbit, zoom, measurements, clipping, transparency, and related viewing tools.
  • glTF 2.0 / GLB — a standard mesh format many 3D tools understand. The UI is built around the web model-viewer component, so you get common material and lighting behavior in the browser.
  • Live updates while you change geometry in Python (the app keeps a channel open so the page can refresh when you publish again).
  • Optional disk cache for uploaded GLBs when you run the long-lived server — see Usage.

The API and packaging are meant to be a mostly drop-in replacement for Yet Another CAD Viewer (YACV). Package renames and choosing how Python talks to the viewer — embedded server, separate server process, or buffer-only (server_type) — are covered in Migrating from yacv-server / yacv-viewer; project history and upstream links are in Special thanks at the end of this file.

Table of contents

Quick start

Requires Python 3.10 through 3.12 (see requires-python in pyproject.toml). The upstream vtk==9.3.1 pin that previously blocked Python 3.13 is gone — build123d>=0.11 depends on cadquery-ocp-novtk 7.9.x, which ships cp313/cp314 wheels — so widening the range is now a matter of testing rather than an upstream blocker.

Install with pip

The viewer package depends on build123d. The example below uses CadQuery, which is a separate install:

python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install cadquery-web-viewer cadquery

While the venv is active, run cadquery-web-viewer or python -m cadquery_web_viewer.

Other install methods (pipx, uv tool, Docker): docs/install.md.

Preview a CadQuery box locally

The library starts a small local server and a browser tab. By default the process waits until you close the viewer tab, so short scripts do not exit before you inspect the model.

import cadquery as cq

from cadquery_web_viewer import show

box = cq.Workplane().box(10, 10, 10)
show(box)

More options (host, port, timeouts, multiple show() calls): docs/usage.md.

Same box with a remote server

In one terminal, keep the viewer running:

cadquery-web-viewer --host localhost --port 32323

In another terminal, with the same Python environment:

import cadquery as cq

from cadquery_web_viewer import show

box = cq.Workplane().box(10, 10, 10)
show(
    box,
    server_type="remote",
    remote_options={"host": "localhost", "port": 32323},
)

Documentation

Examples in this repo

Folder Purpose
examples/in-process/ Full build123d sample, show() with optional textures; with CI set, runs export_all("export") after the viewer closes (not run in GitHub Actions).
examples/remote/ Same style of model sent with server_type="remote".

Trust model

cadquery-web-viewer is intended for localhost or trusted networks only:

  • The HTTP API serves CORS Access-Control-Allow-Origin: *, so any origin may call it from a browser.
  • PUT /api/object/<name> accepts a JSON body with a url field and the server fetches that URL (up to 50 MB) over http/https.
  • The Python runtime is plain flask.Flask.run — there is no auth, rate limiting, or TLS.

For details and operational guidance, see SECURITY.md and the Trust model section of docs/api.md.

Contributing

See CONTRIBUTING.md for the dev loop, test/lint/typecheck commands, and PR conventions. Bug reports and feature requests are welcome on the issue tracker.

Special thanks

Yet Another CAD Viewer (YACV) by Yeicor and contributors is the original project: a web-based CAD and GLB viewer with a Python backend for live tessellation, hot reload, and static export. This repository is a hard fork, with credit to the original authors.

MIT License. Third-party notices: assets/licenses.txt.

Metadata

Release files for cadquery-web-viewer 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cadquery-web-viewer 2.2.0
File Size Uploaded
cadquery_web_viewer-2.2.0.tar.gz 466.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cadquery-web-viewer 2.2.0
File Interpreter ABI Platform
cadquery_web_viewer-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 508.8 kB

Release files / cadquery_web_viewer-2.2.0.tar.gz

Download URL cadquery_web_viewer-2.2.0.tar.gz
Size 466.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1533ca41d1cb292179fbcad8fcd358803375281cba4cc73d7bcaf6179334ed6f
BLAKE2b-256 checksum
How to use checksums
cc9c2897ce486decbb0f5d0e65625b8b8ea884bbb59aef5a5151dfefca8d1410
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / cadquery_web_viewer-2.2.0-py3-none-any.whl

Download URL cadquery_web_viewer-2.2.0-py3-none-any.whl
Size 42.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ca4c91e7fd991f3ac5a6e3ef91867d08b06f4a15279b258e047cf2876090921
BLAKE2b-256 checksum
How to use checksums
9f257c6f30181b1f6f33cb6cc08edb6d8c7008d140adbed5686f07b0d20868d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

2.3.0

2 release files

This release

2.2.0 This release

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page