High-Performance Vector Artboard Data Model & Interactive Editing Engine written in pure MoonBit for WebAssembly (WASM-GC).
📌 Project Overview
moonbit-artboard is a production-grade, zero-dependency 2D vector graphic canvas and interactive design editor kernel built from scratch in MoonBit. It is designed to power WebAssembly-native graphic design applications, design tools, and vector node scene-graph manipulation engines (similar to Figma, Illustrator, and Canvas 2D kernels).
🌟 Key Features
2D & 3D Affine Geometry Engine: Full 2D matrix transformation engine (Matrix2D), cubic/quadratic Bezier evaluation (CubicBezier, QuadraticBezier), 3D perspective transformation matrices (Matrix4x4), and Ear Clipping polygon triangulation algorithms.
Scene-Graph Tree & Transform Hierarchy: Document node tree with parent-child matrix accumulation (ArtboardDocument), Group/Ungroup node commands, layer z-ordering, and Flexbox-style Auto Layout framing engine.
Interactive Selection & Controllers: Bounding box union calculations, 8-point resize handle controllers, rotation handles, and smart alignment guides with edge/center snapping.
Undo / Redo History Stack: Command pattern transaction manager (UndoManager) supporting atomic operations, batch transactions, and history depth bounds.
Spatial Indexing & Hit Testing: Winding number point-in-path hit testing and Grid Spatial Partitioning index for fast viewport culling.
# 1. Format code and check formatting compliance
moon fmt
# 2. Check package interface files
moon info
# 3. Run the full unit test suite (36 passing tests)
moon test
# 4. Compile and execute the main integration demo
moon run src/main
🏆 Open Source Competition (OSC 2026) Submission
This project is submitted to OSC 2026 (Open Source Contest 2026).
Author & Contributor: wccerty (Single contributor, fully matched across GitHub and GitLink).
moonbit-artboard
📌 Project Overview
moonbit-artboardis a production-grade, zero-dependency 2D vector graphic canvas and interactive design editor kernel built from scratch in MoonBit. It is designed to power WebAssembly-native graphic design applications, design tools, and vector node scene-graph manipulation engines (similar to Figma, Illustrator, and Canvas 2D kernels).🌟 Key Features
Matrix2D), cubic/quadratic Bezier evaluation (CubicBezier,QuadraticBezier), 3D perspective transformation matrices (Matrix4x4), and Ear Clipping polygon triangulation algorithms.parse_svg_path).ArtboardDocument), Group/Ungroup node commands, layer z-ordering, and Flexbox-style Auto Layout framing engine.UndoManager) supporting atomic operations, batch transactions, and history depth bounds.export_to_svg), Canvas 2D instruction stream compiler (generate_canvas_instructions), Vector PDF document adapter (export_to_pdf), and HTML5 Canvas code generator.📊 Code Scale & Architecture Sitemap
This repository contains 5,713 lines of clean, idiomatic MoonBit code across 10 modules:
src/mathsrc/shapessrc/scenegraphsrc/spatialsrc/selectionsrc/historysrc/toolssrc/serializationsrc/exportsrc/main🚀 Quick Start & Build Instructions
Prerequisites
Build & Run Commands
🏆 Open Source Competition (OSC 2026) Submission
This project is submitted to OSC 2026 (Open Source Contest 2026).
wccerty(Single contributor, fully matched across GitHub and GitLink).