--- id: ocp-tessellate version: "3.4.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # ocp-tessellate — Tessellate OCP (https://github.com/cadquery/OCP) objects to use with threejs License: permissive · Maintenance: active · Downloads: 107.6K/mo ## 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 above — 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 pip install ocp-tessellate uv add ocp-tessellate poetry add ocp-tessellate ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 107.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags ocp shape to json mesh, cad geometry tessellation, three-cad-viewer export, opencascade mesh conversion, cadquery visualization export, cad-visualization, mesh-conversion, 3d-geometry [View on SkillFed](https://skillfed.io/packages/ocp-tessellate) · [View on PyPI](https://pypi.org/project/ocp-tessellate/)