From cd46e9d59384e3924771a97fa8821d074932d43c Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Sat, 11 Jul 2015 01:31:24 -0700 Subject: [PATCH 1/2] new declarations for version 0.2.1 --- maker.js/makerjs-tests.ts | 44 +++-- maker.js/makerjs.d.ts | 359 +++++++++++++------------------------- 2 files changed, 139 insertions(+), 264 deletions(-) diff --git a/maker.js/makerjs-tests.ts b/maker.js/makerjs-tests.ts index 742b9a10e..33869213d 100644 --- a/maker.js/makerjs-tests.ts +++ b/maker.js/makerjs-tests.ts @@ -12,12 +12,10 @@ function test() { function testRoot() { makerjs.extendObject({abc:123}, {xyz:789}); - makerjs.findById(model.paths, 'a'); makerjs.isModel({}); makerjs.isPath({}); makerjs.isPoint([]); makerjs.pathType.Circle; - makerjs.removeById(models, 'x'); makerjs.round(44.44444, .01); makerjs.unitType.Millimeter; } @@ -54,29 +52,31 @@ function test() { } function testModel(){ + makerjs.model.convertUnits(model, makerjs.unitType.Centimeter); makerjs.model.mirror(model, false, true); makerjs.model.move(makerjs.model.originate(model, [9,9]), [0,0]); + makerjs.model.originate(model); makerjs.model.rotate(makerjs.model.scale(model, 6), 45, [0,0]); } function testModels(): MakerJs.IModel[] { return [ - new makerjs.models.BoltCircle('b', 7, 7, 7, 7), - new makerjs.models.BoltRectangle('c', 2, 2, 2), - new makerjs.models.ConnectTheDots('c', true, [ [0,0], [1,1] ]), - new makerjs.models.GoldenRectangle('g', 7), - new makerjs.models.Oval('g', 7, 7), - new makerjs.models.OvalArc('o', 6, 4, 2, 12), - new makerjs.models.Polygon('p', 7, 5), - new makerjs.models.Rectangle('r', 8, 9), - new makerjs.models.Ring('r', 7, 7), - new makerjs.models.RoundRectangle('r', 2, 2, 0), - new makerjs.models.SCurve('s', 5, .9), - new makerjs.models.Square('s', 8) + new makerjs.models.BoltCircle(7, 7, 7, 7), + new makerjs.models.BoltRectangle(2, 2, 2), + new makerjs.models.ConnectTheDots(true, [ [0,0], [1,1] ]), + new makerjs.models.Oval(7, 7), + new makerjs.models.OvalArc(6, 4, 2, 12), + new makerjs.models.Polygon(7, 5), + new makerjs.models.Rectangle(8, 9), + new makerjs.models.Ring(7, 7), + new makerjs.models.RoundRectangle(2, 2, 0), + new makerjs.models.SCurve(5, .9), + new makerjs.models.Square(8) ]; } function testPath() { + makerjs.path.intersection(paths.circle, paths.arc).intersectionPoints; makerjs.path.mirror(paths.arc, true, true); makerjs.path.moveRelative(paths.circle, [0,0]); makerjs.path.rotate(paths.line, 5, [0,0]); @@ -85,9 +85,9 @@ function test() { function testPaths() { return { - arc: new makerjs.paths.Arc('a', [0,0], 7, 0, 180), - circle: new MakerJs.paths.Circle('c', [0,0], 5), - line: new makerjs.paths.Line('l', [0,0], [1,1]) + arc: new makerjs.paths.Arc([0,0], 7, 0, 180), + circle: new MakerJs.paths.Circle([0,0], 5), + line: new makerjs.paths.Line([0,0], [1,1]) }; } @@ -104,13 +104,9 @@ function test() { makerjs.point.zero(); } - function testTools() { - makerjs.tools.breakPath(paths.line, .7)[0].newPath.cssStyle; - makerjs.tools.bridgeGaps([p1, p2], [p1, p2]); - makerjs.tools.gapPath(model, 'a', 7, .7); - makerjs.tools.pathIntersection(paths.circle, paths.arc).intersectionPoints; - makerjs.tools.solveTriangleASA(4, 4, 4); - makerjs.tools.solveTriangleSSS(9, 9, 9); + function testSolvers() { + makerjs.solvers.solveTriangleASA(4, 4, 4); + makerjs.solvers.solveTriangleSSS(9, 9, 9); } function testUnits() { diff --git a/maker.js/makerjs.d.ts b/maker.js/makerjs.d.ts index dba23aff6..1f2cec591 100644 --- a/maker.js/makerjs.d.ts +++ b/maker.js/makerjs.d.ts @@ -50,54 +50,6 @@ declare module MakerJs { * @returns The original object after merging. */ function extendObject(target: Object, other: Object): Object; - /** - * Things that may have an id. - * @private - */ - interface IHaveId { - id: string; - } - /** - * An item found in an array. - * @private - */ - interface IFound { - /** - * Position of the item within the array. - */ - index: number; - /** - * The found item. - */ - item: T; - } - /** - * Search within an array to find an item by its id property. - * - * Examples: find a path with id of 'abc' - * ``` - * var found: IFound = findById(someModel.paths, 'abc'); //typescript - * var found = findById(someModel.paths, 'abc'); //javascript - * ``` - * - * @param arr Array to search. - * @param id Id of the item to find. - * @returns object with item and its position. - */ - function findById(arr: T[], id: string): IFound; - /** - * Search within an array to find an item by its id property, then remove it from the array. - * - * Examples: remove a model with id of 'xyz' - * ``` - * removeById(someModel.models, 'xyz'); //typescript - * removeById(someModel.models, 'xyz'); //javascript - * ``` - * - * @param arr Array to search. - * @param id Id of the item to find and remove. - */ - function removeById(arr: T[], id: string): void; /** * An x-y point in a two-dimensional space. * Implemented as an array with 2 elements. The first element is x, the second element is y. @@ -133,7 +85,7 @@ declare module MakerJs { /** * A line, curved line or other simple two dimensional shape. */ - interface IPath extends IHaveId { + interface IPath { /** * The type of the path, e.g. "line", "circle", or "arc". These strings are enumerated in pathType. */ @@ -158,8 +110,8 @@ declare module MakerJs { * * Examples: * ``` - * var line: IPathLine = { type: 'line', id: 'myline', origin: [0, 0], end: [1, 1] }; //typescript - * var line = { type: 'line', id: 'myline', origin: [0, 0], end: [1, 1] }; //javascript + * var line: IPathLine = { type: 'line', origin: [0, 0], end: [1, 1] }; //typescript + * var line = { type: 'line', origin: [0, 0], end: [1, 1] }; //javascript * ``` */ interface IPathLine extends IPath { @@ -173,8 +125,8 @@ declare module MakerJs { * * Examples: * ``` - * var circle: IPathCircle = { type: 'circle', id: 'mycircle', origin: [0, 0], radius: 7 }; //typescript - * var circle = { type: 'circle', id: 'mycircle', origin: [0, 0], radius: 7 }; //javascript + * var circle: IPathCircle = { type: 'circle', origin: [0, 0], radius: 7 }; //typescript + * var circle = { type: 'circle', origin: [0, 0], radius: 7 }; //javascript * ``` */ interface IPathCircle extends IPath { @@ -188,8 +140,8 @@ declare module MakerJs { * * Examples: * ``` - * var arc: IPathArc = { type: 'arc', id: 'myarc', origin: [0, 0], radius: 7, startAngle: 0, endAngle: 45 }; //typescript - * var arc = { type: 'arc', id: 'myarc', origin: [0, 0], radius: 7, startAngle: 0, endAngle: 45 }; //javascript + * var arc: IPathArc = { type: 'arc', origin: [0, 0], radius: 7, startAngle: 0, endAngle: 45 }; //typescript + * var arc = { type: 'arc', origin: [0, 0], radius: 7, startAngle: 0, endAngle: 45 }; //javascript * ``` */ interface IPathArc extends IPathCircle { @@ -220,15 +172,15 @@ declare module MakerJs { /** * Key is the type of a path, value is a function which accepts a path object a point object as its parameters. */ - [type: string]: (pathValue: IPath, origin: IPoint) => void; + [type: string]: (id: string, pathValue: IPath, origin: IPoint) => void; } /** * String-based enumeration of all paths types. * * Examples: use pathType instead of string literal when creating a circle. * ``` - * var circle: IPathCircle = { type: pathType.Circle, id: 'mycircle', origin: [0, 0], radius: 7 }; //typescript - * var circle = { type: pathType.Circle, id: 'mycircle', origin: [0, 0], radius: 7 }; //javascript + * var circle: IPathCircle = { type: pathType.Circle, origin: [0, 0], radius: 7 }; //typescript + * var circle = { type: pathType.Circle, origin: [0, 0], radius: 7 }; //javascript * ``` */ var pathType: { @@ -236,19 +188,26 @@ declare module MakerJs { Circle: string; Arc: string; }; + interface IPathMap { + [id: string]: IPath; + } + interface IModelMap { + [id: string]: IModel; + } /** * A model is a composite object which may contain an array of paths, or an array of models recursively. * * Example: * ``` - * var m = { id: 'mymodel', - * paths: [ - * { type: 'line', id: 'l1', origin: [0, 0], end: [1, 1] }, - * { type: 'line', id: 'l2', origin: [0, 0], end: [-1, -1] } - * ] }; + * var m = { + * paths: { + * "line1": { type: 'line', origin: [0, 0], end: [1, 1] }, + * "line2": { type: 'line', origin: [0, 0], end: [-1, -1] } + * } + * }; * ``` */ - interface IModel extends IHaveId { + interface IModel { /** * Optional origin location of this model. */ @@ -260,11 +219,11 @@ declare module MakerJs { /** * Optional array of path objects in this model. */ - paths?: IPath[]; + paths?: IPathMap; /** * Optional array of models within this model. */ - models?: IModel[]; + models?: IModelMap; /** * Optional unit system of this model. See UnitType for possible values. */ @@ -279,9 +238,6 @@ declare module MakerJs { */ function isModel(item: any): boolean; } -/** - * Module for angle functions. - */ declare module MakerJs.angle { /** * Ensures an angle is not greater than 360 @@ -329,9 +285,6 @@ declare module MakerJs.angle { */ function mirror(angleInDegrees: number, mirrorX: boolean, mirrorY: boolean): number; } -/** - * Module for point functions. - */ declare module MakerJs.point { /** * Add two points together and return the result as a new point object. @@ -414,9 +367,6 @@ declare module MakerJs.point { */ function zero(): IPoint; } -/** - * Module for path functions. - */ declare module MakerJs.path { /** * Create a clone of a path, mirrored on either or both x and y axes. @@ -454,9 +404,6 @@ declare module MakerJs.path { */ function scale(pathToScale: IPath, scaleValue: number): IPath; } -/** - * Module for IPath creation shortcuts. - */ declare module MakerJs.paths { /** * Class for arc path. @@ -468,13 +415,12 @@ declare module MakerJs.paths { * @param endAngle The end angle of the arc. */ class Arc implements IPathArc { - id: string; origin: IPoint; radius: number; startAngle: number; endAngle: number; type: string; - constructor(id: string, origin: IPoint, radius: number, startAngle: number, endAngle: number); + constructor(origin: IPoint, radius: number, startAngle: number, endAngle: number); } /** * Class for circle path. @@ -484,11 +430,10 @@ declare module MakerJs.paths { * @param radius The radius of the circle. */ class Circle implements IPathCircle { - id: string; origin: IPoint; radius: number; type: string; - constructor(id: string, origin: IPoint, radius: number); + constructor(origin: IPoint, radius: number); } /** * Class for line path. @@ -498,16 +443,12 @@ declare module MakerJs.paths { * @param end The end point of the line. */ class Line implements IPathLine { - id: string; origin: IPoint; end: IPoint; type: string; - constructor(id: string, origin: IPoint, end: IPoint); + constructor(origin: IPoint, end: IPoint); } } -/** - * Module for model functions. - */ declare module MakerJs.model { /** * Moves all of a model's children (models and paths, recursively) in reference to a single common origin. Useful when points between children need to connect to each other. @@ -551,10 +492,15 @@ declare module MakerJs.model { * @returns The original model (for chaining). */ function scale(modelToScale: IModel, scaleValue: number, scaleOrigin?: boolean): IModel; + /** + * Convert a model to match a different unit system. + * + * @param modeltoConvert The model to convert. + * @param destUnitType The unit system. + * @returns The scaled model (for chaining). + */ + function convertUnits(modeltoConvert: IModel, destUnitType: string): IModel; } -/** - * Module for unit conversion functions. - */ declare module MakerJs.units { /** * Get a conversion ratio between a source unit and a destination unit. @@ -565,9 +511,6 @@ declare module MakerJs.units { */ function conversionScale(srcUnitType: string, destUnitType: string): number; } -/** - * Module for measure functions. - */ declare module MakerJs.measure { /** * Total angle of an arc between its start and end angles. @@ -606,9 +549,6 @@ declare module MakerJs.measure { */ function modelExtents(modelToMeasure: IModel): IMeasure; } -/** - * Module for exporter functions. - */ declare module MakerJs.exporter { /** * @private @@ -640,28 +580,28 @@ declare module MakerJs.exporter { * @param fixPoint Optional function to modify a point prior to export. Function parameter is a point; function must return a point. * @param fixPath Optional function to modify a path prior to output. Function parameters are path and offset point; function must return a path. */ - constructor(map: IPathOriginFunctionMap, fixPoint?: (pointToFix: IPoint) => IPoint, fixPath?: (pathToFix: IPath, origin: IPoint) => IPath, beginModel?: (modelContext: IModel) => void, endModel?: (modelContext: IModel) => void); + constructor(map: IPathOriginFunctionMap, fixPoint?: (pointToFix: IPoint) => IPoint, fixPath?: (pathToFix: IPath, origin: IPoint) => IPath, beginModel?: (id: string, modelContext: IModel) => void, endModel?: (modelContext: IModel) => void); /** * Export a path. * * @param pathToExport The path to export. * @param offset The offset position of the path. */ - exportPath(pathToExport: IPath, offset: IPoint): void; + exportPath(id: string, pathToExport: IPath, offset: IPoint): void; /** * Export a model. * * @param modelToExport The model to export. * @param offset The offset position of the model. */ - exportModel(modelToExport: IModel, offset: IPoint): void; + exportModel(modelId: string, modelToExport: IModel, offset: IPoint): void; /** * Export an object. * * @param item The object to export. May be a path, an array of paths, a model, or an array of models. * @param offset The offset position of the object. */ - exportItem(itemToExport: any, origin: IPoint): void; + exportItem(itemId: string, itemToExport: any, origin: IPoint): void; } } declare module MakerJs.exporter { @@ -674,9 +614,57 @@ declare module MakerJs.exporter { interface IDXFRenderOptions extends IExportOptions { } } -/** - * Module for kit functions. - */ +declare module MakerJs.solvers { + /** + * Solves for the angle of a triangle when you know lengths of 3 sides. + * + * @param length1 Length of side of triangle, opposite of the angle you are trying to find. + * @param length2 Length of any other side of the triangle. + * @param length3 Length of the remaining side of the triangle. + * @returns Angle opposite of the side represented by the first parameter. + */ + function solveTriangleSSS(length1: number, length2: number, length3: number): number; + /** + * Solves for the length of a side of a triangle when you know length of one side and 2 angles. + * + * @param oppositeAngleInDegrees Angle which is opposite of the side you are trying to find. + * @param lengthOfSideBetweenAngles Length of one side of the triangle which is between the provided angles. + * @param otherAngleInDegrees An other angle of the triangle. + * @returns Length of the side of the triangle which is opposite of the first angle parameter. + */ + function solveTriangleASA(oppositeAngleInDegrees: number, lengthOfSideBetweenAngles: number, otherAngleInDegrees: number): number; +} +declare module MakerJs.path { + /** + * An intersection of two paths. + */ + interface IPathIntersection { + /** + * Array of points where the two paths intersected. The length of the array may be either 1 or 2 points. + */ + intersectionPoints: IPoint[]; + /** + * This Array property will only be defined if the first parameter passed to pathIntersection is either an Arc or a Circle. + * It contains the angles of intersection relative to the first path parameter. + * The length of the array may be either 1 or 2. + */ + path1Angles?: number[]; + /** + * This Array property will only be defined if the second parameter passed to pathIntersection is either an Arc or a Circle. + * It contains the angles of intersection relative to the second path parameter. + * The length of the array may be either 1 or 2. + */ + path2Angles?: number[]; + } + /** + * Find the point(s) where 2 paths intersect. + * + * @param path1 First path to find intersection. + * @param path2 Second path to find intersection. + * @result IPathIntersection object, with points(s) of intersection (and angles, when a path is an arc or circle); or null if the paths did not intersect. + */ + function intersection(path1: IPath, path2: IPath): IPathIntersection; +} declare module MakerJs.kit { /** * Describes a parameter and its limits. @@ -793,11 +781,6 @@ declare module MakerJs.exporter { } } declare module MakerJs.exporter { - /** - * The default stroke width in millimeters. - * @private - */ - var svgDefaultStrokeWidth: number; function toSVG(modelToExport: IModel, options?: ISVGRenderOptions): string; function toSVG(pathsToExport: IPath[], options?: ISVGRenderOptions): string; function toSVG(pathToExport: IPath, options?: ISVGRenderOptions): string; @@ -806,9 +789,13 @@ declare module MakerJs.exporter { */ interface ISVGRenderOptions extends IExportOptions { /** - * SVG stroke width of paths. This is in the same unit system as the units property. + * Optional attributes to add to the root svg tag. */ - strokeWidth?: number; + svgAttrs?: IXmlTagAttrs; + /** + * SVG stroke width of paths. This may have a unit type suffix, if not, the value will be in the same unit system as the units property. + */ + strokeWidth?: string; /** * SVG color of the rendered paths. */ @@ -835,174 +822,66 @@ declare module MakerJs.exporter { viewBox: boolean; } } -/** - * Module for primitive model classes. - */ declare module MakerJs.models { class BoltCircle implements IModel { - id: string; - paths: IPath[]; - constructor(id: string, boltRadius: number, holeRadius: number, boltCount: number, firstBoltAngleInDegrees?: number); + paths: IPathMap; + constructor(boltRadius: number, holeRadius: number, boltCount: number, firstBoltAngleInDegrees?: number); } } declare module MakerJs.models { class BoltRectangle implements IModel { - id: string; - paths: IPath[]; - constructor(id: string, width: number, height: number, holeRadius: number); + paths: IPathMap; + constructor(width: number, height: number, holeRadius: number); } } declare module MakerJs.models { class ConnectTheDots implements IModel { - id: string; - paths: IPath[]; - constructor(id: string, isClosed: boolean, points: IPoint[]); - } -} -declare module MakerJs.models { - class Rectangle extends ConnectTheDots { - id: string; - constructor(id: string, width: number, height: number); - } -} -declare module MakerJs.models { - class GoldenRectangle extends Rectangle { - id: string; - constructor(id: string, width: number); - static GoldenRatio: number; + paths: IPathMap; + constructor(isClosed: boolean, points: IPoint[]); } } declare module MakerJs.models { class RoundRectangle implements IModel { - id: string; - paths: IPath[]; - constructor(id: string, width: number, height: number, radius: number); + paths: IPathMap; + constructor(width: number, height: number, radius: number); } } declare module MakerJs.models { class Oval extends RoundRectangle { - id: string; - constructor(id: string, width: number, height: number); + constructor(width: number, height: number); } } declare module MakerJs.models { class OvalArc implements IModel { - id: string; - paths: IPath[]; - constructor(id: string, startAngle: number, endAngle: number, sweepRadius: number, slotRadius: number); + paths: IPathMap; + constructor(startAngle: number, endAngle: number, sweepRadius: number, slotRadius: number); } } declare module MakerJs.models { class Polygon extends ConnectTheDots { - id: string; - constructor(id: string, numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number); + constructor(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number); static getPoints(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number): IPoint[]; } } +declare module MakerJs.models { + class Rectangle extends ConnectTheDots { + constructor(width: number, height: number); + } +} declare module MakerJs.models { class Ring implements IModel { - id: string; - paths: IPath[]; - constructor(id: string, outerRadius: number, innerRadius: number); + paths: IPathMap; + constructor(outerRadius: number, innerRadius: number); } } declare module MakerJs.models { class SCurve implements IModel { - id: string; - paths: IPath[]; - constructor(id: string, width: number, height: number); + paths: IPathMap; + constructor(width: number, height: number); } } declare module MakerJs.models { class Square extends Rectangle { - id: string; - constructor(id: string, side: number); + constructor(side: number); } } -/** - * Module for various functions. - */ -declare module MakerJs.tools { - /** - * A path which has been broken. - */ - interface IBrokenPath { - /** - * The new path after breaking the source path. - */ - newPath: IPath; - /** - * The point where the break ocurred. - */ - newPoint: IPoint; - } - function breakPath(path: IPath, breakAt?: number): IBrokenPath[]; - /** - * Break a path and create a gap within it. Useful when connecting models together. - * - * @param modelToGap Model which will have a gap in one of its paths. - * @param pathId String id of the path in which to create a gap. - * @param gapLength Number length of the gap. - * @breakAt Number between 0 and 1 (default .5) where the gap will be centered along the path. - */ - function gapPath(modelToGap: IModel, pathId: string, gapLength: number, breakAt?: number): IPoint[]; - /** - * Given 2 pairs of points, will return lines that connect the first pair to the second. - * - * @param gap1 First array of 2 point objects. - * @param gap2 Second array of 2 point objects. - * @returns Array containing 2 lines. - */ - function bridgeGaps(gap1: IPoint[], gap2: IPoint[]): IPathLine[]; -} -declare module MakerJs.tools { - /** - * Solves for the angle of a triangle when you know lengths of 3 sides. - * - * @param length1 Length of side of triangle, opposite of the angle you are trying to find. - * @param length2 Length of any other side of the triangle. - * @param length3 Length of the remaining side of the triangle. - * @returns Angle opposite of the side represented by the first parameter. - */ - function solveTriangleSSS(length1: number, length2: number, length3: number): number; - /** - * Solves for the length of a side of a triangle when you know length of one side and 2 angles. - * - * @param oppositeAngleInDegrees Angle which is opposite of the side you are trying to find. - * @param lengthOfSideBetweenAngles Length of one side of the triangle which is between the provided angles. - * @param otherAngleInDegrees An other angle of the triangle. - * @returns Length of the side of the triangle which is opposite of the first angle parameter. - */ - function solveTriangleASA(oppositeAngleInDegrees: number, lengthOfSideBetweenAngles: number, otherAngleInDegrees: number): number; -} -declare module MakerJs.tools { - /** - * An intersection of two paths. - */ - interface IPathIntersection { - /** - * Array of points where the two paths intersected. The length of the array may be either 1 or 2 points. - */ - intersectionPoints: IPoint[]; - /** - * This Array property will only be defined if the first parameter passed to pathIntersection is either an Arc or a Circle. - * It contains the angles of intersection relative to the first path parameter. - * The length of the array may be either 1 or 2. - */ - path1Angles?: number[]; - /** - * This Array property will only be defined if the second parameter passed to pathIntersection is either an Arc or a Circle. - * It contains the angles of intersection relative to the second path parameter. - * The length of the array may be either 1 or 2. - */ - path2Angles?: number[]; - } - /** - * Find the point(s) where 2 paths intersect. - * - * @param path1 First path to find intersection. - * @param path2 Second path to find intersection. - * @result IPathIntersection object, with points(s) of intersection (and angles, when a path is an arc or circle); or null if the paths did not intersect. - */ - function pathIntersection(path1: IPath, path2: IPath): IPathIntersection; -} From 3174d8c3aaf44bf9eab38d3930996128bc7d1843 Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Sat, 11 Jul 2015 10:39:21 -0700 Subject: [PATCH 2/2] Moved IPathIntersection into root module --- maker.js/makerjs.d.ts | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/maker.js/makerjs.d.ts b/maker.js/makerjs.d.ts index 1f2cec591..acea3405b 100644 --- a/maker.js/makerjs.d.ts +++ b/maker.js/makerjs.d.ts @@ -188,6 +188,27 @@ declare module MakerJs { Circle: string; Arc: string; }; + /** + * An intersection of two paths. + */ + interface IPathIntersection { + /** + * Array of points where the two paths intersected. The length of the array may be either 1 or 2 points. + */ + intersectionPoints: IPoint[]; + /** + * This Array property will only be defined if the first parameter passed to pathIntersection is either an Arc or a Circle. + * It contains the angles of intersection relative to the first path parameter. + * The length of the array may be either 1 or 2. + */ + path1Angles?: number[]; + /** + * This Array property will only be defined if the second parameter passed to pathIntersection is either an Arc or a Circle. + * It contains the angles of intersection relative to the second path parameter. + * The length of the array may be either 1 or 2. + */ + path2Angles?: number[]; + } interface IPathMap { [id: string]: IPath; } @@ -635,27 +656,6 @@ declare module MakerJs.solvers { function solveTriangleASA(oppositeAngleInDegrees: number, lengthOfSideBetweenAngles: number, otherAngleInDegrees: number): number; } declare module MakerJs.path { - /** - * An intersection of two paths. - */ - interface IPathIntersection { - /** - * Array of points where the two paths intersected. The length of the array may be either 1 or 2 points. - */ - intersectionPoints: IPoint[]; - /** - * This Array property will only be defined if the first parameter passed to pathIntersection is either an Arc or a Circle. - * It contains the angles of intersection relative to the first path parameter. - * The length of the array may be either 1 or 2. - */ - path1Angles?: number[]; - /** - * This Array property will only be defined if the second parameter passed to pathIntersection is either an Arc or a Circle. - * It contains the angles of intersection relative to the second path parameter. - * The length of the array may be either 1 or 2. - */ - path2Angles?: number[]; - } /** * Find the point(s) where 2 paths intersect. *