Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI tool #13

Closed
kasbah opened this issue Jun 5, 2016 · 4 comments
Closed

CLI tool #13

kasbah opened this issue Jun 5, 2016 · 4 comments
Assignees
Labels

Comments

@kasbah
Copy link
Collaborator

kasbah commented Jun 5, 2016

So we can flesh out some ideas.

Names?

  • gerber2pcb,
  • gerberup
  • stackup
  • pcb-stackup

We definitely want to take in shell expansion:

$ stackup gerbers/*

Easy to specify soldermask color with the rest adapting (similar to how kitnic.yaml color is handled) would be nice:

stackup --color red gerbers/*

Let's keep adding our thoughts here.

@mcous
Copy link
Member

mcous commented Jun 6, 2016

Shell expansion is handled pretty gracefully by the shell itself. Try this out to see what I mean:

$ node index.js ./*

// index.js
console.log(process.argv.slice(2))

If we want to get fancier and support globstars (not enabled on every shell by default, for example default OSX shell), the glob module works pretty great.

In terms of colors, we could do one or all of:

  • What you suggested, with a --color parameter that specifies soldermask color
    • We should also allow the color option in the lib API to be a string as well as an object for this same functionality outside of the CLI
  • Have a series of options that can specify call colors, e.g. --color-fr4, --color-cu, --color-ss
  • Allow the user to pass in a CSS file that will be used as the style node
    • This option would be difficult with the way the current stackup API handles colors

@kasbah
Copy link
Collaborator Author

kasbah commented Jun 6, 2016

Yes, no, I meant we want to take in a list of files. It's kind of obvious, I know.

The rest sounds good. Is there no easy way to copy in CSS to the existing SVG output?

@mcous
Copy link
Member

mcous commented Jun 8, 2016

We'd have to build an addition to the API to allow for a CSS string as the innerText of the style node. Not sure if its really worth it (at least for the first version) as long as the primary way of specifying colors is easy and expressive.

I'm partial to gerber2pcb and pcb-stackup for the name. I think pcb-stackup gets the advantage just because it's the name of the package and that, you know, makes sense.

@kasbah kasbah added the feature label Mar 21, 2018
@mcous mcous self-assigned this Jul 3, 2018
@mcous
Copy link
Member

mcous commented Jul 3, 2018

I'm planning on throwing this in the 4.0.0 release. I've got a little proof of concept going for a new module: @tracespace/cli that will function as both a replacement to gerber-to-svg's CLI and as a CLI for pcb-stackup

# TODO
npm i -g @tracespace/cli

# render all layers and top.svg + bottom.svg to `board-renders`
tracespace board-gerbers/* --out=board-renders

mcous added a commit that referenced this issue Jul 16, 2018
mcous added a commit that referenced this issue Jul 16, 2018
mcous added a commit that referenced this issue Jul 17, 2018
@mcous mcous closed this as completed in 486d6fc Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants