ocp-tessellate
Tessellate OCP (https://github.com/cadquery/OCP) objects to use with threejs
What it is and what it does
ocp-tessellate bridges CAD modeling libraries and web-based 3D viewers by converting solid geometry into triangulated meshes packaged as JSON. It walks hierarchical CAD structures—assemblies, compounds, sketches—preserves their tree organization, computes surface triangulations and discretized edges, and emits a format directly consumable by three-cad-viewer and related tooling.
The package offers three entry points: a high-level export function that writes a ready-to-load JavaScript file, a mid-level converter that produces an OcpGroup hierarchy and instance list, and a tessellation function for fine-grained control over mesh parameters like deviation and angular tolerance. It accepts per-object styling (colors, alphas, material modes) and renderer hints.
Use it for:
- Export CAD designs to interactive 3D web viewers without manual mesh conversion.
- Embed tessellation in CAD tools to preview geometry changes in real time.
- Generate JSON scene trees for downstream processing or custom applications.
- Preserve assembly structure and metadata through the tessellation pipeline.
- Batch convert OCP shapes to web-ready formats for documentation or design review.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts OCP (OpenCascade Python bindings) CAD shapes into JSON-friendly tessellated meshes for visualization in web-based 3D viewers.
Yes. Active, low-friction package with no known vulnerabilities, permissive licensing, and a clear role in the OCP ecosystem. Install if you need to visualize CAD geometry in web-based viewers or embed tessellation in CAD tools; skip if you work exclusively with desktop CAD or have no web visualization requirement.
Install
ocp-tessellate on PyPI
pip
pip install ocp-tessellateuv
uv add ocp-tessellatepoetry
poetry add ocp-tessellateInstalling ocp-tessellate
Before you install
Low friction: pure Python wheel with four lightweight runtime dependencies (webcolors, numpy, cachetools, imagesize). Active maintenance with a release in the last 30 days. Requires Python 3.10+ and OCP 7.8 or 7.9 as external dependencies.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
from ocp_tessellate.convert import export_three_cad_viewer_js
# Accepts OCP shapes, CadQuery, or build123d objects
export_three_cad_viewer_js("shape", your_shape, filename="output.js")
Requires Python 3.10+ and OCP 7.8 or 7.9 installed separately.
Verify before relying
- Performance characteristics with large or complex assemblies (tessellation time, memory usage).
- Exact tessellation quality tuning options and their effect on mesh fidelity vs. file size.
- Compatibility with OCP versions beyond 7.8 and 7.9.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — webcolors, numpy, cachetools, imagesize |
| Maintenance | actively maintained — 30 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 107,648/month — #12,604 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ocp_tessellate-3.4.1-py3-none-any.whl
Keywords: 3d models, 3d printing, 3d viewing, 3d, brep, cad, cadquery, opencscade, python
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
cascadioConverts STEP files to GLB (glTF binary) format…
unclear · top 15,000 on PyPI
ocp-gordonInterpolates networks of curves into smooth…
permissive · top 15,000 on PyPI
ocpsvgConverts between SVG path strings and…
unclear · top 15,000 on PyPI
cadquery-ocpcadquery-ocp provides Python bindings to the…
permissive · top 5,000 on PyPI
cadquery-ocp-novtkProvides Python bindings to the Open CASCADE…
permissive · top 15,000 on PyPI
build123dbuild123d is a Python CAD framework for…
permissive · top 15,000 on PyPI
cadqueryCadQuery is a Python library for writing…
permissive · top 15,000 on PyPI
manifold3dManifold3d creates and operates on manifold…
permissive · top 5,000 on PyPI
cadquery-ocp-proxyA proxy package that routes optional…
permissive · top 5,000 on PyPI
smithy-jsonProvides JSON serialization and deserialization…
permissive · top 15,000 on PyPI