Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 2.48 KB

File metadata and controls

54 lines (36 loc) · 2.48 KB

HueForgeClone (.NET MAUI)

A starter .NET MAUI app that mimics the planning + STL export flow of HueForge-style filament painting.

What’s here

  • 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 WebView hosts 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 upstream hueforge-at-home UI.

Quick start

  1. Open src/HueForgeClone.App/HueForgeClone.App.csproj in Visual Studio 2022 17.10+ or VS for Mac (MAUI).
  2. Restore NuGet packages.
  3. Run on Windows/Mac/Android/iOS.
  4. Click Pick Image, set width/px + sizes, then Export STL. A .stl is 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 HeightMapStlExporter comment).

Use upstream hueforge-at-home (optional)

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-hfh

Then 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).

Export settings

  • 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.

Roadmap

  • 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).

License

MIT (for this sample). Respect third-party licenses for any embedded assets.