[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-77102":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":13,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":27,"discoverSource":28},77102,"ratscad","qewer33\u002Fratscad","qewer33","CAD for the terminal",null,"Rust",107,3,1,2,0,5,40,1.81,"MIT License",false,"main",true,[],"2026-06-12 02:03:42","![banner](.\u002Fassets\u002Fratscad_banner.png)\n\n**ratscad** is a terminal-based IDE for [OpenSCAD](https:\u002F\u002Fopenscad.org\u002F) with a live, hardware-accelerated 3D preview rendered directly in the terminal. It's built with Rust, [Ratatui](https:\u002F\u002Fratatui.rs) and the [Ratty Graphics Protocol](https:\u002F\u002Fgithub.com\u002Forhun\u002Fratty) for inline 3D objects.\n\n![screenshot](.\u002Fassets\u002Fscreenshot_full.png)\n\n\u003Cdiv>\n  \u003Cvideo src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F7fe31947-b734-4d19-9fba-ef606cc7b975\" alt=\"Ratscad Demo\"\u002F>\n\u003C\u002Fdiv>\n\n> [!WARNING]\n> ratscad is currently **experimental**. Please open an issue for any bugs or crashes you encounter.\n\n## Features\n\n- **Tabbed editor** with syntax highlighting, dirty marker, and click-to-switch tab bar\n- **Live 3D preview** of the active document, rendered inline via the Ratty Graphics Protocol\n- **Debounced background builds** that call the `openscad` CLI and pipe the result back to Ratty\n- **Per-document build cache** so switching tabs without edits doesn't trigger a rebuild\n- **Mouse and keyboard camera** with drag-to-rotate, scroll-to-zoom, and arrow \u002F Ctrl+arrow \u002F z \u002F x keys\n- **Isometric default view** with a live X\u002FY\u002FZ axis gizmo in the corner\n- **PBR-shaded meshes** with flat per-face normals derived from OpenSCAD's STL output\n- **File menu popup** with New, Open, Save, Save As, Close, Quit\n- **On-disk save\u002Fload** via a centered path prompt\n- **Fullscreen viewer toggle** (`f` while the viewer is focused)\n- **Bottom toolbar** showing the currently relevant shortcuts in reverse-video chips\n\n## Installation\n\nInstall the published crate with Cargo:\n\n```bash\ncargo install ratscad\n```\n\nRequirements:\n\n- `openscad` on `PATH`, or set `OPENSCAD_BIN` to point at a specific binary. On Linux x86_64 ratscad will download a recent OpenSCAD snapshot automatically on first run, so this is only required on other platforms for now.\n- A GPU and graphics stack supported by Bevy and wgpu (for Ratty's renderer)\n\n## Running\n\nratscad targets the [Ratty](https:\u002F\u002Fgithub.com\u002Forhun\u002Fratty) terminal emulator. Its 3D payload protocol is what makes the inline mesh preview possible; any other terminal will just see the editor with an empty preview pane.\n\nIf you installed `ratscad` from `crates.io`, launch it from Ratty:\n\n```bash\nratty -e ratscad\n```\n\nFor local development, the wrapper script clones Ratty into `references\u002Fratty\u002F` (if it isn't there yet), builds both binaries and launches `ratty -e ratscad`:\n\n```bash\n.\u002Fscripts\u002Frun-in-ratty.sh\n```\n\nDevelopment requirements:\n\n- Rust toolchain with Cargo\n\n## Key Bindings\n\n### Global\n\n| Key | Action |\n|-----|--------|\n| `Ctrl + q` | Quit |\n| `Ctrl + t` | New tab |\n| `Ctrl + w` | Close active tab (last tab kept open) |\n| `Ctrl + o` | Open a file (centered path prompt) |\n| `Ctrl + s` | Save active document; falls back to Save As if untitled |\n| `Ctrl + Shift + s` | Save As (prompt for a new path) |\n| `Ctrl + 1`…`Ctrl + 9` | Jump to tab N |\n| `Alt + h` \u002F `Alt + l` | Previous \u002F next tab |\n| `Ctrl + v` | Focus the viewer |\n| `Ctrl + e` | Focus the editor (also exits fullscreen) |\n| `Alt + m` | Focus the menubar |\n\n### Menubar focus (after `Alt + m`)\n\n| Key | Action |\n|-----|--------|\n| `←` \u002F `→` | Cycle between File \u002F Edit \u002F View \u002F Help |\n| `↓` \u002F `Enter` | Open the active menu |\n| `Esc` | Return to editor |\n\n### File menu popup\n\n| Key | Action |\n|-----|--------|\n| `↑` \u002F `↓` | Navigate items |\n| `Enter` | Activate |\n| `Esc` | Close |\n\n### Path prompt (Open \u002F Save As)\n\n| Key | Action |\n|-----|--------|\n| Any printable char | Append to path |\n| `Backspace` | Delete last char |\n| `Enter` | Submit |\n| `Esc` | Cancel |\n\n### Viewer focus (after `Ctrl + v`)\n\n| Key | Action |\n|-----|--------|\n| `←` \u002F `→` \u002F `↑` \u002F `↓` | Rotate the mesh (5° per press) |\n| `Ctrl` + arrow | Pan the mesh (20px per press) |\n| `z` \u002F `x` | Zoom in \u002F out |\n| `f` | Toggle fullscreen viewer |\n\n### Mouse\n\n| Gesture | Action |\n|---------|--------|\n| Click a tab name | Switch to that tab |\n| Click + drag inside the viewer | Rotate the mesh |\n| Scroll inside the viewer | Zoom in \u002F out |\n| Click inside the editor | Move the cursor |\n\n## Architecture\n\nratscad has two threads.\n\nThe UI thread runs the ratatui draw loop, handles keyboard and mouse input, and owns everything you can see on screen: tabs, focus, popups, the editor buffer, the preview pane, the console. The build thread spends most of its time blocking on a channel. When source text arrives it waits out a short debounce window, spawns OpenSCAD, pipes the SCAD source into stdin, and reads binary STL back from stdout. The STL gets parsed and rewritten in-process as an OBJ (with vertex normals so Bevy's PBR shader has something to light, and a Z-up to Y-up axis swap so the model sits the right way around in Bevy's coordinate system). The OBJ bytes flow back to the UI thread, which hands them to Ratty via the inline-graphics protocol.\n\nThere's a per-document build cache so switching tabs without editing doesn't kick off another OpenSCAD run. Each document keeps the last built source string alongside its OBJ bytes; on tab switch we compare the document's current text against its cached source, and if they match we re-register the cached bytes with Ratty and skip the subprocess entirely. Edits invalidate the cache implicitly, because the cached source no longer equals the current text.\n\nThe build worker needs a path to the openscad binary. On first run, if no binary is cached, ratscad shows an install popup and downloads the official OpenSCAD nightly AppImage for Linux x86_64 from `files.openscad.org`. macOS and Windows currently fall back to whatever `openscad` is on `PATH`. The `OPENSCAD_BIN` environment variable overrides either path if you want to point at a specific build.\n\nCode is laid out as `src\u002Fmain.rs` and `src\u002Fapp.rs` at the top, with `src\u002Fcore\u002F` holding the openscad subsystem and persisted settings, and `src\u002Fui\u002F` holding the editor, preview, console, popups, menubar and toolbar.\n\n## License\n\nratscad is licensed under the MIT license.\n","ratscad 是一个基于终端的 OpenSCAD 集成开发环境，能够在终端内直接渲染实时硬件加速的3D预览。该项目使用 Rust 语言编写，并结合 Ratatui 和 Ratty Graphics Protocol 技术实现终端内的3D对象渲染。它提供了多标签编辑器、实时3D预览、背景构建缓存等核心功能，支持鼠标和键盘控制相机视角，以及PBR着色的网格显示。ratscad 适合需要在命令行环境中进行3D建模工作的开发者或设计者使用，尤其适用于偏好轻量级工具且对终端操作熟悉的用户。请注意，此项目目前仍处于实验阶段。","2026-06-11 03:55:05","CREATED_QUERY"]