Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Layer Forge

Project on hold / archived. A lightweight Python CLI pipeline designed to convert standard raster images into multi-color 3D-printable models (.3mf and meshes) optimized for FDM multi-material and layered workflows. Developed for personal use.


Features

  • Automated End-to-End Generation: Automatically processes images and structures output parameters directly through configuration without requiring complex upfront manual tweaking.
  • Multi-Format Output: Generates both structured 3D models (.3mf) ready for layer-based printing workflows and geometric components.
  • Color Quantization: Reduces complex image color palettes down to a clean set of target colors ideal for sharp 3D prints.
  • FDM Print Customization: Fine-tune physical widths, layer heights, base thicknesses, and color layers directly via configuration.

Current Limitations & Status

  • Filament Transparency & Brand Analysis (Not Implemented): The pipeline does not currently analyze or automatically map real-world manufacturer filament transmission distances (TD) or color transparency into the print sequence. True automated physical blending requires interactive calibration and visual tuning, which remains outside the scope of this prototype.
  • Interactive UI: Interactive color-mapping controls and visual slicing sliders are omitted in favor of configuration-driven automation.

Inspiration & Sourcing Images

While Layer Forge processes a wide variety of raster images, graphic-heavy, stylized, or high-contrast imagery yields the most striking multi-material results.

If you need test candidates, you can explore visual collections or automate downloading batches of reference images using Pinterest-Collector.


Project Structure

The project maintains a modular workspace structure:

Layer Forge/
│
├── defaults/          # Default templates (config.json, filaments.csv, templates)
├── docs/              # Documentation generator metadata and scripts
├── modules/           # Core processing modules (color mapping, config, 3D generator)
├── workspace/         # Active workspace (input images, generated layers, .3mf output)
├── main.py            # Main entry point script
└── README.md          # Project documentation

Configuration Reference (config.json)

{
  "mode": "full",
  "input": "source.jpg",
  "output_dir": "output_layers",
  "output_format": "stl",
  "colors_count": 4,
  "dither": false,
  "brightness": 0,
  "contrast": 0,
  "print_settings": {
    "width": 50,
    "layer_height": 0.08,
    "base_layers": 4,
    "color_layers": 3,
    "print_order": "auto_by_area",
    "filament_type": "PLA",
    "filament_colors": ["#000000", "#FFFFFF", "#FF0000", "#00FF00"]
  }
}

Configuration Parameters

Parameter Type Default Description
input_image String "source.jpg" Path to the input image file (JPEG, PNG).
output_dir String "output_layers" Target directory where generated masks and previews will be saved.
colors_count Integer 4 Target number of colors for palette quantization (number of layers).
dither Boolean false Enables (true) or disables (false) Floyd-Steinberg dithering. Set to false for clean, solid graphic boundaries.
brightness Integer 0 Brightness adjustment percentage (-100 to 100) applied before processing.
contrast Integer 0 Contrast adjustment percentage (-100 to 100) applied before processing.
Print Settings (`print_settings`)
layer_height Float 0.2 Base physical height of a single print layer in millimeters.
base_layers_multiplier Integer 8 Multiplier for the solid bottom base layers (e.g., 8 x 0.2 mm = 1.6 mm total base thickness).
use_custom_heights Boolean false Enables (true) custom extrusion heights per color layer instead of a uniform thickness.
color_layer_heights Array [0.6, 0.4, 0.4, 0.4] Individual extrusion heights in millimeters for each corresponding color layer when custom heights are active.
ams_mode Boolean true Enables (true) multi-material mode (AMS/MMU) or disables (false) for single-extruder manual color swaps.
print_order String "auto_by_area" Layer printing sequence strategy ("auto_by_area" for largest background masks first, or "sequential" for strict file ordering).

Getting Started

  1. Requirements Make sure you have Python installed along with the Pillow library:
pip install Pillow numpy trimesh
  1. Running Run the processing pipeline via:
python main.py

About

Lightweight Python CLI pipeline to convert raster images into multi-color 3D-printable 3MF models and meshes for layered and multi-material FDM printing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages