5.0.0-alpha.0 • Published 1 year ago

@tracespace/core v5.0.0-alpha.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@tracespace/core

npm

Use Gerber/drill files to create an SVG render of a finished PCB in Node.js or the browser. Part of the tracespace collection of PCB visualization tools.

This library contains the main logic for tracespace's render pipeline, built up of the following lower-level libraries:

usage

import fs from 'node:fs/promises'
import {read, plot, renderLayers, renderBoard} from '@tracespace/core'

const files = [
  'top-copper.gbr',
  'top-solder-mask.gbr',
  'top-silk-screen.gbr',
  'bottom-copper.gbr',
  'bottom-solder-mask.gbr',
  'outline.gbr',
  'drill.xnc',
]

const readResult = await read(files)
const plotResult = plot(readResult)
const renderLayersResult = renderLayers(plotResult)
const renderBoardResult = renderBoard(renderLayersResult)

await Promise.all([
  fs.writeFile('top.svg', renderBoardResult.top)
  fs.writeFile('bottom.svg', renderBoardResult.bottom)
])