@tracespace/core
TypeScript icon, indicating that this package has built-in type declarations

5.0.0-alpha.0 • Public • Published

@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)
])

Package Sidebar

Install

npm i @tracespace/core

Weekly Downloads

736

Version

5.0.0-alpha.0

License

MIT

Unpacked Size

485 kB

Total Files

23

Last publish

Collaborators

  • mcous