Skip to content

Commit

Permalink
Update dataformat and readme docs
Browse files Browse the repository at this point in the history
  • Loading branch information
qu1ck committed Dec 31, 2019
1 parent 5c42502 commit ce51782
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
22 changes: 18 additions & 4 deletions DATAFORMAT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pcbdata = {
"F": [
{
// SVG path of the polygon given as 'd' attribute of svg spec.
// If "svgpath" is present "polygons" is ignored.
// If "svgpath" is present "polygons" is ignored.
"svgpath": svgpath,
"polygons": [
// Set of polylines same as in polygon drawing.
Expand Down Expand Up @@ -105,8 +105,9 @@ pcbdata = {

# drawing struct

All drawings are either graphical items (arcs, lines, circles)
All drawings are either graphical items (arcs, lines, circles, curves)
or text.

Rendering method and properties are determined based on `type`
attribute.

Expand Down Expand Up @@ -151,6 +152,19 @@ attribute.
}
```

### curve

```js
{
"type": "curve", // Bezier curve
"start": [x, y],
"end": [x, y],
"cpa": [x, y], // control point A
"cpb": [x, y], // control point B
"width": width,
}
```

### polygon

```js
Expand Down Expand Up @@ -238,7 +252,7 @@ Footprints are a collection of pads, drawings and some metadata.
"shape": shape,
// Only present if shape is "custom".
// SVG path of the polygon given as 'd' attribute of svg spec.
// If "svgpath" is present "polygons", "pos", "angle" are ignored.
// If "svgpath" is present "polygons", "pos", "angle" are ignored.
"svgpath": svgpath,
"polygons": [
// Set of polylines same as in polygon drawing.
Expand All @@ -249,7 +263,7 @@ Footprints are a collection of pads, drawings and some metadata.
"radius": radius,
// Only present if shape is "chamfrect".
// chamfpos is a bitmask, left = 1, right = 2, bottom left = 4, bottom right = 8
"chamfpos": chamfpos,
"chamfpos": chamfpos,
"chamfratio": ratio,
// Pad type is "th" for standard and NPTH pads
// "smd" otherwise.
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ as additional columns in the BOM table (for example manufacturer id) or it can b
used to indicate which components should be omitted altogether (dnp field). For
full description of functionality see [wiki](https://github.com/openscopeproject/InteractiveHtmlBom/wiki).

Generated html page is fully self contained, doesn't need internet connection to work and can be packaged with documentation of your project or hosted anywhere on the web.
Generated html page is fully self contained, doesn't need internet connection to work
and can be packaged with documentation of your project or hosted anywhere on the web.

[Demo is worth a thousand words.](https://openscopeproject.org/InteractiveHtmlBomDemo/)

Expand All @@ -29,8 +30,9 @@ See [project wiki](https://github.com/openscopeproject/InteractiveHtmlBom/wiki)

Plugin code is licensed under MIT license, see `LICENSE` for more info.

Html page uses [Split.js](https://github.com/nathancahill/Split.js)
and [PEP.js](https://github.com/jquery/PEP) libraries that get embedded into
Html page uses [Split.js](https://github.com/nathancahill/Split.js),
[PEP.js](https://github.com/jquery/PEP) and (stripped down)
[lz-strings.js](https://github.com/pieroxy/lz-string) libraries that get embedded into
generated bom page.

`units.py` is borrowed from [KiBom](https://github.com/SchrodingersGat/KiBoM)
Expand Down

0 comments on commit ce51782

Please sign in to comment.