Skip to content

zacharyfmarion/openscad-studio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

225 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenSCAD Studio

OpenSCAD Studio

A modern OpenSCAD editor with live preview and AI copilot β€” runs in your browser or as a desktop app

Try Now Version License Tauri React

🌐 Try it now β€” OpenSCAD Studio is available as a web app (no install needed) or as a macOS desktop app. The web version runs entirely in your browser using WebAssembly.

Desktop: macOS 10.15 (Catalina) or later.


OpenSCAD Studio Screenshot

✨ Motivation

As a software engineer and maker hobbyist, I love OpenSCAD. It allows for precision and maps to my mental model of building things. However, some operations (like rounding with minkowski) are not very intuitive. At work, I often use Cursor and Claude Code for writing code, and found myself plugging my OpenSCAD code into ChatGPT in order to either (1) scaffold out a starting point or (2) fix a confusing issue in my code. I also became frustrated by certain limitations of the OpenSCAD editor, like not being able to easily indent code with the editor commands I'm used to. So I built OpenSCAD Studio, which aims to be something like a Cursor for the language.

Features

  • 🌐 Web app - Use directly in your browser at openscad-studio.pages.dev β€” no install needed
  • πŸ€– AI copilot - Chat with Claude/GPT to generate and fix code (bring your own API key)
  • 🎨 Modern editor - OpenSCAD syntax highlighting, multi-tab editing, format on save, vim mode support
  • πŸ“ 2D mode - Dedicated SVG viewer for laser cutting and engraving
  • πŸ–ΌοΈ Live 3D preview - Interactive mesh viewer with orbit controls and content-hash caching
  • πŸ” Real-time diagnostics - Inline error markers with line/column precision
  • βš™οΈ Customizer panel - Interactive controls for OpenSCAD parameters with auto-rendering
  • 🌈 22+ themes - Popular themes like Catppuccin, Dracula, One Dark Pro, GitHub, Nord, Tokyo Night, and more

Limitations: Special operators (!, #, %, *) preview not yet implemented

πŸ“¦ Installation

Web (No Install)

Visit openscad-studio.pages.dev. Works in Chrome and Edge (requires SharedArrayBuffer support). No OpenSCAD installation needed β€” rendering is done via WebAssembly in your browser.

Desktop (macOS)

Install via Homebrew:

brew tap zacharyfmarion/openscad-studio
brew install --cask openscad-studio

Or download the latest DMG from GitHub Releases. Requires macOS 10.15 (Catalina) or later.

Development

# Install dependencies
pnpm install

# Run web version in development mode
pnpm web:dev

# Run desktop version in development mode (requires Rust toolchain)
pnpm tauri:dev

# Build for production
pnpm web:build    # Web
pnpm tauri:build  # Desktop

Desktop development requires the Rust toolchain. Web development only needs Node.js 18+ and pnpm.

πŸ—οΈ Project Structure

openscad-studio/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ ui/                      # Desktop app (Tauri + React)
β”‚   β”‚   β”œβ”€β”€ src/                 # Shared React frontend
β”‚   β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ hooks/           # Custom React hooks
β”‚   β”‚   β”‚   β”œβ”€β”€ platform/        # Platform abstraction layer
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ types.ts     # PlatformBridge interface
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ tauriBridge.ts # Desktop implementation
β”‚   β”‚   β”‚   β”‚   └── webBridge.ts # Web implementation
β”‚   β”‚   β”‚   β”œβ”€β”€ services/        # OpenSCAD WASM worker, render service, AI service
β”‚   β”‚   β”‚   β”œβ”€β”€ stores/          # Zustand state management
β”‚   β”‚   β”‚   └── themes/          # 22+ editor themes
β”‚   β”‚   └── src-tauri/           # Rust backend (desktop only)
β”‚   └── web/                     # Web app entry point (Vite)
└── packages/
    └── shared/                  # Shared TypeScript types

πŸ€– AI Copilot Setup

The AI copilot uses the Vercel AI SDK with streaming support. AI requests are made client-side in both the web app and the Tauri desktop app, and API keys are currently stored in local storage state inside the browser/webview. This is a convenience tradeoff, not backend-style secret isolation.

  1. Open Settings (⌘,)
  2. Navigate to "AI" tab
  3. Enter your Anthropic / OpenAI API key

Supported Providers: All models from the following providers are supported:

  • Anthropic
  • OpenAI

The AI can:

  • View your current code and preview
  • Make targeted code changes
  • Check for compilation errors
  • Generate new OpenSCAD designs from natural language

πŸ“š Documentation

πŸ—ΊοΈ Roadmap

  • βœ… Phase 1-2: Monaco editor, live preview, 3D viewer, export, caching
  • βœ… Phase 3: AI copilot
  • βœ… Phase 4 (Partial): Production polish, customizer, themes, CI/CD, library management
  • βœ… Phase 5 (v0.7): Web version with openscad-wasm

See engineering-roadmap.md for detailed breakdown.

🀝 Contributing

Contributions are welcome! Please:

  1. Check existing issues or create a new one to discuss your idea
  2. Fork the repository and create a feature branch
  3. Follow the code style (prettier for TypeScript, rustfmt for Rust)
  4. Update documentation as needed
  5. Submit a pull request

For detailed development guidelines, see CLAUDE.md and CONTRIBUTING.md.

πŸ“„ License

This project is licensed under the GNU General Public License v2.0 - see LICENSE for details.

This license change was made to comply with OpenSCAD's GPL-2.0 license, as the project now bundles openscad-wasm.

πŸ™ Acknowledgments

Built with:


Made with ❀️ for the OpenSCAD community