EDITABLE
A program, not a mesh
Dimensions are named parameters, repeated parts are functions, and each part is named by the code that builds it. Change one number and everything derived from it follows.
Feedforward 3D Program Generation from a Single Image
*Equal contribution†Equal advising
OVERVIEW
Code-Any-Shape reads one image and writes a GeoFunc program in a single forward pass; Blender runs the program to rebuild the shape. Below are its own outputs for five held-out test images, one per domain.
Code-Any-Shape
4B vision-language model
One forward pass, no tools
Reading image
0 tokens
Drag to turnSwipe sideways to turn
EDITABLE
Dimensions are named parameters, repeated parts are functions, and each part is named by the code that builds it. Change one number and everything derived from it follows.
ACCURATE
On CAS-Bench, in a single pass. The best proprietary model, writing Blender Python in one pass without tools, recovers 47.5%.
FAST
Median on one GPU. It is on par with render-and-compare coding agents built on GPT-6 Astra at about 1/200 of their cost; the agents take 2 to 22 minutes.
DATA
CAS-600K pairs each program with its image and mesh, across five domains. Every program is verified by execution, and CAS-Bench is its 2,000-item test subset.
Most 3D shapes are represented as meshes or other dense formats, which are unstructured and difficult to edit. Code offers a compelling alternative: programs express shapes as structured, editable compositions of parametric operations and can be generated autoregressively by leveraging the priors of large language models. However, existing image-to-program methods are either restricted to mechanical CAD models or rely on iterative render-and-compare agents that incur high inference costs.
To bridge this gap, we present Code-Any-Shape, a vision-language model that generates image-aligned 3D programs in a single forward pass. Specifically, we introduce GeoFunc, a unified general-purpose geometry language, and construct CAS-600K, a large-scale corpus of 617K image-3D-code triplets spanning 19.8K categories across five domains, alongside the CAS-Bench evaluation benchmark. Trained on this data via supervised fine-tuning and reinforcement learning with hierarchical execution-grounded rewards, Code-Any-Shape demonstrates strong visual-geometric alignment. Extensive experiments show that it surpasses frontier proprietary models in geometric accuracy, matches agent-based methods at roughly 200× lower cost, and achieves state-of-the-art performance on CAS-Bench and three external benchmarks.
EXPLORE
Ten held-out test shapes from CAS-600K, two per domain, each with the GeoFunc program that builds it. Hover a part to find its code, or a line to find its part.
Hover a part · drag to turnTap a part · swipe sideways to turn
EDIT
Five dataset programs from the paper's editing figure. A slider rewrites one named parameter; a rewrite changes or adds a call. Every combination shown here was executed, and red marks what changed.
Hover a part · drag to turnTap a part · swipe sideways to turn
GEOFUNC
GeoFunc is a functional geometry language embedded in Python and executed in Blender. Its 86 words, in 11 families, cover CAD features, mesh modeling and procedural operations.
Every word is a pure function. It returns a new value and never depends on Blender's selection or mode, so a part can be edited without touching the rest.
Each construct has one spelling: fixed argument order, keywords and number format. The model learns geometry instead of style.
Each word is a fixed composition of Blender operations with every input pinned. The same program always builds the same mesh.
Programs keep their named constants, loops and helper functions. For the same objects, other languages need 0.9 to 7.7 times the tokens and 1.3 to 9.5 times the operation calls.
BENCHMARK
Each predicted program is executed and its mesh compared with the ground truth. On CAS-Bench, an item counts as solved when the Chamfer distance is below 0.02.
Success rate on 2,000 test items, one image in. Failures count as 0.
F@0.02 on 20 test items, four per domain, against the inference cost per object.
Each scored with the benchmark's own metric code.
COMPARE
Five test objects, one per domain, with every method of the main results: proprietary models and open VLMs writing Blender Python in a single pass, CAD code models and 3D generators. Pick a method to see its output beside the ground truth.
Drag to turn bothSwipe sideways to turn both
Chamfer distance to the ground truth after centering and scaling both meshes to a unit longest edge; success is a distance below 0.02.
CITE
@article{zheng2026codeanyshape,
title = {Code Any Shape: Feedforward 3D Program Generation from a Single Image},
author = {Zheng, Zehan and Cao, Wei and Wang, Chenlong and Wang, Xingrui and Xu Fei, Esther and
Xie, Jianwen and Liu, Yaoyao and Chen, Jieneng and Yuille, Alan},
journal = {arXiv preprint},
year = {2026}
}
ACKNOWLEDGMENTS
Part of CAS-600K is translated: 521K of its 617K programs are rewritten in GeoFunc from programs released with 24 public datasets. The other 96K programs are generated by our agentic synthesis pipeline. We thank the authors of these datasets: CADFS, DeepCAD, Zero-to-CAD, CADEvolve, CodeCAD, FutureCAD, CadQuarry, FllumaOne, Fusion 360 Gallery, Thingiverse, the FreeCAD library, WHUCAD, AutoMate, CADExpert, Objaverse, Objaverse-XL, MeshCoder, RFW-A, Infinigen, Articraft, BlendNet, SimReady and Bioinspired3D, and the Sand3D team, whose released programs bring several of these collections into the corpus.