explaingit

pyvista/pyvista-cad

Analysis updated 2026-06-24

50PythonAudience · researcherComplexity · 3/5LicenseSetup · moderate

TLDR

PyVista extension that reads CAD formats like STEP, IGES, and IFC and renders smoothly shaded faces with B-rep edges instead of raw triangle meshes.

Mindmap

mindmap
  root((pyvista-cad))
    Inputs
      STEP IGES BREP
      DXF 3MF IFC
      FreeCAD OpenSCAD
    Outputs
      Shaded CAD render
      MultiBlock trees
      FEA mesh handoff
    Use Cases
      Load STEP assemblies
      DXF layer splitting
      IFC property filtering
    Tech Stack
      Python
      PyVista
      cadquery-ocp
      gmsh
      meshio
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Load STEP, IGES, or BREP files into PyVista and render with CAD-style shaded faces

USE CASE 2

Split a DXF drawing into a MultiBlock dataset grouped by layer

USE CASE 3

Read an IFC building, filter by IFC type, and inspect its property sets

USE CASE 4

Drive a STEP part through gmsh to make a tetrahedral FEA mesh and visualize the result

What is it built with?

PythonPyVistacadquery-ocpgmshmeshio

How does it compare?

pyvista/pyvista-caddevelp10/rustinterviewquiestionspatdolitse/engram
Stars504852
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity3/52/52/5
Audienceresearcherdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Different file formats require different pip extras, and Python 3.14 is not yet supported.

MIT license, free for any use including commercial, just keep the copyright notice.

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.

Copy-paste prompts

Prompt 1
Install pyvista-cad with the right extras and load a STEP assembly, then plot it with mesh.cad.plot
Prompt 2
Walk through the STEP-to-gmsh-to-FEA pipeline shown in the README and explain why gmsh stays out of scope
Prompt 3
Show me how the .cad accessor computes analytic surface normals so a coarse mesh still shades smoothly
Prompt 4
Round-trip a 3MF file through pyvista-cad and confirm object color and units are preserved
Prompt 5
Add a small example that filters an IFC model by IfcWall and exports a MultiBlock for visualization

Frequently asked questions

What is pyvista-cad?

PyVista extension that reads CAD formats like STEP, IGES, and IFC and renders smoothly shaded faces with B-rep edges instead of raw triangle meshes.

What language is pyvista-cad written in?

Mainly Python. The stack also includes Python, PyVista, cadquery-ocp.

What license does pyvista-cad use?

MIT license, free for any use including commercial, just keep the copyright notice.

How hard is pyvista-cad to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is pyvista-cad for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.