Skip to content
This repository was archived by the owner on Mar 10, 2019. It is now read-only.

Commit 1b17e4e

Browse files
committed
chore: Deprecate repository
1 parent ea76ec6 commit 1b17e4e

File tree

2 files changed

+66
-95
lines changed

2 files changed

+66
-95
lines changed

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.md

Lines changed: 66 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
# pcb stackup core
1+
# repository deprecated
2+
3+
Development of `pcb-stackup-core` has moved to [tracespace/tracespace][tracespace]!
24

3-
[![npm](https://img.shields.io/npm/v/pcb-stackup-core.svg?style=flat-square)](https://www.npmjs.com/package/pcb-stackup-core)
4-
[![license](https://img.shields.io/github/license/tracespace/pcb-stackup-core.svg?maxAge=2592000&style=flat-square)](https://github.com/tracespace/pcb-stackup-core/blob/master/LICENSE)
5-
[![Travis](https://img.shields.io/travis/tracespace/pcb-stackup-core/master.svg?style=flat-square)](https://travis-ci.org/tracespace/pcb-stackup-core)
6-
[![Coveralls](https://img.shields.io/coveralls/tracespace/pcb-stackup-core/master.svg?style=flat-square)](https://coveralls.io/github/tracespace/pcb-stackup-core)
7-
[![David](https://img.shields.io/david/tracespace/pcb-stackup-core.svg?style=flat-square)](https://david-dm.org/tracespace/pcb-stackup-core)
8-
[![David](https://img.shields.io/david/dev/tracespace/pcb-stackup-core.svg?style=flat-square)](https://david-dm.org/tracespace/pcb-stackup-core#info=devDependencies)
9-
[![Badges](https://img.shields.io/badge/badges-7-ff69b4.svg?style=flat-square)](http://shields.io/)
5+
[tracespace]: https://github.com/tracespace/tracespace
6+
7+
# pcb stackup core
108

119
If you're looking for an easy way to generate beautiful SVG renders of printed circuit boards, check out [pcb-stackup](https://github.com/tracespace/pcb-stackup) first.
1210

13-
This is the low-level module that powers the rendering of pcb-stackup. It takes individual printed circuit board layer converters as output by [gerber-to-svg](https://github.com/mcous/gerber-to-svg) and identified as PCB layer types by [whats-that-gerber](https://www.npmjs.com/package/whats-that-gerber) and uses them to build SVG renders of what the manufactured PCB will look like from the top and the bottom.
11+
This is the low-level module that powers the rendering of pcb-stackup. It takes individual printed circuit board layer converters as output by [gerber-to-svg](https://github.com/mcous/gerber-to-svg) and identified as PCB layer types by [whats-that-gerber](https://www.npmjs.com/package/whats-that-gerber) and uses them to build SVG renders of what the manufactured PCB will look like from the top and the bottom.
1412

1513
Install with:
1614

@@ -34,9 +32,9 @@ $ npm install --save gerber-to-svg whats-that-gerber
3432

3533
## usage
3634

37-
This module is designed to work in Node or in the browser with Browserify or Webpack. The function takes two parameters: an array of layer objects and an options object. It returns an object with a `top` key and a `bottom` key, each of which contains the SVG element and various properties of the render.
35+
This module is designed to work in Node or in the browser with Browserify or Webpack. The function takes two parameters: an array of layer objects and an options object. It returns an object with a `top` key and a `bottom` key, each of which contains the SVG element and various properties of the render.
3836

39-
``` javascript
37+
```javascript
4038
var pcbStackupCore = require('pcb-stackup-core')
4139
var options = {id: 'my-board'}
4240
var stackup = pcbStackupCore(layersArray, options)
@@ -74,10 +72,10 @@ The first parameter to the function is an array of layer objects. A layer object
7472

7573
It is expected that the converters will have already finished before being passed to pcb-stackup-core. This can be done by listening for the converter's `end` event or by using gerber-to-svg in callback mode, as shown in the example.
7674

77-
``` javascript
75+
```javascript
7876
var topCopperLayer = {
7977
type: GERBER_FILE_TYPE,
80-
converter: FINISHED_GERBER_TO_SVG_CONVERTER
78+
converter: FINISHED_GERBER_TO_SVG_CONVERTER,
8179
}
8280
```
8381

@@ -89,11 +87,11 @@ If you will be displaying the individual layers in the same page as the board re
8987

9088
You can tell the stackup function that a layer is stored externally by giving it a layer with an `externalId` attribute. This should be set to the `id` attribute of the layer's external `<g>`. This will prevent the stackup function from pushing the converters defs to the stackup image defs node.
9189

92-
``` javascript
90+
```javascript
9391
var sharedLayer = {
9492
type: GERBER_FILE_TYPE,
9593
converter: FINISHED_GERBER_TO_SVG_CONVERTER,
96-
externalId: ID_OF_THE_EXTERNALLY_STORED_LAYER_GROUP
94+
externalId: ID_OF_THE_EXTERNALLY_STORED_LAYER_GROUP,
9795
}
9896
```
9997

@@ -103,20 +101,20 @@ Please note that when using the `maskWithOutline` option as described below, the
103101

104102
The second parameter of the pcb-stackup-core function is an options object. The only required option is the `id` options. For ease, if no other options are being specified, the id string may be passed as the second parameter directly.
105103

106-
``` javascript
104+
```javascript
107105
// stackup 1 and 2 are equivalent
108106
var stackup1 = pcbStackupCore(layers, 'my-unique-board-id')
109107
var stackup2 = pcbStackupCore(layers, {id: 'my-unique-board-id'})
110108
```
111109

112-
key | default | description
113-
-----------------|-----------|-----------------------------------------------------------
114-
id | N/A | Unique board identifier (required)
115-
color | see below | Colors to apply to the board render by layer type
116-
maskWithOutline | `false` | Use the board outline layer as a mask for the board shape
117-
createElement | see below | Function used to create the XML element nodes
118-
includeNamespace | `true` | Whether or not to include the `xmlns` attribute in the top level SVG node
119-
attributes | `{}` | Map of additional attributes (e.g. `class`) to apply to the SVG nodes
110+
| key | default | description |
111+
| ---------------- | --------- | ------------------------------------------------------------------------- |
112+
| id | N/A | Unique board identifier (required) |
113+
| color | see below | Colors to apply to the board render by layer type |
114+
| maskWithOutline | `false` | Use the board outline layer as a mask for the board shape |
115+
| createElement | see below | Function used to create the XML element nodes |
116+
| includeNamespace | `true` | Whether or not to include the `xmlns` attribute in the top level SVG node |
117+
| attributes | `{}` | Map of additional attributes (e.g. `class`) to apply to the SVG nodes |
120118

121119
#### id
122120

@@ -128,50 +126,50 @@ This option is required and the function will throw if it is missing.
128126

129127
The color object allows the user to override the default styling of the stackup. It consists of layer identifiers as the keys and CSS colors as the values. Any to all layers may be overridden. The default color object is:
130128

131-
``` javascript
129+
```javascript
132130
var DEFAULT_COLOR = {
133131
fr4: '#666',
134132
cu: '#ccc',
135133
cf: '#c93',
136134
sm: 'rgba(0, 66, 0, 0.75)',
137135
ss: '#fff',
138136
sp: '#999',
139-
out: '#000'
137+
out: '#000',
140138
}
141139
```
142140

143141
The keys represent the following layers:
144142

145-
layer | component
146-
------|------------------
147-
fr4 | Substrate
148-
cu | Copper
149-
cf | Copper (finished)
150-
sm | Soldermask
151-
ss | Silkscreen
152-
sp | Solderpaste
153-
out | Board outline
143+
| layer | component |
144+
| ----- | ----------------- |
145+
| fr4 | Substrate |
146+
| cu | Copper |
147+
| cf | Copper (finished) |
148+
| sm | Soldermask |
149+
| ss | Silkscreen |
150+
| sp | Solderpaste |
151+
| out | Board outline |
154152

155153
If a value is falsey (e.g. an empty string), the layer will not be added to the style node. This is useful if you want to add styles with an external stylesheet. If applying colors with an external stylesheet, use the following class-names and specify the `color` attribute:
156154

157-
layer | classname | example (id = 'my-board')
158-
------|-------------|-------------------------------------------------
159-
fr4 | id + `_fr4` | `.my-board_fr4 {color: #666;}`
160-
cu | id + `_cu` | `.my-board_cu {color: #ccc;}`
161-
cf | id + `_cf` | `.my-board_cf {color: #c93;}`
162-
sm | id + `_sm` | `.my-board_sm {color: #rgba(0, 66, 0, 0.75);}`
163-
ss | id + `_ss` | `.my-board_ss {color: #fff;}`
164-
sp | id + `_sp` | `.my-board_sp {color: #999;}`
165-
out | id + `_out` | `.my-board_out {color: #000;}`
155+
| layer | classname | example (id = 'my-board') |
156+
| ----- | ----------- | ---------------------------------------------- |
157+
| fr4 | id + `_fr4` | `.my-board_fr4 {color: #666;}` |
158+
| cu | id + `_cu` | `.my-board_cu {color: #ccc;}` |
159+
| cf | id + `_cf` | `.my-board_cf {color: #c93;}` |
160+
| sm | id + `_sm` | `.my-board_sm {color: #rgba(0, 66, 0, 0.75);}` |
161+
| ss | id + `_ss` | `.my-board_ss {color: #fff;}` |
162+
| sp | id + `_sp` | `.my-board_sp {color: #999;}` |
163+
| out | id + `_out` | `.my-board_out {color: #000;}` |
166164

167165
#### mask board shape with outline
168166

169167
When constructing the stackup, a `<mask>` of all the drill layers is built and applied to the final image to remove the image wherever there are drill hits. If the `maskWithOutline` option is passed as true, the stackup function will _also_ create a `<clipPath>` with the contents of any included outline layers, and use that to remove any part of the image that falls outside of the board outline.
170168

171-
setting | result
172-
------------------|-------------------------------------------------
173-
`false` (default) | Board shape is a rectangle that fits all layers
174-
`true` | Board shape is the shape of the outline layer
169+
| setting | result |
170+
| ----------------- | ----------------------------------------------- |
171+
| `false` (default) | Board shape is a rectangle that fits all layers |
172+
| `true` | Board shape is the shape of the outline layer |
175173

176174
To work, the outline layer must be one or more fully-enclosed loops. If it isn't, setting `maskWithOutline` to true will likely result in the final image being incorrect (or non-existent), because the `<path>`s won't clip the image properly. See the [MDN's documentation of `<clipPath>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/clipPath) for more details.
177175

@@ -181,35 +179,35 @@ To improve your chances of a board outline layer working for `maskWithOutline`,
181179

182180
Both gerber-to-svg and pcb-stackup-core take a `createElement` function as an option. It defaults to [xml-element-string](https://github.com/tracespace/xml-element-string), which outputs a string. However, any function that takes a tag name, attributes object, and children array may be used. For example, you could pass in [React.createElement](https://facebook.github.io/react/docs/top-level-api.html#react.createelement) and create virtual DOM nodes instead.
183181

184-
If you choose to use this option, the function you pass into pcb-stackup-core __must__ be the same one you passed into gerber-to-svg.
182+
If you choose to use this option, the function you pass into pcb-stackup-core **must** be the same one you passed into gerber-to-svg.
185183

186184
The `includeNamespace` option specifies whether or not to include the `xmlns` attribute in the top level SVG node. Some VDOM implementations get angry when you pass the `xmlns` attribute, so you may need to set it to `false`.
187185

188186
#### attributes
189187

190188
If you want to add more attributes to the SVG nodes than are there by default, this is where you do it. For example, to add some classes:
191189

192-
``` javascript
190+
```javascript
193191
var stackup = pcbStackupCore(layers, {
194192
id: 'board-id',
195193
attributes: {
196-
class: 'w-100 h-100'
197-
}
194+
class: 'w-100 h-100',
195+
},
198196
})
199197
```
200198

201199
### layer types
202200

203201
The stackup can be made up of the following layer types:
204202

205-
layer type | abbreviation
206-
-------------------------|--------------
207-
top / bottom copper | tcu / bcu
208-
top / bottom soldermask | tsm / bsm
209-
top / bottom silkscreen | tss / bss
210-
top / bottom solderpaste | tsp / bsp
211-
board outline | out
212-
drill hits | drl
203+
| layer type | abbreviation |
204+
| ------------------------ | ------------ |
205+
| top / bottom copper | tcu / bcu |
206+
| top / bottom soldermask | tsm / bsm |
207+
| top / bottom silkscreen | tss / bss |
208+
| top / bottom solderpaste | tsp / bsp |
209+
| board outline | out |
210+
| drill hits | drl |
213211

214212
## developing and contributing
215213

@@ -219,12 +217,12 @@ Clone and then `$ npm install`. Please accompany all PRs with applicable tests.
219217

220218
This module uses [Mocha](http://mochajs.org/) and [Chai](http://chaijs.com/) for unit testing, [nyc](https://github.com/istanbuljs/nyc) for coverage, and [standard](http://standardjs.com) for linting.
221219

222-
* `$ npm test` - run the tests, calculate coverage, and lint
223-
* `$ npm run test:watch` - run the tests on code changes (does not lint nor cover)
224-
* `$ npm run coverage` - print the coverage report of the last test run
225-
* `$ npm run coverage:html` - generate an html report for the last test run
226-
* `$ npm run lint` - lint the code
227-
* `$ npm run fix` - try and fix the linting errors in the code
220+
- `$ npm test` - run the tests, calculate coverage, and lint
221+
- `$ npm run test:watch` - run the tests on code changes (does not lint nor cover)
222+
- `$ npm run coverage` - print the coverage report of the last test run
223+
- `$ npm run coverage:html` - generate an html report for the last test run
224+
- `$ npm run lint` - lint the code
225+
- `$ npm run fix` - try and fix the linting errors in the code
228226

229227
### integration testing
230228

@@ -237,5 +235,5 @@ The integration tests run the example code on a variety of gerber files to ensur
237235

238236
Browser tests are run with [Zuul](https://github.com/defunctzombie/zuul) and [Sauce Labs](https://saucelabs.com/opensauce/) on the latest two versions of Chrome, Firefox, Safari, and Internet Explorer, as well as the latest version of Edge.
239237

240-
* `$ npm run test:browser` - run the unit tests in a local browser
241-
* `$ npm run test:sauce` - run the units tests in several browsers using Sauce Labs (free [Open Sauce account](https://saucelabs.com/opensauce/), free [ngrok account](https://ngrok.com/), and local [.zuulrc](https://github.com/defunctzombie/zuul/wiki/Zuulrc) required)
238+
- `$ npm run test:browser` - run the unit tests in a local browser
239+
- `$ npm run test:sauce` - run the units tests in several browsers using Sauce Labs (free [Open Sauce account](https://saucelabs.com/opensauce/), free [ngrok account](https://ngrok.com/), and local [.zuulrc](https://github.com/defunctzombie/zuul/wiki/Zuulrc) required)

0 commit comments

Comments
 (0)