├── .gitignore ├── .jsdoc.json ├── LICENSE ├── README.md ├── arc.js ├── bezierCurveThrough.js ├── bezierCurveTo.js ├── circle.js ├── dist ├── shape-points.es.js ├── shape-points.es.js.map ├── shape-points.js └── shape-points.js.map ├── docs ├── code.js ├── highlight.js ├── index.html ├── index.js ├── index.js.map ├── jsdoc │ ├── arc.js.html │ ├── bezierCurveThrough.js.html │ ├── bezierCurveTo.js.html │ ├── circle.js.html │ ├── ellipse.js.html │ ├── fonts │ │ ├── OpenSans-Bold-webfont.eot │ │ ├── OpenSans-Bold-webfont.svg │ │ ├── OpenSans-Bold-webfont.woff │ │ ├── OpenSans-BoldItalic-webfont.eot │ │ ├── OpenSans-BoldItalic-webfont.svg │ │ ├── OpenSans-BoldItalic-webfont.woff │ │ ├── OpenSans-Italic-webfont.eot │ │ ├── OpenSans-Italic-webfont.svg │ │ ├── OpenSans-Italic-webfont.woff │ │ ├── OpenSans-Light-webfont.eot │ │ ├── OpenSans-Light-webfont.svg │ │ ├── OpenSans-Light-webfont.woff │ │ ├── OpenSans-LightItalic-webfont.eot │ │ ├── OpenSans-LightItalic-webfont.svg │ │ ├── OpenSans-LightItalic-webfont.woff │ │ ├── OpenSans-Regular-webfont.eot │ │ ├── OpenSans-Regular-webfont.svg │ │ └── OpenSans-Regular-webfont.woff │ ├── global.html │ ├── index.html │ ├── index.js.html │ ├── line.js.html │ ├── module-shape-points.html │ ├── module-shape-points_arc.html │ ├── module-shape-points_bezierCurveThrough.html │ ├── module-shape-points_bezierCurveTo.html │ ├── module-shape-points_circle.html │ ├── module-shape-points_ellipse.html │ ├── module-shape-points_line.html │ ├── module-shape-points_quadraticCurveTo.html │ ├── module-shape-points_rect.html │ ├── module-shape-points_roundedRect.html │ ├── quadraticCurveTo.js.html │ ├── rect.js.html │ ├── roundedRect.js.html │ ├── scripts │ │ ├── linenumber.js │ │ └── prettify │ │ │ ├── Apache-License-2.0.txt │ │ │ ├── lang-css.js │ │ │ └── prettify.js │ ├── shape-points.module_arc.html │ └── styles │ │ ├── jsdoc-default.css │ │ ├── prettify-jsdoc.css │ │ └── prettify-tomorrow.css ├── rollup.config.js └── rollup.dev.js ├── ellipse.js ├── index.js ├── line.js ├── package.json ├── quadraticCurveTo.js ├── rect.js ├── rollup.config.js ├── roundedRect.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.jsdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "applicationName": "shape-points", 3 | "meta": { 4 | "title": "shape-points", 5 | "description": "", 6 | "keyword": "" 7 | }, 8 | "linenums": true, 9 | "source": { 10 | "include": [ 11 | "./index.js", 12 | "./arc.js", 13 | "./bezierCurveTo.js", 14 | "./bezierCurveThrough.js", 15 | "./circle.js", 16 | "./ellipse.js", 17 | "./line.js", 18 | "./quadraticCurveTo.js", 19 | "./rect.js", 20 | "./roundedRect.js" 21 | ] 22 | }, 23 | "opts": { 24 | "readme": "./README.md", 25 | "encoding": "utf8", 26 | "recurse": true, 27 | "private": false, 28 | "lenient": true, 29 | "destination": "./docs/jsdoc" 30 | }, 31 | "plugins": [ 32 | "plugins/markdown" 33 | ], 34 | "templates": { 35 | "default": { 36 | "outputSourceFiles": true 37 | }, 38 | "applicationName": "shape-points", 39 | "footer" : "by YOPEY YOPEY LLC (yopeyopey.com)", 40 | "copyright" : "Copyright © 2019 YOPEY YOPEY LLC.", 41 | "meta": { 42 | "title": "shape-points API Documentation", 43 | "description": "Documentation for shape-points library", 44 | "keyword": "docs, documentation, html5, javascript, jsdoc, shape, points, arc, bezier, bezierCurveTo, circle, ellipse, quadraticCurveTo, roundedRect" 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 YOPEY YOPEY LLC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # shape-points 2 | Generate points for simple shapes and curves: arcs, rectangles, rounded rectangles, circles, ellipses, bezierCurveTo, bezierCurveThrough (i.e., bezier curves through specific points) 3 | 4 | ## rationale 5 | 6 | I needed to find the points of a rounded rectangle. Then I had fun adding lots of other shapes and curves. 7 | 8 | ## installation 9 | 10 | ``` 11 | yarn add shape-points 12 | ``` 13 | or 14 | ``` 15 | npm i shape-points 16 | ``` 17 | ## programmatic example 18 | ```js 19 | import * as ShapePoints from 'shape-points' 20 | 21 | // alternatively: 22 | // const roundedRect = require('shape-points').roundedRect 23 | 24 | const points = ShapePoints.roundedRect(125, 100, 200, 100, 30) 25 | 26 | // assuming a canvas context was set up 27 | context.moveTo(points[0], points[1]) 28 | for (let i = 2; i < points.length; i += 2) 29 | { 30 | context.lineTo(points[i], points[i + 1]) 31 | } 32 | context.stroke() 33 | ``` 34 | ## live example 35 | https://davidfig.github.io/shape-points/ 36 | 37 | ## API 38 | https://davidfig.github.io/shape-points/jsdoc/ 39 | 40 | ## License 41 | MIT License 42 | (c) 2018 [YOPEY YOPEY LLC](https://yopeyopey.com/) by [David Figatner](https://twitter.com/yopey_yopey/) 43 | -------------------------------------------------------------------------------- /arc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * calculate points for arc 3 | * @module shape-points/arc 4 | * @param {number} x 5 | * @param {number} y 6 | * @param {number} start angle (radians) 7 | * @param {number} end angle (radians) 8 | * @param {number} radius 9 | * @param {number} [pointsInArc=5] 10 | * @returns {array} [x1, y1, x2, y2, ... xn, yn] 11 | */ 12 | export function arc(x, y, start, end, radius, pointsInArc) 13 | { 14 | pointsInArc = pointsInArc > 1 ? pointsInArc : 5 15 | const points = [] 16 | let angle = start 17 | const interval = (end - start) / (pointsInArc - 1) 18 | for (let count = 0; count < pointsInArc; count++) 19 | { 20 | points.push(x + radius * Math.cos(angle), y + radius * Math.sin(angle)) 21 | angle += interval 22 | } 23 | return points 24 | } 25 | 26 | -------------------------------------------------------------------------------- /bezierCurveThrough.js: -------------------------------------------------------------------------------- 1 | import Curve from 'fit-curve' 2 | 3 | import { bezierCurveTo } from './bezierCurveTo' 4 | 5 | /** 6 | * Calculate points for smooth bezier curves passing through a series of points 7 | * uses https://github.com/soswow/fit-curve/blob/master/src/fit-curve.js 8 | * uses ShapePoints.curveError=50 for error value 9 | * @module shape-points/bezierCurveThrough 10 | * @param {(number|number[])} x1 - starting point or array of points [x1, y1, x2, y2, ... xn, yn] 11 | * @param {number} [y1] 12 | * @param {number} [x2] 13 | * @param {number} [y2] 14 | * @param {number} [xn] - ending point 15 | * @param {number} [yn] 16 | * @param {object} [options] 17 | * @param {number} [options.pointsInArc=5] 18 | * @param {number} [options.curveError=50] 19 | * @returns {number[]} [x1, y1, x2, y2, ... xn, yn] 20 | */ 21 | export function bezierCurveThrough() 22 | { 23 | let pointsInArc = 5, curveError = 50 24 | const points = [] 25 | if (Array.isArray(arguments[0])) 26 | { 27 | const array = arguments[0] 28 | for (let i = 0; i < array.length; i += 2) 29 | { 30 | points.push([array[i], array[i + 1]]) 31 | } 32 | if (arguments.length === 2) 33 | { 34 | pointsInArc = arguments[1].pointsInArc 35 | curveError = arguments[1].curveError 36 | } 37 | } 38 | else 39 | { 40 | let length = arguments.length 41 | if (arguments.length % 2 === 1) 42 | { 43 | length-- 44 | pointsInArc = arguments[length].pointsInArc 45 | curveError = arguments[length].curveError 46 | } 47 | for (let i = 0; i < length; i += 2) 48 | { 49 | points.push([arguments[i], arguments[i + 1]]) 50 | } 51 | } 52 | 53 | // two points creates a line 54 | if (points.length === 2) 55 | { 56 | return [points[0][0], points[0][1], points[1][0], points[1][1]] 57 | } 58 | 59 | // not enough points 60 | if (points.length < 4) 61 | { 62 | return [] 63 | } 64 | 65 | const results = [] 66 | const curves = Curve(points, curveError) 67 | for (let i = 0; i < curves.length; i++) 68 | { 69 | const c = curves[i] 70 | results.push(...bezierCurveTo(c[0][0], c[0][1], c[1][0], c[1][1], c[2][0], c[2][1], c[3][0], c[3][1], pointsInArc)) 71 | } 72 | return results 73 | } -------------------------------------------------------------------------------- /bezierCurveTo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Calculate points for a bezier curve with a starting point and two control points 3 | * from https://stackoverflow.com/a/15399173/1955997 4 | * @module shape-points/bezierCurveTo 5 | * @param {number} x1 - starting point (usually a moveTo) 6 | * @param {number} y1 - starting point 7 | * @param {number} cp1x - first control point 8 | * @param {number} cp1y - first control point 9 | * @param {number} cp2x - second control point 10 | * @param {number} cp2y - second control point 11 | * @param {number} x2 - ending point 12 | * @param {number} y2 - ending point 13 | * @param {number} [pointsInArc=5] 14 | * @returns {array} [x1, y1, x2, y2, ... xn, yn] 15 | */ 16 | export function bezierCurveTo(x1, y1, cp1x, cp1y, cp2x, cp2y, x2, y2, pointsInArc) 17 | { 18 | pointsInArc = pointsInArc || 5 19 | const points = [] 20 | const interval = 1 / pointsInArc 21 | for (let t = 0; t <= 1; t += interval) 22 | { 23 | const B0_t = Math.pow(1 - t, 3), 24 | B1_t = 3 * t * Math.pow(1 - t, 2), 25 | B2_t = 3 * Math.pow(t, 2) * (1 - t), 26 | B3_t = Math.pow(t, 3) 27 | 28 | points.push( 29 | (B0_t * x1) + (B1_t * cp1x) + (B2_t * cp2x) + (B3_t * x2), 30 | (B0_t * y1) + (B1_t * cp1y) + (B2_t * cp2y) + (B3_t * y2) 31 | ) 32 | } 33 | return points 34 | } 35 | -------------------------------------------------------------------------------- /circle.js: -------------------------------------------------------------------------------- 1 | /** 2 | * calculate points for a circle (calculates using pointsInArc * 4) 3 | * @module shape-points/circle 4 | * @param {number} x 5 | * @param {number} y 6 | * @param {number} radius 7 | * @param {number} [pointsInArc=5] 8 | * @returns {array} [x1, y1, x2, y2, ... xn, yn] 9 | */ 10 | export function circle(x, y, radius, pointsInArc) 11 | { 12 | pointsInArc = pointsInArc || 5 13 | const points = [] 14 | const interval = Math.PI * 2 / (pointsInArc * 4) 15 | for (let i = 0; i < Math.PI * 2; i += interval) 16 | { 17 | points.push(x + Math.cos(i) * radius, y + Math.sin(i) * radius) 18 | } 19 | return points 20 | } -------------------------------------------------------------------------------- /dist/shape-points.js: -------------------------------------------------------------------------------- 1 | !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t=t||self).ShapePoints={})}(this,(function(t){"use strict";function r(t,r,n,e,o,u){const a=[];let i=n;const s=(e-n)/((u=u>1?u:5)-1);for(let n=0;no&&(o=e,i=h);return[o,i]}(t,c=function(t,r,n,e){var o,u,a,i,c,h,m,l,p,d,b,M,I,g,y,v,A,L=t[0],P=t[t.length-1];for(o=[L,null,null,P],u=s.zeros_Xx2x2(r.length),I=0,g=r.length;I1)return 1;for(var o,u,a,i,s=1;s<=e;s++)if(r<=n[s]){a=(s-1)/e,u=s/e,i=(r-(o=n[s-1]))/(n[s]-o)*(u-a)+a;break}return i}function i(t,r){return s.normalize(s.subtract(t,r))}var s=function(){function t(){r(this,t)}return t.zeros_Xx2x2=function(t){for(var r=[];t--;)r.push([0,0]);return r},t.mulItems=function(t,r){return t.map((function(t){return t*r}))},t.mulMatrix=function(t,r){return t.reduce((function(t,n,e){return t+n*r[e]}),0)},t.subtract=function(t,r){return t.map((function(t,n){return t-r[n]}))},t.addArrays=function(t,r){return t.map((function(t,n){return t+r[n]}))},t.addItems=function(t,r){return t.map((function(t){return t+r}))},t.sum=function(t){return t.reduce((function(t,r){return t+r}))},t.dot=function(r,n){return t.mulMatrix(r,n)},t.vectorLen=function(t){return Math.hypot.apply(Math,t)},t.divItems=function(t,r){return t.map((function(t){return t/r}))},t.squareItems=function(t){return t.map((function(t){return t*t}))},t.normalize=function(t){return this.divItems(t,this.vectorLen(t))},t}(),f=function(){function t(){r(this,t)}return t.q=function(t,r){var n=1-r,e=s.mulItems(t[0],n*n*n),o=s.mulItems(t[1],3*n*n*r),u=s.mulItems(t[2],3*n*r*r),a=s.mulItems(t[3],r*r*r);return s.addArrays(s.addArrays(e,o),s.addArrays(u,a))},t.qprime=function(t,r){var n=1-r,e=s.mulItems(s.subtract(t[1],t[0]),3*n*n),o=s.mulItems(s.subtract(t[2],t[1]),6*n*r),u=s.mulItems(s.subtract(t[3],t[2]),3*r*r);return s.addArrays(s.addArrays(e,o),u)},t.qprimeprime=function(t,r){return s.addArrays(s.mulItems(s.addArrays(s.subtract(t[2],s.mulItems(t[1],2)),t[0]),6*(1-r)),s.mulItems(s.addArrays(s.subtract(t[3],s.mulItems(t[2],2)),t[1]),6*r))},t}();t.exports=function(t,r,o){if(!Array.isArray(t))throw new TypeError("First argument should be an array");if(t.forEach((function(r){if(!Array.isArray(r)||r.some((function(t){return"number"!=typeof t}))||r.length!==t[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")})),(t=t.filter((function(r,n){return 0===n||!r.every((function(r,e){return r===t[n-1][e]}))}))).length<2)return[];var u=t.length,a=i(t[1],t[0]),f=i(t[u-2],t[u-1]);return function t(r,o,u,a,i){var f,c,h,m,l,p,d,b,M,I,g,y,v;if(2===r.length)return y=s.vectorLen(s.subtract(r[0],r[1]))/3,[f=[r[0],s.addArrays(r[0],s.mulItems(o,y)),s.addArrays(r[1],s.mulItems(u,y)),r[1]]];c=function(t){var r,n,e,o=[];return t.forEach((function(t,u){r=u?n+s.vectorLen(s.subtract(t,e)):0,o.push(r),n=r,e=t})),o=o.map((function(t){return t/n}))}(r);var A=n(r,c,c,o,u,i);if(f=A[0],m=A[1],p=A[2],0===m||m.9999&&P<1.0001)break}l=m,d=p}if(g=[],(b=s.subtract(r[p-1],r[p+1])).every((function(t){return 0===t}))){var x=[-(b=s.subtract(r[p-1],r[p]))[1],b[0]];b[0]=x[0],b[1]=x[1]}return M=s.normalize(b),I=s.mulItems(M,-1),g=(g=g.concat(t(r.slice(0,p+1),o,M,a,i))).concat(t(r.slice(p),I,u,a,i))}(t,a,f,r,o)}}(t)}));t.arc=r,t.bezierCurveThrough=function(){let t=5,r=50;const o=[];if(Array.isArray(arguments[0])){const n=arguments[0];for(let t=0;t 2 | 3 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | -------------------------------------------------------------------------------- /docs/jsdoc/arc.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: arc.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: arc.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
/**
30 |  * calculate points for arc
31 |  * @module shape-points/arc
32 |  * @param {number} x
33 |  * @param {number} y
34 |  * @param {number} start angle (radians)
35 |  * @param {number} end angle (radians)
36 |  * @param {number} radius
37 |  * @param {number} [pointsInArc=5]
38 |  * @returns {array} [x1, y1, x2, y2, ... xn, yn]
39 |  */
40 | export function arc(x, y, start, end, radius, pointsInArc)
41 | {
42 |     pointsInArc = pointsInArc > 1 ? pointsInArc : 5
43 |     const points = []
44 |     let angle = start
45 |     const interval = (end - start) / (pointsInArc - 1)
46 |     for (let count = 0; count < pointsInArc; count++)
47 |     {
48 |         points.push(x + radius * Math.cos(angle), y + radius * Math.sin(angle))
49 |         angle += interval
50 |     }
51 |     return points
52 | }
53 | 
54 | 
55 |
56 |
57 | 58 | 59 | 60 | 61 |
62 | 63 | 66 | 67 |
68 | 69 |
70 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 71 |
72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /docs/jsdoc/bezierCurveThrough.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: bezierCurveThrough.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: bezierCurveThrough.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
import Curve from 'fit-curve'
 30 | 
 31 | import { bezierCurveTo } from './bezierCurveTo'
 32 | 
 33 | /**
 34 |  * Calculate points for smooth bezier curves passing through a series of points
 35 |  * uses https://github.com/soswow/fit-curve/blob/master/src/fit-curve.js
 36 |  * uses ShapePoints.curveError=50 for error value
 37 |  * @module shape-points/bezierCurveThrough
 38 |  * @param {(number|number[])} x1 - starting point or array of points [x1, y1, x2, y2, ... xn, yn]
 39 |  * @param {number} [y1]
 40 |  * @param {number} [x2]
 41 |  * @param {number} [y2]
 42 |  * @param {number} [xn] - ending point
 43 |  * @param {number} [yn]
 44 |  * @param {object} [options]
 45 |  * @param {number} [options.pointsInArc=5]
 46 |  * @param {number} [options.curveError=50]
 47 |  * @returns {number[]} [x1, y1, x2, y2, ... xn, yn]
 48 |  */
 49 | export function bezierCurveThrough()
 50 | {
 51 |     let pointsInArc = 5, curveError = 50
 52 |     const points = []
 53 |     if (Array.isArray(arguments[0]))
 54 |     {
 55 |         const array = arguments[0]
 56 |         for (let i = 0; i < array.length; i += 2)
 57 |         {
 58 |             points.push([array[i], array[i + 1]])
 59 |         }
 60 |         if (arguments.length === 2)
 61 |         {
 62 |             pointsInArc = arguments[1].pointsInArc
 63 |             curveError = arguments[1].curveError
 64 |         }
 65 |     }
 66 |     else
 67 |     {
 68 |         let length = arguments.length
 69 |         if (arguments.length % 2 === 1)
 70 |         {
 71 |             length--
 72 |             pointsInArc = arguments[length].pointsInArc
 73 |             curveError = arguments[length].curveError
 74 |         }
 75 |         for (let i = 0; i < length; i += 2)
 76 |         {
 77 |             points.push([arguments[i], arguments[i + 1]])
 78 |         }
 79 |     }
 80 | 
 81 |     // two points creates a line
 82 |     if (points.length === 2)
 83 |     {
 84 |         return [points[0][0], points[0][1], points[1][0], points[1][1]]
 85 |     }
 86 | 
 87 |     // not enough points
 88 |     if (points.length < 4)
 89 |     {
 90 |         return []
 91 |     }
 92 | 
 93 |     const results = []
 94 |     const curves = Curve(points, curveError)
 95 |     for (let i = 0; i < curves.length; i++)
 96 |     {
 97 |         const c = curves[i]
 98 |         results.push(...bezierCurveTo(c[0][0], c[0][1], c[1][0], c[1][1], c[2][0], c[2][1], c[3][0], c[3][1], pointsInArc))
 99 |     }
100 |     return results
101 | }
102 |
103 |
104 | 105 | 106 | 107 | 108 |
109 | 110 | 113 | 114 |
115 | 116 |
117 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 118 |
119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /docs/jsdoc/bezierCurveTo.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: bezierCurveTo.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: bezierCurveTo.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
/**
30 |  * Calculate points for a bezier curve with a starting point and two control points
31 |  * from https://stackoverflow.com/a/15399173/1955997
32 |  * @module shape-points/bezierCurveTo
33 |  * @param {number} x1 - starting point (usually a moveTo)
34 |  * @param {number} y1 - starting point
35 |  * @param {number} cp1x - first control point
36 |  * @param {number} cp1y - first control point
37 |  * @param {number} cp2x - second control point
38 |  * @param {number} cp2y - second control point
39 |  * @param {number} x2 - ending point
40 |  * @param {number} y2 - ending point
41 |  * @param {number} [pointsInArc=5]
42 |  * @returns {array} [x1, y1, x2, y2, ... xn, yn]
43 |  */
44 | export function bezierCurveTo(x1, y1, cp1x, cp1y, cp2x, cp2y, x2, y2, pointsInArc)
45 | {
46 |     pointsInArc = pointsInArc || 5
47 |     const points = []
48 |     const interval = 1 / pointsInArc
49 |     for (let t = 0; t <= 1; t += interval)
50 |     {
51 |         const B0_t = Math.pow(1 - t, 3),
52 |             B1_t = 3 * t * Math.pow(1 - t, 2),
53 |             B2_t = 3 * Math.pow(t, 2) * (1 - t),
54 |             B3_t = Math.pow(t, 3)
55 | 
56 |         points.push(
57 |             (B0_t * x1) + (B1_t * cp1x) + (B2_t * cp2x) + (B3_t * x2),
58 |             (B0_t * y1) + (B1_t * cp1y) + (B2_t * cp2y) + (B3_t * y2)
59 |         )
60 |     }
61 |     return points
62 | }
63 | 
64 |
65 |
66 | 67 | 68 | 69 | 70 |
71 | 72 | 75 | 76 |
77 | 78 |
79 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 80 |
81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /docs/jsdoc/circle.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: circle.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: circle.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
/**
30 |  * calculate points for a circle (calculates using pointsInArc * 4)
31 |  * @module shape-points/circle
32 |  * @param {number} x
33 |  * @param {number} y
34 |  * @param {number} radius
35 |  * @param {number} [pointsInArc=5]
36 |  * @returns {array} [x1, y1, x2, y2, ... xn, yn]
37 |  */
38 | export function circle(x, y, radius, pointsInArc)
39 | {
40 |     pointsInArc = pointsInArc || 5
41 |     const points = []
42 |     const interval = Math.PI * 2 / (pointsInArc * 4)
43 |     for (let i = 0; i < Math.PI * 2; i += interval)
44 |     {
45 |         points.push(x + Math.cos(i) * radius, y + Math.sin(i) * radius)
46 |     }
47 |     return points
48 | }
49 |
50 |
51 | 52 | 53 | 54 | 55 |
56 | 57 | 60 | 61 |
62 | 63 |
64 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 65 |
66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /docs/jsdoc/ellipse.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: ellipse.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: ellipse.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
/**
30 |  * calculate points for a ellipse (calculates using pointsInArc * 4)
31 |  * @module shape-points/ellipse
32 |  * @param {number} x
33 |  * @param {number} y
34 |  * @param {number} rx
35 |  * @param {number} ry
36 |  * @param {number} [pointsInArc=5]
37 |  * @returns {array} [x1, y1, x2, y2, ... xn, yn]
38 |  */
39 | export function ellipse(x, y, rx, ry, pointsInArc)
40 | {
41 |     pointsInArc = pointsInArc || 5
42 |     const points = []
43 |     const interval = Math.PI * 2 / (pointsInArc * 4)
44 |     for (let i = 0; i < Math.PI * 2; i += interval)
45 |     {
46 |         points.push(x - rx * Math.sin(i), y - ry * Math.cos(i))
47 |     }
48 |     return points
49 | }
50 | 
51 | 
52 |
53 |
54 | 55 | 56 | 57 | 58 |
59 | 60 | 63 | 64 |
65 | 66 |
67 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 68 |
69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-Bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-Bold-webfont.eot -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-Bold-webfont.woff -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-BoldItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-BoldItalic-webfont.eot -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-BoldItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-BoldItalic-webfont.woff -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-Italic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-Italic-webfont.eot -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-Italic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-Italic-webfont.woff -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-Light-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-Light-webfont.eot -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-Light-webfont.woff -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-LightItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-LightItalic-webfont.eot -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-LightItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-LightItalic-webfont.woff -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-Regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-Regular-webfont.eot -------------------------------------------------------------------------------- /docs/jsdoc/fonts/OpenSans-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfig/shape-points/144d719f36ea521cffbf680dda271e3dde3fc3b5/docs/jsdoc/fonts/OpenSans-Regular-webfont.woff -------------------------------------------------------------------------------- /docs/jsdoc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Home 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Home

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 |

shape-points

47 |

Generate points for simple shapes and curves: arcs, rectangles, rounded rectangles, circles, ellipses, bezierCurveTo, bezierCurveThrough (i.e., bezier curves through specific points)

48 |

rationale

49 |

I needed to find the points of a rounded rectangle. Then I had fun adding lots of other shapes and curves.

50 |

installation

51 |
yarn add shape-points
 52 | 
53 |

or

54 |
npm i shape-points
 55 | 
56 |

programmatic example

57 |
import * as ShapePoints from 'shape-points'
 58 | 
 59 | // alternatively: 
 60 | // const roundedRect = require('shape-points').roundedRect
 61 | 
 62 | const points = ShapePoints.roundedRect(125, 100, 200, 100, 30)
 63 | 
 64 | // assuming a canvas context was set up
 65 | context.moveTo(points[0], points[1])
 66 | for (let i = 2; i < points.length; i += 2)
 67 | {
 68 |     context.lineTo(points[i], points[i + 1])
 69 | }
 70 | context.stroke()
 71 | 
72 |

live example

73 |

https://davidfig.github.io/shape-points/

74 |

API

75 |

https://davidfig.github.io/shape-points/jsdoc/

76 |

License

77 |

MIT License
78 | (c) 2018 YOPEY YOPEY LLC by David Figatner

79 |
80 | 81 | 82 | 83 | 84 | 85 | 86 |
87 | 88 | 91 | 92 |
93 | 94 |
95 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 96 |
97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /docs/jsdoc/index.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: index.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: index.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
/** @module shape-points */
30 | 
31 | export { rect } from './rect'
32 | export { arc } from './arc'
33 | export { roundedRect } from './roundedRect'
34 | export { line } from './line'
35 | export { circle } from './circle'
36 | export { ellipse } from './ellipse'
37 | export { bezierCurveTo } from './bezierCurveTo'
38 | export { bezierCurveThrough } from './bezierCurveThrough'
39 | export { quadraticCurveTo } from './quadraticCurveTo'
40 |
41 |
42 | 43 | 44 | 45 | 46 |
47 | 48 | 51 | 52 |
53 | 54 |
55 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 56 |
57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /docs/jsdoc/line.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: line.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: line.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
/**
30 |  * calculate points for a line with a certain thickness (either one thickness or a starting and ending thickness)
31 |  * @module shape-points/line
32 |  * @param {number} x1
33 |  * @param {number} y1
34 |  * @param {number} x2
35 |  * @param {number} y2
36 |  * @param {number|object} [thickness]
37 |  * @param {number} thickness.start
38 |  * @param {number} thickness.end
39 |  * @returns {array} [x1, y1, x2, y2, ... xn, yn]
40 |  */
41 | export function line(x1, y1, x2, y2, thickness)
42 | {
43 |     thickness = thickness || 0
44 |     const angle = Math.atan2(y2 - y1, x2 - x1)
45 |     const perp = angle - Math.PI / 2
46 |     const half = isNaN(thickness) ? { start: thickness.start / 2, end: thickness.end / 2 } : { start: thickness / 2, end: thickness / 2 }
47 |     return [
48 |         x1 - Math.cos(perp) * half.start, y1 - Math.sin(perp) * half.start,
49 |         x2 - Math.cos(perp) * half.end, y2 - Math.sin(perp) * half.end,
50 |         x2 + Math.cos(perp) * half.end, y2 + Math.sin(perp) * half.end,
51 |         x1 + Math.cos(perp) * half.start, y1 + Math.sin(perp) * half.start
52 |     ]
53 | }
54 | 
55 | 
56 |
57 |
58 | 59 | 60 | 61 | 62 |
63 | 64 | 67 | 68 |
69 | 70 |
71 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 72 |
73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /docs/jsdoc/module-shape-points.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: shape-points 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: shape-points

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 |
34 | 35 |
36 |
37 | 38 | 39 | 40 | 41 | 42 |
43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
64 | 65 |
66 | 67 | 68 | 69 | 70 |
71 | 72 | 75 | 76 |
77 | 78 |
79 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 80 |
81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /docs/jsdoc/module-shape-points_arc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: shape-points/arc 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: shape-points/arc

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 | 41 |

calculate points for arc

42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
Parameters:
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 97 | 98 | 99 | 106 | 107 | 108 | 109 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 132 | 133 | 134 | 141 | 142 | 143 | 144 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 167 | 168 | 169 | 176 | 177 | 178 | 179 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 202 | 203 | 204 | 211 | 212 | 213 | 214 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 237 | 238 | 239 | 246 | 247 | 248 | 249 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 272 | 273 | 274 | 283 | 284 | 285 | 286 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 |
NameTypeAttributesDefaultDescription
x 90 | 91 | 92 | number 93 | 94 | 95 | 96 | 100 | 101 | 102 | 103 | 104 | 105 | 110 | 111 |
y 125 | 126 | 127 | number 128 | 129 | 130 | 131 | 135 | 136 | 137 | 138 | 139 | 140 | 145 | 146 |
start 160 | 161 | 162 | number 163 | 164 | 165 | 166 | 170 | 171 | 172 | 173 | 174 | 175 | 180 | 181 |

angle (radians)

end 195 | 196 | 197 | number 198 | 199 | 200 | 201 | 205 | 206 | 207 | 208 | 209 | 210 | 215 | 216 |

angle (radians)

radius 230 | 231 | 232 | number 233 | 234 | 235 | 236 | 240 | 241 | 242 | 243 | 244 | 245 | 250 | 251 |
pointsInArc 265 | 266 | 267 | number 268 | 269 | 270 | 271 | 275 | 276 | <optional>
277 | 278 | 279 | 280 | 281 | 282 |
287 | 288 | 5 289 | 290 |
299 | 300 | 301 | 302 | 303 | 304 | 305 |
306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 |
Source:
333 |
336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 |
344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 |
Returns:
360 | 361 | 362 |
363 |

[x1, y1, x2, y2, ... xn, yn]

364 |
365 | 366 | 367 | 368 |
369 |
370 | Type 371 |
372 |
373 | 374 | array 375 | 376 | 377 |
378 |
379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 |
389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 |
410 | 411 |
412 | 413 | 414 | 415 | 416 |
417 | 418 | 421 | 422 |
423 | 424 |
425 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 426 |
427 | 428 | 429 | 430 | 431 | -------------------------------------------------------------------------------- /docs/jsdoc/module-shape-points_bezierCurveThrough.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: shape-points/bezierCurveThrough 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: shape-points/bezierCurveThrough

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 | 41 |

Calculate points for smooth bezier curves passing through a series of points 42 | uses https://github.com/soswow/fit-curve/blob/master/src/fit-curve.js 43 | uses ShapePoints.curveError=50 for error value

44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 |
Parameters:
60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 100 | 101 | 102 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 131 | 132 | 133 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 164 | 165 | 166 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 197 | 198 | 199 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 230 | 231 | 232 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 263 | 264 | 265 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 296 | 297 | 298 | 307 | 308 | 309 | 310 | 311 | 420 | 421 | 422 | 423 | 424 |
NameTypeAttributesDescription
x1 90 | 91 | 92 | number 93 | | 94 | 95 | Array.<number> 96 | 97 | 98 | 99 | 103 | 104 | 105 | 106 | 107 | 108 |

starting point or array of points [x1, y1, x2, y2, ... xn, yn]

y1 124 | 125 | 126 | number 127 | 128 | 129 | 130 | 134 | 135 | <optional>
136 | 137 | 138 | 139 | 140 | 141 |
x2 157 | 158 | 159 | number 160 | 161 | 162 | 163 | 167 | 168 | <optional>
169 | 170 | 171 | 172 | 173 | 174 |
y2 190 | 191 | 192 | number 193 | 194 | 195 | 196 | 200 | 201 | <optional>
202 | 203 | 204 | 205 | 206 | 207 |
xn 223 | 224 | 225 | number 226 | 227 | 228 | 229 | 233 | 234 | <optional>
235 | 236 | 237 | 238 | 239 | 240 |

ending point

yn 256 | 257 | 258 | number 259 | 260 | 261 | 262 | 266 | 267 | <optional>
268 | 269 | 270 | 271 | 272 | 273 |
options 289 | 290 | 291 | object 292 | 293 | 294 | 295 | 299 | 300 | <optional>
301 | 302 | 303 | 304 | 305 | 306 |
312 |
Properties
313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 352 | 353 | 354 | 363 | 364 | 365 | 366 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 391 | 392 | 393 | 402 | 403 | 404 | 405 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 |
NameTypeAttributesDefaultDescription
pointsInArc 345 | 346 | 347 | number 348 | 349 | 350 | 351 | 355 | 356 | <optional>
357 | 358 | 359 | 360 | 361 | 362 |
367 | 368 | 5 369 | 370 |
curveError 384 | 385 | 386 | number 387 | 388 | 389 | 390 | 394 | 395 | <optional>
396 | 397 | 398 | 399 | 400 | 401 |
406 | 407 | 50 408 | 409 |
418 | 419 |
425 | 426 | 427 | 428 | 429 | 430 | 431 |
432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 |
Source:
459 |
462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 |
470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 |
Returns:
486 | 487 | 488 |
489 |

[x1, y1, x2, y2, ... xn, yn]

490 |
491 | 492 | 493 | 494 |
495 |
496 | Type 497 |
498 |
499 | 500 | Array.<number> 501 | 502 | 503 |
504 |
505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 |
515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 |
536 | 537 |
538 | 539 | 540 | 541 | 542 |
543 | 544 | 547 | 548 |
549 | 550 |
551 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 552 |
553 | 554 | 555 | 556 | 557 | -------------------------------------------------------------------------------- /docs/jsdoc/module-shape-points_bezierCurveTo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: shape-points/bezierCurveTo 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: shape-points/bezierCurveTo

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 | 41 |

Calculate points for a bezier curve with a starting point and two control points 42 | from https://stackoverflow.com/a/15399173/1955997

43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 |
Parameters:
59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 98 | 99 | 100 | 107 | 108 | 109 | 110 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 133 | 134 | 135 | 142 | 143 | 144 | 145 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 168 | 169 | 170 | 177 | 178 | 179 | 180 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 203 | 204 | 205 | 212 | 213 | 214 | 215 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 238 | 239 | 240 | 247 | 248 | 249 | 250 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 273 | 274 | 275 | 282 | 283 | 284 | 285 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 308 | 309 | 310 | 317 | 318 | 319 | 320 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 343 | 344 | 345 | 352 | 353 | 354 | 355 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 378 | 379 | 380 | 389 | 390 | 391 | 392 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 |
NameTypeAttributesDefaultDescription
x1 91 | 92 | 93 | number 94 | 95 | 96 | 97 | 101 | 102 | 103 | 104 | 105 | 106 | 111 | 112 |

starting point (usually a moveTo)

y1 126 | 127 | 128 | number 129 | 130 | 131 | 132 | 136 | 137 | 138 | 139 | 140 | 141 | 146 | 147 |

starting point

cp1x 161 | 162 | 163 | number 164 | 165 | 166 | 167 | 171 | 172 | 173 | 174 | 175 | 176 | 181 | 182 |

first control point

cp1y 196 | 197 | 198 | number 199 | 200 | 201 | 202 | 206 | 207 | 208 | 209 | 210 | 211 | 216 | 217 |

first control point

cp2x 231 | 232 | 233 | number 234 | 235 | 236 | 237 | 241 | 242 | 243 | 244 | 245 | 246 | 251 | 252 |

second control point

cp2y 266 | 267 | 268 | number 269 | 270 | 271 | 272 | 276 | 277 | 278 | 279 | 280 | 281 | 286 | 287 |

second control point

x2 301 | 302 | 303 | number 304 | 305 | 306 | 307 | 311 | 312 | 313 | 314 | 315 | 316 | 321 | 322 |

ending point

y2 336 | 337 | 338 | number 339 | 340 | 341 | 342 | 346 | 347 | 348 | 349 | 350 | 351 | 356 | 357 |

ending point

pointsInArc 371 | 372 | 373 | number 374 | 375 | 376 | 377 | 381 | 382 | <optional>
383 | 384 | 385 | 386 | 387 | 388 |
393 | 394 | 5 395 | 396 |
405 | 406 | 407 | 408 | 409 | 410 | 411 |
412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 |
Source:
439 |
442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 |
450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 |
Returns:
466 | 467 | 468 |
469 |

[x1, y1, x2, y2, ... xn, yn]

470 |
471 | 472 | 473 | 474 |
475 |
476 | Type 477 |
478 |
479 | 480 | array 481 | 482 | 483 |
484 |
485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 |
495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 |
516 | 517 |
518 | 519 | 520 | 521 | 522 |
523 | 524 | 527 | 528 |
529 | 530 |
531 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 532 |
533 | 534 | 535 | 536 | 537 | -------------------------------------------------------------------------------- /docs/jsdoc/module-shape-points_circle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: shape-points/circle 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: shape-points/circle

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 | 41 |

calculate points for a circle (calculates using pointsInArc * 4)

42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
Parameters:
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 97 | 98 | 99 | 106 | 107 | 108 | 109 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 132 | 133 | 134 | 141 | 142 | 143 | 144 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 167 | 168 | 169 | 176 | 177 | 178 | 179 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 202 | 203 | 204 | 213 | 214 | 215 | 216 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 |
NameTypeAttributesDefaultDescription
x 90 | 91 | 92 | number 93 | 94 | 95 | 96 | 100 | 101 | 102 | 103 | 104 | 105 | 110 | 111 |
y 125 | 126 | 127 | number 128 | 129 | 130 | 131 | 135 | 136 | 137 | 138 | 139 | 140 | 145 | 146 |
radius 160 | 161 | 162 | number 163 | 164 | 165 | 166 | 170 | 171 | 172 | 173 | 174 | 175 | 180 | 181 |
pointsInArc 195 | 196 | 197 | number 198 | 199 | 200 | 201 | 205 | 206 | <optional>
207 | 208 | 209 | 210 | 211 | 212 |
217 | 218 | 5 219 | 220 |
229 | 230 | 231 | 232 | 233 | 234 | 235 |
236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 |
Source:
263 |
266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 |
274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 |
Returns:
290 | 291 | 292 |
293 |

[x1, y1, x2, y2, ... xn, yn]

294 |
295 | 296 | 297 | 298 |
299 |
300 | Type 301 |
302 |
303 | 304 | array 305 | 306 | 307 |
308 |
309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 |
319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 |
340 | 341 |
342 | 343 | 344 | 345 | 346 |
347 | 348 | 351 | 352 |
353 | 354 |
355 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 356 |
357 | 358 | 359 | 360 | 361 | -------------------------------------------------------------------------------- /docs/jsdoc/module-shape-points_ellipse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: shape-points/ellipse 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: shape-points/ellipse

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 | 41 |

calculate points for a ellipse (calculates using pointsInArc * 4)

42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
Parameters:
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 97 | 98 | 99 | 106 | 107 | 108 | 109 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 132 | 133 | 134 | 141 | 142 | 143 | 144 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 167 | 168 | 169 | 176 | 177 | 178 | 179 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 202 | 203 | 204 | 211 | 212 | 213 | 214 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 237 | 238 | 239 | 248 | 249 | 250 | 251 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 |
NameTypeAttributesDefaultDescription
x 90 | 91 | 92 | number 93 | 94 | 95 | 96 | 100 | 101 | 102 | 103 | 104 | 105 | 110 | 111 |
y 125 | 126 | 127 | number 128 | 129 | 130 | 131 | 135 | 136 | 137 | 138 | 139 | 140 | 145 | 146 |
rx 160 | 161 | 162 | number 163 | 164 | 165 | 166 | 170 | 171 | 172 | 173 | 174 | 175 | 180 | 181 |
ry 195 | 196 | 197 | number 198 | 199 | 200 | 201 | 205 | 206 | 207 | 208 | 209 | 210 | 215 | 216 |
pointsInArc 230 | 231 | 232 | number 233 | 234 | 235 | 236 | 240 | 241 | <optional>
242 | 243 | 244 | 245 | 246 | 247 |
252 | 253 | 5 254 | 255 |
264 | 265 | 266 | 267 | 268 | 269 | 270 |
271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 |
Source:
298 |
301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 |
309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 |
Returns:
325 | 326 | 327 |
328 |

[x1, y1, x2, y2, ... xn, yn]

329 |
330 | 331 | 332 | 333 |
334 |
335 | Type 336 |
337 |
338 | 339 | array 340 | 341 | 342 |
343 |
344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 |
354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 |
375 | 376 |
377 | 378 | 379 | 380 | 381 |
382 | 383 | 386 | 387 |
388 | 389 |
390 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 391 |
392 | 393 | 394 | 395 | 396 | -------------------------------------------------------------------------------- /docs/jsdoc/module-shape-points_line.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: shape-points/line 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: shape-points/line

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 | 41 |

calculate points for a line with a certain thickness (either one thickness or a starting and ending thickness)

42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
Parameters:
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 95 | 96 | 97 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 126 | 127 | 128 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 157 | 158 | 159 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 188 | 189 | 190 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 222 | 223 | 224 | 233 | 234 | 235 | 236 | 237 | 310 | 311 | 312 | 313 | 314 |
NameTypeAttributesDescription
x1 88 | 89 | 90 | number 91 | 92 | 93 | 94 | 98 | 99 | 100 | 101 | 102 | 103 |
y1 119 | 120 | 121 | number 122 | 123 | 124 | 125 | 129 | 130 | 131 | 132 | 133 | 134 |
x2 150 | 151 | 152 | number 153 | 154 | 155 | 156 | 160 | 161 | 162 | 163 | 164 | 165 |
y2 181 | 182 | 183 | number 184 | 185 | 186 | 187 | 191 | 192 | 193 | 194 | 195 | 196 |
thickness 212 | 213 | 214 | number 215 | | 216 | 217 | object 218 | 219 | 220 | 221 | 225 | 226 | <optional>
227 | 228 | 229 | 230 | 231 | 232 |
238 |
Properties
239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 |
NameTypeDescription
start 267 | 268 | 269 | number 270 | 271 | 272 | 273 |
end 290 | 291 | 292 | number 293 | 294 | 295 | 296 |
308 | 309 |
315 | 316 | 317 | 318 | 319 | 320 | 321 |
322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 |
Source:
349 |
352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 |
360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 |
Returns:
376 | 377 | 378 |
379 |

[x1, y1, x2, y2, ... xn, yn]

380 |
381 | 382 | 383 | 384 |
385 |
386 | Type 387 |
388 |
389 | 390 | array 391 | 392 | 393 |
394 |
395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 |
405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 |
426 | 427 |
428 | 429 | 430 | 431 | 432 |
433 | 434 | 437 | 438 |
439 | 440 |
441 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 442 |
443 | 444 | 445 | 446 | 447 | -------------------------------------------------------------------------------- /docs/jsdoc/module-shape-points_quadraticCurveTo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: shape-points/quadraticCurveTo 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: shape-points/quadraticCurveTo

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 | 41 |

calculate points in a quadratic curve

42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
Parameters:
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 |
NameTypeDescription
x1 86 | 87 | 88 | number 89 | 90 | 91 | 92 |

starting point

y1 109 | 110 | 111 | number 112 | 113 | 114 | 115 |
cp1x 132 | 133 | 134 | number 135 | 136 | 137 | 138 |

control point

cp1y 155 | 156 | 157 | number 158 | 159 | 160 | 161 |
x2 178 | 179 | 180 | number 181 | 182 | 183 | 184 |

ending point

y2 201 | 202 | 203 | number 204 | 205 | 206 | 207 |
219 | 220 | 221 | 222 | 223 | 224 | 225 |
226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 |
Source:
253 |
256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 |
264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 |
Returns:
280 | 281 | 282 |
283 |

[x1, y1, x2, y2, ... xn, yn]

284 |
285 | 286 | 287 | 288 |
289 |
290 | Type 291 |
292 |
293 | 294 | array 295 | 296 | 297 |
298 |
299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 |
309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 |
330 | 331 |
332 | 333 | 334 | 335 | 336 |
337 | 338 | 341 | 342 |
343 | 344 |
345 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 346 |
347 | 348 | 349 | 350 | 351 | -------------------------------------------------------------------------------- /docs/jsdoc/module-shape-points_rect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: shape-points/rect 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: shape-points/rect

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 | 41 |

calculate points for rectangle

42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
Parameters:
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 |
NameTypeDescription
x 86 | 87 | 88 | number 89 | 90 | 91 | 92 |

(center)

y 109 | 110 | 111 | number 112 | 113 | 114 | 115 |
width 132 | 133 | 134 | number 135 | 136 | 137 | 138 |
height 155 | 156 | 157 | number 158 | 159 | 160 | 161 |
173 | 174 | 175 | 176 | 177 | 178 | 179 |
180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 |
Source:
207 |
210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 |
218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 |
Returns:
234 | 235 | 236 |
237 |

[x1, y1, x2, y2, ... xn, yn]

238 |
239 | 240 | 241 | 242 |
243 |
244 | Type 245 |
246 |
247 | 248 | array 249 | 250 | 251 |
252 |
253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 |
263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 |
284 | 285 |
286 | 287 | 288 | 289 | 290 |
291 | 292 | 295 | 296 |
297 | 298 |
299 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 300 |
301 | 302 | 303 | 304 | 305 | -------------------------------------------------------------------------------- /docs/jsdoc/module-shape-points_roundedRect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: shape-points/roundedRect 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: shape-points/roundedRect

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 | 41 |

calculate points for a rounded rectangle with one corner radius, or 4 separate corner radii

42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
Parameters:
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 97 | 98 | 99 | 106 | 107 | 108 | 109 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 132 | 133 | 134 | 141 | 142 | 143 | 144 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 167 | 168 | 169 | 176 | 177 | 178 | 179 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 202 | 203 | 204 | 211 | 212 | 213 | 214 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 240 | 241 | 242 | 249 | 250 | 251 | 252 | 255 | 256 | 257 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 435 | 436 | 437 | 446 | 447 | 448 | 449 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 |
NameTypeAttributesDefaultDescription
x 90 | 91 | 92 | number 93 | 94 | 95 | 96 | 100 | 101 | 102 | 103 | 104 | 105 | 110 | 111 |

(center)

y 125 | 126 | 127 | number 128 | 129 | 130 | 131 | 135 | 136 | 137 | 138 | 139 | 140 | 145 | 146 |
width 160 | 161 | 162 | number 163 | 164 | 165 | 166 | 170 | 171 | 172 | 173 | 174 | 175 | 180 | 181 |
height 195 | 196 | 197 | number 198 | 199 | 200 | 201 | 205 | 206 | 207 | 208 | 209 | 210 | 215 | 216 |
radius 230 | 231 | 232 | number 233 | | 234 | 235 | object 236 | 237 | 238 | 239 | 243 | 244 | 245 | 246 | 247 | 248 | 253 | 254 | 258 |
Properties
259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 296 | 297 | 298 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 329 | 330 | 331 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 362 | 363 | 364 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 395 | 396 | 397 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 |
NameTypeAttributesDescription
topLeft 289 | 290 | 291 | number 292 | 293 | 294 | 295 | 299 | 300 | <optional>
301 | 302 | 303 | 304 | 305 | 306 |
topRight 322 | 323 | 324 | number 325 | 326 | 327 | 328 | 332 | 333 | <optional>
334 | 335 | 336 | 337 | 338 | 339 |
bottomLeft 355 | 356 | 357 | number 358 | 359 | 360 | 361 | 365 | 366 | <optional>
367 | 368 | 369 | 370 | 371 | 372 |
bottomRight 388 | 389 | 390 | number 391 | 392 | 393 | 394 | 398 | 399 | <optional>
400 | 401 | 402 | 403 | 404 | 405 |
416 | 417 |
pointsInArc 428 | 429 | 430 | number 431 | 432 | 433 | 434 | 438 | 439 | <optional>
440 | 441 | 442 | 443 | 444 | 445 |
450 | 451 | 5 452 | 453 |
462 | 463 | 464 | 465 | 466 | 467 | 468 |
469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 |
Source:
496 |
499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 |
507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 |
Returns:
523 | 524 | 525 |
526 |

[x1, y1, x2, y2, ... xn, yn]

527 |
528 | 529 | 530 | 531 |
532 |
533 | Type 534 |
535 |
536 | 537 | array 538 | 539 | 540 |
541 |
542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 |
552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 |
573 | 574 |
575 | 576 | 577 | 578 | 579 |
580 | 581 | 584 | 585 |
586 | 587 |
588 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 589 |
590 | 591 | 592 | 593 | 594 | -------------------------------------------------------------------------------- /docs/jsdoc/quadraticCurveTo.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: quadraticCurveTo.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: quadraticCurveTo.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
/**
30 |  * calculate points in a quadratic curve
31 |  * @module shape-points/quadraticCurveTo
32 |  * @param {number} x1 - starting point
33 |  * @param {number} y1
34 |  * @param {number} cp1x - control point
35 |  * @param {number} cp1y
36 |  * @param {number} x2 - ending point
37 |  * @param {number} y2
38 |  * @returns {array} [x1, y1, x2, y2, ... xn, yn]
39 |  */
40 | export function quadraticCurveTo(x1, y1, cp1x, cp1y, x2, y2, pointsInArc)
41 | {
42 |     pointsInArc = pointsInArc || 5
43 |     const points = []
44 |     const interval = 1 / pointsInArc
45 |     for (let t = 0; t <= 1; t += interval)
46 |     {
47 |         const B0_t = Math.pow(1 - t, 2),
48 |             B1_t = 2 * t * (1 - t),
49 |             B2_t = Math.pow(t, 2)
50 | 
51 |         points.push(
52 |             (B0_t * x1) + (B1_t * cp1x) + (B2_t * x2),
53 |             (B0_t * y1) + (B1_t * cp1y) + (B2_t * y2)
54 |         )
55 |     }
56 |     return points
57 | }
58 |
59 |
60 | 61 | 62 | 63 | 64 |
65 | 66 | 69 | 70 |
71 | 72 |
73 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 74 |
75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /docs/jsdoc/rect.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: rect.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: rect.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
/**
30 |  * calculate points for rectangle
31 |  * @module shape-points/rect
32 |  * @param {number} x (center)
33 |  * @param {number} y
34 |  * @param {number} width
35 |  * @param {number} height
36 |  * @returns {array} [x1, y1, x2, y2, ... xn, yn]
37 |  */
38 | export function rect(x, y, width, height)
39 | {
40 |     return [
41 |         x - width / 2, y - height / 2,
42 |         x + width / 2, y - height / 2,
43 |         x + width / 2, y + height / 2,
44 |         x - width / 2, y + height / 2
45 |     ]
46 | }
47 |
48 |
49 | 50 | 51 | 52 | 53 |
54 | 55 | 58 | 59 |
60 | 61 |
62 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 63 |
64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /docs/jsdoc/roundedRect.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: roundedRect.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: roundedRect.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
import { arc } from './arc'
 30 | 
 31 | /**
 32 |  * calculate points for a rounded rectangle with one corner radius, or 4 separate corner radii
 33 |  * @module shape-points/roundedRect
 34 |  * @param {number} x (center)
 35 |  * @param {number} y
 36 |  * @param {number} width
 37 |  * @param {number} height
 38 |  * @param {(number|object)} radius
 39 |  * @param {number} [radius.topLeft]
 40 |  * @param {number} [radius.topRight]
 41 |  * @param {number} [radius.bottomLeft]
 42 |  * @param {number} [radius.bottomRight]
 43 |  * @param {number} [pointsInArc=5]
 44 |  * @returns {array} [x1, y1, x2, y2, ... xn, yn]
 45 |  */
 46 | export function roundedRect(x, y, width, height, radius, pointsInArc)
 47 | {
 48 |     pointsInArc = pointsInArc || 5
 49 |     if (isNaN(radius))
 50 |     {
 51 |         radius.topLeft = radius.topLeft || 0
 52 |         radius.topRight = radius.topRight || 0
 53 |         radius.bottomLeft = radius.bottomLeft || 0
 54 |         radius.bottomRight = radius.bottomRight || 0
 55 |         const points = [
 56 |             x - width / 2 + radius.topLeft, y - height / 2,
 57 |             x + width / 2 - radius.topRight, y - height / 2
 58 |         ]
 59 |         if (radius.topRight)
 60 |         {
 61 |             points.push(...arc(x + width / 2 - radius.topRight, y - height / 2 + radius.topRight, 3 * Math.PI / 2, Math.PI * 2, radius.topRight, pointsInArc))
 62 |         }
 63 |         points.push(
 64 |             x + width / 2, y - height / 2 + radius.topRight,
 65 |             x + width / 2, y + height / 2 - radius.bottomRight
 66 |         )
 67 |         if (radius.bottomRight)
 68 |         {
 69 |             points.push(...arc(x + width / 2 - radius.bottomRight, y + height / 2 - radius.bottomRight, 0, Math.PI / 2, radius.bottomRight, pointsInArc))
 70 |         }
 71 |         points.push(
 72 |             x + width / 2 - radius.bottomRight, y + height / 2,
 73 |             x - width / 2 + radius.bottomLeft, y + height / 2
 74 |         )
 75 |         if (radius.bottomLeft)
 76 |         {
 77 |             points.push(...arc(x - width / 2 + radius.bottomLeft, y + height / 2 - radius.bottomLeft, Math.PI / 2, Math.PI, radius.bottomLeft, pointsInArc))
 78 |         }
 79 |         points.push(
 80 |             x - width / 2, y + height / 2 - radius.bottomLeft,
 81 |             x - width / 2, y - height / 2 + radius.topLeft
 82 |         )
 83 |         if (radius.topLeft)
 84 |         {
 85 |             points.push(...arc(x - width / 2 + radius.topLeft, y - height / 2 + radius.topLeft, Math.PI, 3 * Math.PI / 2, radius.topLeft, pointsInArc))
 86 |         }
 87 |         return points
 88 |     }
 89 |     return [
 90 |         x - width / 2 + radius, y - height / 2,
 91 |         x + width / 2 - radius, y - height / 2,
 92 |         ...arc(x + width / 2 - radius, y - height / 2 + radius, 3 * Math.PI / 2, 2 * Math.PI, radius, pointsInArc),
 93 |         x + width / 2, y - height / 2 + radius,
 94 |         x + width / 2, y + height / 2 - radius,
 95 |         ...arc(x + width / 2 - radius, y + height / 2 - radius, 0, Math.PI / 2, radius, pointsInArc),
 96 |         x + width / 2 - radius, y + height / 2,
 97 |         x - width / 2 + radius, y + height / 2,
 98 |         ...arc(x - width / 2 + radius, y + height / 2 - radius, Math.PI / 2, Math.PI, radius, pointsInArc),
 99 |         x - width / 2, y + height / 2 - radius,
100 |         x - width / 2, y - height / 2 + radius,
101 |         ...arc(x - width / 2 + radius, y - height / 2 + radius, Math.PI, 3 * Math.PI / 2, radius, pointsInArc),
102 |     ]
103 | }
104 |
105 |
106 | 107 | 108 | 109 | 110 |
111 | 112 | 115 | 116 |
117 | 118 |
119 | Documentation generated by JSDoc 3.6.10 on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) 120 |
121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /docs/jsdoc/scripts/linenumber.js: -------------------------------------------------------------------------------- 1 | /*global document */ 2 | (() => { 3 | const source = document.getElementsByClassName('prettyprint source linenums'); 4 | let i = 0; 5 | let lineNumber = 0; 6 | let lineId; 7 | let lines; 8 | let totalLines; 9 | let anchorHash; 10 | 11 | if (source && source[0]) { 12 | anchorHash = document.location.hash.substring(1); 13 | lines = source[0].getElementsByTagName('li'); 14 | totalLines = lines.length; 15 | 16 | for (; i < totalLines; i++) { 17 | lineNumber++; 18 | lineId = `line${lineNumber}`; 19 | lines[i].id = lineId; 20 | if (lineId === anchorHash) { 21 | lines[i].className += ' selected'; 22 | } 23 | } 24 | } 25 | })(); 26 | -------------------------------------------------------------------------------- /docs/jsdoc/scripts/prettify/Apache-License-2.0.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /docs/jsdoc/scripts/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", 2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /docs/jsdoc/scripts/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= 3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), 9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, 11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, 12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), 13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} 14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ 21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p 2 | 3 | 4 | 5 | JSDoc: Module: arc 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: arc

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 |
32 | 33 |
34 |
35 | 36 | 37 |

calculate points for arc

38 | 39 | 40 | 41 | 42 | 43 |
44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
Source:
71 |
74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 |
82 | 83 | 84 | 85 | 86 |
87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 |
108 | 109 |
110 | 111 | 112 | 113 | 114 |
115 | 116 | 119 | 120 |
121 | 122 |
123 | Documentation generated by JSDoc 3.6.3 on Sat Sep 14 2019 08:58:02 GMT+0800 (Taipei Standard Time) 124 |
125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /docs/jsdoc/styles/jsdoc-default.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Open Sans'; 3 | font-weight: normal; 4 | font-style: normal; 5 | src: url('../fonts/OpenSans-Regular-webfont.eot'); 6 | src: 7 | local('Open Sans'), 8 | local('OpenSans'), 9 | url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), 10 | url('../fonts/OpenSans-Regular-webfont.woff') format('woff'), 11 | url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg'); 12 | } 13 | 14 | @font-face { 15 | font-family: 'Open Sans Light'; 16 | font-weight: normal; 17 | font-style: normal; 18 | src: url('../fonts/OpenSans-Light-webfont.eot'); 19 | src: 20 | local('Open Sans Light'), 21 | local('OpenSans Light'), 22 | url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'), 23 | url('../fonts/OpenSans-Light-webfont.woff') format('woff'), 24 | url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg'); 25 | } 26 | 27 | html 28 | { 29 | overflow: auto; 30 | background-color: #fff; 31 | font-size: 14px; 32 | } 33 | 34 | body 35 | { 36 | font-family: 'Open Sans', sans-serif; 37 | line-height: 1.5; 38 | color: #4d4e53; 39 | background-color: white; 40 | } 41 | 42 | a, a:visited, a:active { 43 | color: #0095dd; 44 | text-decoration: none; 45 | } 46 | 47 | a:hover { 48 | text-decoration: underline; 49 | } 50 | 51 | header 52 | { 53 | display: block; 54 | padding: 0px 4px; 55 | } 56 | 57 | tt, code, kbd, samp { 58 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 59 | } 60 | 61 | .class-description { 62 | font-size: 130%; 63 | line-height: 140%; 64 | margin-bottom: 1em; 65 | margin-top: 1em; 66 | } 67 | 68 | .class-description:empty { 69 | margin: 0; 70 | } 71 | 72 | #main { 73 | float: left; 74 | width: 70%; 75 | } 76 | 77 | article dl { 78 | margin-bottom: 40px; 79 | } 80 | 81 | article img { 82 | max-width: 100%; 83 | } 84 | 85 | section 86 | { 87 | display: block; 88 | background-color: #fff; 89 | padding: 12px 24px; 90 | border-bottom: 1px solid #ccc; 91 | margin-right: 30px; 92 | } 93 | 94 | .variation { 95 | display: none; 96 | } 97 | 98 | .signature-attributes { 99 | font-size: 60%; 100 | color: #aaa; 101 | font-style: italic; 102 | font-weight: lighter; 103 | } 104 | 105 | nav 106 | { 107 | display: block; 108 | float: right; 109 | margin-top: 28px; 110 | width: 30%; 111 | box-sizing: border-box; 112 | border-left: 1px solid #ccc; 113 | padding-left: 16px; 114 | } 115 | 116 | nav ul { 117 | font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; 118 | font-size: 100%; 119 | line-height: 17px; 120 | padding: 0; 121 | margin: 0; 122 | list-style-type: none; 123 | } 124 | 125 | nav ul a, nav ul a:visited, nav ul a:active { 126 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 127 | line-height: 18px; 128 | color: #4D4E53; 129 | } 130 | 131 | nav h3 { 132 | margin-top: 12px; 133 | } 134 | 135 | nav li { 136 | margin-top: 6px; 137 | } 138 | 139 | footer { 140 | display: block; 141 | padding: 6px; 142 | margin-top: 12px; 143 | font-style: italic; 144 | font-size: 90%; 145 | } 146 | 147 | h1, h2, h3, h4 { 148 | font-weight: 200; 149 | margin: 0; 150 | } 151 | 152 | h1 153 | { 154 | font-family: 'Open Sans Light', sans-serif; 155 | font-size: 48px; 156 | letter-spacing: -2px; 157 | margin: 12px 24px 20px; 158 | } 159 | 160 | h2, h3.subsection-title 161 | { 162 | font-size: 30px; 163 | font-weight: 700; 164 | letter-spacing: -1px; 165 | margin-bottom: 12px; 166 | } 167 | 168 | h3 169 | { 170 | font-size: 24px; 171 | letter-spacing: -0.5px; 172 | margin-bottom: 12px; 173 | } 174 | 175 | h4 176 | { 177 | font-size: 18px; 178 | letter-spacing: -0.33px; 179 | margin-bottom: 12px; 180 | color: #4d4e53; 181 | } 182 | 183 | h5, .container-overview .subsection-title 184 | { 185 | font-size: 120%; 186 | font-weight: bold; 187 | letter-spacing: -0.01em; 188 | margin: 8px 0 3px 0; 189 | } 190 | 191 | h6 192 | { 193 | font-size: 100%; 194 | letter-spacing: -0.01em; 195 | margin: 6px 0 3px 0; 196 | font-style: italic; 197 | } 198 | 199 | table 200 | { 201 | border-spacing: 0; 202 | border: 0; 203 | border-collapse: collapse; 204 | } 205 | 206 | td, th 207 | { 208 | border: 1px solid #ddd; 209 | margin: 0px; 210 | text-align: left; 211 | vertical-align: top; 212 | padding: 4px 6px; 213 | display: table-cell; 214 | } 215 | 216 | thead tr 217 | { 218 | background-color: #ddd; 219 | font-weight: bold; 220 | } 221 | 222 | th { border-right: 1px solid #aaa; } 223 | tr > th:last-child { border-right: 1px solid #ddd; } 224 | 225 | .ancestors, .attribs { color: #999; } 226 | .ancestors a, .attribs a 227 | { 228 | color: #999 !important; 229 | text-decoration: none; 230 | } 231 | 232 | .clear 233 | { 234 | clear: both; 235 | } 236 | 237 | .important 238 | { 239 | font-weight: bold; 240 | color: #950B02; 241 | } 242 | 243 | .yes-def { 244 | text-indent: -1000px; 245 | } 246 | 247 | .type-signature { 248 | color: #aaa; 249 | } 250 | 251 | .name, .signature { 252 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 253 | } 254 | 255 | .details { margin-top: 14px; border-left: 2px solid #DDD; } 256 | .details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } 257 | .details dd { margin-left: 70px; } 258 | .details ul { margin: 0; } 259 | .details ul { list-style-type: none; } 260 | .details li { margin-left: 30px; padding-top: 6px; } 261 | .details pre.prettyprint { margin: 0 } 262 | .details .object-value { padding-top: 0; } 263 | 264 | .description { 265 | margin-bottom: 1em; 266 | margin-top: 1em; 267 | } 268 | 269 | .code-caption 270 | { 271 | font-style: italic; 272 | font-size: 107%; 273 | margin: 0; 274 | } 275 | 276 | .source 277 | { 278 | border: 1px solid #ddd; 279 | width: 80%; 280 | overflow: auto; 281 | } 282 | 283 | .prettyprint.source { 284 | width: inherit; 285 | } 286 | 287 | .source code 288 | { 289 | font-size: 100%; 290 | line-height: 18px; 291 | display: block; 292 | padding: 4px 12px; 293 | margin: 0; 294 | background-color: #fff; 295 | color: #4D4E53; 296 | } 297 | 298 | .prettyprint code span.line 299 | { 300 | display: inline-block; 301 | } 302 | 303 | .prettyprint.linenums 304 | { 305 | padding-left: 70px; 306 | -webkit-user-select: none; 307 | -moz-user-select: none; 308 | -ms-user-select: none; 309 | user-select: none; 310 | } 311 | 312 | .prettyprint.linenums ol 313 | { 314 | padding-left: 0; 315 | } 316 | 317 | .prettyprint.linenums li 318 | { 319 | border-left: 3px #ddd solid; 320 | } 321 | 322 | .prettyprint.linenums li.selected, 323 | .prettyprint.linenums li.selected * 324 | { 325 | background-color: lightyellow; 326 | } 327 | 328 | .prettyprint.linenums li * 329 | { 330 | -webkit-user-select: text; 331 | -moz-user-select: text; 332 | -ms-user-select: text; 333 | user-select: text; 334 | } 335 | 336 | .params .name, .props .name, .name code { 337 | color: #4D4E53; 338 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 339 | font-size: 100%; 340 | } 341 | 342 | .params td.description > p:first-child, 343 | .props td.description > p:first-child 344 | { 345 | margin-top: 0; 346 | padding-top: 0; 347 | } 348 | 349 | .params td.description > p:last-child, 350 | .props td.description > p:last-child 351 | { 352 | margin-bottom: 0; 353 | padding-bottom: 0; 354 | } 355 | 356 | .disabled { 357 | color: #454545; 358 | } 359 | -------------------------------------------------------------------------------- /docs/jsdoc/styles/prettify-jsdoc.css: -------------------------------------------------------------------------------- 1 | /* JSDoc prettify.js theme */ 2 | 3 | /* plain text */ 4 | .pln { 5 | color: #000000; 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | 10 | /* string content */ 11 | .str { 12 | color: #006400; 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | 17 | /* a keyword */ 18 | .kwd { 19 | color: #000000; 20 | font-weight: bold; 21 | font-style: normal; 22 | } 23 | 24 | /* a comment */ 25 | .com { 26 | font-weight: normal; 27 | font-style: italic; 28 | } 29 | 30 | /* a type name */ 31 | .typ { 32 | color: #000000; 33 | font-weight: normal; 34 | font-style: normal; 35 | } 36 | 37 | /* a literal value */ 38 | .lit { 39 | color: #006400; 40 | font-weight: normal; 41 | font-style: normal; 42 | } 43 | 44 | /* punctuation */ 45 | .pun { 46 | color: #000000; 47 | font-weight: bold; 48 | font-style: normal; 49 | } 50 | 51 | /* lisp open bracket */ 52 | .opn { 53 | color: #000000; 54 | font-weight: bold; 55 | font-style: normal; 56 | } 57 | 58 | /* lisp close bracket */ 59 | .clo { 60 | color: #000000; 61 | font-weight: bold; 62 | font-style: normal; 63 | } 64 | 65 | /* a markup tag name */ 66 | .tag { 67 | color: #006400; 68 | font-weight: normal; 69 | font-style: normal; 70 | } 71 | 72 | /* a markup attribute name */ 73 | .atn { 74 | color: #006400; 75 | font-weight: normal; 76 | font-style: normal; 77 | } 78 | 79 | /* a markup attribute value */ 80 | .atv { 81 | color: #006400; 82 | font-weight: normal; 83 | font-style: normal; 84 | } 85 | 86 | /* a declaration */ 87 | .dec { 88 | color: #000000; 89 | font-weight: bold; 90 | font-style: normal; 91 | } 92 | 93 | /* a variable name */ 94 | .var { 95 | color: #000000; 96 | font-weight: normal; 97 | font-style: normal; 98 | } 99 | 100 | /* a function name */ 101 | .fun { 102 | color: #000000; 103 | font-weight: bold; 104 | font-style: normal; 105 | } 106 | 107 | /* Specify class=linenums on a pre to get line numbering */ 108 | ol.linenums { 109 | margin-top: 0; 110 | margin-bottom: 0; 111 | } 112 | -------------------------------------------------------------------------------- /docs/jsdoc/styles/prettify-tomorrow.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* Pretty printing styles. Used with prettify.js. */ 4 | /* SPAN elements with the classes below are added by prettyprint. */ 5 | /* plain text */ 6 | .pln { 7 | color: #4d4d4c; } 8 | 9 | @media screen { 10 | /* string content */ 11 | .str { 12 | color: #718c00; } 13 | 14 | /* a keyword */ 15 | .kwd { 16 | color: #8959a8; } 17 | 18 | /* a comment */ 19 | .com { 20 | color: #8e908c; } 21 | 22 | /* a type name */ 23 | .typ { 24 | color: #4271ae; } 25 | 26 | /* a literal value */ 27 | .lit { 28 | color: #f5871f; } 29 | 30 | /* punctuation */ 31 | .pun { 32 | color: #4d4d4c; } 33 | 34 | /* lisp open bracket */ 35 | .opn { 36 | color: #4d4d4c; } 37 | 38 | /* lisp close bracket */ 39 | .clo { 40 | color: #4d4d4c; } 41 | 42 | /* a markup tag name */ 43 | .tag { 44 | color: #c82829; } 45 | 46 | /* a markup attribute name */ 47 | .atn { 48 | color: #f5871f; } 49 | 50 | /* a markup attribute value */ 51 | .atv { 52 | color: #3e999f; } 53 | 54 | /* a declaration */ 55 | .dec { 56 | color: #f5871f; } 57 | 58 | /* a variable name */ 59 | .var { 60 | color: #c82829; } 61 | 62 | /* a function name */ 63 | .fun { 64 | color: #4271ae; } } 65 | /* Use higher contrast and text-weight for printable form. */ 66 | @media print, projection { 67 | .str { 68 | color: #060; } 69 | 70 | .kwd { 71 | color: #006; 72 | font-weight: bold; } 73 | 74 | .com { 75 | color: #600; 76 | font-style: italic; } 77 | 78 | .typ { 79 | color: #404; 80 | font-weight: bold; } 81 | 82 | .lit { 83 | color: #044; } 84 | 85 | .pun, .opn, .clo { 86 | color: #440; } 87 | 88 | .tag { 89 | color: #006; 90 | font-weight: bold; } 91 | 92 | .atn { 93 | color: #404; } 94 | 95 | .atv { 96 | color: #060; } } 97 | /* Style */ 98 | /* 99 | pre.prettyprint { 100 | background: white; 101 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 102 | font-size: 12px; 103 | line-height: 1.5; 104 | border: 1px solid #ccc; 105 | padding: 10px; } 106 | */ 107 | 108 | /* Specify class=linenums on a pre to get line numbering */ 109 | ol.linenums { 110 | margin-top: 0; 111 | margin-bottom: 0; } 112 | 113 | /* IE indents via margin-left */ 114 | li.L0, 115 | li.L1, 116 | li.L2, 117 | li.L3, 118 | li.L4, 119 | li.L5, 120 | li.L6, 121 | li.L7, 122 | li.L8, 123 | li.L9 { 124 | /* */ } 125 | 126 | /* Alternate shading for lines */ 127 | li.L1, 128 | li.L3, 129 | li.L5, 130 | li.L7, 131 | li.L9 { 132 | /* */ } 133 | -------------------------------------------------------------------------------- /docs/rollup.config.js: -------------------------------------------------------------------------------- 1 | import resolve from 'rollup-plugin-node-resolve' 2 | import commonjs from 'rollup-plugin-commonjs' 3 | 4 | export default { 5 | input: 'docs/code.js', 6 | plugins: [ 7 | resolve({ 8 | preferBuiltins: false, 9 | browser: true 10 | }), 11 | commonjs() 12 | ], 13 | output: 14 | { 15 | file: 'docs/index.js', 16 | format: 'iife', 17 | sourcemap: true 18 | } 19 | } -------------------------------------------------------------------------------- /docs/rollup.dev.js: -------------------------------------------------------------------------------- 1 | import resolve from 'rollup-plugin-node-resolve' 2 | import commonjs from 'rollup-plugin-commonjs' 3 | import serve from 'rollup-plugin-serve' 4 | 5 | export default 6 | { 7 | input: 'docs/code.js', 8 | plugins: [ 9 | resolve( 10 | { 11 | browser: true, 12 | preferBuiltins: false 13 | }), 14 | commonjs(), 15 | serve( 16 | { 17 | contentBase: 'docs', 18 | verbose: true 19 | }) 20 | ], 21 | output: 22 | { 23 | file: 'docs/index.js', 24 | format: 'iife', 25 | name: 'ShapePointsTest', 26 | sourcemap: true 27 | } 28 | } -------------------------------------------------------------------------------- /ellipse.js: -------------------------------------------------------------------------------- 1 | /** 2 | * calculate points for a ellipse (calculates using pointsInArc * 4) 3 | * @module shape-points/ellipse 4 | * @param {number} x 5 | * @param {number} y 6 | * @param {number} rx 7 | * @param {number} ry 8 | * @param {number} [pointsInArc=5] 9 | * @returns {array} [x1, y1, x2, y2, ... xn, yn] 10 | */ 11 | export function ellipse(x, y, rx, ry, pointsInArc) 12 | { 13 | pointsInArc = pointsInArc || 5 14 | const points = [] 15 | const interval = Math.PI * 2 / (pointsInArc * 4) 16 | for (let i = 0; i < Math.PI * 2; i += interval) 17 | { 18 | points.push(x - rx * Math.sin(i), y - ry * Math.cos(i)) 19 | } 20 | return points 21 | } 22 | 23 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** @module shape-points */ 2 | 3 | export { rect } from './rect' 4 | export { arc } from './arc' 5 | export { roundedRect } from './roundedRect' 6 | export { line } from './line' 7 | export { circle } from './circle' 8 | export { ellipse } from './ellipse' 9 | export { bezierCurveTo } from './bezierCurveTo' 10 | export { bezierCurveThrough } from './bezierCurveThrough' 11 | export { quadraticCurveTo } from './quadraticCurveTo' -------------------------------------------------------------------------------- /line.js: -------------------------------------------------------------------------------- 1 | /** 2 | * calculate points for a line with a certain thickness (either one thickness or a starting and ending thickness) 3 | * @module shape-points/line 4 | * @param {number} x1 5 | * @param {number} y1 6 | * @param {number} x2 7 | * @param {number} y2 8 | * @param {number|object} [thickness] 9 | * @param {number} thickness.start 10 | * @param {number} thickness.end 11 | * @returns {array} [x1, y1, x2, y2, ... xn, yn] 12 | */ 13 | export function line(x1, y1, x2, y2, thickness) 14 | { 15 | thickness = thickness || 0 16 | const angle = Math.atan2(y2 - y1, x2 - x1) 17 | const perp = angle - Math.PI / 2 18 | const half = isNaN(thickness) ? { start: thickness.start / 2, end: thickness.end / 2 } : { start: thickness / 2, end: thickness / 2 } 19 | return [ 20 | x1 - Math.cos(perp) * half.start, y1 - Math.sin(perp) * half.start, 21 | x2 - Math.cos(perp) * half.end, y2 - Math.sin(perp) * half.end, 22 | x2 + Math.cos(perp) * half.end, y2 + Math.sin(perp) * half.end, 23 | x1 + Math.cos(perp) * half.start, y1 + Math.sin(perp) * half.start 24 | ] 25 | } 26 | 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shape-points", 3 | "version": "3.0.4", 4 | "description": "Generate points for simple shapes and curves: arcs, rectangles, rounded rectangles, circles, ellipses, bezierCurveTo, bezierCurveThrough (i.e., bezier curves through specific points)", 5 | "main": "dist/shape-points.js", 6 | "module": "dist/shape-points.es.js", 7 | "directories": { 8 | "doc": "docs" 9 | }, 10 | "scripts": { 11 | "test": "rollup -c docs/rollup.dev.js --watch", 12 | "build": "rollup -c rollup.config.js", 13 | "build-demo": "rollup -c docs/rollup.config.js", 14 | "docs": "jsdoc -c .jsdoc.json", 15 | "prepublishOnly": "yarn build && yarn build-demo && yarn docs" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/davidfig/shape-points.git" 20 | }, 21 | "keywords": [ 22 | "coordinates", 23 | "shapes", 24 | "geometry", 25 | "points", 26 | "rounded rectangle", 27 | "line", 28 | "arc", 29 | "circle", 30 | "ellipse", 31 | "bezier", 32 | "bezierCurveTo" 33 | ], 34 | "author": "David Figatner", 35 | "license": "MIT", 36 | "bugs": { 37 | "url": "https://github.com/davidfig/shape-points/issues" 38 | }, 39 | "homepage": "https://github.com/davidfig/shape-points#readme", 40 | "devDependencies": { 41 | "fork-me-github": "^1.2.0", 42 | "highlight.js": "^9.12.0", 43 | "jsdoc": "^3.6.3", 44 | "markdown-api": "^1.1.3", 45 | "rollup": "^1.21.2", 46 | "rollup-plugin-commonjs": "^10.1.0", 47 | "rollup-plugin-node-resolve": "^5.2.0", 48 | "rollup-plugin-serve": "^1.0.1", 49 | "rollup-plugin-terser": "^5.1.2" 50 | }, 51 | "dependencies": { 52 | "fit-curve": "^0.1.6" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /quadraticCurveTo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * calculate points in a quadratic curve 3 | * @module shape-points/quadraticCurveTo 4 | * @param {number} x1 - starting point 5 | * @param {number} y1 6 | * @param {number} cp1x - control point 7 | * @param {number} cp1y 8 | * @param {number} x2 - ending point 9 | * @param {number} y2 10 | * @returns {array} [x1, y1, x2, y2, ... xn, yn] 11 | */ 12 | export function quadraticCurveTo(x1, y1, cp1x, cp1y, x2, y2, pointsInArc) 13 | { 14 | pointsInArc = pointsInArc || 5 15 | const points = [] 16 | const interval = 1 / pointsInArc 17 | for (let t = 0; t <= 1; t += interval) 18 | { 19 | const B0_t = Math.pow(1 - t, 2), 20 | B1_t = 2 * t * (1 - t), 21 | B2_t = Math.pow(t, 2) 22 | 23 | points.push( 24 | (B0_t * x1) + (B1_t * cp1x) + (B2_t * x2), 25 | (B0_t * y1) + (B1_t * cp1y) + (B2_t * y2) 26 | ) 27 | } 28 | return points 29 | } -------------------------------------------------------------------------------- /rect.js: -------------------------------------------------------------------------------- 1 | /** 2 | * calculate points for rectangle 3 | * @module shape-points/rect 4 | * @param {number} x (center) 5 | * @param {number} y 6 | * @param {number} width 7 | * @param {number} height 8 | * @returns {array} [x1, y1, x2, y2, ... xn, yn] 9 | */ 10 | export function rect(x, y, width, height) 11 | { 12 | return [ 13 | x - width / 2, y - height / 2, 14 | x + width / 2, y - height / 2, 15 | x + width / 2, y + height / 2, 16 | x - width / 2, y + height / 2 17 | ] 18 | } -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import { terser } from 'rollup-plugin-terser' 2 | import resolve from 'rollup-plugin-node-resolve' 3 | import commonjs from 'rollup-plugin-commonjs' 4 | 5 | export default [ 6 | { 7 | input: 'index.js', 8 | plugins: [ 9 | resolve( 10 | { 11 | preferBuiltins: false 12 | }), 13 | commonjs(), 14 | terser() 15 | ], 16 | output: 17 | { 18 | file: 'dist/shape-points.js', 19 | format: 'umd', 20 | name: 'ShapePoints', 21 | sourcemap: true 22 | } 23 | }, 24 | { 25 | input: 'index.js', 26 | plugins: [ 27 | resolve( 28 | { 29 | preferBuiltins: false 30 | }), 31 | commonjs() 32 | ], 33 | output: 34 | { 35 | file: 'dist/shape-points.es.js', 36 | format: 'esm', 37 | sourcemap: true 38 | } 39 | }] -------------------------------------------------------------------------------- /roundedRect.js: -------------------------------------------------------------------------------- 1 | import { arc } from './arc' 2 | 3 | /** 4 | * calculate points for a rounded rectangle with one corner radius, or 4 separate corner radii 5 | * @module shape-points/roundedRect 6 | * @param {number} x (center) 7 | * @param {number} y 8 | * @param {number} width 9 | * @param {number} height 10 | * @param {(number|object)} radius 11 | * @param {number} [radius.topLeft] 12 | * @param {number} [radius.topRight] 13 | * @param {number} [radius.bottomLeft] 14 | * @param {number} [radius.bottomRight] 15 | * @param {number} [pointsInArc=5] 16 | * @returns {array} [x1, y1, x2, y2, ... xn, yn] 17 | */ 18 | export function roundedRect(x, y, width, height, radius, pointsInArc) 19 | { 20 | pointsInArc = pointsInArc || 5 21 | if (isNaN(radius)) 22 | { 23 | radius.topLeft = radius.topLeft || 0 24 | radius.topRight = radius.topRight || 0 25 | radius.bottomLeft = radius.bottomLeft || 0 26 | radius.bottomRight = radius.bottomRight || 0 27 | const points = [ 28 | x - width / 2 + radius.topLeft, y - height / 2, 29 | x + width / 2 - radius.topRight, y - height / 2 30 | ] 31 | if (radius.topRight) 32 | { 33 | points.push(...arc(x + width / 2 - radius.topRight, y - height / 2 + radius.topRight, 3 * Math.PI / 2, Math.PI * 2, radius.topRight, pointsInArc)) 34 | } 35 | points.push( 36 | x + width / 2, y - height / 2 + radius.topRight, 37 | x + width / 2, y + height / 2 - radius.bottomRight 38 | ) 39 | if (radius.bottomRight) 40 | { 41 | points.push(...arc(x + width / 2 - radius.bottomRight, y + height / 2 - radius.bottomRight, 0, Math.PI / 2, radius.bottomRight, pointsInArc)) 42 | } 43 | points.push( 44 | x + width / 2 - radius.bottomRight, y + height / 2, 45 | x - width / 2 + radius.bottomLeft, y + height / 2 46 | ) 47 | if (radius.bottomLeft) 48 | { 49 | points.push(...arc(x - width / 2 + radius.bottomLeft, y + height / 2 - radius.bottomLeft, Math.PI / 2, Math.PI, radius.bottomLeft, pointsInArc)) 50 | } 51 | points.push( 52 | x - width / 2, y + height / 2 - radius.bottomLeft, 53 | x - width / 2, y - height / 2 + radius.topLeft 54 | ) 55 | if (radius.topLeft) 56 | { 57 | points.push(...arc(x - width / 2 + radius.topLeft, y - height / 2 + radius.topLeft, Math.PI, 3 * Math.PI / 2, radius.topLeft, pointsInArc)) 58 | } 59 | return points 60 | } 61 | return [ 62 | x - width / 2 + radius, y - height / 2, 63 | x + width / 2 - radius, y - height / 2, 64 | ...arc(x + width / 2 - radius, y - height / 2 + radius, 3 * Math.PI / 2, 2 * Math.PI, radius, pointsInArc), 65 | x + width / 2, y - height / 2 + radius, 66 | x + width / 2, y + height / 2 - radius, 67 | ...arc(x + width / 2 - radius, y + height / 2 - radius, 0, Math.PI / 2, radius, pointsInArc), 68 | x + width / 2 - radius, y + height / 2, 69 | x - width / 2 + radius, y + height / 2, 70 | ...arc(x - width / 2 + radius, y + height / 2 - radius, Math.PI / 2, Math.PI, radius, pointsInArc), 71 | x - width / 2, y + height / 2 - radius, 72 | x - width / 2, y - height / 2 + radius, 73 | ...arc(x - width / 2 + radius, y - height / 2 + radius, Math.PI, 3 * Math.PI / 2, radius, pointsInArc), 74 | ] 75 | } -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@babel/code-frame@^7.5.5": 6 | version "7.16.7" 7 | resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" 8 | integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== 9 | dependencies: 10 | "@babel/highlight" "^7.16.7" 11 | 12 | "@babel/helper-validator-identifier@^7.16.7": 13 | version "7.16.7" 14 | resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" 15 | integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== 16 | 17 | "@babel/highlight@^7.16.7": 18 | version "7.16.10" 19 | resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" 20 | integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== 21 | dependencies: 22 | "@babel/helper-validator-identifier" "^7.16.7" 23 | chalk "^2.0.0" 24 | js-tokens "^4.0.0" 25 | 26 | "@babel/parser@^7.9.4": 27 | version "7.17.8" 28 | resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.8.tgz#2817fb9d885dd8132ea0f8eb615a6388cca1c240" 29 | integrity sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ== 30 | 31 | "@types/estree@*": 32 | version "0.0.51" 33 | resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" 34 | integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== 35 | 36 | "@types/linkify-it@*": 37 | version "3.0.2" 38 | resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9" 39 | integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA== 40 | 41 | "@types/markdown-it@^12.2.3": 42 | version "12.2.3" 43 | resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51" 44 | integrity sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ== 45 | dependencies: 46 | "@types/linkify-it" "*" 47 | "@types/mdurl" "*" 48 | 49 | "@types/mdurl@*": 50 | version "1.0.2" 51 | resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" 52 | integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== 53 | 54 | "@types/node@*": 55 | version "17.0.23" 56 | resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.23.tgz#3b41a6e643589ac6442bdbd7a4a3ded62f33f7da" 57 | integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw== 58 | 59 | "@types/resolve@0.0.8": 60 | version "0.0.8" 61 | resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" 62 | integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== 63 | dependencies: 64 | "@types/node" "*" 65 | 66 | acorn@^7.1.0: 67 | version "7.4.1" 68 | resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" 69 | integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== 70 | 71 | ansi-styles@^3.2.1: 72 | version "3.2.1" 73 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" 74 | integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== 75 | dependencies: 76 | color-convert "^1.9.0" 77 | 78 | argparse@^2.0.1: 79 | version "2.0.1" 80 | resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" 81 | integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== 82 | 83 | balanced-match@^1.0.0: 84 | version "1.0.2" 85 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" 86 | integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== 87 | 88 | bluebird@^3.7.2: 89 | version "3.7.2" 90 | resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" 91 | integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== 92 | 93 | brace-expansion@^1.1.7: 94 | version "1.1.11" 95 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 96 | integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== 97 | dependencies: 98 | balanced-match "^1.0.0" 99 | concat-map "0.0.1" 100 | 101 | buffer-from@^1.0.0: 102 | version "1.1.2" 103 | resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" 104 | integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== 105 | 106 | builtin-modules@^3.1.0: 107 | version "3.2.0" 108 | resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" 109 | integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== 110 | 111 | catharsis@^0.9.0: 112 | version "0.9.0" 113 | resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.9.0.tgz#40382a168be0e6da308c277d3a2b3eb40c7d2121" 114 | integrity sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A== 115 | dependencies: 116 | lodash "^4.17.15" 117 | 118 | chalk@^2.0.0: 119 | version "2.4.2" 120 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" 121 | integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== 122 | dependencies: 123 | ansi-styles "^3.2.1" 124 | escape-string-regexp "^1.0.5" 125 | supports-color "^5.3.0" 126 | 127 | color-convert@^1.9.0: 128 | version "1.9.3" 129 | resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" 130 | integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== 131 | dependencies: 132 | color-name "1.1.3" 133 | 134 | color-name@1.1.3: 135 | version "1.1.3" 136 | resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" 137 | integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= 138 | 139 | commander@^2.11.0, commander@^2.20.0: 140 | version "2.20.3" 141 | resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" 142 | integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== 143 | 144 | concat-map@0.0.1: 145 | version "0.0.1" 146 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 147 | integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= 148 | 149 | entities@~2.1.0: 150 | version "2.1.0" 151 | resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" 152 | integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== 153 | 154 | escape-string-regexp@^1.0.5: 155 | version "1.0.5" 156 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 157 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= 158 | 159 | escape-string-regexp@^2.0.0: 160 | version "2.0.0" 161 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" 162 | integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== 163 | 164 | estree-walker@^0.6.1: 165 | version "0.6.1" 166 | resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" 167 | integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== 168 | 169 | fit-curve@^0.1.6: 170 | version "0.1.7" 171 | resolved "https://registry.yarnpkg.com/fit-curve/-/fit-curve-0.1.7.tgz#31620e83575e6d485248211715d5ff2f98cbf766" 172 | integrity sha512-Md3b3ReA/qJwwYvKXeHpOV1fhPqwhJ9/29zc9lfi8ijyg00J0S9C7+5XMZDFhlDAKbwOvVgBxVIG1EHoMSC3vw== 173 | 174 | fork-me-github@^1.2.0: 175 | version "1.2.0" 176 | resolved "https://registry.yarnpkg.com/fork-me-github/-/fork-me-github-1.2.0.tgz#168634ad7909925329f1142702cd009a2b4de5e0" 177 | integrity sha512-CvNytGJCD+Dsn31iImCZFwxwmGnImTYiEJz0WR7OzFof4OKBLzc0P/AyvX1CKysZx/Z0WRMlgMDzxl2LrFtaHg== 178 | 179 | fs.realpath@^1.0.0: 180 | version "1.0.0" 181 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 182 | integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= 183 | 184 | function-bind@^1.1.1: 185 | version "1.1.1" 186 | resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" 187 | integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== 188 | 189 | glob@^7.1.2: 190 | version "7.2.0" 191 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" 192 | integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== 193 | dependencies: 194 | fs.realpath "^1.0.0" 195 | inflight "^1.0.4" 196 | inherits "2" 197 | minimatch "^3.0.4" 198 | once "^1.3.0" 199 | path-is-absolute "^1.0.0" 200 | 201 | has-flag@^3.0.0: 202 | version "3.0.0" 203 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" 204 | integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= 205 | 206 | has@^1.0.3: 207 | version "1.0.3" 208 | resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" 209 | integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== 210 | dependencies: 211 | function-bind "^1.1.1" 212 | 213 | highlight.js@^9.12.0: 214 | version "9.18.5" 215 | resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.5.tgz#d18a359867f378c138d6819edfc2a8acd5f29825" 216 | integrity sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA== 217 | 218 | inflight@^1.0.4: 219 | version "1.0.6" 220 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 221 | integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= 222 | dependencies: 223 | once "^1.3.0" 224 | wrappy "1" 225 | 226 | inherits@2: 227 | version "2.0.4" 228 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" 229 | integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== 230 | 231 | is-core-module@^2.8.1: 232 | version "2.8.1" 233 | resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" 234 | integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== 235 | dependencies: 236 | has "^1.0.3" 237 | 238 | is-module@^1.0.0: 239 | version "1.0.0" 240 | resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" 241 | integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= 242 | 243 | is-reference@^1.1.2: 244 | version "1.2.1" 245 | resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" 246 | integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== 247 | dependencies: 248 | "@types/estree" "*" 249 | 250 | jest-worker@^24.9.0: 251 | version "24.9.0" 252 | resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" 253 | integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== 254 | dependencies: 255 | merge-stream "^2.0.0" 256 | supports-color "^6.1.0" 257 | 258 | js-tokens@^4.0.0: 259 | version "4.0.0" 260 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" 261 | integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== 262 | 263 | js2xmlparser@^4.0.2: 264 | version "4.0.2" 265 | resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-4.0.2.tgz#2a1fdf01e90585ef2ae872a01bc169c6a8d5e60a" 266 | integrity sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA== 267 | dependencies: 268 | xmlcreate "^2.0.4" 269 | 270 | jsdoc@^3.6.3: 271 | version "3.6.10" 272 | resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-3.6.10.tgz#dc903c44763b78afa7d94d63da475d20bc224cc4" 273 | integrity sha512-IdQ8ppSo5LKZ9o3M+LKIIK8i00DIe5msDvG3G81Km+1dhy0XrOWD0Ji8H61ElgyEj/O9KRLokgKbAM9XX9CJAg== 274 | dependencies: 275 | "@babel/parser" "^7.9.4" 276 | "@types/markdown-it" "^12.2.3" 277 | bluebird "^3.7.2" 278 | catharsis "^0.9.0" 279 | escape-string-regexp "^2.0.0" 280 | js2xmlparser "^4.0.2" 281 | klaw "^4.0.1" 282 | markdown-it "^12.3.2" 283 | markdown-it-anchor "^8.4.1" 284 | marked "^4.0.10" 285 | mkdirp "^1.0.4" 286 | requizzle "^0.2.3" 287 | strip-json-comments "^3.1.0" 288 | taffydb "2.6.2" 289 | underscore "~1.13.2" 290 | 291 | klaw@^4.0.1: 292 | version "4.0.1" 293 | resolved "https://registry.yarnpkg.com/klaw/-/klaw-4.0.1.tgz#8dc6f5723f05894e8e931b516a8ff15c2976d368" 294 | integrity sha512-pgsE40/SvC7st04AHiISNewaIMUbY5V/K8b21ekiPiFoYs/EYSdsGa+FJArB1d441uq4Q8zZyIxvAzkGNlBdRw== 295 | 296 | linkify-it@^3.0.1: 297 | version "3.0.3" 298 | resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" 299 | integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== 300 | dependencies: 301 | uc.micro "^1.0.1" 302 | 303 | lodash@^4.17.14, lodash@^4.17.15: 304 | version "4.17.21" 305 | resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" 306 | integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== 307 | 308 | magic-string@^0.25.2: 309 | version "0.25.9" 310 | resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" 311 | integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== 312 | dependencies: 313 | sourcemap-codec "^1.4.8" 314 | 315 | markdown-api@^1.1.3: 316 | version "1.1.3" 317 | resolved "https://registry.yarnpkg.com/markdown-api/-/markdown-api-1.1.3.tgz#415d4b28a46a48f6ffa487f120493f52b56168f4" 318 | integrity sha1-QV1LKKRqSPb/pIfxIEk/UrVhaPQ= 319 | dependencies: 320 | commander "^2.11.0" 321 | glob "^7.1.2" 322 | 323 | markdown-it-anchor@^8.4.1: 324 | version "8.4.1" 325 | resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.4.1.tgz#29e560593f5edb80b25fdab8b23f93ef8a91b31e" 326 | integrity sha512-sLODeRetZ/61KkKLJElaU3NuU2z7MhXf12Ml1WJMSdwpngeofneCRF+JBbat8HiSqhniOMuTemXMrsI7hA6XyA== 327 | 328 | markdown-it@^12.3.2: 329 | version "12.3.2" 330 | resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" 331 | integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== 332 | dependencies: 333 | argparse "^2.0.1" 334 | entities "~2.1.0" 335 | linkify-it "^3.0.1" 336 | mdurl "^1.0.1" 337 | uc.micro "^1.0.5" 338 | 339 | marked@^4.0.10: 340 | version "4.0.12" 341 | resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.12.tgz#2262a4e6fd1afd2f13557726238b69a48b982f7d" 342 | integrity sha512-hgibXWrEDNBWgGiK18j/4lkS6ihTe9sxtV4Q1OQppb/0zzyPSzoFANBa5MfsG/zgsWklmNnhm0XACZOH/0HBiQ== 343 | 344 | mdurl@^1.0.1: 345 | version "1.0.1" 346 | resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" 347 | integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= 348 | 349 | merge-stream@^2.0.0: 350 | version "2.0.0" 351 | resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" 352 | integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== 353 | 354 | mime@>=2.4.6: 355 | version "3.0.0" 356 | resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" 357 | integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== 358 | 359 | minimatch@^3.0.4: 360 | version "3.1.2" 361 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" 362 | integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== 363 | dependencies: 364 | brace-expansion "^1.1.7" 365 | 366 | mkdirp@^1.0.4: 367 | version "1.0.4" 368 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" 369 | integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== 370 | 371 | once@^1.3.0: 372 | version "1.4.0" 373 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 374 | integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= 375 | dependencies: 376 | wrappy "1" 377 | 378 | opener@1: 379 | version "1.5.2" 380 | resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" 381 | integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== 382 | 383 | path-is-absolute@^1.0.0: 384 | version "1.0.1" 385 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 386 | integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= 387 | 388 | path-parse@^1.0.7: 389 | version "1.0.7" 390 | resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" 391 | integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== 392 | 393 | randombytes@^2.1.0: 394 | version "2.1.0" 395 | resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" 396 | integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== 397 | dependencies: 398 | safe-buffer "^5.1.0" 399 | 400 | requizzle@^0.2.3: 401 | version "0.2.3" 402 | resolved "https://registry.yarnpkg.com/requizzle/-/requizzle-0.2.3.tgz#4675c90aacafb2c036bd39ba2daa4a1cb777fded" 403 | integrity sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ== 404 | dependencies: 405 | lodash "^4.17.14" 406 | 407 | resolve@^1.11.0, resolve@^1.11.1: 408 | version "1.22.0" 409 | resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" 410 | integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== 411 | dependencies: 412 | is-core-module "^2.8.1" 413 | path-parse "^1.0.7" 414 | supports-preserve-symlinks-flag "^1.0.0" 415 | 416 | rollup-plugin-commonjs@^10.1.0: 417 | version "10.1.0" 418 | resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-10.1.0.tgz#417af3b54503878e084d127adf4d1caf8beb86fb" 419 | integrity sha512-jlXbjZSQg8EIeAAvepNwhJj++qJWNJw1Cl0YnOqKtP5Djx+fFGkp3WRh+W0ASCaFG5w1jhmzDxgu3SJuVxPF4Q== 420 | dependencies: 421 | estree-walker "^0.6.1" 422 | is-reference "^1.1.2" 423 | magic-string "^0.25.2" 424 | resolve "^1.11.0" 425 | rollup-pluginutils "^2.8.1" 426 | 427 | rollup-plugin-node-resolve@^5.2.0: 428 | version "5.2.0" 429 | resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz#730f93d10ed202473b1fb54a5997a7db8c6d8523" 430 | integrity sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw== 431 | dependencies: 432 | "@types/resolve" "0.0.8" 433 | builtin-modules "^3.1.0" 434 | is-module "^1.0.0" 435 | resolve "^1.11.1" 436 | rollup-pluginutils "^2.8.1" 437 | 438 | rollup-plugin-serve@^1.0.1: 439 | version "1.1.0" 440 | resolved "https://registry.yarnpkg.com/rollup-plugin-serve/-/rollup-plugin-serve-1.1.0.tgz#0654a57021a21b903340c69940f7463706e8288d" 441 | integrity sha512-pYkSsuA0/psKqhhictkJw1c2klya5b+LlCvipWqI9OE1aG2M97mRumZCbBlry5CMEOzYBBgSDgd1694sNbmyIw== 442 | dependencies: 443 | mime ">=2.4.6" 444 | opener "1" 445 | 446 | rollup-plugin-terser@^5.1.2: 447 | version "5.3.1" 448 | resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.3.1.tgz#8c650062c22a8426c64268548957463bf981b413" 449 | integrity sha512-1pkwkervMJQGFYvM9nscrUoncPwiKR/K+bHdjv6PFgRo3cgPHoRT83y2Aa3GvINj4539S15t/tpFPb775TDs6w== 450 | dependencies: 451 | "@babel/code-frame" "^7.5.5" 452 | jest-worker "^24.9.0" 453 | rollup-pluginutils "^2.8.2" 454 | serialize-javascript "^4.0.0" 455 | terser "^4.6.2" 456 | 457 | rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: 458 | version "2.8.2" 459 | resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" 460 | integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== 461 | dependencies: 462 | estree-walker "^0.6.1" 463 | 464 | rollup@^1.21.2: 465 | version "1.32.1" 466 | resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.32.1.tgz#4480e52d9d9e2ae4b46ba0d9ddeaf3163940f9c4" 467 | integrity sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A== 468 | dependencies: 469 | "@types/estree" "*" 470 | "@types/node" "*" 471 | acorn "^7.1.0" 472 | 473 | safe-buffer@^5.1.0: 474 | version "5.2.1" 475 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" 476 | integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== 477 | 478 | serialize-javascript@^4.0.0: 479 | version "4.0.0" 480 | resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" 481 | integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== 482 | dependencies: 483 | randombytes "^2.1.0" 484 | 485 | source-map-support@~0.5.12: 486 | version "0.5.21" 487 | resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" 488 | integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== 489 | dependencies: 490 | buffer-from "^1.0.0" 491 | source-map "^0.6.0" 492 | 493 | source-map@^0.6.0, source-map@~0.6.1: 494 | version "0.6.1" 495 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 496 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== 497 | 498 | sourcemap-codec@^1.4.8: 499 | version "1.4.8" 500 | resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" 501 | integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== 502 | 503 | strip-json-comments@^3.1.0: 504 | version "3.1.1" 505 | resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" 506 | integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== 507 | 508 | supports-color@^5.3.0: 509 | version "5.5.0" 510 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" 511 | integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== 512 | dependencies: 513 | has-flag "^3.0.0" 514 | 515 | supports-color@^6.1.0: 516 | version "6.1.0" 517 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" 518 | integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== 519 | dependencies: 520 | has-flag "^3.0.0" 521 | 522 | supports-preserve-symlinks-flag@^1.0.0: 523 | version "1.0.0" 524 | resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" 525 | integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== 526 | 527 | taffydb@2.6.2: 528 | version "2.6.2" 529 | resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" 530 | integrity sha1-fLy2S1oUG2ou/CxdLGe04VCyomg= 531 | 532 | terser@^4.6.2: 533 | version "4.8.0" 534 | resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" 535 | integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== 536 | dependencies: 537 | commander "^2.20.0" 538 | source-map "~0.6.1" 539 | source-map-support "~0.5.12" 540 | 541 | uc.micro@^1.0.1, uc.micro@^1.0.5: 542 | version "1.0.6" 543 | resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" 544 | integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== 545 | 546 | underscore@~1.13.2: 547 | version "1.13.2" 548 | resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.2.tgz#276cea1e8b9722a8dbed0100a407dda572125881" 549 | integrity sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g== 550 | 551 | wrappy@1: 552 | version "1.0.2" 553 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 554 | integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= 555 | 556 | xmlcreate@^2.0.4: 557 | version "2.0.4" 558 | resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-2.0.4.tgz#0c5ab0f99cdd02a81065fa9cd8f8ae87624889be" 559 | integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg== 560 | --------------------------------------------------------------------------------