Skip to main content

smlibpy 0.1·python 3.10 – 3.14


smlibpy is a Python library for 3D modeling on SMLib, the NURBS kernel that NVIDIA released as open source this October. It comes with an MCP server, so your agent can build parts too.

agent, look at smlibpy.classcad.ch and install the mcp

Your agent finds the steps in /llms.txt. If you only want the library: pip install smlibpy.

Or add it by handClaude Code · Claude Desktop · Codex · VS Code · Cursor · OpenCode

in a terminal

claude plugin marketplace add awv-informatik/smlibpy
claude plugin install smlibpy@smlibpy

reads STEPwrites STEP STL glTFMIT + Apache 2.0no account

An agent is told: agent, look at smlibpy.classcad.ch and install the mcp. It reads llms.txt and adds the smlibpy server, which runs with uvx and needs no account. In a new session it is asked for a pipe flange: a Ø120 × 12 mm plate with a Ø70 neck, 40 mm tall, bored Ø50, with eight Ø10 holes on a Ø95 circle. It reads the guides, revolves a half section, adds the holes, a fillet and a chamfer, checks the volume (157 979.5 mm³), looks at a snapshot of four views and saves flange.step. The session's live viewer comes up beside the conversation with the part in it, and the part is turned.

01Python

Your script builds the model. Each line creates a shape or changes it: combine solids with + and −, round edges, cut a pocket. Hover over a line to see the part at that step.

plate.pyline 3
  1. from smlibpy import *
  2. plate = Box(80, 60, 10)
  3. plate = plate.fillet(plate.edges().parallel_to(Z), 8)
  4. plate -= GridLocations(60, 40, 2, 2) * Cylinder(4, 10)
  5. plate -= Rectangle(30, 20).on(plate.faces().top()).extrude(-4)
  6. plate.export("plate.step")
a box, centered on the origin48 000 mm³ · 6 faces

builds in 22 msvolume 43 040 mm³19 faces · validSTEP with the exact geometry

02Install

There are wheels for Linux, macOS and Windows, for Python 3.10 to 3.14. The kernel is compiled in, so there is nothing else to set up.

In Python

terminal · part.py
  1. $ pip install smlibpy
  2. from smlibpy import *
  3. part = Box(40, 30, 10) - Cylinder(6, 20)
  4. print(part.volume)
  5. part.export("part.step")
  6. show(part)

show() opens the part in your browser, or inline in a notebook. render() saves a PNG instead, for scripts and CI. Getting started has more.

For your agent

terminal
  1. $ claude plugin marketplace add awv-informatik/smlibpy
  2. $ claude plugin install smlibpy@smlibpy

The plugin installs the MCP server and a skill with a guide for every function. The server runs on your machine with uvx and opens a viewer that updates after every script. Setup for other hosts is at the top of this page and in the docs.

03How it works

Parts are B-reps with exact surfaces: planes, cylinders, cones, spheres, tori and NURBS. Volumes and areas are integrated over those surfaces, so they are accurate to about seven digits.

smlibpy checks what the kernel returns. If a fillet is too large for its edges, you get an error that tells you the largest size that fits.

smlibpy reads and writes STEP itself and keeps the exact geometry. We compared the reader with OpenCASCADE on 430 files.

The MCP server runs scripts in a separate process. If a script hangs or the kernel crashes, the server restarts it and replays the session.

  1. Your scriptPython you write, or that an agent writes and runs through the MCP server.
  2. MCP serverRuns the scripts, keeps the session, shows the live viewer and renders pictures.
  3. smlibpyShapes, selections, features, result checks, and the STEP reader and writer.
  4. SMLibThe C++ kernel: topology, Booleans, fillets, offsets, sweeps and mass properties.

04Examples

Each one is a short script in the repository. The drawings and the numbers come from running those scripts.

05smlibpy and ClassCAD

Both use SMLib. ClassCAD has been built on it for twenty years.

ClassCAD

A CAD system.

ClassCAD stores how a part was made. Sketches have constraints and dimensions, and features reference the faces and edges they were built on. When you change a dimension, ClassCAD recalculates only what depends on it.

It also has assemblies with mates, a PDM for versions and releases, and Buerligons, the CAD app in the browser.

history graph · references · constrained sketches · assemblies · PDM · reuse · incremental recalculation

smlibpy

A library.

In smlibpy, a part is what your script produces. Nothing is stored besides the script. To change the part, you edit the script and run it again, which takes milliseconds for most parts.

That works well for variants, batch jobs, notebooks, CI checks and agents. It is also the quickest way to try out SMLib.

scripts · exact geometry · STEP in and out · notebooks · agents

STEP works between the two: a part made with smlibpy opens in ClassCAD as a solid. An agent with both MCP servers can save a part with smlibpy and load it into Buerligons.

06SMLib and OpenCASCADE

OpenCASCADE has been the open-source B-rep kernel for more than twenty years. Now SMLib is open source too. This is how they compare.

SMLibOpenCASCADE
Where fromA commercial NURBS kernel that has been in production use for decades; ClassCAD has used it for twenty years. NVIDIA released it as open source in usd-brep in October 2026.Matra Datavision’s CAS.CADE, open source since 1999 and developed by Open Cascade SAS.
LicenseApache 2.0: you can use, change and ship it, also in closed-source products.LGPL 2.1 with an exception for linking; changes to OCCT itself stay open.
ScopeA modeling kernel: geometry, topology, Booleans, blends, offsets, sweeps, tessellation, healing.A platform: the kernel plus data exchange, meshing, visualization and an application framework.
GeometryNURBS throughout; planes, cylinders and the other analytic surfaces stay analytic.Analytic surfaces, B-splines, offsets and more, each with its own algorithms.
FilletsCircular, variable and curvature-continuous (G2, G3) blends.Rolling-ball fillets, tangent-continuous, constant or variable.
FilesNone in the kernel. smlibpy reads and writes STEP itself.STEP, IGES and more, built in.
Pythonsmlibpy, and NVIDIA’s own low-level bindings.pythonOCC and OCP, with CadQuery and others on top.
Around itNew to open source, so far with few users.A large ecosystem: FreeCAD, KiCad, CadQuery and more.

We use both. When we compared smlibpy's STEP reader with OpenCASCADE on 430 files, they agreed on 425. Two of the other five were OpenCASCADE errors (it built one spherical face of a CAx-IF test part from the wrong side), and three were problems in the files.

OpenCASCADE is the better choice if you need its file formats, meshing, viewers or the tools built on it. SMLib makes sense if you need a permissive license, or G2 blends in a kernel small enough to ship in your own product.

07Questions

Is it free?
Yes. smlibpy is MIT licensed and SMLib comes with it under Apache 2.0. Both allow commercial use.
Do I need a GPU, a CAD system or an account?
No. It is a Python package with the kernel compiled in. Pictures are rendered in software, and the viewer is a page in your browser.
How exact is it?
The geometry is exact. Triangles only come in when you export a mesh. Volumes, areas and centers are accurate to about seven digits by default, and mass_properties(accuracy=…) can go further.
Who makes it?
AWV Informatik in St. Gallen, the people behind ClassCAD, buerli and Buerligons. We have built CAD on SMLib for twenty years.
Is it ready?
It is new, version 0.1. Modeling, measuring and STEP work and are tested. Assemblies with constraints, 2D drawings and text are not there yet.