--- license: other tags: - Text - Image - 3D - OpenSCAD - CAD - text-to-code - 3d-modeling - multimodal size_categories: - 10K 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 ```json { "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": "" } ``` ## How to Use ### Loading with `datasets` ```python 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 ```python 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.