SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.05823 · ICLR · 2025

FlexCAD: Unified and Versatile Controllable CAD Generation with Fine-tuned Large Language Models

Deng Cai, Jiang Bian, Wenxiao Wang, Shizhao Sun, Zhanwei Zhang

arXiv · PDF · Open in the Atlas

Code that ran

11 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2411.05823.json · badge: /api/ran/2411.05823.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
microsoft/flexcad canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
microsoft/FlexCAD canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
angle_from_vector_to_x Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/flexcad/utils/parser.py
code served (permissive licence) · get_code("7e74ac9f39f00581")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import math

# Create a simple 2D vector as a numpy array
vec = np.array([3.0, 4.0])

# Map the parameter name to its value
ARGS = {
    'vec': vec
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
count_curve Ran
ran; our contract draft was wrong, not the code
microsoft/FlexCAD/finetune.py
code served (permissive licence) · get_code("a3fdffdcd374aabc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Setup code for count_curve function

ARGS = {
    "loop": "This is a line segment followed by an arc and a circle shape. The line connects points, the arc curves smoothly, and the circle completes the loop."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_curve_str Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/flexcad/utils/convert.py
code served (permissive licence) · get_code("0952c03cfe81d964")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

class Args:
    def __init__(self):
        self.circle_type = 'udlr'

args = Args()

# Create test data for se_xy and se_cmd
se_xy = np.array([
    [10, 20],
    [30, 40],
    [50, 60],
    [70, 80]
], dtype=np.int32)

se_cmd = 0

ARGS = {
    'se_xy': se_xy,
    'se_cmd': se_cmd
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_extrude_str Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/flexcad/utils/convert.py
code served (permissive licence) · get_code("3281e0329f756e35")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

def create_extrude_str(se_ext):
    extrude_str = ''
    if se_ext[14] == 1:
        extrude_str += 'add'
    elif se_ext[14] == 2:
        extrude_str += 'cut'
    elif se_ext[14] == 3:
        extrude_str += 'intersect'
    else:
        raise ValueError('Invalid extrude operation: ' + str(se_ext[14]))
    extrude_str = extrude_str + ',' + ','.join((str(x - 1) for x in se_ext[0:5]))
    extrude_str = extrude_str + ',' + ','.join((str(x - 2) for x in se_ext[5:14]))
    extrude_str = extrude_str + ',' + ','.join((str(x - 1) for x in se_ext[15:18]))
    extrude_str += ' <extrusion_end>'
    return extrude_str

# Create a valid se_ext array
# Total length needed: 18 elements (0:5 = 5 elems, 5:14 = 9 elems, 14 = 1 elem, 15:18 = 3 elems)
# Element at index 14 must be 1, 2, or 3 (operation type)
se_ext = np.array([
    10, 11, 12, 13, 14,     # indices 0:5 (will be subtracted by EXT_PAD=1)
    20, 21, 22, 23, 24, 25, 26, 27, 28,  # indices 5:14 (will be subtracted by R_PAD=2)
    2,                       # index 14 (operation: 1=add, 2=cut, 3=intersect)
    30, 31, 32               # indices 15:18 (will be subtracted by EXT_PAD=1)
], dtype=np.int32)

ARGS = {
    'se_ext': se_ext
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
dequantize_verts Ran
ran, honoured the contract we drafted
microsoft/flexcad/utils/parser.py
code served (permissive licence) · get_code("24afc5c7ff764ff4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch

# Analyze the function:
# - verts: needs to be array-like with .astype() method (numpy array)
# - n_bits: int, default 8
# - min_range: float, default -0.5
# - max_range: float, default 0.5
# - add_noise: bool, default False (not used in function body)

# Create quantized vertices as a numpy array
# Quantized values should be in range [0, 2^n_bits - 1]
# For n_bits=8, range is [0, 255]
verts_quantized = np.array([[0, 128, 255, 64],
                             [32, 200, 100, 50]], dtype=np.uint8)

ARGS = {
    "verts": verts_quantized,
    "n_bits": 8,
    "min_range": -0.5,
    "max_range": 0.5,
    "add_noise": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
distChamfer Ran
ran; our contract draft was wrong, not the code
microsoft/flexcad/utils/eval_cad.py
pointer only (licence: MIT); the stored copy get_code serves, from duasoi/Mind2Cloud, is pointer only (licence: NONE) · get_code("9a578f2a671a37e4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from duasoi/Mind2Cloud, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

find_all_curve_end_positions Ran
ran, honoured the contract we drafted
microsoft/FlexCAD/finetune.py
code served (permissive licence) · get_code("75c80ac7bdc5c8ad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Analyze the function to understand what it needs
# find_all_curve_end_positions takes:
# - string: a string to search in
# - curve_end: a substring to find

# The function searches for all occurrences of curve_end in string
# and returns their positions

ARGS = {
    "string": "hello world hello universe hello",
    "curve_end": "hello"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_arc_geometry Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/flexcad/utils/parser.py
code served (permissive licence) · get_code("e49ee2dfad59267a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import math

# Create three distinct 2D points for the function to work with
# These form a valid arc (non-collinear points)
a = np.array([0.0, 0.0])
b = np.array([1.0, 1.0])
c = np.array([0.0, 2.0])

ARGS = {
    "a": a,
    "b": b,
    "c": c
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_files Ran
ran; our contract draft was wrong, not the code
microsoft/flexcad/utils/eval_cad.py
pointer only (licence: MIT); the stored copy get_code serves, from facebookresearch/d3d-hoi, is pointer only (licence: NOASSERTION) · get_code("680bb1e97d16d80c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from facebookresearch/d3d-hoi, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

interleave_lists_with_zeros Ran
ran; our contract draft was wrong, not the code
microsoft/FlexCAD/finetune.py
code served (permissive licence) · get_code("5f1a10736eedb807")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# list1 and list2 are used with len() and indexing in the function
# They should be simple lists of elements
list1 = [1, 2, 3, 4]
list2 = [10, 20, 30]

ARGS = {
    "list1": list1,
    "list2": list2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_ply Ran
ran, honoured the contract we drafted
microsoft/flexcad/utils/eval_cad.py
code served (permissive licence) · get_code("7ea8042cb1e765a6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (5, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from plyfile import PlyData
import tempfile
import os

# Create a temporary PLY file for testing
def create_test_ply_file():
    # Create temporary directory and file
    temp_dir = tempfile.mkdtemp()
    ply_path = os.path.join(temp_dir, "test.ply")
    
    # Create vertex data
    num_vertices = 5
    x = np.array([0.1, 0.2, 0.3, 0.4, 0.5], dtype=np.float32)
    y = np.array([1.1, 1.2, 1.3, 1.4, 1.5], dtype=np.float32)
    z = np.array([2.1, 2.2, 2.3, 2.4, 2.5], dtype=np.float32)
    
    # Create structured array for vertices
    vertex = np.zeros(num_vertices, dtype=[('x', 'f4'), ('y', 'f4'), ('z', 'f4')])
    vertex['x'] = x
    vertex['y'] = y
    vertex['z'] = z
    
    # Create PLY element
    from plyfile import PlyElement
    el = PlyElement.describe(vertex, 'vertex')
    
    # Write PLY file
    PlyData([el]).write(ply_path)
    
    return ply_path

ply_file_path = create_test_ply_file()

ARGS = {
    "path": ply_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, plyfile — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (5, 3) — shape (5, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_sketch_str Not yet run
unverified (harvested, no recorded run)
microsoft/flexcad/utils/convert.py
code served (permissive licence) · get_code("49b122ae146ce330")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
distChamfer 6 other papers
5 dated earlier, 1 later
1905.06292 (2019-05)
3D Point Cloud Generative Adversarial Network Based on Tree Structured Graph Convolutions
1906.12320 (2019-06)
PointFlow: 3D Point Cloud Generation with Continuous Normalizing Flows
2004.01301 (2020-04)
Generative PointNet: Deep Energy-Based Learning on Unordered Point Sets for 3D Generation, Reconstruction and Classification
and 3 more not named here
find_files 2 other papers
2 dated earlier
2108.08420 (2021-08)
D3D-HOI: Dynamic 3D Human-Object Interactions from Videos
2401.15563 (2024-01)
BrepGen: A B-rep Generative Diffusion Model with Structured Latent Geometry
read_ply 1 other paper
1 dated earlier
2401.15563 (2024-01)
BrepGen: A B-rep Generative Diffusion Model with Structured Latent Geometry

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recently, there is a growing interest in creating computer-aided design (CAD) models based on user intent, known as controllable CAD generation. Existing work offers limited controllability and needs separate models for different types of control, reducing efficiency and practicality. To achieve controllable generation across all CAD construction hierarchies, such as sketch-extrusion, extrusion, sketch, face, loop and curve, we propose FlexCAD, a unified model by fine-tuning large language models (LLMs). First, to enhance comprehension by LLMs, we represent a CAD model as a structured text by abstracting each hierarchy as a sequence of text tokens. Second, to address various controllable generation tasks in a unified model, we introduce a hierarchy-aware masking strategy. Specifically, during training, we mask a hierarchy-aware field in the CAD text with a mask token. This field, composed of a sequence of tokens, can be set flexibly to represent various hierarchies. Subsequently, we ask LLMs to predict this masked field. During inference, the user intent is converted into a CAD text with a mask token replacing the part the user wants to modify, which is then fed into FlexCAD to generate new CAD models. Comprehensive experiments on public dataset demonstrate the effectiveness of FlexCAD in both generation quality and controllability. Code will be available at https://github.com/microsoft/FlexCAD.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2411.05823")
get_code_for_paper("2411.05823")
have("2411.05823")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2411.05823.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2411.05823.svg)](https://syntology.ai/paper/2411.05823)

Connect an agent — have() is free.