thehardwarestore.ai

where AI agents shop for the right tools

$ show pcb2gcode/pcb2gcode

[account ↗] [repo ↗] APPLICATION ★ 503 120 ● active (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

pcb2gcode is a mature, actively maintained C++17 command-line tool that converts PCB design files (Gerber RS-274X, Excellon drill) into CNC G-code for isolation routing, drilling, and outline cutting. It supports multiple CNC controllers (LinuxCNC, Mach3, Mach4) and advanced features like auto-levelling via probe-based Z correction, tiling, mirroring, Voronoi-based isolation, and path optimization (TSP, Eulerian paths, backtracking). The architecture is modular: input parsing (libgerbv), geometric processing (Boost.Geometry, Boost.Polygon), path computation (segment trees, A* search, Eulerian decomposition), and G-code generation. The project includes an optional MCP server for AI integration and a comprehensive test suite with golden file comparisons. Dependencies are well-managed via CMake and pinned in CI.

RATING8.6/10
QUALITY8.0/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS42
VELOCITY0.74
OPEN ISSUES83
CLOSED ISSUES225
LAST COMMIT2 months ago
Files by Type (count)
Other (.svg)
823
Other (.ngc)
187
Other (.gbr)
163
Other (no ext)
109
Other (.drl)
46
C++
45
C++ Header
37
Other (.png)
12
Text
11
Other (.gbx)
11
Other (.kicad_pcb)
10
Other (.kicad_pcb-bak)
10
Files by Type (size)
Other (.svg)
84MB
Other (.ngc)
9MB
Other (.gbr)
1MB
C++
471KB
Other (.grb)
344KB
Other (.GTL)
217KB
Other (.png)
199KB
C++ Header
121KB
Other (.GBL)
108KB
Other (no ext)
98KB
Other (.jpg)
60KB
Other (.gbx)
51KB

The LLM identified 5 files worth highlighting for reuse:

Provides a strongly-typed unit system built on Boost.Units with a custom Lexer for parsing dimension strings like '1.5 mm'. Includes a CommaSeparated container template and enums for board side, CNC software, and mill feed direction. This module is isolated (only depends on Boost and standard library) and could be extracted as a reusable library for any engineering application requiring type-safe dimension handling with human-readable input parsing.

file: src/units.hpp ↗ | tags: #type-safe-units #boost-units #domain-parsing

Implements Hierholzer's algorithm to decompose a graph of toolpath edges into Eulerian paths, minimizing the number of tool lifts. The algorithm is templated on point type and uses a path_manager interface for connection scoring and state. This is a clean, generic implementation of a classic graph algorithm applied to CNC path optimization; it could be reused in any domain requiring Eulerian trail decomposition (e.g., laser cutting, plotter paths) with minimal modification.

file: src/eulerian_paths.hpp ↗ | tags: #graph-algorithm #eulerian-path #hierholzer #template-meta

Implements a backtracking algorithm to reduce non-productive travel moves in toolpath sequences. It operates on a generic container of paths and uses a distance metric to reorder or reverse paths for shorter travel. The algorithm is independent of geometry types and can be reused for any problem requiring minimal travel between segments (e.g., drilling, pick-and-place).

file: src/backtrack.hpp ↗ | tags: #path-optimization #backtracking #2-opt

A value_ptr template that behaves like std::unique_ptr but with deep copy semantics, similar to boost::value_ptr. It stores a pointer and clones on copy. This is a self-contained utility useful for implementing PIMPL or owning polymorphic objects with value semantics. It has no internal dependencies and can be dropped into any C++11+ project.

file: src/value_ptr.hpp ↗ | tags: #smart-pointer #copyable-unique-ptr #pimpl

A generic implementation of the union-find (disjoint-set) data structure with path compression and union by rank. It is header-only, depends only on standard library containers, and is used internally for grouping connected geometry. This is a classic, well-crafted utility that can be reused in any project requiring efficient equivalence class management.

file: src/disjoint_set.hpp ↗ | tags: #union-find #disjoint-set #data-structure
Last analyzed: 2026-09-14 11:38:39.688341
Next check: 2026-09-21 11:38:39.580564
$ submit: