smlibpy

A Python library for 3D modeling on the SMLib NURBS kernel. It comes with an MCP server, so your agent can build parts too.
from smlibpy import *
plate = Box(80, 60, 10)
plate = plate.fillet(plate.edges().parallel_to(Z), 8)
plate -= GridLocations(60, 40, 2, 2) * Cylinder(4, 10)
plate -= Rectangle(30, 20).on(plate.faces().top()).extrude(-4)
plate.export("plate.step")
show(plate)
Parts are B-reps with exact surfaces. You combine shapes with +, - and &, and every
feature returns a new part. Faces and edges are picked by their geometry, for example
part.edges().parallel_to(Z).concave(). Fillets can be circular, variable or G2/G3, and there
are shells, lofts, sweeps, freeform surfaces, stitching, intersections and mass properties.
STEP files are read and written with the exact geometry; meshes go to glTF and STL.
- Getting started: install, a first part, the viewer.
- Concepts: shapes, planes, placement, patterns, selection.
- Sketches and parts: from 2D profiles to solids.
- Features: fillets, chamfers, shells, splits.
- Selecting: every way to pick faces and edges.
- Surfaces: freeform modeling and stitching.
- Measuring and files: mass properties, STEP, glTF.
- Examples: brackets, flanges, gears, a bottle.
- The kernel: how smlibpy uses SMLib, accuracy and limits.