Skip to main content

A minimal, LLM-friendly CAD library in Python

Project description

llmcad

A minimal, LLM-friendly CAD library in Python.

PyPI version Python versions License


Documentation: https://llmcad.org

Source Code: https://github.com/llmcad/llmcad


llmcad is a Python CAD library designed from the ground up to be LLM-friendly, by abstracting 3D spatial reasoning, which LLMs typically struggle with. It wraps OpenCASCADE (via OCP) with a minimal, explicit API that makes 3D modeling predictable and debuggable for AI agents.

The key features are:

  • Minimal API: ~28 core concepts. Shapes, sketches, operations, booleans, assemblies — nothing more.
  • Named faces and edges: Every face and edge has a semantic name (top, front, left_edge, ...), so LLMs can reference geometry unambiguously.
  • Face-local coordinate systems: Each face carries its own 2D frame. Positioning on faces uses intuitive local offsets — no global coordinate math.
  • Visual debugging: Built-in multi-view snapshots, face coloring, and edge visualization for LLM feedback loops.
  • Immutable operations: Boolean ops return new bodies. No mutation, no surprises.

Installation

pip install llmcad

Example

from llmcad import Box, Cylinder, Rect, extrude, fillet, snapshot

# Create a base plate
plate = Box(100, 60, 10, name="plate")

# Add a boss on the top face
boss = extrude(
    Rect(30, 30).place_on(plate.top),
    amount=20,
    name="boss",
)
plate = plate + boss

# Cut a hole through the boss
hole = extrude(
    Rect(10, 10).place_on(plate.faces["boss_end"]),
    through=True,
    name="hole",
)
plate = plate - hole

# Fillet the top edges of the boss
plate = fillet(plate.faces["boss_end"].edges, radius=3)

# Render a multi-view snapshot
snapshot(plate, "plate")

License

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llmcad-0.2.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llmcad-0.2.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file llmcad-0.2.0.tar.gz.

File metadata

  • Download URL: llmcad-0.2.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llmcad-0.2.0.tar.gz
Algorithm Hash digest
SHA256 829da1d9ac0faa6d4b2ff4e09d347ed277fe3a3f8cd3b84b3b15db3a4aa92ef2
MD5 6b977ac494b052614468424ae46b0909
BLAKE2b-256 3f26e736148bdbd7787ad68aacaaf122f484e14a97d1ab9e3a80ac6f2da4fffa

See more details on using hashes here.

File details

Details for the file llmcad-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: llmcad-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llmcad-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 35dc3380dfc842c67b633197d1134605efd39335925508db0938605b590bc1f6
MD5 2f56b21628090a62f8c880062408e37a
BLAKE2b-256 4054f316d8dcc4d74108111ad0c086dfdd230b2e952b6a55d81898b129ee6267

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page