sand3d

sand3d

Python 3D modeling library for LLMs

Description

Ask an LLM for a washing machine with a working door and it will likely write hundreds of lines of Blender script, with coordinates worked out in its head and a door that clips through the cabinet. sand3d writes 3D objects as short Python programs instead: profiles, solids, edits, joints and assemblies each have their own verb, and parts, edges and faces are reached by name rather than by hand-computed coordinates. It runs on Blender's bpy module, and the same program builds the same mesh, bit for bit.

It is built around prompt length: the whole API is about 3,600 tokens and fits in a system prompt, and a part takes 2 to 6 times fewer tokens than in Blender Python, CadQuery or FeatureScript. The showcase washing machine is 38 lines, with the cabinet, drum, door, detergent drawer and dial as named parts and four joints saying how they move.

Features



Short and readable: around sixty verbs on one s3d namespace cover profiles, extrude, revolve, loft, fillet, chamfer, hole and shell; there are no fixed category functions such as chair() because a category is a program you write in it.

Joints and assemblies: joint adds hinges, sliders and continuous rotation, and assembly groups the parts, so you can pose an object and check its range of motion.

One-call export: s3d.export picks the format from the extension: GLB for the web and game engines, URDF for ROS, PyBullet and MuJoCo, USDA for Omniverse and Isaac Sim, OBJ and STL for other tools and slicers.

Datasets: five sand3d program datasets on Hugging Face under CC BY 4.0, built from Objaverse, public CAD, Articraft, NVIDIA SimReady and AutoMate, over 100,000 components in all.

Gallery and explorer: the website plays objects joint by joint, and a Hugging Face space browses the datasets.

Install and licence: pip install sand3d on Python 3.13 (recommended) or 3.11, with Blender installed as the bpy module; Apache-2.0.