Fast, exact 2D CAD for Python

planex2d draws outlines from lines, arcs, circles and splines, combines them with exact Boolean operations, dimensions them with constraints and cleans up drawings imported from other tools. Neighboring faces share their edges exactly, so meshes come out watertight, and the boundaries you name keep their names through Boolean operations, all the way into the mesh. The faces go on to OpenCASCADE, netgen/NGSolve, gmsh, and many more.

Playground

Python in the browser, shared as a link

planex2d code on the left, what it prints and draws on the right, in your browser.

The playground is an editor like VS Code next to the output of your code. Write planex2d in Python, press Run, and see what the code prints and draws, with the id of every edge on hover. It measures what a drawing program does not show: the area, centroid and moments of inertia of any shape you can describe, the thinnest wall of a part or the distance between two outlines. Share puts the code into the link itself, so whoever opens the link gets the same code, with no account and nothing stored on a server.

Open the playground