Datasets:
Text-to-Code-3D-Samples
Text-to-Code-3D-Samples is a medium-scale multimodal 3D dataset containing ~59,999 paired entries of natural language design specifications, executable OpenSCAD (Open-source Solid 3D CAD Modeller) programmatic source scripts, and 3D visual render representations. Converted and curated into Apache Parquet format from publicly accessible CAD model repositories, open-source 3D asset libraries, and synthetic parametric definitions, this dataset is designed for training, supervised fine-tuning (SFT), and evaluating Code-LLMs and Vision-Language Models (VLMs) on parametric CAD synthesis (Text-to-CAD, Image-to-CAD, and CAD code generation).
This is an experimental dataset only and may contain artifacts.
- Total Samples: ~59,999 rows
- Format: Apache Parquet (
Prompt,Code,Image) - Modalities: Text, Code, Image
- Split: Train
Dataset Structure & Schema
Feature Fields
| Field | Type | Description |
|---|---|---|
Prompt |
string |
Technical description detailing dimensions, physical functional parts, and structural topology |
Code |
string |
Executable programmatic OpenSCAD code script implementing constructive solid geometry (CSG) |
Image |
Image |
Rendered 2D isometric/orthographic preview of the generated 3D solid model |
Data Instance Example
{
"Prompt": "Design a parametric mounting bracket with four counter-sunk mounting holes along a rectangular base and a reinforced center rib.",
"Code": "difference() { union() { cube([60, 40, 5], center=true); translate([0, 0, 15]) cube([10, 40, 25], center=true); } for(x=[-20, 20], y=[-12, 12]) translate([x, y, -3]) cylinder(h=8, r=2.5, $fn=30); }",
"Image": "<PIL.PngImagePlugin.PngImageFile image mode="RGB" size="256x256">"
}
How to Use
Loading with datasets
from datasets import load_dataset
# Load the dataset
dataset = load_dataset("prithivMLmods/Text-to-Code-3D-Samples", split="train")
# Access a single record
sample = dataset[0]
prompt = sample["Prompt"]
code = sample["Code"]
rendered_image = sample["Image"]
print("Prompt:\n", prompt)
print("\nOpenSCAD Code:\n", code)
Instruction Fine-Tuning Format
def format_cad_instruction(example):
instruction = (
"You are an expert mechanical engineer and CAD programmer. Write compilable "
"OpenSCAD code that builds the 3D geometry specified below.\n\n"
f"Specification: {example['Prompt']}"
)
return {
"prompt": instruction,
"completion": example["Code"]
}
formatted_dataset = dataset.map(format_cad_instruction)
Intended Uses
- Parametric CAD Generation: Fine-tuning Code-LLMs (e.g., CodeLlama, Qwen-Coder, DeepSeek-Coder) to translate natural language engineering requests into compilable OpenSCAD scripts.
- Multimodal Reverse-CAD: Training Vision-Language Models to reverse-engineer constructive solid geometry (CSG) code directly from multi-view or isometric renders.
- Rapid Prototyping & Additive Manufacturing: Providing structured references for automating custom 3D printing components, brackets, enclosures, and adapters.
- Downloads last month
- -
