Skip to content

S1N4X/SmithForge-WebUI

Repository files navigation

SmithForge Logo

SmithForge: WebUI Edition

SmithForge WebUI is a web-based interface for the SmithForge tool, which allows you to seamlessly combine two 3MF models by overlaying and embedding a Hueforge model onto a base shape with automatic scaling, positioning, and precise intersection alignment. This project includes a Docker setup for easy deployment.

Features

  • Web-based interface for SmithForge
  • Interactive 3D Model Preview - Visualize your models before processing
  • Layer Visualization - View Hueforge color layers before processing
  • Automatic Model Repair - Validate and fix mesh issues before processing
  • Upload and process 3MF models
  • Automatic scaling and positioning
  • Customizable rotation and shifts
  • Parameter Presets - Save and load your favorite parameter combinations
  • Dockerized for easy deployment

Requirements

  • Docker
  • Docker Compose
  • Docker Desktop (optional for ease of use)

Installation

  1. Clone the repository with submodules:

    git clone --recurse-submodules https://github.com/yourusername/smithforge-webui.git
    cd smithforge-webui
  2. Build and run the Docker container:

    docker-compose up --build -d
    version: '3'
    services:
      smithforge-webui:
        build: .
        ports:
          - "8000:8000"
  3. Access the web interface at http://localhost:8000.

Usage

  1. Open the web interface in your browser.
  2. Upload the Hueforge and base 3MF models.
  3. Configure the optional settings as needed.
  4. Click "Start Forging" to process the models.
  5. Download the combined 3MF model once the process is complete.

3D Model Preview

The 3D Model Preview feature allows you to visualize your uploaded models in an interactive 3D viewer before processing, helping you verify your models and catch potential issues early.

How to Use

  1. Upload Models: When you upload your Hueforge or base model files, they will automatically appear in the 3D viewer
  2. Navigate the View:
    • Rotate: Left-click and drag
    • Pan: Right-click and drag
    • Zoom: Scroll mouse wheel
  3. View Controls:
    • Both: Show both base and overlay models together (default)
    • Base Only: Show only the base model
    • Overlay Only: Show only the Hueforge overlay model
  4. Wireframe Mode: Toggle to see the model's mesh structure

Model Information

The preview panel displays useful information about each model:

  • Dimensions: Width × Height × Depth in millimeters
  • Volume: Approximate volume in cubic millimeters
  • Loading Status: Visual indicator while models are being processed

Technical Details

  • Models are converted from 3MF to GLB format on-the-fly for web display
  • The viewer uses Three.js for hardware-accelerated 3D rendering
  • Base model appears in gray, overlay model in blue with transparency
  • Grid helper shows scale and orientation

Benefits

  • Verify Models: Ensure your models loaded correctly before processing
  • Check Alignment: Visual confirmation of model positioning
  • Early Error Detection: Spot issues with model geometry or size
  • Better Understanding: See exactly what will be processed

Parameter Presets

Parameter Presets allow you to save and reuse your frequently-used parameter combinations, making it faster to work with similar projects.

Saving a Preset

  1. Configure all your desired parameters (rotation, scaling, shifts, etc.)
  2. Enter a name for your preset in the "Save Current Settings" field
  3. Click the "Save Preset" button
  4. Your preset is now saved in your browser's local storage

Loading a Preset

  1. Select a preset from the "Load Saved Preset" dropdown
  2. Click the "Load" button
  3. All form fields will be populated with the saved values

Deleting a Preset

  1. Select a preset from the "Load Saved Preset" dropdown
  2. Click the "Delete" button
  3. Confirm the deletion

What Gets Saved

Presets save the following parameters:

  • Base rotation angle
  • Force scale value
  • Scale down permission
  • X, Y, Z position shifts
  • Color preservation setting
  • Output filename template
  • Base template selection (default bases or upload)

Note: Presets are stored locally in your browser using localStorage. They will persist between sessions but are not synced across different browsers or devices.

Layer Visualization

The Layer Visualization feature extracts and displays color layer information from Hueforge 3MF files, helping you understand the layer structure before processing.

How It Works

  1. Upload Hueforge File: When you select a Hueforge 3MF file, the layer information is automatically extracted
  2. View Layers: Expand the "Layer Visualization" section in Optional Settings to see:
    • Number of layers
    • Total height
    • Individual layer heights (Z-coordinates)
    • Layer colors (color-coded bars)
    • File format (Bambu Lab, PrusaSlicer, etc.)
  3. Dynamic Updates: Layer heights automatically adjust when you change the Z-shift parameter

Supported Formats

  • Bambu Lab (layer_config_ranges.xml)
  • PrusaSlicer/SuperSlicer (custom_gcode_per_layer.xml)
  • Generic 3MF (color metadata)

Layer Height Adjustments

The visualization accounts for:

  • Embedding overlap (DEFAULT_EMBEDDING_OVERLAP_MM = 0.1mm)
  • User Z-shift parameter
  • Shows final layer positions in the combined model

Benefits

  • Verify Layer Data: Ensure color information is present before processing
  • Check Heights: Confirm layer positions after embedding
  • Troubleshoot: Identify layer-related issues early
  • Plan Prints: Understand where filament changes will occur

Automatic Model Repair

The Automatic Model Repair feature validates and fixes common mesh issues that can cause boolean operations to fail, such as the "Not all meshes are volumes" error.

How It Works

  1. Enable Auto-Repair: Check the "Enable automatic mesh repair" option in the Optional Settings
  2. Automatic Validation: Both models are validated before processing
  3. Repair Process: Issues are automatically fixed using proven repair algorithms
  4. Detailed Report: View repair results in the process log after forging

Issues That Can Be Fixed

  • Non-watertight meshes - Holes in the mesh surface are automatically filled
  • Non-manifold edges - Edges shared by more than 2 faces are corrected
  • Degenerate faces - Zero-area faces are removed
  • Duplicate vertices/faces - Redundant geometry is cleaned up
  • Inverted normals - Face orientations are corrected for consistent winding
  • Unreferenced vertices - Orphaned vertices are removed

When to Use Auto-Repair

Use auto-repair when:

  • You encounter "Not all meshes are volumes" errors
  • Your models have been edited or modified in external tools
  • You're working with models from various sources with unknown quality
  • You want to ensure reliable boolean operations

Repair Report

After processing with auto-repair enabled, the result page will show:

  • A blue notification indicating auto-repair was used
  • Detailed repair information in the process log, including:
    • Issues detected in each model
    • Repairs successfully applied
    • Warnings about any remaining issues

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

Acknowledgements

About

WebUI Edition of SmithForge ran inside a docker container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •