A starter .NET MAUI app that mimics the planning + STL export flow of HueForge-style filament painting.
-
HueForgeClone.Core: C# engine
BeerLambertMixer: simple transmissive color blending (approximation).HeightMapStlExporter: converts a height map (or your pixel stack) into a binary STL.Models: Filament, Palette, ProjectSettings, etc.
-
HueForgeClone.App: MAUI UI
- Pick an image → set export params → Export STL.
- A
WebViewhosts a lightweight mixer UI (Resources/Raw/wwwroot/mixer.html). The JS page is a placeholder and demonstrates JS→C# bridging. You can replace it with the upstreamhueforge-at-homeUI.
- Open
src/HueForgeClone.App/HueForgeClone.App.csprojin Visual Studio 2022 17.10+ or VS for Mac (MAUI). - Restore NuGet packages.
- Run on Windows/Mac/Android/iOS.
- Click Pick Image, set width/px + sizes, then Export STL. A
.stlis written to the app's cache folder; the app shows a path and the unique color-swap Z heights.
STL export currently uses an inverted grayscale → height mapping (lithophane-like) as a baseline. To plug in the per-pixel layer stack from your mixer, compute per-pixel total stacked thickness and feed that into the exporter (see
HeightMapStlExportercomment).
If you want to embed the upstream mixer UI locally:
cd src/HueForgeClone.App/Resources/Raw/wwwroot
git clone https://github.com/LucasKendi/hueforge-at-home thirdparty-hfhThen update mixer.html to reference their index.html or copy its assets over. The MAUI WebView loads local HTML via FileSystem.OpenAppPackageFileAsync and you can wire JS→C# via URL-scheme callbacks (see MainPage.xaml.cs).
- TargetWidthPx: how many pixels across the height map (export resolution).
- PixelSizeMm: XY size of each pixel in millimeters (physical size).
- LayerHeightMm: your slicer layer height. Quantization snaps heights to layer steps.
- BaseThicknessMm: flat base behind the relief.
- BorderMm: optional thin rim to help adhesion/crisp edges.
- Replace placeholder JS with upstream mixer or a full C# mixer.
- Pass the computed PixelStack from JS to C# and sum layer thicknesses per pixel.
- Palette editor & filament calibration (TD, opacity, hex).
MIT (for this sample). Respect third-party licenses for any embedded assets.