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.
- 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
- Docker
- Docker Compose
- Docker Desktop (optional for ease of use)
-
Clone the repository with submodules:
git clone --recurse-submodules https://github.com/yourusername/smithforge-webui.git cd smithforge-webui -
Build and run the Docker container:
docker-compose up --build -d
version: '3' services: smithforge-webui: build: . ports: - "8000:8000"
-
Access the web interface at
http://localhost:8000.
- Open the web interface in your browser.
- Upload the Hueforge and base 3MF models.
- Configure the optional settings as needed.
- Click "Start Forging" to process the models.
- Download the combined 3MF model once the process is complete.
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.
- Upload Models: When you upload your Hueforge or base model files, they will automatically appear in the 3D viewer
- Navigate the View:
- Rotate: Left-click and drag
- Pan: Right-click and drag
- Zoom: Scroll mouse wheel
- 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
- Wireframe Mode: Toggle to see the model's mesh structure
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
- 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
- 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 allow you to save and reuse your frequently-used parameter combinations, making it faster to work with similar projects.
- Configure all your desired parameters (rotation, scaling, shifts, etc.)
- Enter a name for your preset in the "Save Current Settings" field
- Click the "Save Preset" button
- Your preset is now saved in your browser's local storage
- Select a preset from the "Load Saved Preset" dropdown
- Click the "Load" button
- All form fields will be populated with the saved values
- Select a preset from the "Load Saved Preset" dropdown
- Click the "Delete" button
- Confirm the deletion
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.
The Layer Visualization feature extracts and displays color layer information from Hueforge 3MF files, helping you understand the layer structure before processing.
- Upload Hueforge File: When you select a Hueforge 3MF file, the layer information is automatically extracted
- 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.)
- Dynamic Updates: Layer heights automatically adjust when you change the Z-shift parameter
- Bambu Lab (layer_config_ranges.xml)
- PrusaSlicer/SuperSlicer (custom_gcode_per_layer.xml)
- Generic 3MF (color metadata)
The visualization accounts for:
- Embedding overlap (DEFAULT_EMBEDDING_OVERLAP_MM = 0.1mm)
- User Z-shift parameter
- Shows final layer positions in the combined model
- 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
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.
- Enable Auto-Repair: Check the "Enable automatic mesh repair" option in the Optional Settings
- Automatic Validation: Both models are validated before processing
- Repair Process: Issues are automatically fixed using proven repair algorithms
- Detailed Report: View repair results in the process log after forging
- 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
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
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
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
