StencilForge is a desktop tool for generating PCB stencil STL models from Gerber inputs.
StencilForge converts Gerber and Excellon exports into 3D STL models for PCB stencils and locator fixtures. It supports a desktop UI, configurable geometry processing, and both CadQuery and Trimesh backends.
- Fast Gerber to STL pipeline
- CadQuery or Trimesh backend
- Stencil cutouts with configurable offsets
- Locator structure: step or wall
- VTK preview window without WebGL
- Create a virtual environment and install dependencies:
pip install -r requirements.txt - Install the package:
pip install -e . - Update
config/stencilforge.jsonas needed - Run:
stencilforge <gerber_dir> <output_stl>Build the UI:
cd ui-vue
npm install
npm run buildLaunch the desktop UI:
stencilforge-uipaste_patterns: paste layer file patternsoutline_patterns: board outline layer patternsthickness_mm: stencil thicknesspaste_offset_mm: aperture offset, negative values shrink openingsoutline_margin_mm: fallback outline margin when no outline file existsoutput_mode:holes_onlyorsolid_with_cutoutsmodel_backend:trimeshorcadquerylocator_enabled: enable the locator structurelocator_mode:steporwalllocator_height_mm: locator wall heightlocator_width_mm: locator wall widthlocator_clearance_mm: locator clearance gaplocator_step_height_mm: locator step heightlocator_step_width_mm: locator step widthlocator_open_side: open side (none/top/right/bottom/left)locator_open_width_mm: open widthstl_linear_deflection: STL linear deflection in mmstl_angular_deflection: STL angular deflection in radiansarc_steps: number of arc approximation stepscurve_resolution: circle buffer resolutionqfn_regen_enabled: enable QFN aperture regenerationqfn_min_feature_mm: minimum printable feature sizeqfn_confidence_threshold: confidence threshold for QFN regenerationqfn_max_pad_width_mm: maximum pad width considered for QFN
- Changelog:
CHANGELOG.md - Commit messages and PR titles: Conventional Commits
- Community docs:
CONTRIBUTING.md,SECURITY.md,CODE_OF_CONDUCT.md - Issue and PR templates:
.github/
GPL-3.0-only. See LICENSE.



