@itwin/core-geometry 4.2.0-dev.1 → 4.2.0-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/lib/cjs/curve/Loop.d.ts +1 -2
  2. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  3. package/lib/cjs/curve/Loop.js.map +1 -1
  4. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  5. package/lib/cjs/curve/Path.d.ts +1 -2
  6. package/lib/cjs/curve/Path.d.ts.map +1 -1
  7. package/lib/cjs/curve/Path.js.map +1 -1
  8. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  9. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +26 -6
  10. package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
  11. package/lib/cjs/geometry3d/GrowableXYArray.js +66 -15
  12. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  13. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +5 -2
  14. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  15. package/lib/cjs/geometry3d/GrowableXYZArray.js +10 -3
  16. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  17. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +9 -5
  18. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  19. package/lib/cjs/polyface/PolyfaceBuilder.js +9 -5
  20. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  21. package/lib/esm/curve/Loop.d.ts +1 -2
  22. package/lib/esm/curve/Loop.d.ts.map +1 -1
  23. package/lib/esm/curve/Loop.js.map +1 -1
  24. package/lib/esm/curve/ParityRegion.js.map +1 -1
  25. package/lib/esm/curve/Path.d.ts +1 -2
  26. package/lib/esm/curve/Path.d.ts.map +1 -1
  27. package/lib/esm/curve/Path.js.map +1 -1
  28. package/lib/esm/curve/UnionRegion.js.map +1 -1
  29. package/lib/esm/geometry3d/GrowableXYArray.d.ts +26 -6
  30. package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
  31. package/lib/esm/geometry3d/GrowableXYArray.js +66 -15
  32. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  33. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +5 -2
  34. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  35. package/lib/esm/geometry3d/GrowableXYZArray.js +10 -3
  36. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  37. package/lib/esm/polyface/PolyfaceBuilder.d.ts +9 -5
  38. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  39. package/lib/esm/polyface/PolyfaceBuilder.js +9 -5
  40. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  41. package/package.json +3 -3
@@ -4,7 +4,6 @@
4
4
  import { GeometryHandler } from "../geometry3d/GeometryHandler";
5
5
  import { IndexedXYZCollection } from "../geometry3d/IndexedXYZCollection";
6
6
  import { Point3d } from "../geometry3d/Point3dVector3d";
7
- import { AnyCurve } from "./CurveChain";
8
7
  import { CurveChain } from "./CurveCollection";
9
8
  import { CurvePrimitive } from "./CurvePrimitive";
10
9
  import { RecursiveCurveProcessor } from "./CurveProcessor";
@@ -37,7 +36,7 @@ export declare class Loop extends CurveChain {
37
36
  /** Create a loop from an array of points */
38
37
  static createPolygon(points: IndexedXYZCollection | Point3d[]): Loop;
39
38
  /** Create a loop with the stroked form of this loop. */
40
- cloneStroked(options?: StrokeOptions): AnyCurve;
39
+ cloneStroked(options?: StrokeOptions): Loop;
41
40
  /** Return the boundary type (2) of a corresponding MicroStation CurveVector */
42
41
  dgnBoundaryType(): number;
43
42
  /** Invoke `processor.announceLoop(this, indexInParent)` */
@@ -1 +1 @@
1
- {"version":3,"file":"Loop.d.ts","sourceRoot":"","sources":["../../../src/curve/Loop.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,eAAe,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AAC,CAAC;IAClC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAS7B,kBAAkB;IAClB,YACE,KAAuB,EAAE,MAAkC,EAAE,KAAuB,EAAE,MAAkC;QAExH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACD,uCAAuC;IAChC,IAAI,CAAC,IAAU,EAAE,KAAqB;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IACD,uCAAuC;IAChC,IAAI,CAAC,IAAU,EAAE,KAAqB;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { AnyCurve } from \"./CurveChain\";\r\nimport { CurveChain } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * A `Loop` is a curve chain that is the boundary of a closed (planar) loop.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class Loop extends CurveChain {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"loop\";\r\n /** Tag value that can be set to true for user code to mark inner and outer loops. */\r\n public override isInner: boolean = false;\r\n /** Test if `other` is a `Loop` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof Loop;\r\n }\r\n /** Test if `other` is an instance of `Loop` */\r\n public constructor() {\r\n super();\r\n }\r\n /**\r\n * Create a loop from variable length list of CurvePrimitives\r\n * @param curves array of individual curve primitives\r\n */\r\n public static create(...curves: CurvePrimitive[]): Loop {\r\n const result = new Loop();\r\n for (const curve of curves) {\r\n result.children.push(curve);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Create a loop from an array of curve primitives\r\n * @param curves array of individual curve primitives\r\n */\r\n public static createArray(curves: CurvePrimitive[]): Loop {\r\n const result = new Loop();\r\n for (const curve of curves) {\r\n result.children.push(curve);\r\n }\r\n return result;\r\n }\r\n /** Create a loop from an array of points */\r\n public static createPolygon(points: IndexedXYZCollection | Point3d[]): Loop {\r\n const linestring = LineString3d.create(points);\r\n linestring.addClosurePoint();\r\n return Loop.create(linestring);\r\n }\r\n /** Create a loop with the stroked form of this loop. */\r\n public cloneStroked(options?: StrokeOptions): AnyCurve {\r\n const strokes = LineString3d.create();\r\n for (const curve of this.children)\r\n curve.emitStrokes(strokes, options);\r\n // eliminate near-duplicate points between children\r\n strokes.removeDuplicatePoints();\r\n if (strokes.isPhysicallyClosed) {\r\n strokes.popPoint();\r\n strokes.addClosurePoint();\r\n }\r\n return Loop.create(strokes);\r\n }\r\n /** Return the boundary type (2) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n /**\r\n * All \"Loop\" become \"outer\". TypeScript Loop object is equivalent to a native CurveVector with\r\n * boundaryType = BOUNDARY_TYPE_Outer. In other words, TypeScript has no flavor of Loop that\r\n * carries \"hole\" semantics.\r\n */\r\n return 2;\r\n }\r\n /** Invoke `processor.announceLoop(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceLoop(this, indexInParent);\r\n }\r\n /** Create a new `Loop` with no children */\r\n public cloneEmptyPeer(): Loop {\r\n return new Loop();\r\n }\r\n /** Second step of double dispatch: call `handler.handleLoop(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleLoop(this);\r\n }\r\n}\r\n\r\n/**\r\n * Structure carrying a pair of loops with curve geometry.\r\n * @public\r\n */\r\nexport class LoopCurveLoopCurve {\r\n /** First loop */\r\n public loopA?: Loop;\r\n /** A curve (typically an edge of loopA) */\r\n public curveA?: CurvePrimitive;\r\n /** second loop */\r\n public loopB?: Loop;\r\n /** A curve (typically an edge of loopB) */\r\n public curveB?: CurvePrimitive;\r\n /** Constructor */\r\n public constructor(\r\n loopA: Loop | undefined, curveA: CurvePrimitive | undefined, loopB: Loop | undefined, curveB: CurvePrimitive | undefined,\r\n ) {\r\n this.loopA = loopA;\r\n this.curveA = curveA;\r\n this.loopB = loopB;\r\n this.curveB = curveB;\r\n }\r\n /** Set the loopA and curveA members */\r\n public setA(loop: Loop, curve: CurvePrimitive) {\r\n this.loopA = loop;\r\n this.curveA = curve;\r\n }\r\n /** Set the loopB and curveB members */\r\n public setB(loop: Loop, curve: CurvePrimitive) {\r\n this.loopB = loop;\r\n this.curveB = curve;\r\n }\r\n}\r\n\r\n/**\r\n * Carrier object for loops characterized by area sign\r\n * @public\r\n */\r\nexport interface SignedLoops {\r\n /** Array of loops that have positive area sign (i.e. counterclockwise loops). */\r\n positiveAreaLoops: Loop[];\r\n /** Array of loops that have negative area sign (i.e. clockwise loops). */\r\n negativeAreaLoops: Loop[];\r\n /** Slivers where there are coincident sections of input curves. */\r\n slivers: Loop[];\r\n /** Array indicating edges between loops */\r\n edges?: LoopCurveLoopCurve[];\r\n}\r\n"]}
1
+ {"version":3,"file":"Loop.js","sourceRoot":"","sources":["../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uCAAuC;IAChC,IAAI,CAAC,IAAU,EAAE,KAAqB;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { CurveChain } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * A `Loop` is a curve chain that is the boundary of a closed (planar) loop.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class Loop extends CurveChain {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"loop\";\r\n /** Tag value that can be set to true for user code to mark inner and outer loops. */\r\n public override isInner: boolean = false;\r\n /** Test if `other` is a `Loop` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof Loop;\r\n }\r\n /** Test if `other` is an instance of `Loop` */\r\n public constructor() {\r\n super();\r\n }\r\n /**\r\n * Create a loop from variable length list of CurvePrimitives\r\n * @param curves array of individual curve primitives\r\n */\r\n public static create(...curves: CurvePrimitive[]): Loop {\r\n const result = new Loop();\r\n for (const curve of curves) {\r\n result.children.push(curve);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Create a loop from an array of curve primitives\r\n * @param curves array of individual curve primitives\r\n */\r\n public static createArray(curves: CurvePrimitive[]): Loop {\r\n const result = new Loop();\r\n for (const curve of curves) {\r\n result.children.push(curve);\r\n }\r\n return result;\r\n }\r\n /** Create a loop from an array of points */\r\n public static createPolygon(points: IndexedXYZCollection | Point3d[]): Loop {\r\n const linestring = LineString3d.create(points);\r\n linestring.addClosurePoint();\r\n return Loop.create(linestring);\r\n }\r\n /** Create a loop with the stroked form of this loop. */\r\n public cloneStroked(options?: StrokeOptions): Loop {\r\n const strokes = LineString3d.create();\r\n for (const curve of this.children)\r\n curve.emitStrokes(strokes, options);\r\n // eliminate near-duplicate points between children\r\n strokes.removeDuplicatePoints();\r\n if (strokes.isPhysicallyClosed) {\r\n strokes.popPoint();\r\n strokes.addClosurePoint();\r\n }\r\n return Loop.create(strokes);\r\n }\r\n /** Return the boundary type (2) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n /**\r\n * All \"Loop\" become \"outer\". TypeScript Loop object is equivalent to a native CurveVector with\r\n * boundaryType = BOUNDARY_TYPE_Outer. In other words, TypeScript has no flavor of Loop that\r\n * carries \"hole\" semantics.\r\n */\r\n return 2;\r\n }\r\n /** Invoke `processor.announceLoop(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceLoop(this, indexInParent);\r\n }\r\n /** Create a new `Loop` with no children */\r\n public cloneEmptyPeer(): Loop {\r\n return new Loop();\r\n }\r\n /** Second step of double dispatch: call `handler.handleLoop(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleLoop(this);\r\n }\r\n}\r\n\r\n/**\r\n * Structure carrying a pair of loops with curve geometry.\r\n * @public\r\n */\r\nexport class LoopCurveLoopCurve {\r\n /** First loop */\r\n public loopA?: Loop;\r\n /** A curve (typically an edge of loopA) */\r\n public curveA?: CurvePrimitive;\r\n /** second loop */\r\n public loopB?: Loop;\r\n /** A curve (typically an edge of loopB) */\r\n public curveB?: CurvePrimitive;\r\n /** Constructor */\r\n public constructor(\r\n loopA: Loop | undefined, curveA: CurvePrimitive | undefined, loopB: Loop | undefined, curveB: CurvePrimitive | undefined,\r\n ) {\r\n this.loopA = loopA;\r\n this.curveA = curveA;\r\n this.loopB = loopB;\r\n this.curveB = curveB;\r\n }\r\n /** Set the loopA and curveA members */\r\n public setA(loop: Loop, curve: CurvePrimitive) {\r\n this.loopA = loop;\r\n this.curveA = curve;\r\n }\r\n /** Set the loopB and curveB members */\r\n public setB(loop: Loop, curve: CurvePrimitive) {\r\n this.loopB = loop;\r\n this.curveB = curve;\r\n }\r\n}\r\n\r\n/**\r\n * Carrier object for loops characterized by area sign\r\n * @public\r\n */\r\nexport interface SignedLoops {\r\n /** Array of loops that have positive area sign (i.e. counterclockwise loops). */\r\n positiveAreaLoops: Loop[];\r\n /** Array of loops that have negative area sign (i.e. clockwise loops). */\r\n negativeAreaLoops: Loop[];\r\n /** Slivers where there are coincident sections of input curves. */\r\n slivers: Loop[];\r\n /** Array indicating edges between loops */\r\n edges?: LoopCurveLoopCurve[];\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ParityRegion.js","sourceRoot":"","sources":["../../../src/curve/ParityRegion.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B;;;;;;GAMG;AACH,MAAM,OAAO,YAAa,SAAQ,eAAe;IAG/C,uDAAuD;IAChD,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,YAAY,CAAC;IACvC,CAAC;IAGD,uDAAuD;IACvD,IAAoB,QAAQ;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACD,oDAAoD;IACpD;QACE,KAAK,EAAE,CAAC;QAdV,wCAAwC;QACxB,wBAAmB,GAAG,cAAc,CAAC;QAcnD,IAAI,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,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { AnyCurve } from \"./CurveChain\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { Loop } from \"./Loop\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * * A `ParityRegion` is a collection of `Loop` objects.\r\n * * The loops collectively define a planar region.\r\n * * A point is \"in\" the composite region if it is \"in\" an odd number of the loops.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class ParityRegion extends CurveCollection {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"parityRegion\";\r\n /** Test if `other` is an instance of `ParityRegion` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof ParityRegion;\r\n }\r\n /** Array of loops in this parity region. */\r\n protected _children: Loop[];\r\n /** Return the array of loops in this parity region. */\r\n public override get children(): Loop[] {\r\n return this._children;\r\n }\r\n /** Construct parity region with empty loop array */\r\n public constructor() {\r\n super();\r\n this._children = [];\r\n }\r\n /** Add loops (recursively) to this region's children */\r\n public addLoops(data?: Loop | Loop[] | Loop[][]): void {\r\n if (data === undefined) {\r\n } else if (data instanceof Loop)\r\n this.children.push(data);\r\n else if (Array.isArray(data)) {\r\n for (const child of data) {\r\n if (child instanceof Loop)\r\n this.children.push(child);\r\n else if (Array.isArray(child))\r\n this.addLoops(child);\r\n }\r\n }\r\n }\r\n /**\r\n * Return a single loop or parity region with given loops.\r\n * * The returned structure CAPTURES the loops.\r\n * * The loops are NOT reorganized by hole analysis.\r\n */\r\n public static createLoops(data?: Loop | Loop[] | Loop[][]): Loop | ParityRegion {\r\n if (data instanceof Loop)\r\n return data;\r\n const result = new ParityRegion();\r\n result.addLoops(data);\r\n return result;\r\n }\r\n /** Create a parity region with given loops */\r\n public static create(...data: Loop[]): ParityRegion {\r\n const result = new ParityRegion();\r\n for (const child of data) {\r\n result.children.push(child);\r\n }\r\n return result;\r\n }\r\n /** Return the boundary type (4) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 4;\r\n }\r\n /** Invoke `processor.announceParityRegion(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceParityRegion(this, indexInParent);\r\n }\r\n /** Return a deep copy. */\r\n public override clone(): ParityRegion {\r\n const clone = new ParityRegion();\r\n let child;\r\n for (child of this.children) {\r\n const childClone = child.clone();\r\n if (childClone instanceof Loop)\r\n clone.children.push(childClone);\r\n }\r\n return clone;\r\n }\r\n /** Stroke these curves into a new ParityRegion. */\r\n public cloneStroked(options?: StrokeOptions): ParityRegion {\r\n const clone = new ParityRegion();\r\n let child;\r\n for (child of this.children) {\r\n const childStrokes = child.cloneStroked(options) as Loop;\r\n if (childStrokes)\r\n clone.children.push(childStrokes);\r\n }\r\n return clone;\r\n }\r\n /** Create a new empty parity region. */\r\n public cloneEmptyPeer(): ParityRegion {\r\n return new ParityRegion();\r\n }\r\n /**\r\n * Add `child` to this parity region.\r\n * * Any child type other than `Loop` is ignored.\r\n */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child && child instanceof Loop) {\r\n this._children.push(child);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Get child `i` by index. */\r\n public getChild(i: number): Loop | undefined {\r\n if (i < this._children.length)\r\n return this._children[i];\r\n return undefined;\r\n }\r\n /** Second step of double dispatch: call `handler.handleRegion(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleParityRegion(this);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ParityRegion.js","sourceRoot":"","sources":["../../../src/curve/ParityRegion.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B;;;;;;GAMG;AACH,MAAM,OAAO,YAAa,SAAQ,eAAe;IAG/C,uDAAuD;IAChD,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,YAAY,CAAC;IACvC,CAAC;IAGD,uDAAuD;IACvD,IAAoB,QAAQ;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACD,oDAAoD;IACpD;QACE,KAAK,EAAE,CAAC;QAdV,wCAAwC;QACxB,wBAAmB,GAAG,cAAc,CAAC;QAcnD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACtB,CAAC;IACD,wDAAwD;IACjD,QAAQ,CAAC,IAA+B;QAC7C,IAAI,IAAI,KAAK,SAAS,EAAE;SACvB;aAAM,IAAI,IAAI,YAAY,IAAI;YAC7B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACtB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC5B,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE;gBACxB,IAAI,KAAK,YAAY,IAAI;oBACvB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;qBACvB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;oBAC3B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;aACxB;SACF;IACH,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,IAA+B;QACvD,IAAI,IAAI,YAAY,IAAI;YACtB,OAAO,IAAI,CAAC;QACd,MAAM,MAAM,G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KAAK,CAAC;IACf,CAAC;IACD,wCAAwC;IACjC,cAAc;QACnB,OAAO,IAAI,YAAY,EAAE,CAAC;IAC5B,CAAC;IACD;;;OAGG;IACI,WAAW,CAAC,KAA2B;QAC5C,IAAI,KAAK,IAAI,KAAK,YAAY,IAAI,EAAE;YAClC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,8BAA8B;IACvB,QAAQ,CAAC,CAAS;QACvB,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,yEAAyE;IAClE,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { AnyCurve } from \"./CurveChain\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { Loop } from \"./Loop\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * * A `ParityRegion` is a collection of `Loop` objects.\r\n * * The loops collectively define a planar region.\r\n * * A point is \"in\" the composite region if it is \"in\" an odd number of the loops.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class ParityRegion extends CurveCollection {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"parityRegion\";\r\n /** Test if `other` is an instance of `ParityRegion` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof ParityRegion;\r\n }\r\n /** Array of loops in this parity region. */\r\n protected _children: Loop[];\r\n /** Return the array of loops in this parity region. */\r\n public override get children(): Loop[] {\r\n return this._children;\r\n }\r\n /** Construct parity region with empty loop array */\r\n public constructor() {\r\n super();\r\n this._children = [];\r\n }\r\n /** Add loops (recursively) to this region's children */\r\n public addLoops(data?: Loop | Loop[] | Loop[][]): void {\r\n if (data === undefined) {\r\n } else if (data instanceof Loop)\r\n this.children.push(data);\r\n else if (Array.isArray(data)) {\r\n for (const child of data) {\r\n if (child instanceof Loop)\r\n this.children.push(child);\r\n else if (Array.isArray(child))\r\n this.addLoops(child);\r\n }\r\n }\r\n }\r\n /**\r\n * Return a single loop or parity region with given loops.\r\n * * The returned structure CAPTURES the loops.\r\n * * The loops are NOT reorganized by hole analysis.\r\n */\r\n public static createLoops(data?: Loop | Loop[] | Loop[][]): Loop | ParityRegion {\r\n if (data instanceof Loop)\r\n return data;\r\n const result = new ParityRegion();\r\n result.addLoops(data);\r\n return result;\r\n }\r\n /** Create a parity region with given loops */\r\n public static create(...data: Loop[]): ParityRegion {\r\n const result = new ParityRegion();\r\n for (const child of data) {\r\n result.children.push(child);\r\n }\r\n return result;\r\n }\r\n /** Return the boundary type (4) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 4;\r\n }\r\n /** Invoke `processor.announceParityRegion(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceParityRegion(this, indexInParent);\r\n }\r\n /** Return a deep copy. */\r\n public override clone(): ParityRegion {\r\n const clone = new ParityRegion();\r\n let child;\r\n for (child of this.children) {\r\n const childClone = child.clone();\r\n if (childClone instanceof Loop)\r\n clone.children.push(childClone);\r\n }\r\n return clone;\r\n }\r\n /** Stroke these curves into a new ParityRegion. */\r\n public cloneStroked(options?: StrokeOptions): ParityRegion {\r\n const clone = new ParityRegion();\r\n let child;\r\n for (child of this.children) {\r\n const childStrokes = child.cloneStroked(options);\r\n if (childStrokes)\r\n clone.children.push(childStrokes);\r\n }\r\n return clone;\r\n }\r\n /** Create a new empty parity region. */\r\n public cloneEmptyPeer(): ParityRegion {\r\n return new ParityRegion();\r\n }\r\n /**\r\n * Add `child` to this parity region.\r\n * * Any child type other than `Loop` is ignored.\r\n */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child && child instanceof Loop) {\r\n this._children.push(child);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Get child `i` by index. */\r\n public getChild(i: number): Loop | undefined {\r\n if (i < this._children.length)\r\n return this._children[i];\r\n return undefined;\r\n }\r\n /** Second step of double dispatch: call `handler.handleRegion(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleParityRegion(this);\r\n }\r\n}\r\n"]}
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import { GeometryHandler } from "../geometry3d/GeometryHandler";
5
5
  import { Point3d } from "../geometry3d/Point3dVector3d";
6
- import { AnyCurve } from "./CurveChain";
7
6
  import { CurveChain } from "./CurveCollection";
8
7
  import { CurvePrimitive } from "./CurvePrimitive";
9
8
  import { RecursiveCurveProcessor } from "./CurveProcessor";
@@ -36,7 +35,7 @@ export declare class Path extends CurveChain {
36
35
  */
37
36
  static createArray(curves: CurvePrimitive[]): Path;
38
37
  /** Return a deep copy, with leaf-level curve primitives stroked. */
39
- cloneStroked(options?: StrokeOptions): AnyCurve;
38
+ cloneStroked(options?: StrokeOptions): Path;
40
39
  /** Return the boundary type (1) of a corresponding MicroStation CurveVector */
41
40
  dgnBoundaryType(): number;
42
41
  /** Clone as a new `Path` with no primitives */
@@ -1 +1 @@
1
- {"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../../src/curve/Path.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,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C,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;QACtC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;YAC/B,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IACD,gFAAgF;IACzE,eAAe;QACpB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,+CAA+C;IACxC,cAAc;QACnB,OAAO,IAAI,IAAI,EAAE,CAAC;IACpB,CAAC;IACD,sEAAsE;IAC/D,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { AnyCurve } from \"./CurveChain\";\r\nimport { CurveChain } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * * A `Path` object is a collection of curves that join head-to-tail to form a path.\r\n * * A `Path` object does not bound a planar region. Use `Loop` to indicate region bounding.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class Path extends CurveChain {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"path\";\r\n /** Test if `other` is an instance of `Path` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof Path;\r\n }\r\n /** Invoke `processor.announcePath(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announcePath(this, indexInParent);\r\n }\r\n /** Construct an empty path. */\r\n public constructor() {\r\n super();\r\n }\r\n /**\r\n * Create a path from a variable length list of curve primitives\r\n * * CurvePrimitive params are captured.\r\n * @param curves variable length list of individual curve primitives or point arrays.\r\n */\r\n public static create(...curves: Array<CurvePrimitive | Point3d[]>): Path {\r\n const result = new Path();\r\n for (const curve of curves) {\r\n if (curve instanceof CurvePrimitive)\r\n result.children.push(curve);\r\n else if (Array.isArray(curve) && curve.length > 0 && curve[0] instanceof Point3d) {\r\n result.children.push(LineString3d.create(curve));\r\n }\r\n }\r\n return result;\r\n }\r\n /**\r\n * Create a path from a an array of curve primitives.\r\n * @param curves array of individual curve primitives.\r\n */\r\n public static createArray(curves: CurvePrimitive[]): Path {\r\n const result = new Path();\r\n for (const curve of curves) {\r\n result.children.push(curve);\r\n }\r\n return result;\r\n }\r\n /** Return a deep copy, with leaf-level curve primitives stroked. */\r\n public cloneStroked(options?: StrokeOptions): AnyCurve {\r\n const strokes = LineString3d.create();\r\n for (const curve of this.children)\r\n curve.emitStrokes(strokes, options);\r\n return Path.create(strokes);\r\n }\r\n /** Return the boundary type (1) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 1;\r\n }\r\n /** Clone as a new `Path` with no primitives */\r\n public cloneEmptyPeer(): Path {\r\n return new Path();\r\n }\r\n /** Second step of double dispatch: call `handler.handlePath(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handlePath(this);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Path.js","sourceRoot":"","sources":["../../../src/curve/Path.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,E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,CAAC,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,oEAAoE;IAC7D,YAAY,CAAC,OAAuB;QACzC,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;QACtC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;YAC/B,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IACD,gFAAgF;IACzE,eAAe;QACpB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,+CAA+C;IACxC,cAAc;QACnB,OAAO,IAAI,IAAI,EAAE,CAAC;IACpB,CAAC;IACD,sEAAsE;IAC/D,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { CurveChain } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * * A `Path` object is a collection of curves that join head-to-tail to form a path.\r\n * * A `Path` object does not bound a planar region. Use `Loop` to indicate region bounding.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class Path extends CurveChain {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"path\";\r\n /** Test if `other` is an instance of `Path` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof Path;\r\n }\r\n /** Invoke `processor.announcePath(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announcePath(this, indexInParent);\r\n }\r\n /** Construct an empty path. */\r\n public constructor() {\r\n super();\r\n }\r\n /**\r\n * Create a path from a variable length list of curve primitives\r\n * * CurvePrimitive params are captured.\r\n * @param curves variable length list of individual curve primitives or point arrays.\r\n */\r\n public static create(...curves: Array<CurvePrimitive | Point3d[]>): Path {\r\n const result = new Path();\r\n for (const curve of curves) {\r\n if (curve instanceof CurvePrimitive)\r\n result.children.push(curve);\r\n else if (Array.isArray(curve) && curve.length > 0 && curve[0] instanceof Point3d) {\r\n result.children.push(LineString3d.create(curve));\r\n }\r\n }\r\n return result;\r\n }\r\n /**\r\n * Create a path from a an array of curve primitives.\r\n * @param curves array of individual curve primitives.\r\n */\r\n public static createArray(curves: CurvePrimitive[]): Path {\r\n const result = new Path();\r\n for (const curve of curves) {\r\n result.children.push(curve);\r\n }\r\n return result;\r\n }\r\n /** Return a deep copy, with leaf-level curve primitives stroked. */\r\n public cloneStroked(options?: StrokeOptions): Path {\r\n const strokes = LineString3d.create();\r\n for (const curve of this.children)\r\n curve.emitStrokes(strokes, options);\r\n return Path.create(strokes);\r\n }\r\n /** Return the boundary type (1) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 1;\r\n }\r\n /** Clone as a new `Path` with no primitives */\r\n public cloneEmptyPeer(): Path {\r\n return new Path();\r\n }\r\n /** Second step of double dispatch: call `handler.handlePath(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handlePath(this);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UnionRegion.js","sourceRoot":"","sources":["../../../src/curve/UnionRegion.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AAC;YACxE,IAAI,YAAY;gBACd,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACrC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,qCAAqC;IAC9B,cAAc;QACnB,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;IACD;;;OAGG;IACI,WAAW,CAAC,KAAe;QAChC,IAAI,KAAK,IAAI,KAAK,YAAY,YAAY,IAAI,KAAK,YAAY,IAAI,EAAE;YACnE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,0CAA0C;IACnC,QAAQ,CAAC,CAAS;QACvB,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IACvE,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { AnyCurve } from \"./CurveChain\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { Loop } from \"./Loop\";\r\nimport { ParityRegion } from \"./ParityRegion\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * * A `UnionRegion` is a collection of other planar region types -- `Loop` and `ParityRegion`.\r\n * * The composite is the union of the contained regions.\r\n * * A point is \"in\" the composite if it is \"in\" one or more of the contained regions.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class UnionRegion extends CurveCollection {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"unionRegion\";\r\n /** Test if `other` is a `UnionRegion` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof UnionRegion;\r\n }\r\n /** Collection of Loop and ParityRegion children. */\r\n protected _children: Array<ParityRegion | Loop>;\r\n /** Return the array of regions */\r\n public override get children(): Array<ParityRegion | Loop> {\r\n return this._children;\r\n }\r\n /** Constructor -- initialize with no children */\r\n public constructor() {\r\n super();\r\n this._children = [];\r\n }\r\n /** Create a `UnionRegion` with given region children */\r\n public static create(...data: Array<ParityRegion | Loop>): UnionRegion {\r\n const result = new UnionRegion();\r\n for (const child of data) {\r\n result.tryAddChild(child);\r\n }\r\n return result;\r\n }\r\n /** Return the boundary type (5) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 5;\r\n }\r\n /** Dispatch to more strongly typed `processor.announceUnionRegion(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceUnionRegion(this, indexInParent);\r\n }\r\n /** Return structural clone with stroked primitives. */\r\n public cloneStroked(options?: StrokeOptions): UnionRegion {\r\n const clone = new UnionRegion();\r\n let child;\r\n for (child of this._children) {\r\n const childStrokes = child.cloneStroked(options) as ParityRegion | Loop;\r\n if (childStrokes)\r\n clone.children.push(childStrokes);\r\n }\r\n return clone;\r\n }\r\n /** Return new empty `UnionRegion` */\r\n public cloneEmptyPeer(): UnionRegion {\r\n return new UnionRegion();\r\n }\r\n /**\r\n * Try to add a child.\r\n * * Returns false if the `AnyCurve` child is not a region type.\r\n */\r\n public tryAddChild(child: AnyCurve): boolean {\r\n if (child && child instanceof ParityRegion || child instanceof Loop) {\r\n this._children.push(child);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Return a child identified by index. */\r\n public getChild(i: number): Loop | ParityRegion | undefined {\r\n if (i < this._children.length)\r\n return this._children[i];\r\n return undefined;\r\n }\r\n /** Second step of double dispatch: call `handler.handleUnionRegion(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleUnionRegion(this);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"UnionRegion.js","sourceRoot":"","sources":["../../../src/curve/UnionRegion.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;;;GAMG;AACH,MAAM,OAAO,WAAY,SAAQ,eAAe;IAG9C,yCAAyC;IAClC,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,WAAW,CAAC;IACtC,CAAC;IAGD,kCAAkC;IAClC,IAAoB,QAAQ;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACD,iDAAiD;IACjD;QACE,KAAK,EAAE,CAAC;QAdV,wCAAwC;QACxB,wBAAmB,GAAG,aAAa,CAAC;QAclD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACtB,CAAC;IACD,wDAAwD;IACjD,MAAM,CAAC,MAAM,CAAC,GAAG,IAAgC;QACtD,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QACjC,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE;YACxB,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SAC3B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,+EAA+E;IACxE,eAAe;QACpB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,2FAA2F;IACpF,wBAAwB,CAAC,SAAkC,EAAE,gBAAwB,CAAC,CAAC;QAC5F,OAAO,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC5D,CAAC;IACD,uDAAuD;IAChD,YAAY,CAAC,OAAuB;QACzC,MAAM,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,IAAI,KAAK,CAAC;QACV,KAAK,KAAK,IAAI,IAAI,CAAC,SAAS,EAAE;YAC5B,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACjD,IAAI,YAAY;gBACd,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACrC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,qCAAqC;IAC9B,cAAc;QACnB,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;IACD;;;OAGG;IACI,WAAW,CAAC,KAAe;QAChC,IAAI,KAAK,IAAI,KAAK,YAAY,YAAY,IAAI,KAAK,YAAY,IAAI,EAAE;YACnE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,0CAA0C;IACnC,QAAQ,CAAC,CAAS;QACvB,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IACvE,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { AnyCurve } from \"./CurveChain\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { Loop } from \"./Loop\";\r\nimport { ParityRegion } from \"./ParityRegion\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * * A `UnionRegion` is a collection of other planar region types -- `Loop` and `ParityRegion`.\r\n * * The composite is the union of the contained regions.\r\n * * A point is \"in\" the composite if it is \"in\" one or more of the contained regions.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class UnionRegion extends CurveCollection {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"unionRegion\";\r\n /** Test if `other` is a `UnionRegion` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof UnionRegion;\r\n }\r\n /** Collection of Loop and ParityRegion children. */\r\n protected _children: Array<ParityRegion | Loop>;\r\n /** Return the array of regions */\r\n public override get children(): Array<ParityRegion | Loop> {\r\n return this._children;\r\n }\r\n /** Constructor -- initialize with no children */\r\n public constructor() {\r\n super();\r\n this._children = [];\r\n }\r\n /** Create a `UnionRegion` with given region children */\r\n public static create(...data: Array<ParityRegion | Loop>): UnionRegion {\r\n const result = new UnionRegion();\r\n for (const child of data) {\r\n result.tryAddChild(child);\r\n }\r\n return result;\r\n }\r\n /** Return the boundary type (5) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 5;\r\n }\r\n /** Dispatch to more strongly typed `processor.announceUnionRegion(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceUnionRegion(this, indexInParent);\r\n }\r\n /** Return structural clone with stroked primitives. */\r\n public cloneStroked(options?: StrokeOptions): UnionRegion {\r\n const clone = new UnionRegion();\r\n let child;\r\n for (child of this._children) {\r\n const childStrokes = child.cloneStroked(options);\r\n if (childStrokes)\r\n clone.children.push(childStrokes);\r\n }\r\n return clone;\r\n }\r\n /** Return new empty `UnionRegion` */\r\n public cloneEmptyPeer(): UnionRegion {\r\n return new UnionRegion();\r\n }\r\n /**\r\n * Try to add a child.\r\n * * Returns false if the `AnyCurve` child is not a region type.\r\n */\r\n public tryAddChild(child: AnyCurve): boolean {\r\n if (child && child instanceof ParityRegion || child instanceof Loop) {\r\n this._children.push(child);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Return a child identified by index. */\r\n public getChild(i: number): Loop | ParityRegion | undefined {\r\n if (i < this._children.length)\r\n return this._children[i];\r\n return undefined;\r\n }\r\n /** Second step of double dispatch: call `handler.handleUnionRegion(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleUnionRegion(this);\r\n }\r\n}\r\n"]}
@@ -66,13 +66,21 @@ export declare class GrowableXYArray extends IndexedXYCollection {
66
66
  */
67
67
  clone(): GrowableXYArray;
68
68
  /** Create an array populated from
69
- * * An array of Point2d
70
- * * An array of Point3d (hidden as XAndY)
71
- * * An array of objects with keyed values, et `{x:1, y:1}`
72
- * * A `GrowableXYZArray`
69
+ * Valid inputs are:
70
+ * * Point2d
71
+ * * Point3d
72
+ * * An array of 2 doubles
73
+ * * An array of 3 doubles
74
+ * * A GrowableXYZArray
75
+ * * A GrowableXYArray
76
+ * * Any json object satisfying Point3d.isXAndY
77
+ * * A Float64Array of doubles, interpreted as xyxy
78
+ * * An array of any of the above
79
+ */
80
+ static create(data: any, result?: GrowableXYArray): GrowableXYArray;
81
+ /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray
82
+ * @deprecated in 4.x. Moved to GrowableXYZArray class.
73
83
  */
74
- static create(data: XAndY[] | GrowableXYZArray): GrowableXYArray;
75
- /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray */
76
84
  static createArrayOfGrowableXYZArray(data: MultiLineStringDataVariant): GrowableXYZArray[] | undefined;
77
85
  /** push a point to the end of the array */
78
86
  push(toPush: XAndY): void;
@@ -80,6 +88,18 @@ export declare class GrowableXYArray extends IndexedXYCollection {
80
88
  pushAll(points: XAndY[]): void;
81
89
  /** push all points of an array */
82
90
  pushAllXYAndZ(points: XYAndZ[] | GrowableXYZArray): void;
91
+ /** Push points from variant sources.
92
+ * Valid inputs are:
93
+ * * Point2d
94
+ * * Point3d
95
+ * * An array of 2 doubles
96
+ * * A GrowableXYArray
97
+ * * A GrowableXYZArray
98
+ * * Any json object satisfying Point3d.isXAndY
99
+ * * A Float64Array of doubles, interpreted as xyxy
100
+ * * An array of any of the above
101
+ */
102
+ pushFrom(p: any): void;
83
103
  /**
84
104
  * Replicate numWrap xy values from the front of the array as new values at the end.
85
105
  * @param numWrap number of xy values to replicate
@@ -1 +1 @@
1
- {"version":3,"file":"GrowableXYArray.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/GrowableXYArray.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE3C;;GAEG;AACH,qBAAa,eAAgB,SAAQ,mBAAmB;IACtD;;OAEG;IACH,OAAO,CAAC,KAAK,CAAe;IAC5B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAS;IAC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,+BAA+B;IACxB,aAAa,CAAC,KAAK,EAAE,eAAe,EAAE,SAAS,GAAE,MAAqC,GAAG,OAAO;CAYxG"}
@@ -10,7 +10,6 @@ import { GrowableXYZArray } from "./GrowableXYZArray";
10
10
  import { IndexedXYCollection } from "./IndexedXYCollection";
11
11
  import { Point2d, Vector2d } from "./Point2dVector2d";
12
12
  import { Point3d } from "./Point3dVector3d";
13
- import { PointStreamGrowableXYZArrayCollector, VariantPointDataStream } from "./PointStreaming";
14
13
  /** `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.
15
14
  * @public
16
15
  */
@@ -105,26 +104,33 @@ export class GrowableXYArray extends IndexedXYCollection {
105
104
  return newPoints;
106
105
  }
107
106
  /** Create an array populated from
108
- * * An array of Point2d
109
- * * An array of Point3d (hidden as XAndY)
110
- * * An array of objects with keyed values, et `{x:1, y:1}`
111
- * * A `GrowableXYZArray`
107
+ * Valid inputs are:
108
+ * * Point2d
109
+ * * Point3d
110
+ * * An array of 2 doubles
111
+ * * An array of 3 doubles
112
+ * * A GrowableXYZArray
113
+ * * A GrowableXYArray
114
+ * * Any json object satisfying Point3d.isXAndY
115
+ * * A Float64Array of doubles, interpreted as xyxy
116
+ * * An array of any of the above
112
117
  */
113
- static create(data) {
114
- const newPoints = new GrowableXYArray(data.length);
115
- if (data instanceof GrowableXYZArray) {
116
- newPoints.pushAllXYAndZ(data);
118
+ static create(data, result) {
119
+ if (result) {
120
+ result.clear();
117
121
  }
118
122
  else {
119
- newPoints.pushAll(data);
123
+ const pointCount = typeof data[0] === "number" ? data.length / 2 : data.length;
124
+ result = new GrowableXYArray(pointCount);
120
125
  }
121
- return newPoints;
126
+ result.pushFrom(data);
127
+ return result;
122
128
  }
123
- /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray */
129
+ /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray
130
+ * @deprecated in 4.x. Moved to GrowableXYZArray class.
131
+ */
124
132
  static createArrayOfGrowableXYZArray(data) {
125
- const collector = new PointStreamGrowableXYZArrayCollector();
126
- VariantPointDataStream.streamXYZ(data, collector);
127
- return collector.claimArrayOfGrowableXYZArray();
133
+ return GrowableXYZArray.createArrayOfGrowableXYZArray(data);
128
134
  }
129
135
  /** push a point to the end of the array */
130
136
  push(toPush) {
@@ -150,6 +156,51 @@ export class GrowableXYArray extends IndexedXYCollection {
150
156
  this.pushXY(p.x, p.y);
151
157
  }
152
158
  }
159
+ /** Push points from variant sources.
160
+ * Valid inputs are:
161
+ * * Point2d
162
+ * * Point3d
163
+ * * An array of 2 doubles
164
+ * * A GrowableXYArray
165
+ * * A GrowableXYZArray
166
+ * * Any json object satisfying Point3d.isXAndY
167
+ * * A Float64Array of doubles, interpreted as xyxy
168
+ * * An array of any of the above
169
+ */
170
+ pushFrom(p) {
171
+ if (p instanceof Point3d) {
172
+ this.pushXY(p.x, p.y);
173
+ }
174
+ else if (p instanceof GrowableXYZArray) {
175
+ this.pushAllXYAndZ(p);
176
+ }
177
+ else if (p instanceof Point2d) {
178
+ this.pushXY(p.x, p.y);
179
+ }
180
+ else if (Geometry.isNumberArray(p, 3) || p instanceof Float64Array) {
181
+ const xyToAdd = Math.trunc(p.length / 2);
182
+ this.ensureCapacity(this._xyInUse + xyToAdd, false);
183
+ this.copyData(p, xyToAdd, this._xyInUse);
184
+ this._xyInUse += xyToAdd;
185
+ }
186
+ else if (Geometry.isNumberArray(p, 2)) {
187
+ this.pushXY(p[0], p[1]);
188
+ }
189
+ else if (Array.isArray(p)) {
190
+ // direct recursion re-wraps p and goes infinite. Unroll here.
191
+ for (const q of p)
192
+ this.pushFrom(q);
193
+ }
194
+ else if (Point3d.isXAndY(p)) {
195
+ this.pushXY(p.x, p.y);
196
+ }
197
+ else if (p instanceof IndexedXYCollection) {
198
+ const n = p.length;
199
+ this.ensureCapacity(this._xyInUse + n, false);
200
+ for (let i = 0; i < n; i++)
201
+ this.pushXY(p.getXAtUncheckedPointIndex(i), p.getYAtUncheckedPointIndex(i));
202
+ }
203
+ }
153
204
  /**
154
205
  * Replicate numWrap xy values from the front of the array as new values at the end.
155
206
  * @param numWrap number of xy values to replicate