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 (e.g. absolute coordinate positioning), 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.1.0.tar.gz (71.4 kB view details)

Uploaded Source

Built Distribution

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

llmcad-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmcad-0.1.0.tar.gz
  • Upload date:
  • Size: 71.4 kB
  • 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.1.0.tar.gz
Algorithm Hash digest
SHA256 9338b2bf067adaca0a5be058c1f3ad8143310d150d3159116ba5ea34ebf1f244
MD5 60a74eb04c6dd7cdadd8a5317e4c18ae
BLAKE2b-256 1bacf1669caba1dff6880405ba0d9f3975aad3be54ca7d567e4fcba85a938db4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llmcad-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2592b212344c48672d29c5eeb0fd40a75ab4664877fc3aee81914bd86020bf2
MD5 2087ba715d4ad5739b9a5636e4a1f78f
BLAKE2b-256 482e3eae7166ce2ce414741c69c0654f79cad723e5c560ee4ccca4fa216ced44

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