ShapeLib: Designing a Library of Programmatic 3D Shape Abstractions with Large Language Models

R. Kenny Jones1 Paul Guerrero2 Niloy J. Mitra2,3 Daniel Ritchie4

1Stanford University    2Adobe Research    3University College London    4Brown University

ACM Transactions on Graphics (TOG), 2026

BibTeX
@article{jones2026shapelib,
  title   = {ShapeLib: Designing a Library of Programmatic 3D
             Shape Abstractions with Large Language Models},
  author  = {Jones, R. Kenny and Guerrero, Paul and
             Mitra, Niloy J. and Ritchie, Daniel},
  journal = {ACM Transactions on Graphics},
  doi     = {10.1145/3840293},
  year    = {2026}
}
Abstract

We present ShapeLib, the first method that uses the priors of Large Language Models (LLMs) to design libraries of programmatic 3D shape abstractions. Our system accepts two forms of user-provided design intent: high-level text descriptions of functions to include in the output library and a small seed set of exemplar shapes.

We discover a library of abstractions that matches this design intent with a guided LLM workflow that first proposes different ways of applying and implementing functions, and then validates these functions are helpful in representing seed set shapes. To extend beyond the seed set, we develop library-specific recognition networks that map shapes (represented as primitives, voxels, or point clouds) to programs that use these newly discovered abstractions.

Across multiple modeling domains (split by shape category), we find that LLMs, when thoughtfully combined with geometric reasoning, can be guided to author libraries of abstraction functions that generalize across shape distributions. Our framework takes a step towards realizing the long-standing shape analysis aspiration of discovering reusable, programmatic shape abstractions while exposing interpretable, semantically aligned interfaces. Our extensive evaluation demonstrates that ShapeLib provides distinct advantages over prior alternative abstraction discovery works in terms of generalization, usability, and maintaining plausibility under manipulation. Finally, we demonstrate that ShapeLib's abstraction functions unlock a number of downstream applications, combining LLM reasoning over shape programs with geometry processing tools to support shape editing and generation workflows.

ShapeLib overview

ShapeLib guides an LLM through the process of developing a library of programmatic abstraction functions from an input design intent. A user communicates this design intent with two modalities: function descriptions and a seed set of shapes. Each function description specifies the intended behavior of one abstraction function, while the seed set provides representative geometric structures for grounding.

The discovered functions generalize to new shapes and expose semantically aligned, easy-to-work-with interfaces. They support shape manipulation through LLM program edits and mesh deformation, and shape generation through LLM program synthesis and geometric detailization.

Function descriptions and example shapes enter ShapeLib and become an abstraction library.

Designing a library of shape abstractions

ShapeLib converts user-provided design intent into a fully realized library of abstraction functions in four stages: interface creation converts function descriptions into a library interface; application proposal identifies which functions should model which seed set shapes; implementation proposal generates candidate function implementations.

The library is finalized with a validation step that searches for pairs of applications and implementations that best reconstruct the seed set shapes

A validated function implementation and its interface are added to the abstraction library.

Complementary design intent modalities

The two forms of design intent provide complementary signals. Function descriptions provide guidance through language and give the user control over the interface exposed by the library. The seed set provides geometric guidance and an avenue for validation: ShapeLib searches for function implementations and applications that can explain substructures in the seed set shapes.

Without semantic guidance, geometry-based systems such as ShapeCoder find abstractions that generalize to new shapes but are difficult to interact with and produce non-semantic outputs under parameter modifications. Without a seed set, LLMs produce seemingly sensible functions, but their internal logic has structural inconsistencies that limit their ability to represent actual shape structures.

ShapeLib combines function descriptions and seed shapes to produce useful functions.

Library-specific recognition networks

To extend ShapeLib's abstractions beyond the seed set, an LLM authors a sample_shape function that uses the library functions to sample synthetic shape programs. Executing these programs produces paired visual input and program output data for supervised training.

The recognition network learns an inverse task: given an input shape, it reconstructs the shape by writing a program that uses the abstraction functions. The same framework supports shapes represented as primitives, voxels, or point clouds by changing the input encoder.

Synthetic program and shape pairs train a model that converts new shapes into ShapeLib programs.

Results

ShapeLib generates libraries of shape abstractions that generalize over shape distributions and align with semantics. We demonstrate the downstream benefits of our approach:

Reconstructing unstructured geometry with programs

ShapeLib's recognition networks reconstruct input shapes, represented here as point clouds or voxels, with programs that use the discovered library functions. Parts are colored according to the function that produced them, showing how consistently each abstraction aligns with shape semantics.

Input
Eight input shapes represented as point clouds or voxels
ShapeLib
The eight input shapes reconstructed with ShapeLib abstractions
Reconstruction library
Take-away: ShapeLib abstractions produce more accurate reconstructions than libraries from alternative methods, with function applications that are more consistently aligned with semantics.

Editing geometry through shape programs

Given an input mesh, ShapeLib uses a recognition network to infer a reconstructing program. An LLM modifies this program with respect to an edit request. Executing the original and edited programs produces starting and target cuboid layouts that guide a cage-based deformation of the input geometry.

Edit request:

Input mesh
Selected input mesh
Inferred ShapeLib program
ShapeLib program inferred from the selected mesh
Edited ShapeLib program
ShapeLib program after the selected edit
Deformed geometry
Input mesh deformed using the edited ShapeLib program
Take-away: ShapeLib supports text-driven mesh edits by combining LLM program modifications with a lightweight cage-based deformation scheme.

Structure generation and geometric detailization

For structure generation, an LLM converts text descriptions into shape programs using a provided library of abstraction functions and in-context examples sourced from the seed set. We compare programs generated with ShapeLib, ShapeCoder, and LLM-only libraries.

Prompt: Bar stool with high seat, narrow circular base

LLM-Only, ShapeCoder, and ShapeLib generations for the selected prompt
Take-away: LLMs generate better shape structures with ShapeLib libraries because the semantically aligned abstractions expose an easy-to-use programmatic interface.

Geometric detailization of shape abstractions

ShapeLib programs execute into layouts of cuboid primitives. A structure-conditioned 3D generative model converts each layout into a mesh with geometric details; sampling allows multiple stylistic variations from the same part conditioning input.

Program structure
Eight ShapeLib program structures extracted from the paper figure
Detailed geometry
First geometric detailization of the program structures
Detailization style
Take-away: The detailization process largely respects the input layout while producing multiple plausible variations from the same structure.

What ShapeLib learns

We use ShapeLib to produce abstraction libraries for five shape-modeling domains: chairs, tables, storage, faucets, and lamps. Each abstraction pairs a validated LLM-authored implementation with a well-defined, semantically aligned interface. Select a category to inspect one learned function and see how different parameterizations cover a family of substructures found in validation shapes.

Chairs

ladder_chair_back

Constructs a ladder-style chair back with a selectable frame style, number of bars, bar spacing, and part thicknesses.

Validated LLM implementation

Parameterized applications

Chair reconstruction using the ladder_chair_back abstraction
frame=.13 · bar=.09 · count=4 spacing=.15 · left_right
Chair reconstruction using a second parameterization of ladder_chair_back
frame=.06 · bar=.13 · count=4 spacing=.20 · left_right
Chair reconstruction using a third parameterization of ladder_chair_back
frame=.12 · bar=.11 · count=3 spacing=.20 · left_right
Chair reconstruction using a fourth parameterization of ladder_chair_back
frame=.10 · bar=.08 · count=4 spacing=.14 · left_right

The selected abstraction is highlighted within each reconstructed shape.

Acknowledgements

We would like to thank the participants in our user study for their contribution to our research. We would also like to thank the anonymous reviewers for their helpful suggestions. We further thank Adrian Chang for feedback on an early draft, and Maneesh Agrawala and Aditya Ganeshan for comments on the manuscript. This research was supported by the National Science Foundation (#1941808, #2519772) and gifts from the University College London AI Center and Adobe Research.