Skip to main content

Sandflow  sand3d

3D modeling in Python, built for LLMs.

sand3d is a Python library for writing 3D objects as short programs: profiles, solids, edits, frames, joints and assemblies, over Blender's bpy. A program says how a shape is made, part by part and in its own words, so a model writes it in a few hundred tokens and a person can read it.

Objects written in sand3d

Website · API for LLMs · Writing an assembly · Export · Citation

License: Apache-2.0 Python 3.11 and 3.13 bpy 4.5 and 5.2 tests

Why sand3d

Tokens per part, median: the same part takes 4.0 times sand3d's tokens in Blender Python, 2.3 in CadQuery, 6.0 in FeatureScript, 2.0 in the Articraft SDK
How it is measured, part by part

  • Short. A part takes 2 to 6× fewer tokens than the same part in Blender Python, CadQuery or FeatureScript (details).
  • The whole API fits in a prompt, about 3,600 tokens (the API).
  • Named, not computed. Parts, edges and faces are reached by name, never by hand-computed coordinates.
  • Deterministic. The same program builds the same mesh, bit for bit.

A whole object, part by part

A washing machine written in sand3d: its part tree, its four joints, and the three files it exports

A front-loading washing machine in 38 lines of code (play it and read it): the cabinet, the drum, the door with its glass and handle, the detergent drawer and the dial, each a named part, and four joints that say how they move.

door = s3d.group("door", ring, glass, handle)                      # the handle and the glass move with it
s3d.joint("door_hinge", door, hinge, axis="-Z", range=(0, 143))
s3d.joint("drum_spin", drum, front.move(0, 400), kind="continuous")
s3d.joint("drawer_slide", drawer, top_band.move(150), kind="prismatic", axis="+X", range=(0, 200))
s3d.joint("dial_turn", dial, top_band.move(-150), kind="continuous")
return s3d.assembly("washing_machine", cab, drum, door, drawer, dial, front=front)

Export: GLB, URDF, USD, OBJ, STL

One call; the file's extension names the format; lengths in metres.

s3d.export(machine, "washer.glb")    # or .urdf, .usda, .obj, .stl
format what it carries for
GLB meshes, materials, the joints in each node's extras, at the current pose the web, viewers, game engines
URDF a link per moving part, its joints and their limits, at rest; OBJ meshes beside it ROS, PyBullet, MuJoCo, Isaac
USDA the same tree in OpenUSD (UsdGeom, UsdPhysics), with the materials Omniverse, Isaac Sim, USD pipelines
OBJ, STL the meshes alone, at the current pose: OBJ Y up, binary STL Z up any 3D tool, slicers

.usd, .usdc and .usdz come from the .usda through USD's own tools (usdcat, usdzip). The scene is also an ordinary Blender scene, for anything else Blender writes.

Install

Python 3.13 (recommended) or 3.11. Blender comes with it, as the bpy module: 5.2 LTS on Python 3.13, 4.5 LTS on Python 3.11, the two versions the tests run on.

pip install sand3d        # or, in a uv project: uv add sand3d

bpy has no wheel for Python 3.12, nor for Intel Macs from 5.2 on: there, use Python 3.11.

A first program

The bracket
import sand3d as s3d

def bracket(w=80, d=40, t=6, hole_d=6.6, pitch=50):
    plate = s3d.extrude("plate", s3d.rect(w, d, r=4), t)
    s3d.hole(plate, hole_d, on=s3d.grid(2, 1, pitch, 0))
    s3d.fillet(plate, 1, edges="top")
    return plate

s3d.export(bracket(), "bracket.glb")

Millimetres by default. Every verb with code that runs and its render: the quickstart; objects to play joint by joint: the gallery; every signature: the API. The programs themselves: docs/examples/ and programs/.

Give it to your LLM

Put docs/api.md in the system prompt: the rules of the vocabulary, every signature, and worked examples, in about 3 600 tokens; llms.txt points a model at it. For objects of several parts, the guidelines give the eight rules of an assembly program: the plan first, then the details, then the parts.

What is in it

Everything on one flat s3d.<verb> surface:

family verbs
profiles rect circle slot polygon poly arc spline superellipse text offset stroke … (16)
solids and paths extrude revolve sweep loft wire helix box cylinder tube sphere torus dome … (15)
edits cut join intersect split hole pocket fillet chamfer shell dent … (15)
frames and placement Frame face edge bbox local at transform grid ring along snap
articulation joint pose seat
assembly group assembly attach export units fingerprint … (8)
parts and materials gear knurl thread material

No category verbs (chair(), table()): a category is a program written in sand3d.

Citation

If you use sand3d in your work, please cite it. CITATION.cff holds the same, and GitHub shows it as "Cite this repository".

@misc{sand3d2026,
  author = {Neveu, Thibault and Loy, Andr{\'e}a},
  title  = {sand3d},
  year   = {2026},
  note   = {Version 1.6.1},
  url    = {https://github.com/Sandflow-ai/sand3d}
}

Contributing and license

How the library is built, tested and versioned: CONTRIBUTING.md. Apache License 2.0: see LICENSE.

Metadata

Release files for sand3d 1.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sand3d 1.6.1
File Size Uploaded Provenance Actions
sand3d-1.6.1.tar.gz 183.4 kB With provenance Details for sand3d-1.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sand3d 1.6.1
File Interpreter ABI Platform Actions
sand3d-1.6.1-py3-none-any.whl Python 3 none any Details for sand3d-1.6.1-py3-none-any.whl

Total release size: 294.4 kB

Release files / sand3d-1.6.1.tar.gz

Download URL sand3d-1.6.1.tar.gz
Size 183.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d33739db40dc457f3193342cbb733bf8cc1143a608d1078038544cafe2be6490
BLAKE2b-256 checksum
How to use checksums
53c92b9b5c53dbe66bbc6885ea62edbf0d5f4fa1e478002be6ff048214a5d4ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / sand3d-1.6.1-py3-none-any.whl

Download URL sand3d-1.6.1-py3-none-any.whl
Size 111.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a4221227404c3c8cdb2d699931a17be94b1e72df6ee515e991997f6de7283ac
BLAKE2b-256 checksum
How to use checksums
5f3fab513547242230b20bb9e65ac3e7c73a0b5403c43e84df4e029c088def2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for sand3d 1.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sand3d-1.6.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.6.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page