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.3.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.3.0
File Size Uploaded
cadquery_web_viewer-2.3.0.tar.gz 483.2 kB Details

Built distribution (wheel)

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

Total release size: 531.6 kB

Release files / cadquery_web_viewer-2.3.0.tar.gz

Download URL cadquery_web_viewer-2.3.0.tar.gz
Size 483.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0f0cb3714d4a42a84b383be3c31084ed6c9e59451d8e9af5c47e99300549247c
BLAKE2b-256 checksum
How to use checksums
9113ddb37bf1e9897a11d137ee2aabcaa5b25b652da0f1c4b6e81da5bce6bbcd
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 Oct 1, 2026.

Transparency log

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

Download URL cadquery_web_viewer-2.3.0-py3-none-any.whl
Size 48.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ddca0b309f4d0c6a9fbac6dc39e93de00fbe2e95eedace8e1e6f4c626869fc1e
BLAKE2b-256 checksum
How to use checksums
305a0594e9505810fbcdc6d1681e532ba69b8d85dae94c69934113772b2b17fb
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 Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files

2.2.0

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