explaingit

qewer33/ratscad

98Rust

TLDR

ratscad is a code editor that runs in a terminal window and shows a live 3D preview of the model you are editing, also inside the terminal.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

In plain English

ratscad is a code editor that runs in a terminal window and shows a live 3D preview of the model you are editing, also inside the terminal. It is built for OpenSCAD, which is a programming language for designing solid 3D objects by writing code rather than by clicking shapes in a graphical CAD program. The author marks the project as experimental and asks users to report bugs they hit. It is written in Rust and uses Ratatui, a library for building text user interfaces. The 3D preview is shown using something called the Ratty Graphics Protocol, which is a way for a special terminal emulator named Ratty to draw inline 3D objects right inside a normal-looking terminal pane. Because the protocol is specific to Ratty, the 3D preview only appears when you launch ratscad inside that terminal, although the text editor part still works elsewhere. The editor side offers tabs with syntax highlighting, a dirty marker to show unsaved changes, click-to-switch tabs, a file menu popup with the usual New, Open, Save, Save As, Close, and Quit, and a path prompt for opening or saving files. The preview pane shows the model with an isometric default view and an X/Y/Z axis gizmo in the corner. You can rotate, pan, and zoom with the keyboard or with mouse drag and scroll, and there is a fullscreen preview mode. A bottom toolbar shows the relevant shortcuts at any moment. Under the hood, ratscad runs two threads. One handles the user interface and input. The other waits for changes in the source code, holds back for a short delay so it does not rebuild on every keystroke, then runs the openscad command-line program, pipes the source in, and reads the resulting 3D mesh back. The mesh is converted into a format suitable for the Ratty renderer, which uses Bevy and wgpu for the actual graphics, and includes a per-document cache so that switching tabs without edits skips the rebuild. Installation is through Cargo with cargo install ratscad. On Linux x86_64 it can download a recent OpenSCAD build automatically; on macOS and Windows you need openscad on your PATH or pointed at by the OPENSCAD_BIN environment variable. The project is shared under the MIT license.

Open on GitHub → Explain another repo

Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.