Skip to content

Convert from and to the specctra dsn format from tscircuit soup json

License

Notifications You must be signed in to change notification settings

PCBNexus/specctra-dsn-json

 
 

Repository files navigation

Specctra DSN JSON Parser

This library parses Specctra DSN files and converts them into JSON. It can also convert Specctra DSN files into tscircuit JSON and serialize them back to DSN.

This library parses Specctra DSN files and converts them into JSON for interoperability. It has no official relationship with Specctra, Cadence, or the Allegro PCB Router.

Table of Contents

Installation

To install the package, run:

npm install specctra-dsn-json

Usage

Here's a basic example of how to use the library:

import { parseDsnToJson } from "@tscircuit/specctra-dsn-json"

const dsnContent = `
(pcb "example.dsn"
  (parser
    (string_quote ")
    (space_in_quoted_tokens on)
  )
  (resolution um 10)
  (unit um)
  ...
)
`

const jsonOutput = parseDsnToJson(dsnContent)
console.log(JSON.stringify(jsonOutput, null, 2))

Features

  • Parses Specctra DSN files into a structured JSON format
  • Supports various elements of the DSN format including:
    • Parser information
    • Resolution and units
    • Structure (layers, boundaries, vias, rules)
    • Component placement
    • Library definitions
    • Network and wiring information
  • Provides a type-safe interface using Zod schemas

Development

To set up the project for development:

  1. Clone the repository
  2. Install dependencies: npm install
  3. Run tests: npm test

To build the project:

npm run build

References

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Convert from and to the specctra dsn format from tscircuit soup json

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%