$ show Adam-CAD/CADAM
CADAM is a production-grade, open-source web application that converts natural language descriptions into fully parametric 3D CAD models. It operates in two primary modes: parametric (generating OpenSCAD code via an AI agent that can iterate with live previews) and creative (producing 3D meshes via external providers like Meshy and Tripo). The application is built with React 19, TypeScript, TanStack Start, Vite, and Tailwind CSS, with a Supabase backend for authentication, database, and file storage. AI integration spans multiple providers (Anthropic, OpenAI, Google, xAI, and others) via the Vercel AI SDK, and the generated OpenSCAD code is compiled in-browser using a vendored WebAssembly build of OpenSCAD. The system includes a token-based billing model, real-time preview updates, parameter editing, and export to STL, OBJ, GLB, and other formats. Although primarily an application, the benchmarks directory serves as a research record of the quality of generated parametric models, covering complex assemblies like a V8 engine and turbofan.
The LLM identified 5 files worth highlighting for reuse:
Extracts CAD parameters from OpenSCAD source code by parsing variable declarations and Customizer-style comments, producing a structured list of controls (sliders, toggles, color pickers, dropdowns) that can drive a dynamic UI. It is fully self-contained, pure logic, and can be reused in any project that needs to derive configuration from annotated code comments.
A versatile UI component that renders parameter controls for all supported types (number, boolean, string, color, array) using Radix-based sliders, switches, toggle groups, and color pickers. It is disconnected from the application context, accepts a controlled value and onChange, and can be extracted for any project needing a generic parameter-editing interface from a schema.
Implements a decision algorithm for persisting AI assistant messages during a tool-calling loop, handling insert, update, and skip cases based on pending tool calls and client-side clobber guards. It encapsulates race condition logic (e.g., preventing overwrite of client-resolved tool outputs) and can be reused in any AI chat application that requires robust message persistence while streaming tool-use interactions.
Manages a dedicated Web Worker that compiles OpenSCAD code to 3D geometries (STL, OFF) using a vendored WASM build. It handles worker lifecycle, multiple compilation modes (preview, colored preview, export), and deferral to avoid React StrictMode double-mount issues. This hook can be extracted as a standalone OpenSCAD compilation service for any web-based CAD tool.
A reusable 3D model viewer using React Three Fiber that loads GLTF/GLB meshes from a URL and provides non-destructive material controls (brightness, roughness, normal intensity) with original properties restoration. It decouples viewing from the broader application and can be used in any project needing an inspectable 3D viewer with lighting adjustments.