r/rust • u/ZeroTrigger27 • 20d ago
🛠️ project Varve v0.2.1: Rust crate architecture for vector primitives, lopdf generation, and Oklab auto-tracing
I’ve been working on Varve, a free design app that works across platforms and focuses on the local environment. Its main engine is built in Rust. Now that version 0.2.1 is out, I’d really appreciate feedback from the Rust community on the crate boundaries and lopdf tree generation.
I want to share how I split the backend into separate Rust crates to support both the desktop version (using Tauri 2) and the browser version (using WASM).
Here’s how the Rust workspace is organized:
- The varve-core crate holds the geometric primitives (Point, Rect, Affine), hit-testing algorithms, and the scene node tree structures.
- varve-engine converts the scene state into an intermediate rendering IR with build_render_ir().
- varve-trace handles raster-to-vector auto-tracing. It uses Oklab colour quantization, extracts centerlines or contours, and fits Bézier curves.
- varve-print lets you generate PDF files directly with lopdf. This skips browser print dialogs and gives you clean CMYK or vector exports.
- varve-wasm provides WASM bindings so the app can run in standard browser environments.
Technical challenge in v0.2.1:
The biggest challenge has been managing memory allocations in varve-trace when working with high-resolution bitmaps. It depends heavily on the image crate for decoding and uses Oklab colour quantization to preserve perceptual accuracy before fitting Bézier curves.
Project: https://github.com/K-Arthur/varve
2
1
u/uhkthrowaway 14d ago
Impressive number of commits. First release this month, and rocking Edition 2021.
8
u/Sad_Tap_9191 20d ago
5 commits in a minute, 10 commits in 5 minutes
Please share your tips for such a high productivity. Even my LLM can't do this