@itwin/core-geometry 4.4.0-dev.25 → 4.4.0-dev.26
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.
- package/lib/cjs/curve/Loop.js +1 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +35 -3
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +101 -2
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/curve/Loop.js +1 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +35 -3
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +101 -2
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { HalfEdge, HalfEdgeGraph, HalfEdgeMask, HalfEdgeToBooleanFunction, NodeToNumberFunction } from "./Graph";
|
|
2
2
|
import { SignedDataSummary } from "./SignedDataSummary";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Interface for an object that executes boolean tests on edges.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
4
7
|
export interface HalfEdgeTestObject {
|
|
5
8
|
testEdge(h: HalfEdge): boolean;
|
|
6
9
|
}
|
|
7
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Class to test match of half edge mask.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
8
14
|
export declare class HalfEdgeMaskTester {
|
|
9
15
|
private _targetMask;
|
|
10
16
|
private _targetValue;
|
|
@@ -17,7 +23,10 @@ export declare class HalfEdgeMaskTester {
|
|
|
17
23
|
/** Return true if the value of the targetMask matches the targetValue. */
|
|
18
24
|
testEdge(edge: HalfEdge): boolean;
|
|
19
25
|
}
|
|
20
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Class for different types of searches for HalfEdgeGraph.
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
21
30
|
export declare class HalfEdgeGraphSearch {
|
|
22
31
|
/**
|
|
23
32
|
* Static method for face area computation -- useful as function parameter in `collectFaceAreaSummary`.
|
|
@@ -98,6 +107,29 @@ export declare class HalfEdgeGraphSearch {
|
|
|
98
107
|
* of the component. In other words, entry [i][j] is a HalfEdge in the j_th face loop of the i_th component.
|
|
99
108
|
*/
|
|
100
109
|
static collectConnectedComponentsWithExteriorParityMasks(graph: HalfEdgeGraph, parityEdgeTester: HalfEdgeTestObject | undefined, parityMask?: HalfEdgeMask): HalfEdge[][];
|
|
110
|
+
/**
|
|
111
|
+
* Breadth First Search through connected component of a graph.
|
|
112
|
+
* @param component vector of nodes, one per face.
|
|
113
|
+
* @param seed seed node in component.
|
|
114
|
+
* @param visitMask mask to apply to visited nodes. Assumed cleared throughout component.
|
|
115
|
+
* @param ignoreMask (optional) mask preset on faces to ignore. Default value is `HalfEdgeMask.EXTERIOR` to
|
|
116
|
+
* ignore exterior faces. Pass `HalfEdgeMask.NULL_MASK` to process all faces.
|
|
117
|
+
* @param maxFaceCount (optional) maximum number of faces in the component. Should be positive; otherwise
|
|
118
|
+
* `Infinity` is used.
|
|
119
|
+
* @returns node at which to start next component if maximum face count exceeded, or undefined.
|
|
120
|
+
*/
|
|
121
|
+
private static exploreComponent;
|
|
122
|
+
/**
|
|
123
|
+
* Collect connected components of the graph (via Breadth First Search).
|
|
124
|
+
* @param graph graph to inspect.
|
|
125
|
+
* @param maxFaceCount (optional) maximum number of faces in each component. Should be positive; otherwise
|
|
126
|
+
* `Infinity` is used.
|
|
127
|
+
* @param ignoreMask (optional) mask preset on faces to ignore. Default value is `HalfEdgeMask.EXTERIOR` to ignore
|
|
128
|
+
* exterior faces. Pass `HalfEdgeMask.NULL_MASK` to process all faces.
|
|
129
|
+
* @returns the components of the graph, each component represented by an array of nodes, one node per face
|
|
130
|
+
* of the component. In other words, entry [i][j] is a HalfEdge in the j_th face loop of the i_th component.
|
|
131
|
+
*/
|
|
132
|
+
static collectConnectedComponents(graph: HalfEdgeGraph, maxFaceCount?: number, ignoreMask?: HalfEdgeMask): HalfEdge[][];
|
|
101
133
|
/**
|
|
102
134
|
* Test if test point (xTest,yTest) is inside/outside a face or on an edge.
|
|
103
135
|
* @param seedNode any node on the face loop.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HalfEdgeGraphSearch.d.ts","sourceRoot":"","sources":["../../../src/topology/HalfEdgeGraphSearch.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"HalfEdgeGraphSearch.d.ts","sourceRoot":"","sources":["../../../src/topology/HalfEdgeGraphSearch.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,yBAAyB,EAAgB,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/H,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAKxD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAChC;AACD;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,YAAY,CAAU;IAC9B;;;;OAIG;gBACgB,IAAI,EAAE,YAAY,EAAE,WAAW,GAAE,OAAc;IAIlE,0EAA0E;IACnE,QAAQ,CAAC,IAAI,EAAE,QAAQ,GA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,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IA2BrG;;;;;;;;OAQG;WACW,mCAAmC,CAC/C,IAAI,EAAE,QAAQ,EACd,SAAS,EAAE,YAAY,EACvB,cAAc,EAAE,yBAAyB,EACzC,sBAAsB,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GAChE,IAAI;IAoBP;;;;;;;;;OASG;WACW,mCAAmC,CAAC,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,GAAG,QAAQ,EAAE,EAAE;CAkBlH"}
|
|
@@ -12,7 +12,10 @@ const Range_1 = require("../geometry3d/Range");
|
|
|
12
12
|
const Graph_1 = require("./Graph");
|
|
13
13
|
const SignedDataSummary_1 = require("./SignedDataSummary");
|
|
14
14
|
const XYParitySearchContext_1 = require("./XYParitySearchContext");
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Class to test match of half edge mask.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
16
19
|
class HalfEdgeMaskTester {
|
|
17
20
|
/**
|
|
18
21
|
* Constructor
|
|
@@ -29,7 +32,10 @@ class HalfEdgeMaskTester {
|
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
exports.HalfEdgeMaskTester = HalfEdgeMaskTester;
|
|
32
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Class for different types of searches for HalfEdgeGraph.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
33
39
|
class HalfEdgeGraphSearch {
|
|
34
40
|
/**
|
|
35
41
|
* Static method for face area computation -- useful as function parameter in `collectFaceAreaSummary`.
|
|
@@ -221,6 +227,99 @@ class HalfEdgeGraphSearch {
|
|
|
221
227
|
HalfEdgeGraphSearch.correctParityInComponentArrays(parityMask, components);
|
|
222
228
|
return components;
|
|
223
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Breadth First Search through connected component of a graph.
|
|
232
|
+
* @param component vector of nodes, one per face.
|
|
233
|
+
* @param seed seed node in component.
|
|
234
|
+
* @param visitMask mask to apply to visited nodes. Assumed cleared throughout component.
|
|
235
|
+
* @param ignoreMask (optional) mask preset on faces to ignore. Default value is `HalfEdgeMask.EXTERIOR` to
|
|
236
|
+
* ignore exterior faces. Pass `HalfEdgeMask.NULL_MASK` to process all faces.
|
|
237
|
+
* @param maxFaceCount (optional) maximum number of faces in the component. Should be positive; otherwise
|
|
238
|
+
* `Infinity` is used.
|
|
239
|
+
* @returns node at which to start next component if maximum face count exceeded, or undefined.
|
|
240
|
+
*/
|
|
241
|
+
static exploreComponent(component, seed, visitMask, ignoreMask = Graph_1.HalfEdgeMask.EXTERIOR, maxFaceCount = Infinity) {
|
|
242
|
+
if (maxFaceCount <= 0)
|
|
243
|
+
maxFaceCount = Infinity;
|
|
244
|
+
const boundaryMask = visitMask | ignoreMask;
|
|
245
|
+
let numFaces = 0;
|
|
246
|
+
const candidates = []; // the queue
|
|
247
|
+
candidates.push(seed);
|
|
248
|
+
while (candidates.length !== 0 && numFaces < maxFaceCount) {
|
|
249
|
+
// shift is O(n) and may be inefficient for large queues; if needed, we can replace
|
|
250
|
+
// queue by circular array or implement the queue using 2 stacks; both are O(1)
|
|
251
|
+
const node = candidates.shift();
|
|
252
|
+
if (node.isMaskSet(boundaryMask))
|
|
253
|
+
continue;
|
|
254
|
+
component.push(node);
|
|
255
|
+
++numFaces;
|
|
256
|
+
const enqueueNeighboringFaces = (heNode) => {
|
|
257
|
+
heNode.setMask(visitMask);
|
|
258
|
+
const neighbor = heNode.vertexSuccessor;
|
|
259
|
+
if (!neighbor.isMaskSet(boundaryMask))
|
|
260
|
+
candidates.push(neighbor);
|
|
261
|
+
};
|
|
262
|
+
node.collectAroundFace(enqueueNeighboringFaces);
|
|
263
|
+
}
|
|
264
|
+
if (candidates.length === 0)
|
|
265
|
+
return undefined;
|
|
266
|
+
else {
|
|
267
|
+
const front = candidates[0];
|
|
268
|
+
while (candidates.length !== 0) {
|
|
269
|
+
// try to find a node at the boundary of both the geometry and previous component
|
|
270
|
+
const node = candidates.shift(); // shift may be inefficient for large queues
|
|
271
|
+
if (node.vertexSuccessor.isMaskSet(ignoreMask))
|
|
272
|
+
return node;
|
|
273
|
+
if (node.edgeMate.isMaskSet(ignoreMask))
|
|
274
|
+
return node;
|
|
275
|
+
}
|
|
276
|
+
return front;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Collect connected components of the graph (via Breadth First Search).
|
|
281
|
+
* @param graph graph to inspect.
|
|
282
|
+
* @param maxFaceCount (optional) maximum number of faces in each component. Should be positive; otherwise
|
|
283
|
+
* `Infinity` is used.
|
|
284
|
+
* @param ignoreMask (optional) mask preset on faces to ignore. Default value is `HalfEdgeMask.EXTERIOR` to ignore
|
|
285
|
+
* exterior faces. Pass `HalfEdgeMask.NULL_MASK` to process all faces.
|
|
286
|
+
* @returns the components of the graph, each component represented by an array of nodes, one node per face
|
|
287
|
+
* of the component. In other words, entry [i][j] is a HalfEdge in the j_th face loop of the i_th component.
|
|
288
|
+
*/
|
|
289
|
+
static collectConnectedComponents(graph, maxFaceCount = Infinity, ignoreMask = Graph_1.HalfEdgeMask.EXTERIOR) {
|
|
290
|
+
const components = [];
|
|
291
|
+
if (graph.countMask(ignoreMask) === 0)
|
|
292
|
+
ignoreMask = Graph_1.HalfEdgeMask.NULL_MASK;
|
|
293
|
+
const visitMask = Graph_1.HalfEdgeMask.VISITED;
|
|
294
|
+
const boundaryMask = visitMask | ignoreMask;
|
|
295
|
+
// Starting with the input node, look ahead for a boundary face. Failing that, return the input node.
|
|
296
|
+
// Starting all floods at the boundary reduces the chance of ending up with a ring-shaped component at the boundary.
|
|
297
|
+
const findNextFloodSeed = (index) => {
|
|
298
|
+
for (let i = index; i < graph.countNodes(); ++i) {
|
|
299
|
+
if (!graph.allHalfEdges[i].isMaskSet(boundaryMask)
|
|
300
|
+
&& graph.allHalfEdges[i].edgeMate.isMaskSet(boundaryMask)) {
|
|
301
|
+
index = i;
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return index;
|
|
306
|
+
};
|
|
307
|
+
for (let i = 0; i < graph.countNodes(); ++i) {
|
|
308
|
+
if (graph.allHalfEdges[i].isMaskSet(boundaryMask))
|
|
309
|
+
continue;
|
|
310
|
+
const i0 = findNextFloodSeed(i);
|
|
311
|
+
let seed = graph.allHalfEdges[i0];
|
|
312
|
+
do { // flood this component
|
|
313
|
+
const component = [];
|
|
314
|
+
seed = HalfEdgeGraphSearch.exploreComponent(component, seed, visitMask, ignoreMask, maxFaceCount);
|
|
315
|
+
if (component.length !== 0)
|
|
316
|
+
components.push(component);
|
|
317
|
+
} while (seed !== undefined);
|
|
318
|
+
if (!graph.allHalfEdges[i].isMaskSet(visitMask))
|
|
319
|
+
--i; // reprocess this node
|
|
320
|
+
}
|
|
321
|
+
return components;
|
|
322
|
+
}
|
|
224
323
|
/**
|
|
225
324
|
* Test if test point (xTest,yTest) is inside/outside a face or on an edge.
|
|
226
325
|
* @param seedNode any node on the face loop.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HalfEdgeGraphSearch.js","sourceRoot":"","sources":["../../../src/topology/HalfEdgeGraphSearch.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,+CAA8C;AAC9C,mCAAiH;AACjH,2DAAwD;AACxD,mEAAgE;AAQhE,6CAA6C;AAC7C,MAAa,kBAAkB;IAG7B;;;;OAIG;IACH,YAAmB,IAAkB,EAAE,cAAuB,IAAI;QAChE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IACD,0EAA0E;IACnE,QAAQ,CAAC,IAAc;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC;IAChE,CAAC;CACF;AAhBD,gD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K,CAAC;IACf,CAAC;CACF;AAhTD,kDAgTC","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 Topology\r\n */\r\nimport { Range1d } from \"../geometry3d/Range\";\r\nimport { HalfEdge, HalfEdgeGraph, HalfEdgeMask, HalfEdgeToBooleanFunction, NodeToNumberFunction } from \"./Graph\";\r\nimport { SignedDataSummary } from \"./SignedDataSummary\";\r\nimport { XYParitySearchContext } from \"./XYParitySearchContext\";\r\n\r\n// cspell:word internaldocs\r\n\r\n/** Interface for an object that executes boolean tests on edges. */\r\nexport interface HalfEdgeTestObject {\r\n testEdge(h: HalfEdge): boolean;\r\n}\r\n/** Class to test match of half edge mask. */\r\nexport class HalfEdgeMaskTester {\r\n private _targetMask: HalfEdgeMask;\r\n private _targetValue: boolean;\r\n /**\r\n * Constructor\r\n * @param mask mask to test in `testEdge` function\r\n * @param targetValue value to match for true return\r\n */\r\n public constructor(mask: HalfEdgeMask, targetValue: boolean = true) {\r\n this._targetMask = mask;\r\n this._targetValue = targetValue;\r\n }\r\n /** Return true if the value of the targetMask matches the targetValue. */\r\n public testEdge(edge: HalfEdge): boolean {\r\n return edge.isMaskSet(this._targetMask) === this._targetValue;\r\n }\r\n}\r\n/** Class for different types of searches for HalfEdgeGraph. */\r\nexport class HalfEdgeGraphSearch {\r\n /**\r\n * Static method for face area computation -- useful as function parameter in `collectFaceAreaSummary`.\r\n * * This simply calls `node.signedFaceArea()`\r\n * @param node instance for signedFaceArea call.\r\n */\r\n public static signedFaceArea(node: HalfEdge): number {\r\n return node.signedFaceArea();\r\n }\r\n /**\r\n * Return a summary of face data (e.g., area) as computed by the callback on the faces of the graph.\r\n * * Callers with curved edge graphs must supply their own area function.\r\n * @param source graph or array of nodes to examine.\r\n * @param collectAllNodes flag to pass to the `SignedDataSummary` constructor to control collection of nodes.\r\n * @param areaFunction function to obtain area (or other numeric value). Default computes polygonal face area.\r\n */\r\n public static collectFaceAreaSummary(\r\n source: HalfEdgeGraph | HalfEdge[],\r\n collectAllNodes: boolean = false,\r\n areaFunction: NodeToNumberFunction = (node) => HalfEdgeGraphSearch.signedFaceArea(node),\r\n ): SignedDataSummary<HalfEdge> {\r\n const result = new SignedDataSummary<HalfEdge>(collectAllNodes);\r\n let allFaces: HalfEdge[];\r\n if (source instanceof HalfEdgeGraph)\r\n allFaces = source.collectFaceLoops();\r\n else\r\n allFaces = source;\r\n for (const node of allFaces) {\r\n const area = areaFunction(node);\r\n result.announceItem(node, area);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Search the graph for the face with the most negative area.\r\n * @param oneCandidateNodePerFace graph or an array containing one node from each face to be considered.\r\n * @returns node on the negative area face with largest absolute area, or `undefined` if no negative area face.\r\n */\r\n public static findMinimumAreaFace(\r\n oneCandidateNodePerFace: HalfEdgeGraph | HalfEdge[], faceAreaFunction?: NodeToNumberFunction,\r\n ): HalfEdge | undefined {\r\n const summary = HalfEdgeGraphSearch.collectFaceAreaSummary(oneCandidateNodePerFace, false, faceAreaFunction);\r\n return summary.largestNegativeItem;\r\n }\r\n /**\r\n * Test if the graph is triangulated.\r\n * * Return `false` if:\r\n * * number of positive area faces with more than 3 edges is larger than `numPositiveExceptionsAllowed`.\r\n * * graph has more than 1 negative area face when `allowMultipleNegativeAreaFaces` is `false`.\r\n * * 2-edge faces are ignored.\r\n */\r\n public static isTriangulatedCCW(\r\n source: HalfEdgeGraph | HalfEdge[],\r\n allowMultipleNegativeAreaFaces: boolean = true,\r\n numPositiveExceptionsAllowed: number = 0,\r\n ): boolean {\r\n let allFaces: HalfEdge[];\r\n if (source instanceof HalfEdgeGraph)\r\n allFaces = source.collectFaceLoops();\r\n else\r\n allFaces = source;\r\n let numNegative = 0;\r\n let numPositiveExceptions = 0;\r\n for (const node of allFaces) {\r\n const numEdges = node.countEdgesAroundFace();\r\n if (numEdges >= 3) {\r\n const area = node.signedFaceArea();\r\n if (area > 0) {\r\n if (numEdges > 3) {\r\n numPositiveExceptions++;\r\n if (numPositiveExceptions > numPositiveExceptionsAllowed)\r\n return false;\r\n }\r\n } else {\r\n numNegative++;\r\n if (numNegative > 1) {\r\n if (!allowMultipleNegativeAreaFaces)\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * Process a face during graph traversal.\r\n * @param faceSeed a node in the face.\r\n * @param mask mask to set on each node of the face.\r\n * @param allNodeStack array appended with each node of the face.\r\n * @param onePerFaceStack array appended with `faceSeed`.\r\n */\r\n private static pushAndMaskAllNodesInFace(\r\n faceSeed: HalfEdge, mask: number, allNodeStack: HalfEdge[], onePerFaceStack: HalfEdge[],\r\n ): void {\r\n onePerFaceStack.push(faceSeed);\r\n faceSeed.collectAroundFace((node: HalfEdge) => {\r\n node.setMask(mask);\r\n allNodeStack.push(node);\r\n });\r\n }\r\n /**\r\n * Traverse (via Depth First Search) to all accessible faces from the given seed.\r\n * @param faceSeed first node to start the traverse.\r\n * @param visitMask mask applied to all faces as visited.\r\n * @param parityEdgeTester function to test if an edge is adjacent to two faces of opposite parity, e.g., a boundary\r\n * edge that separates an \"interior\" face and an \"exterior\" face. If `parityEdgeTester` is not supplied and `parityMask`\r\n * is supplied, the default parity rule is to alternate parity state in a \"bullseye\" pattern starting at the seed face,\r\n * with each successive concentric ring of faces at constant topological distance from the seed face receiving the\r\n * opposite parity state of the previous ring.\r\n * @param parityMask mask to apply to the first face and faces that share the same parity as the first face, as\r\n * determined by the parity rule. If this is `NULL_MASK`, there is no record of parity. If (non-null) parity mask\r\n * is given, on return it is entirely set or entirely clear around each face.\r\n * @returns an array that contains one representative node in each face of the connected component.\r\n */\r\n private static parityFloodFromSeed(\r\n faceSeed: HalfEdge,\r\n visitMask: HalfEdgeMask,\r\n parityEdgeTester: HalfEdgeTestObject | undefined,\r\n parityMask: HalfEdgeMask,\r\n ): HalfEdge[] {\r\n const faces: HalfEdge[] = [];\r\n if (faceSeed.isMaskSet(visitMask))\r\n return faces; // empty array\r\n const allMasks = parityMask | visitMask;\r\n const stack: HalfEdge[] = [];\r\n // the seed face is arbitrarily assigned the parity mask\r\n HalfEdgeGraphSearch.pushAndMaskAllNodesInFace(faceSeed, allMasks, stack, faces);\r\n while (stack.length > 0) {\r\n const p = stack.pop()!;\r\n const mate = p.edgeMate;\r\n if (!mate)\r\n continue;\r\n if (!mate.isMaskSet(visitMask)) {\r\n let newState = p.isMaskSet(parityMask);\r\n if (!parityEdgeTester || parityEdgeTester.testEdge(p))\r\n newState = !newState;\r\n HalfEdgeGraphSearch.pushAndMaskAllNodesInFace(mate, newState ? allMasks : visitMask, stack, faces);\r\n }\r\n }\r\n return faces;\r\n }\r\n /**\r\n * * Correct the parity mask in the faces of a component.\r\n * * It is assumed that the parity mask is applied _consistently_ throughout the supplied faces, but maybe\r\n * not _correctly_.\r\n * * A consistently applied parity mask is \"correct\" if it is set on the negative area (\"exterior\") face of\r\n * a connected component.\r\n * * This method finds a face with negative area and toggles the mask throughout the input faces if this face\r\n * lacks the parity mask.\r\n * * In a properly merged planar subdivision there should be only one true negative area face per component.\r\n */\r\n private static correctParityInSingleComponent(parityMask: HalfEdgeMask, faces: HalfEdge[]): void {\r\n const exteriorHalfEdge = HalfEdgeGraphSearch.findMinimumAreaFace(faces);\r\n if (!exteriorHalfEdge) {\r\n // graph has all degenerate faces; do nothing\r\n } else if (exteriorHalfEdge.isMaskSet(parityMask)) {\r\n // all should be well; nothing to do\r\n } else {\r\n for (const faceSeed of faces) {\r\n if (faceSeed.isMaskSet(parityMask)) {\r\n faceSeed.clearMaskAroundFace(parityMask);\r\n } else {\r\n faceSeed.setMaskAroundFace(parityMask);\r\n }\r\n }\r\n }\r\n }\r\n /** Apply `correctParityInSingleComponent` to each array in components (quick exit if `parityMask` is `NULL_MASK`). */\r\n private static correctParityInComponentArrays(parityMask: HalfEdgeMask, components: HalfEdge[][]): void {\r\n if (parityMask === HalfEdgeMask.NULL_MASK)\r\n return;\r\n for (const facesInComponent of components)\r\n HalfEdgeGraphSearch.correctParityInSingleComponent(parityMask, facesInComponent);\r\n }\r\n /**\r\n * Collect connected components of the graph (via Depth First Search).\r\n * @param graph graph to inspect.\r\n * @param parityEdgeTester (optional) function to test if an edge is adjacent to two faces of opposite parity,\r\n * e.g., a boundary edge that separates an \"interior\" face and an \"exterior\" face. If `parityEdgeTester` is not\r\n * supplied and `parityMask` is supplied, the default parity rule is to alternate parity state in a \"bullseye\"\r\n * pattern starting at the seed face, with each successive concentric ring of faces at constant topological\r\n * distance from the seed face receiving the opposite parity state of the previous ring.\r\n * @param parityMask (optional) mask to apply to the first face and faces that share the same parity as the\r\n * first face, as determined by the parity rule. If this is `NULL_MASK`, there is no record of parity. If\r\n * (non-null) parity mask is given, on return it is entirely set or entirely clear around each face.\r\n * @returns the components of the graph, each component represented by an array of nodes, one node per face\r\n * of the component. In other words, entry [i][j] is a HalfEdge in the j_th face loop of the i_th component.\r\n */\r\n public static collectConnectedComponentsWithExteriorParityMasks(\r\n graph: HalfEdgeGraph,\r\n parityEdgeTester: HalfEdgeTestObject | undefined,\r\n parityMask: HalfEdgeMask = HalfEdgeMask.NULL_MASK,\r\n ): HalfEdge[][] {\r\n // Illustration of the algorithm can be found at geometry/internaldocs/Graph.md\r\n const components = [];\r\n const visitMask = HalfEdgeMask.VISITED;\r\n const allMasks = parityMask | visitMask;\r\n graph.clearMask(allMasks);\r\n for (const faceSeed of graph.allHalfEdges) {\r\n if (!faceSeed.isMaskSet(visitMask)) {\r\n const newFaces = HalfEdgeGraphSearch.parityFloodFromSeed(faceSeed, visitMask, parityEdgeTester, parityMask);\r\n // parityFloodFromSeed does not return an empty array because it is called on an unvisited faceSeed\r\n components.push(newFaces);\r\n }\r\n }\r\n HalfEdgeGraphSearch.correctParityInComponentArrays(parityMask, components);\r\n return components;\r\n }\r\n /**\r\n * Test if test point (xTest,yTest) is inside/outside a face or on an edge.\r\n * @param seedNode any node on the face loop.\r\n * @param xTest x coordinate of the test point.\r\n * @param yTest y coordinate of the test point.\r\n * @returns 0 if ON, 1 if IN, -1 if OUT.\r\n */\r\n public static pointInOrOnFaceXY(seedNode: HalfEdge, xTest: number, yTest: number): number | undefined {\r\n const context = new XYParitySearchContext(xTest, yTest);\r\n // walk around looking for an accepted node to start the search (seedNode is usually ok)\r\n let nodeA = seedNode;\r\n let nodeB = seedNode.faceSuccessor;\r\n for (; ; nodeA = nodeB) {\r\n if (context.tryStartEdge(nodeA.x, nodeA.y, nodeB.x, nodeB.y))\r\n break;\r\n if (nodeB === seedNode) {\r\n // the test point and the face are all on line \"y = yTest\"\r\n const range = Range1d.createXX(nodeB.x, nodeB.faceSuccessor.x);\r\n return range.containsX(xTest) ? 0 : -1;\r\n }\r\n nodeB = nodeA.faceSuccessor;\r\n }\r\n // nodeB is the real start node for search, so stop when we revisit it. For each edge, accumulate parity and hits\r\n let nodeC = nodeB.faceSuccessor;\r\n for (; ;) {\r\n if (!context.advance(nodeC.x, nodeC.y)) {\r\n return context.classifyCounts();\r\n }\r\n if (nodeC === nodeB)\r\n break;\r\n nodeC = nodeC.faceSuccessor;\r\n }\r\n return context.classifyCounts();\r\n }\r\n /**\r\n * Collect boundary edges starting from `seed`.\r\n * * If `seed` is not a boundary node or is already visited, the function exists early.\r\n * @param seed start node.\r\n * @param visitMask mask to set on processed nodes.\r\n * @param isBoundaryEdge function to test if an edge in a boundary edge.\r\n * @param announceEdgeInBoundary callback invoked on each edge in the boundary loop in order. The counter is zero\r\n * for the first edge, and incremented with each successive edge.\r\n */\r\n public static collectExtendedBoundaryLoopFromSeed(\r\n seed: HalfEdge,\r\n visitMask: HalfEdgeMask,\r\n isBoundaryEdge: HalfEdgeToBooleanFunction,\r\n announceEdgeInBoundary: (edge: HalfEdge, counter: number) => void,\r\n ): void {\r\n let counter = 0;\r\n while (!seed.getMask(visitMask) && isBoundaryEdge(seed)) {\r\n announceEdgeInBoundary(seed, counter++);\r\n seed.setMask(visitMask);\r\n const vertexBase = seed.faceSuccessor;\r\n let candidateAroundVertex = vertexBase;\r\n for (; ;) {\r\n if (candidateAroundVertex.getMask(visitMask)) // end of boundary loop\r\n return;\r\n if (isBoundaryEdge(candidateAroundVertex)) {\r\n seed = candidateAroundVertex;\r\n break;\r\n }\r\n candidateAroundVertex = candidateAroundVertex.vertexPredecessor;\r\n if (candidateAroundVertex === vertexBase)\r\n break; // prevent infinite loop in case exteriorMask is not set on the edge mate of the boundary edge\r\n }\r\n }\r\n }\r\n /**\r\n * Collect boundary edges in the graph.\r\n * * A boundary edge is defined by `exteriorMask` being set on only its \"exterior\" edge mate.\r\n * * Each boundary edge is identified in the output by its edge mate that lacks `exteriorMask`.\r\n * * Each inner array is ordered in the output so that its boundary edges form a connected path. If `exteriorMask`\r\n * is preset consistently around each \"exterior\" face, these paths are loops.\r\n * @param graph the graph to query\r\n * @param exteriorMask mask preset on exactly one side of boundary edges\r\n * @returns array of boundary loops, each loop an array of the unmasked mates of boundary edges\r\n */\r\n public static collectExtendedBoundaryLoopsInGraph(graph: HalfEdgeGraph, exteriorMask: HalfEdgeMask): HalfEdge[][] {\r\n // Illustration of the algorithm can be found at geometry/internaldocs/Graph.md\r\n const loops: HalfEdge[][] = [];\r\n const visitMask = graph.grabMask(true);\r\n const isBoundaryEdge = (edge: HalfEdge): boolean => {\r\n return edge.getMask(exteriorMask) === 0 && edge.edgeMate.getMask(exteriorMask) !== 0;\r\n };\r\n const announceEdgeInBoundary = (edge: HalfEdge, counter: number) => {\r\n if (counter === 0)\r\n loops.push([]);\r\n loops[loops.length - 1].push(edge);\r\n };\r\n for (const seed of graph.allHalfEdges) {\r\n this.collectExtendedBoundaryLoopFromSeed(seed, visitMask, isBoundaryEdge, announceEdgeInBoundary);\r\n }\r\n graph.dropMask(visitMask);\r\n return loops;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"HalfEdgeGraphSearch.js","sourceRoot":"","sources":["../../../src/top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EAAE,uBAAuB;oBACnE,OAAO;gBACT,IAAI,cAAc,CAAC,qBAAqB,CAAC,EAAE;oBACzC,IAAI,GAAG,qBAAqB,CAAC;oBAC7B,MAAM;iBACP;gBACD,qBAAqB,GAAG,qBAAqB,CAAC,iBAAiB,CAAC;gBAChE,IAAI,qBAAqB,KAAK,UAAU;oBACtC,MAAM,CAAC,8FAA8F;aACxG;SACF;IACH,CAAC;IACD;;;;;;;;;OASG;IACI,MAAM,CAAC,mCAAmC,CAAC,KAAoB,EAAE,YAA0B;QAChG,+EAA+E;QAC/E,MAAM,KAAK,GAAiB,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,cAAc,GAAG,CAAC,IAAc,EAAW,EAAE;YACjD,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACvF,CAAC,CAAC;QACF,MAAM,sBAAsB,GAAG,CAAC,IAAc,EAAE,OAAe,EAAE,EAAE;YACjE,IAAI,OAAO,KAAK,CAAC;gBACf,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjB,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC,CAAC;QACF,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,YAAY,EAAE;YACrC,IAAI,CAAC,mCAAmC,CAAC,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,sBAAsB,CAAC,CAAC;SACnG;QACD,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAvZD,kDAuZC","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 Topology\r\n */\r\nimport { Range1d } from \"../geometry3d/Range\";\r\nimport { HalfEdge, HalfEdgeGraph, HalfEdgeMask, HalfEdgeToBooleanFunction, NodeFunction, NodeToNumberFunction } from \"./Graph\";\r\nimport { SignedDataSummary } from \"./SignedDataSummary\";\r\nimport { XYParitySearchContext } from \"./XYParitySearchContext\";\r\n\r\n// cspell:word internaldocs\r\n\r\n/**\r\n * Interface for an object that executes boolean tests on edges.\r\n * @internal\r\n */\r\nexport interface HalfEdgeTestObject {\r\n testEdge(h: HalfEdge): boolean;\r\n}\r\n/**\r\n * Class to test match of half edge mask.\r\n * @internal\r\n */\r\nexport class HalfEdgeMaskTester {\r\n private _targetMask: HalfEdgeMask;\r\n private _targetValue: boolean;\r\n /**\r\n * Constructor\r\n * @param mask mask to test in `testEdge` function\r\n * @param targetValue value to match for true return\r\n */\r\n public constructor(mask: HalfEdgeMask, targetValue: boolean = true) {\r\n this._targetMask = mask;\r\n this._targetValue = targetValue;\r\n }\r\n /** Return true if the value of the targetMask matches the targetValue. */\r\n public testEdge(edge: HalfEdge): boolean {\r\n return edge.isMaskSet(this._targetMask) === this._targetValue;\r\n }\r\n}\r\n/**\r\n * Class for different types of searches for HalfEdgeGraph.\r\n * @internal\r\n */\r\nexport class HalfEdgeGraphSearch {\r\n /**\r\n * Static method for face area computation -- useful as function parameter in `collectFaceAreaSummary`.\r\n * * This simply calls `node.signedFaceArea()`\r\n * @param node instance for signedFaceArea call.\r\n */\r\n public static signedFaceArea(node: HalfEdge): number {\r\n return node.signedFaceArea();\r\n }\r\n /**\r\n * Return a summary of face data (e.g., area) as computed by the callback on the faces of the graph.\r\n * * Callers with curved edge graphs must supply their own area function.\r\n * @param source graph or array of nodes to examine.\r\n * @param collectAllNodes flag to pass to the `SignedDataSummary` constructor to control collection of nodes.\r\n * @param areaFunction function to obtain area (or other numeric value). Default computes polygonal face area.\r\n */\r\n public static collectFaceAreaSummary(\r\n source: HalfEdgeGraph | HalfEdge[],\r\n collectAllNodes: boolean = false,\r\n areaFunction: NodeToNumberFunction = (node) => HalfEdgeGraphSearch.signedFaceArea(node),\r\n ): SignedDataSummary<HalfEdge> {\r\n const result = new SignedDataSummary<HalfEdge>(collectAllNodes);\r\n let allFaces: HalfEdge[];\r\n if (source instanceof HalfEdgeGraph)\r\n allFaces = source.collectFaceLoops();\r\n else\r\n allFaces = source;\r\n for (const node of allFaces) {\r\n const area = areaFunction(node);\r\n result.announceItem(node, area);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Search the graph for the face with the most negative area.\r\n * @param oneCandidateNodePerFace graph or an array containing one node from each face to be considered.\r\n * @returns node on the negative area face with largest absolute area, or `undefined` if no negative area face.\r\n */\r\n public static findMinimumAreaFace(\r\n oneCandidateNodePerFace: HalfEdgeGraph | HalfEdge[], faceAreaFunction?: NodeToNumberFunction,\r\n ): HalfEdge | undefined {\r\n const summary = HalfEdgeGraphSearch.collectFaceAreaSummary(oneCandidateNodePerFace, false, faceAreaFunction);\r\n return summary.largestNegativeItem;\r\n }\r\n /**\r\n * Test if the graph is triangulated.\r\n * * Return `false` if:\r\n * * number of positive area faces with more than 3 edges is larger than `numPositiveExceptionsAllowed`.\r\n * * graph has more than 1 negative area face when `allowMultipleNegativeAreaFaces` is `false`.\r\n * * 2-edge faces are ignored.\r\n */\r\n public static isTriangulatedCCW(\r\n source: HalfEdgeGraph | HalfEdge[],\r\n allowMultipleNegativeAreaFaces: boolean = true,\r\n numPositiveExceptionsAllowed: number = 0,\r\n ): boolean {\r\n let allFaces: HalfEdge[];\r\n if (source instanceof HalfEdgeGraph)\r\n allFaces = source.collectFaceLoops();\r\n else\r\n allFaces = source;\r\n let numNegative = 0;\r\n let numPositiveExceptions = 0;\r\n for (const node of allFaces) {\r\n const numEdges = node.countEdgesAroundFace();\r\n if (numEdges >= 3) {\r\n const area = node.signedFaceArea();\r\n if (area > 0) {\r\n if (numEdges > 3) {\r\n numPositiveExceptions++;\r\n if (numPositiveExceptions > numPositiveExceptionsAllowed)\r\n return false;\r\n }\r\n } else {\r\n numNegative++;\r\n if (numNegative > 1) {\r\n if (!allowMultipleNegativeAreaFaces)\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * Process a face during graph traversal.\r\n * @param faceSeed a node in the face.\r\n * @param mask mask to set on each node of the face.\r\n * @param allNodeStack array appended with each node of the face.\r\n * @param onePerFaceStack array appended with `faceSeed`.\r\n */\r\n private static pushAndMaskAllNodesInFace(\r\n faceSeed: HalfEdge, mask: number, allNodeStack: HalfEdge[], onePerFaceStack: HalfEdge[],\r\n ): void {\r\n onePerFaceStack.push(faceSeed);\r\n faceSeed.collectAroundFace((node: HalfEdge) => {\r\n node.setMask(mask);\r\n allNodeStack.push(node);\r\n });\r\n }\r\n /**\r\n * Traverse (via Depth First Search) to all accessible faces from the given seed.\r\n * @param faceSeed first node to start the traverse.\r\n * @param visitMask mask applied to all faces as visited.\r\n * @param parityEdgeTester function to test if an edge is adjacent to two faces of opposite parity, e.g., a boundary\r\n * edge that separates an \"interior\" face and an \"exterior\" face. If `parityEdgeTester` is not supplied and `parityMask`\r\n * is supplied, the default parity rule is to alternate parity state in a \"bullseye\" pattern starting at the seed face,\r\n * with each successive concentric ring of faces at constant topological distance from the seed face receiving the\r\n * opposite parity state of the previous ring.\r\n * @param parityMask mask to apply to the first face and faces that share the same parity as the first face, as\r\n * determined by the parity rule. If this is `NULL_MASK`, there is no record of parity. If (non-null) parity mask\r\n * is given, on return it is entirely set or entirely clear around each face.\r\n * @returns an array that contains one representative node in each face of the connected component.\r\n */\r\n private static parityFloodFromSeed(\r\n faceSeed: HalfEdge,\r\n visitMask: HalfEdgeMask,\r\n parityEdgeTester: HalfEdgeTestObject | undefined,\r\n parityMask: HalfEdgeMask,\r\n ): HalfEdge[] {\r\n const faces: HalfEdge[] = [];\r\n if (faceSeed.isMaskSet(visitMask))\r\n return faces; // empty array\r\n const allMasks = parityMask | visitMask;\r\n const stack: HalfEdge[] = [];\r\n // the seed face is arbitrarily assigned the parity mask\r\n HalfEdgeGraphSearch.pushAndMaskAllNodesInFace(faceSeed, allMasks, stack, faces);\r\n while (stack.length > 0) {\r\n const p = stack.pop()!;\r\n const mate = p.edgeMate;\r\n if (!mate)\r\n continue;\r\n if (!mate.isMaskSet(visitMask)) {\r\n let newState = p.isMaskSet(parityMask);\r\n if (!parityEdgeTester || parityEdgeTester.testEdge(p))\r\n newState = !newState;\r\n HalfEdgeGraphSearch.pushAndMaskAllNodesInFace(mate, newState ? allMasks : visitMask, stack, faces);\r\n }\r\n }\r\n return faces;\r\n }\r\n /**\r\n * * Correct the parity mask in the faces of a component.\r\n * * It is assumed that the parity mask is applied _consistently_ throughout the supplied faces, but maybe\r\n * not _correctly_.\r\n * * A consistently applied parity mask is \"correct\" if it is set on the negative area (\"exterior\") face of\r\n * a connected component.\r\n * * This method finds a face with negative area and toggles the mask throughout the input faces if this face\r\n * lacks the parity mask.\r\n * * In a properly merged planar subdivision there should be only one true negative area face per component.\r\n */\r\n private static correctParityInSingleComponent(parityMask: HalfEdgeMask, faces: HalfEdge[]): void {\r\n const exteriorHalfEdge = HalfEdgeGraphSearch.findMinimumAreaFace(faces);\r\n if (!exteriorHalfEdge) {\r\n // graph has all degenerate faces; do nothing\r\n } else if (exteriorHalfEdge.isMaskSet(parityMask)) {\r\n // all should be well; nothing to do\r\n } else {\r\n for (const faceSeed of faces) {\r\n if (faceSeed.isMaskSet(parityMask)) {\r\n faceSeed.clearMaskAroundFace(parityMask);\r\n } else {\r\n faceSeed.setMaskAroundFace(parityMask);\r\n }\r\n }\r\n }\r\n }\r\n /** Apply `correctParityInSingleComponent` to each array in components (quick exit if `parityMask` is `NULL_MASK`). */\r\n private static correctParityInComponentArrays(parityMask: HalfEdgeMask, components: HalfEdge[][]): void {\r\n if (parityMask === HalfEdgeMask.NULL_MASK)\r\n return;\r\n for (const facesInComponent of components)\r\n HalfEdgeGraphSearch.correctParityInSingleComponent(parityMask, facesInComponent);\r\n }\r\n /**\r\n * Collect connected components of the graph (via Depth First Search).\r\n * @param graph graph to inspect.\r\n * @param parityEdgeTester (optional) function to test if an edge is adjacent to two faces of opposite parity,\r\n * e.g., a boundary edge that separates an \"interior\" face and an \"exterior\" face. If `parityEdgeTester` is not\r\n * supplied and `parityMask` is supplied, the default parity rule is to alternate parity state in a \"bullseye\"\r\n * pattern starting at the seed face, with each successive concentric ring of faces at constant topological\r\n * distance from the seed face receiving the opposite parity state of the previous ring.\r\n * @param parityMask (optional) mask to apply to the first face and faces that share the same parity as the\r\n * first face, as determined by the parity rule. If this is `NULL_MASK`, there is no record of parity. If\r\n * (non-null) parity mask is given, on return it is entirely set or entirely clear around each face.\r\n * @returns the components of the graph, each component represented by an array of nodes, one node per face\r\n * of the component. In other words, entry [i][j] is a HalfEdge in the j_th face loop of the i_th component.\r\n */\r\n public static collectConnectedComponentsWithExteriorParityMasks(\r\n graph: HalfEdgeGraph,\r\n parityEdgeTester: HalfEdgeTestObject | undefined,\r\n parityMask: HalfEdgeMask = HalfEdgeMask.NULL_MASK,\r\n ): HalfEdge[][] {\r\n // Illustration of the algorithm can be found at geometry/internaldocs/Graph.md\r\n const components = [];\r\n const visitMask = HalfEdgeMask.VISITED;\r\n const allMasks = parityMask | visitMask;\r\n graph.clearMask(allMasks);\r\n for (const faceSeed of graph.allHalfEdges) {\r\n if (!faceSeed.isMaskSet(visitMask)) {\r\n const newFaces = HalfEdgeGraphSearch.parityFloodFromSeed(faceSeed, visitMask, parityEdgeTester, parityMask);\r\n // parityFloodFromSeed does not return an empty array because it is called on an unvisited faceSeed\r\n components.push(newFaces);\r\n }\r\n }\r\n HalfEdgeGraphSearch.correctParityInComponentArrays(parityMask, components);\r\n return components;\r\n }\r\n /**\r\n * Breadth First Search through connected component of a graph.\r\n * @param component vector of nodes, one per face.\r\n * @param seed seed node in component.\r\n * @param visitMask mask to apply to visited nodes. Assumed cleared throughout component.\r\n * @param ignoreMask (optional) mask preset on faces to ignore. Default value is `HalfEdgeMask.EXTERIOR` to\r\n * ignore exterior faces. Pass `HalfEdgeMask.NULL_MASK` to process all faces.\r\n * @param maxFaceCount (optional) maximum number of faces in the component. Should be positive; otherwise\r\n * `Infinity` is used.\r\n * @returns node at which to start next component if maximum face count exceeded, or undefined.\r\n */\r\n private static exploreComponent(\r\n component: HalfEdge[],\r\n seed: HalfEdge,\r\n visitMask: HalfEdgeMask,\r\n ignoreMask: HalfEdgeMask = HalfEdgeMask.EXTERIOR,\r\n maxFaceCount: number = Infinity,\r\n ): HalfEdge | undefined {\r\n if (maxFaceCount <= 0)\r\n maxFaceCount = Infinity;\r\n const boundaryMask: HalfEdgeMask = visitMask | ignoreMask;\r\n let numFaces = 0;\r\n const candidates: HalfEdge[] = []; // the queue\r\n candidates.push(seed);\r\n while (candidates.length !== 0 && numFaces < maxFaceCount) {\r\n // shift is O(n) and may be inefficient for large queues; if needed, we can replace\r\n // queue by circular array or implement the queue using 2 stacks; both are O(1)\r\n const node = candidates.shift()!;\r\n if (node.isMaskSet(boundaryMask))\r\n continue;\r\n component.push(node);\r\n ++numFaces;\r\n const enqueueNeighboringFaces: NodeFunction = (heNode: HalfEdge) => {\r\n heNode.setMask(visitMask);\r\n const neighbor = heNode.vertexSuccessor;\r\n if (!neighbor.isMaskSet(boundaryMask))\r\n candidates.push(neighbor);\r\n };\r\n node.collectAroundFace(enqueueNeighboringFaces);\r\n }\r\n if (candidates.length === 0)\r\n return undefined;\r\n else {\r\n const front = candidates[0];\r\n while (candidates.length !== 0) {\r\n // try to find a node at the boundary of both the geometry and previous component\r\n const node = candidates.shift()!; // shift may be inefficient for large queues\r\n if (node.vertexSuccessor.isMaskSet(ignoreMask))\r\n return node;\r\n if (node.edgeMate.isMaskSet(ignoreMask))\r\n return node;\r\n }\r\n return front;\r\n }\r\n }\r\n /**\r\n * Collect connected components of the graph (via Breadth First Search).\r\n * @param graph graph to inspect.\r\n * @param maxFaceCount (optional) maximum number of faces in each component. Should be positive; otherwise\r\n * `Infinity` is used.\r\n * @param ignoreMask (optional) mask preset on faces to ignore. Default value is `HalfEdgeMask.EXTERIOR` to ignore\r\n * exterior faces. Pass `HalfEdgeMask.NULL_MASK` to process all faces.\r\n * @returns the components of the graph, each component represented by an array of nodes, one node per face\r\n * of the component. In other words, entry [i][j] is a HalfEdge in the j_th face loop of the i_th component.\r\n */\r\n public static collectConnectedComponents(\r\n graph: HalfEdgeGraph,\r\n maxFaceCount: number = Infinity,\r\n ignoreMask: HalfEdgeMask = HalfEdgeMask.EXTERIOR,\r\n ): HalfEdge[][] {\r\n const components: HalfEdge[][] = [];\r\n if (graph.countMask(ignoreMask) === 0)\r\n ignoreMask = HalfEdgeMask.NULL_MASK;\r\n const visitMask = HalfEdgeMask.VISITED;\r\n const boundaryMask: HalfEdgeMask = visitMask | ignoreMask;\r\n // Starting with the input node, look ahead for a boundary face. Failing that, return the input node.\r\n // Starting all floods at the boundary reduces the chance of ending up with a ring-shaped component at the boundary.\r\n const findNextFloodSeed = (index: number) => {\r\n for (let i = index; i < graph.countNodes(); ++i) {\r\n if (!graph.allHalfEdges[i].isMaskSet(boundaryMask)\r\n && graph.allHalfEdges[i].edgeMate.isMaskSet(boundaryMask)) {\r\n index = i;\r\n break;\r\n }\r\n }\r\n return index;\r\n };\r\n for (let i = 0; i < graph.countNodes(); ++i) {\r\n if (graph.allHalfEdges[i].isMaskSet(boundaryMask))\r\n continue;\r\n const i0 = findNextFloodSeed(i);\r\n let seed: HalfEdge | undefined = graph.allHalfEdges[i0];\r\n do { // flood this component\r\n const component: HalfEdge[] = [];\r\n seed = HalfEdgeGraphSearch.exploreComponent(component, seed, visitMask, ignoreMask, maxFaceCount);\r\n if (component.length !== 0)\r\n components.push(component);\r\n } while (seed !== undefined);\r\n if (!graph.allHalfEdges[i].isMaskSet(visitMask))\r\n --i; // reprocess this node\r\n }\r\n return components;\r\n }\r\n /**\r\n * Test if test point (xTest,yTest) is inside/outside a face or on an edge.\r\n * @param seedNode any node on the face loop.\r\n * @param xTest x coordinate of the test point.\r\n * @param yTest y coordinate of the test point.\r\n * @returns 0 if ON, 1 if IN, -1 if OUT.\r\n */\r\n public static pointInOrOnFaceXY(seedNode: HalfEdge, xTest: number, yTest: number): number | undefined {\r\n const context = new XYParitySearchContext(xTest, yTest);\r\n // walk around looking for an accepted node to start the search (seedNode is usually ok)\r\n let nodeA = seedNode;\r\n let nodeB = seedNode.faceSuccessor;\r\n for (; ; nodeA = nodeB) {\r\n if (context.tryStartEdge(nodeA.x, nodeA.y, nodeB.x, nodeB.y))\r\n break;\r\n if (nodeB === seedNode) {\r\n // the test point and the face are all on line \"y = yTest\"\r\n const range = Range1d.createXX(nodeB.x, nodeB.faceSuccessor.x);\r\n return range.containsX(xTest) ? 0 : -1;\r\n }\r\n nodeB = nodeA.faceSuccessor;\r\n }\r\n // nodeB is the real start node for search, so stop when we revisit it. For each edge, accumulate parity and hits\r\n let nodeC = nodeB.faceSuccessor;\r\n for (; ;) {\r\n if (!context.advance(nodeC.x, nodeC.y)) {\r\n return context.classifyCounts();\r\n }\r\n if (nodeC === nodeB)\r\n break;\r\n nodeC = nodeC.faceSuccessor;\r\n }\r\n return context.classifyCounts();\r\n }\r\n /**\r\n * Collect boundary edges starting from `seed`.\r\n * * If `seed` is not a boundary node or is already visited, the function exists early.\r\n * @param seed start node.\r\n * @param visitMask mask to set on processed nodes.\r\n * @param isBoundaryEdge function to test if an edge in a boundary edge.\r\n * @param announceEdgeInBoundary callback invoked on each edge in the boundary loop in order. The counter is zero\r\n * for the first edge, and incremented with each successive edge.\r\n */\r\n public static collectExtendedBoundaryLoopFromSeed(\r\n seed: HalfEdge,\r\n visitMask: HalfEdgeMask,\r\n isBoundaryEdge: HalfEdgeToBooleanFunction,\r\n announceEdgeInBoundary: (edge: HalfEdge, counter: number) => void,\r\n ): void {\r\n let counter = 0;\r\n while (!seed.getMask(visitMask) && isBoundaryEdge(seed)) {\r\n announceEdgeInBoundary(seed, counter++);\r\n seed.setMask(visitMask);\r\n const vertexBase = seed.faceSuccessor;\r\n let candidateAroundVertex = vertexBase;\r\n for (; ;) {\r\n if (candidateAroundVertex.getMask(visitMask)) // end of boundary loop\r\n return;\r\n if (isBoundaryEdge(candidateAroundVertex)) {\r\n seed = candidateAroundVertex;\r\n break;\r\n }\r\n candidateAroundVertex = candidateAroundVertex.vertexPredecessor;\r\n if (candidateAroundVertex === vertexBase)\r\n break; // prevent infinite loop in case exteriorMask is not set on the edge mate of the boundary edge\r\n }\r\n }\r\n }\r\n /**\r\n * Collect boundary edges in the graph.\r\n * * A boundary edge is defined by `exteriorMask` being set on only its \"exterior\" edge mate.\r\n * * Each boundary edge is identified in the output by its edge mate that lacks `exteriorMask`.\r\n * * Each inner array is ordered in the output so that its boundary edges form a connected path. If `exteriorMask`\r\n * is preset consistently around each \"exterior\" face, these paths are loops.\r\n * @param graph the graph to query\r\n * @param exteriorMask mask preset on exactly one side of boundary edges\r\n * @returns array of boundary loops, each loop an array of the unmasked mates of boundary edges\r\n */\r\n public static collectExtendedBoundaryLoopsInGraph(graph: HalfEdgeGraph, exteriorMask: HalfEdgeMask): HalfEdge[][] {\r\n // Illustration of the algorithm can be found at geometry/internaldocs/Graph.md\r\n const loops: HalfEdge[][] = [];\r\n const visitMask = graph.grabMask(true);\r\n const isBoundaryEdge = (edge: HalfEdge): boolean => {\r\n return edge.getMask(exteriorMask) === 0 && edge.edgeMate.getMask(exteriorMask) !== 0;\r\n };\r\n const announceEdgeInBoundary = (edge: HalfEdge, counter: number) => {\r\n if (counter === 0)\r\n loops.push([]);\r\n loops[loops.length - 1].push(edge);\r\n };\r\n for (const seed of graph.allHalfEdges) {\r\n this.collectExtendedBoundaryLoopFromSeed(seed, visitMask, isBoundaryEdge, announceEdgeInBoundary);\r\n }\r\n graph.dropMask(visitMask);\r\n return loops;\r\n }\r\n}\r\n"]}
|
package/lib/esm/curve/Loop.js
CHANGED
|
@@ -67,7 +67,7 @@ export class Loop extends CurveChain {
|
|
|
67
67
|
dgnBoundaryType() {
|
|
68
68
|
/**
|
|
69
69
|
* All "Loop" become "outer". TypeScript Loop object is equivalent to a native CurveVector with
|
|
70
|
-
* boundaryType = BOUNDARY_TYPE_Outer.
|
|
70
|
+
* boundaryType = BOUNDARY_TYPE_Outer. In other words, TypeScript has no flavor of Loop that
|
|
71
71
|
* carries "hole" semantics.
|
|
72
72
|
*/
|
|
73
73
|
return 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loop.js","sourceRoot":"","sources":["../../../src/curve/Loop.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;GAIG;AACH,MAAM,OAAO,IAAK,SAAQ,UAAU;IAKlC,kCAAkC;IAC3B,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,IAAI,CAAC;IAC/B,CAAC;IACD,+CAA+C;IAC/C;QACE,KAAK,EAAE,CAAC;QAVV,wCAAwC;QACxB,wBAAmB,GAAG,MAAM,CAAC;QAC7C,qFAAqF;QACrE,YAAO,GAAY,KAAK,CAAC;IAQzC,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,MAAM,CAAC,GAAG,MAAwB;QAC9C,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QAC1B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YAC1B,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,WAAW,CAAC,MAAwB;QAChD,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QAC1B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YAC1B,MAAM,CAAC,QA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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 { 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.
|
|
1
|
+
{"version":3,"file":"Loop.js","sourceRoot":"","sources":["../../../src/curve/Loop.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;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------------------------------------------------------------------------------------\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":"PolyfaceQuery.d.ts","sourceRoot":"","sources":["../../../src/polyface/PolyfaceQuery.ts"],"names":[],"mappings":"AAKA;;GAEG;AAIH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGrC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAE1F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAIlE,OAAO,EAAE,KAAK,EAAE,M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