JSPM

  • Created
  • Published
  • Downloads 87
  • Score
    100M100P100Q75179F
  • License MIT

Render @hpcreery/tracespace-plotter image trees as SVGs.

Package Exports

  • @hpcreery/tracespace-renderer

Readme

@hpcreery/tracespace-renderer

npm

Render @hpcreery/tracespace-plotter image trees as SVGs. Part of the tracespace collection of PCB visualization tools.

This module is one part of the tracespace render pipeline, and you may not need to use it directly. See @tracespace/core to integrate the full render pipeline into your project.

npm install @hpcreery/tracespace-renderer@next

usage

import fs from 'node:fs/promises'
import {toHtml} from 'hast-util-to-html'

import {parse} from '@hpcreery/tracespace-parser'
import {plot} from '@hpcreery/tracespace-plotter'
import {render} from '@hpcreery/tracespace-renderer'

const gerberContents = await fs.readFile('gerber.gbr', 'utf-8')
const syntaxTree = parse(gerberContents)
const imageTree = plot(syntaxTree)
const image = render(imageTree)

await fs.writeFile('render.svg', toHtml(image), 'utf-8)