explaingit

pyvista/pyvista-cad

50Python

TLDR

pyvista-cad is a Python package that adds CAD file support and CAD-style rendering to PyVista, a 3D mesh and visualization library.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

In plain English

pyvista-cad is a Python package that adds CAD file support and CAD-style rendering to PyVista, a 3D mesh and visualization library. PyVista on its own handles general 3D meshes, but it does not read native CAD formats like STEP or IGES, and its default renderer draws the underlying triangulation rather than the cleaner shaded look you get in a CAD application. This package fills both gaps without forking PyVista or monkey-patching it. On the file format side, the package can read and write STEP, IGES, BREP, DXF, 3MF, IFC, FreeCAD .fcstd, OpenSCAD .scad, and glTF. Which formats you actually get depends on which install extra you pick. The base install covers DXF and glTF; there are extras for STEP, 3MF, IFC, IGES, and OpenSCAD, plus a [full] extra that pulls everything. Once installed, the formats register with pv.read() so you can use them like any other PyVista format. Python 3.10 through 3.13 are supported; 3.14 is held back until cadquery-ocp ships matching wheels. For rendering, the package adds a .cad accessor to PyVista datasets and a plotter.cad component. Calling mesh.cad.plot() draws smoothly shaded faces using analytic surface normals so a coarse mesh still shades like a round surface, and it overlays only the model's topological B-rep edges instead of every triangle edge. Plain meshes that have no B-rep history fall back to crease feature edges. The README walks through a real-world workflow: load a STEP assembly, inspect its block tree, find a specific part with a glob pattern, drive that part through gmsh to produce a tetrahedral FEA mesh, then read the resulting .msh file back via PyVista's existing meshio integration and clip it. gmsh meshing itself is kept out of scope because gmsh is GPLv2+ and would license-contaminate downstream users; the package's own dependencies stay on MIT, BSD, Apache, or LGPL-with-exception licenses. Other documented tasks include splitting a DXF drawing by layer into a MultiBlock, round-tripping a 3MF print while preserving object color and units, loading an IFC building and filtering by IFC type, and reading IFC property sets. The package is MIT licensed and is published on PyPI as pyvista-cad.

Open on GitHub → Explain another repo

Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.