gerber2svg

Crates.iogerber2svg
lib.rsgerber2svg
version0.3.0
created_at2023-07-14 16:46:09.118304+00
updated_at2025-08-20 16:53:20.233882+00
descriptionGerber2Svg is a library and utility, used to convert a Gerber (x2 or x3) file into an SVG file.
homepagehttps://github.com/jnthbdn/rs-gerber2svg
repositoryhttps://github.com/jnthbdn/rs-gerber2svg
max_upload_size
id916479
size48,765
Jonathan BAUDIN (jnthbdn)

documentation

README

Gerber2SVG

Badges

Introduction

Gerber2Svg is a library and utility written in Rust, used to convert a Gerber (x2 or x3) file into an SVG file.

The generated SVG file is not a single compound path but rather a collection of independent elements such as paths, rectangles, circles, and other primitives. The SVG output preserves the units defined in the source Gerber file. However, certain SVG viewers and editors (including Inkscape) may not interpret these units consistently. This behavior is usually related to DPI or scaling settings applied during file opening or import.

â„šī¸ Useful links

  • SVG Viewer: online editor/viewer that lets you open SVG files while preserving correct dimensions and units.
  • Gerber Viewer: official online viewer for Gerber files.

âš ī¸ This work is in progress, so please be kind 😇. If you discover any bug or mistake, feel free to open an issue or submit a PR! Even typo fixes are welcome 😛

Usage

Command to display help: gerber2svg --help

Short option Long option Required Description
-i --input Yes The Gerber file
-s --scale No Scale the path and apertures [default: 1.0]
-o --output No The SVG output file (otherwise SVG will be print on standard output)
-c --crop No Crop the SVG to remove unnecessary space
-d --debug No Be verbose and print debug info
-h --help No Prints help information
-V --version No Prints version information
-v --verbose No Be more verbose and show gerber comments

With any option other than --input or -i, the SVG will be printed to standard output.

To Do

Task Status
Upgrade gerber_parser đŸŸĸ
Test with new gerber_parser 🟠
Support Arc segment 🟠
Test arc 🔴
Test scale 🔴
Support Region Mode 🔴
Support Quadrant Mode 🔴
Support Exetnded Code ❓
Support Obround aperture 🔴
Support Polygon aperture 🔴
Support Macro aperture 🔴
Finish this list... 🔴
Commit count: 24

cargo fmt