Build, check and export exact 3D CAD parts by running Python with smlibpy on SMLib, NVIDIA's open-source NURBS kernel: solids, fillets, shells, sweeps, surfaces, STEP and STL.
A Python library for 3D modeling on the SMLib NURBS kernel. The API follows the style of build123d's algebra mode and shares a few ideas with CadQuery, but not its method chains: shapes are plain values, and every operation returns a new one.
It comes with an MCP server, so your agent can build parts too. And it runs in the browser:
smlibwasm is the same library for JavaScript and TypeScript, on the kernel compiled
to WebAssembly, and smlibpy-three is it for three.js.
Parts are B-reps with exact surfaces: planes, cylinders, cones, spheres, tori and NURBS.
Volumes, areas and inertia are integrated over those surfaces, and STEP files keep them as they
are. You combine shapes with +, - and &, and every feature returns a new part. Faces and
edges are picked by their geometry, for example part.faces().top() or
part.edges().parallel_to(Z).concave(). The plate above builds in about 40 ms. The
concepts explain shapes, planes, locations and selections.
Primitives: Box, Cylinder, Cone, Sphere, Torus, Wedge, Pyramid, sectors of them
(arc_size=) and AnnularSector
Holes: Hole, CounterBoreHole, CounterSinkHole, placed with Locations, GridLocations,
PolarLocations, HexLocations
Booleans: fuse, cut, intersect, which can also be written +, -, &; merge makes one
part of several cells (as for several materials), cells() gives them back, named after the
parts they lie in; imprint splits faces where a tool crosses them; split by planes and sheets
Operations: extrude (also tapered, with plane walls), revolve, swing (a revolve around any
outline), loft (also with end tangents, closed, or of open sections along rails), sweep (the
profile's attitude, a twist and a scale along the path; along helices without rolling; an open
profile from the path to a second rail), shell (walls of their own thickness, round or sharp
corners), offset (sharp or round), thicken, draft, mirror, split, section
Direct editing: move_faces and offset_faces move and push-pull faces, resize holes and
bosses, and rebuild the part around them exactly
Fillets: circular, variable radius, and curvature-continuous (G2/G3), along tangent runs, with
mitred or set-back corners; chamfers with one or two setbacks or an angle, exact cones on round
edges
twist, taper and bend work on finished parts, and on edges, wires and points. A tapered
cylinder becomes an exact cone, a plate bent by up to 90 degrees exact cylinders (sheet metal
you can unfold).
unroll lays a part wrapped around an axis out flat