Skip to main content

A library for rendering gerber files as SVGs and PDFs

Project description

Gerber Renderer

Python library for rendering RS274X gerber PCB files as svgs or pdfs.

Table of contents

Installation

The easiest way to install pandas is to install it via pip from PyPI.

Officially Python 3.6 and above.

Installing from PyPI

pip install gerber-renderer

Dependencies

Package

Minimum supported version

svgwrite

1.4

svglib

1.0

reportlab

3.5

Usage

Gerber Renderer is a Python library for rendering RS274X gerber PCB files as svgs or pdfs.

Importing

from gerber_renderer import Gerber

Functions

Initialize

board = Gerber.Board(file=file_path, max_height=XXX, verbose=True)

file: string representing the relative path to the root folder containing the gerber files
max_height: integer representing the maximum height (in pixels) of the rendered svg (default=500px)
verbose: outputs info about the current progress to the terminal (default=False)

Render SVG

board.render(output=output_path)

output: string representing the relative path to the root folder to save the svg files to

Render PDF

board.render_pdf(output=output_path, layer='top_copper', color='white', scale_compensation=0.0, full_page=True, mirrored=True, offset=(0, 0))

output: string representing the relative path to the root folder to save the svg files to
layer: string representing the layer to be rendered on the pdf (default='top_copper') [options: copper, mask, silk]
color: string representing the color of the PDF (default='white') [white renders negative of layer for exposing]
scale_compensation: float representing the percent change in size [+0.05 = 5% bigger] (default=0.0) [needed for some printers]
full_page: boolean, when True a full A4 sized PDF is rendered (default=False)
mirrored: boolean, when True the output PDF will be mirrored (default=False)
offset: tuple of floats (X,Y). The rendered PDF will be offset by (X,Y) pixels (default=(0,0))

Examples

Render SVG

from gerber_renderer import Gerber

board = Gerber.Board('./tests/gerber.zip', verbose=True)
board.render('./tests/output')

Output

Render PDF

from gerber_renderer import Gerber

board = Gerber.Board('./tests/gerber.zip', verbose=True)
board.render_pdf('./tests/output', 'top_copper', 'white', full_page=True)

Output

Result

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gerber_renderer-0.1.4.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gerber_renderer-0.1.4-py2.py3-none-any.whl (9.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file gerber_renderer-0.1.4.tar.gz.

File metadata

  • Download URL: gerber_renderer-0.1.4.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for gerber_renderer-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0c754b76d7538e1183030a1f544128eaf1a0a42dca8de5c47a25761687d82581
MD5 c6014438b58c88fc808539f5894211ae
BLAKE2b-256 10ce51d52b4e249975fde43f36d525db4d4950d6269e0332a36fb23f50a7aaba

See more details on using hashes here.

File details

Details for the file gerber_renderer-0.1.4-py2.py3-none-any.whl.

File metadata

  • Download URL: gerber_renderer-0.1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for gerber_renderer-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 94e832373cb37d5c8d362773b6cf8b889405f5137c9682d034cfdeccea954c11
MD5 d4d2875b7f8d45a2521d85687a339c3e
BLAKE2b-256 459ddb4ce2580db4ff62a509e0377b7d0cc5530cdb430da2cdf40f51dc0d8a73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page