From ce517822428e20549a89ff4550c6e8d5a3bd516b Mon Sep 17 00:00:00 2001 From: qu1ck Date: Mon, 30 Dec 2019 21:02:41 -0800 Subject: [PATCH] Update dataformat and readme docs --- DATAFORMAT.md | 22 ++++++++++++++++++---- README.md | 8 +++++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/DATAFORMAT.md b/DATAFORMAT.md index 4177ff01..f1ae3537 100644 --- a/DATAFORMAT.md +++ b/DATAFORMAT.md @@ -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. @@ -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. @@ -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 @@ -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. @@ -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. diff --git a/README.md b/README.md index d8f756c4..8ceb0e2d 100644 --- a/README.md +++ b/README.md @@ -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/) @@ -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)