@itwin/core-geometry 5.0.0-dev.20 → 5.0.0-dev.23

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 (69) hide show
  1. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  2. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  3. package/lib/cjs/curve/Arc3d.d.ts +10 -1
  4. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  5. package/lib/cjs/curve/Arc3d.js +13 -1
  6. package/lib/cjs/curve/Arc3d.js.map +1 -1
  7. package/lib/cjs/curve/CurveFactory.d.ts +10 -4
  8. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  9. package/lib/cjs/curve/CurveFactory.js +50 -59
  10. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  11. package/lib/cjs/curve/StrokeOptions.d.ts +3 -3
  12. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  13. package/lib/cjs/curve/StrokeOptions.js +1 -1
  14. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  15. package/lib/cjs/geometry3d/PolylineOps.d.ts +2 -1
  16. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  17. package/lib/cjs/geometry3d/PolylineOps.js +2 -1
  18. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  19. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +27 -20
  20. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  21. package/lib/cjs/polyface/IndexedEdgeMatcher.js +56 -30
  22. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  23. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  24. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  25. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +2 -1
  26. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  27. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +4 -4
  28. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  29. package/lib/cjs/polyface/PolyfaceBuilder.js +18 -50
  30. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  31. package/lib/cjs/solid/SweepContour.d.ts +24 -15
  32. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  33. package/lib/cjs/solid/SweepContour.js +24 -15
  34. package/lib/cjs/solid/SweepContour.js.map +1 -1
  35. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  36. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  37. package/lib/esm/curve/Arc3d.d.ts +10 -1
  38. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  39. package/lib/esm/curve/Arc3d.js +13 -1
  40. package/lib/esm/curve/Arc3d.js.map +1 -1
  41. package/lib/esm/curve/CurveFactory.d.ts +10 -4
  42. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  43. package/lib/esm/curve/CurveFactory.js +50 -59
  44. package/lib/esm/curve/CurveFactory.js.map +1 -1
  45. package/lib/esm/curve/StrokeOptions.d.ts +3 -3
  46. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  47. package/lib/esm/curve/StrokeOptions.js +1 -1
  48. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  49. package/lib/esm/geometry3d/PolylineOps.d.ts +2 -1
  50. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  51. package/lib/esm/geometry3d/PolylineOps.js +2 -1
  52. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  53. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +27 -20
  54. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  55. package/lib/esm/polyface/IndexedEdgeMatcher.js +56 -30
  56. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  57. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  58. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  59. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +2 -1
  60. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  61. package/lib/esm/polyface/PolyfaceBuilder.d.ts +4 -4
  62. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  63. package/lib/esm/polyface/PolyfaceBuilder.js +19 -51
  64. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  65. package/lib/esm/solid/SweepContour.d.ts +24 -15
  66. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  67. package/lib/esm/solid/SweepContour.js +24 -15
  68. package/lib/esm/solid/SweepContour.js.map +1 -1
  69. package/package.json +3 -3
@@ -220,7 +220,8 @@ class PolylineOps {
220
220
  data.pop();
221
221
  }
222
222
  }
223
- /** Create an array of planes.
223
+ /**
224
+ * Create an array of planes.
224
225
  * * First plane has origin at first centerline point, with unit normal directed at the next point.
225
226
  * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors
226
227
  * along the incoming and outgoing segments.
@@ -1 +1 @@
1
- {"version":3,"file":"PolylineOps.js","sourceRoot":"","sources":["../../../src/geometry3d/PolylineOps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,8DAA4G;AAE5G,0DAAuD;AACvD,wDAAqD;AACrD,0CAAuC;AACvC,yDAAsD;AAEtD,iFAA8E;AAC9E,+DAA4D;AAC5D,uDAAsD;AACtD,uFAA+E;AAC/E,mCAAkC;AAElC,sBAAsB;AACtB;;;GAGG;AACH,MAAa,WAAW;IACtB;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,MAAiB;QAC7C,MAAM,KAAK,GAAG,eAAO,CAAC,UAAU,EAAE,CAAC;QACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,KAAK,CA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H,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACvC,CAAC;CACF;AA1UD,kCA0UC","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/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { CurveExtendMode, CurveExtendOptions, VariantCurveExtendParameter } from \"../curve/CurveExtendMode\";\r\nimport { CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"./IndexedXYZCollection\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"./Plane3dByOriginAndUnitNormal\";\r\nimport { Point3dArrayCarrier } from \"./Point3dArrayCarrier\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { PolylineCompressionContext } from \"./PolylineCompressionByEdgeOffset\";\r\nimport { Range1d } from \"./Range\";\r\n\r\n// cspell:word Puecker\r\n/**\r\n * PolylineOps is a collection of static methods operating on polylines.\r\n * @public\r\n */\r\nexport class PolylineOps {\r\n /**\r\n * Return a Range1d with the shortest and longest edge lengths of the polyline.\r\n * @param points points to examine.\r\n */\r\n public static edgeLengthRange(points: Point3d[]): Range1d {\r\n const range = Range1d.createNull();\r\n for (let i = 1; i < points.length; i++) {\r\n range.extendX(points[i - 1].distance(points[i]));\r\n }\r\n return range;\r\n }\r\n /**\r\n * Return a simplified subset of given points.\r\n * * Points are removed by the Douglas-Puecker algorithm, viz https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm\r\n * * This is a global search, with multiple passes over the data.\r\n * @param source\r\n * @param chordTolerance\r\n */\r\n public static compressByChordError(source: Point3d[], chordTolerance: number): Point3d[] {\r\n return PolylineCompressionContext.compressPoint3dArrayByChordError(source, chordTolerance);\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points if very close to their neighbors.\r\n * * This is a local search, with a single pass over the data.\r\n * @param source input points\r\n * @param maxEdgeLength\r\n * @see [[GrowableXYZArray.cloneCompressed]]\r\n */\r\n public static compressShortEdges(source: Point3d[] | IndexedXYZCollection, maxEdgeLength: number): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n PolylineCompressionContext.compressInPlaceByShortEdgeLength(dest, maxEdgeLength);\r\n return dest.getPoint3dArray();\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points of the triangle with adjacent points is small.\r\n * * This is a local search, with a single pass over the data.\r\n * @param source input points\r\n * @param maxEdgeLength\r\n */\r\n public static compressSmallTriangles(source: Point3d[], maxTriangleArea: number): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n PolylineCompressionContext.compressInPlaceBySmallTriangleArea(dest, maxTriangleArea);\r\n return dest.getPoint3dArray();\r\n }\r\n\r\n /**\r\n * Return a simplified subset of given points, omitting points if close to the edge between neighboring points before and after\r\n * * This is a local search, with a single pass over the data for each pass.\r\n * @param source input points\r\n * @param maxDistance omit points if this close to edge between points before and after\r\n * @param numPass max number of times to run the filter. numPass=2 is observed to behave well.\r\n *\r\n */\r\n public static compressByPerpendicularDistance(source: Point3d[], maxDistance: number, numPass: number = 2): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n let num0 = dest.length;\r\n for (let pass = 0; pass < numPass; pass++) {\r\n PolylineCompressionContext.compressInPlaceByPerpendicularDistance(dest, maxDistance);\r\n const num1 = dest.length;\r\n if (num1 === num0)\r\n break;\r\n num0 = num1;\r\n }\r\n return dest.getPoint3dArray();\r\n }\r\n private static squaredDistanceToInterpolatedPoint(pointQ: Point3d, point0: Point3d, fraction: number, point1: Point3d): number {\r\n const g = 1.0 - fraction;\r\n const dx = pointQ.x - (g * point0.x + fraction * point1.x);\r\n const dy = pointQ.y - (g * point0.y + fraction * point1.y);\r\n const dz = pointQ.z - (g * point0.z + fraction * point1.z);\r\n return dx * dx + dy * dy + dz * dz;\r\n }\r\n /**\r\n * test if either\r\n * * points[indexA] matches pointQ\r\n * * line from points[indexA] to points[indexB] overlaps points[indexA] to pointQ\r\n * @param points\r\n * @param pointQ\r\n * @param tolerance\r\n */\r\n private static isDanglerConfiguration(points: Point3d[], indexA: number, indexB: number, pointQ: Point3d, squaredDistanceTolerance: number): boolean {\r\n if (indexA < 0 || indexA >= points.length)\r\n return false;\r\n const pointA = points[indexA];\r\n // simple point match ...\r\n const d2Q = pointA.distanceSquared(pointQ);\r\n if (d2Q <= squaredDistanceTolerance)\r\n return true;\r\n if (indexB < 0 || indexB >= points.length)\r\n return false;\r\n const pointB = points[indexB];\r\n // The expensive test .. does newPoint double back to an interior or extrapolation of the final dest segment?\r\n //\r\n // or pointQ\r\n const dot = pointA.dotVectorsToTargets(pointB, pointQ);\r\n // simple case -- pointB..pointA..pointQ continues forward\r\n if (dot <= 0.0)\r\n return false;\r\n const d2B = pointA.distanceSquared(pointB);\r\n let distanceSquared;\r\n if (d2Q >= d2B) {\r\n // pointB----------------------------------->>>>>>> pointA\r\n // pointQ<<<<---------------------------------------------------------\r\n const fraction = dot / d2Q; // safe to divide because of earlier d2Q test.\r\n distanceSquared = this.squaredDistanceToInterpolatedPoint(pointB, pointA, fraction, pointQ);\r\n } else {\r\n // pointB----------------------------------->>>>>>> pointA\r\n // pointQ<<<<----------------------\r\n const fraction = dot / d2B;\r\n distanceSquared = this.squaredDistanceToInterpolatedPoint(pointQ, pointA, fraction, pointB);\r\n }\r\n return distanceSquared < squaredDistanceTolerance;\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points on \"danglers\" that depart and return on a single path.\r\n * @param source input points\r\n * @param closed if true, an edge returning to point 0 is implied even if final point does not match.\r\n * @param tolerance tolerance for near-zero distance.\r\n */\r\n public static compressDanglers(source: Point3d[], closed: boolean = false, tolerance: number = Geometry.smallMetricDistance): Point3d[] {\r\n let n = source.length;\r\n const squaredDistanceTolerance = tolerance * tolerance;\r\n if (closed)\r\n while (n > 1 && source[n - 1].distanceSquared(source[0]) <= squaredDistanceTolerance)\r\n n--;\r\n const dest = [];\r\n dest.push(source[0].clone());\r\n for (let i = 1; i < n; i++) {\r\n const newPoint = source[i];\r\n while (this.isDanglerConfiguration(dest, dest.length - 1, dest.length - 2, newPoint, squaredDistanceTolerance))\r\n dest.pop();\r\n dest.push(newPoint.clone());\r\n }\r\n if (closed) {\r\n // No purge moving backwards. Last point\r\n let leftIndex = 0;\r\n let rightIndex = dest.length - 1;\r\n while (rightIndex > leftIndex + 2) {\r\n if (this.isDanglerConfiguration(dest, leftIndex, leftIndex + 1, dest[rightIndex], squaredDistanceTolerance)) {\r\n leftIndex++;\r\n } else if (this.isDanglerConfiguration(dest, rightIndex, rightIndex - 1, dest[leftIndex], squaredDistanceTolerance)) {\r\n rightIndex--;\r\n } else {\r\n break;\r\n }\r\n }\r\n if (rightIndex + 1 < dest.length)\r\n dest.length = rightIndex + 1;\r\n if (leftIndex > 0) {\r\n dest.splice(0, leftIndex);\r\n }\r\n }\r\n return dest;\r\n }\r\n /**\r\n * Add closure points to a polyline or array of polylines\r\n * @param data points.\r\n */\r\n public static addClosurePoint(data: Point3d[] | Point3d[][]) {\r\n if (data.length === 0)\r\n return;\r\n const q0 = data[0];\r\n if (Array.isArray(q0)) {\r\n for (const child of data) {\r\n if (Array.isArray(child))\r\n this.addClosurePoint(child);\r\n }\r\n return;\r\n }\r\n const q1 = data[data.length - 1];\r\n if (q0 instanceof Point3d && q1 instanceof Point3d && !q0.isAlmostEqual(q1)) {\r\n (data as Point3d[]).push(q0.clone());\r\n }\r\n }\r\n /**\r\n * Remove closure points of a polyline or array of polylines\r\n * @param data points.\r\n */\r\n public static removeClosurePoint(data: Point3d[] | Point3d[][]) {\r\n if (data.length === 0)\r\n return;\r\n const q0 = data[0];\r\n if (Array.isArray(q0)) {\r\n for (const child of data) {\r\n if (Array.isArray(child))\r\n this.removeClosurePoint(child);\r\n }\r\n return;\r\n }\r\n const q1 = data[data.length - 1];\r\n if (q0 instanceof Point3d && q1 instanceof Point3d && q0.isAlmostEqual(q1)) {\r\n (data as Point3d[]).pop();\r\n }\r\n }\r\n /** Create an array of planes.\r\n * * First plane has origin at first centerline point, with unit normal directed at the next point.\r\n * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors\r\n * along the incoming and outgoing segments.\r\n * * Last plane has origin at last centerline point, with unit normal directed from previous point.\r\n * * All sets of adjacent coincident points are reduced to a single point.\r\n * * Hence the output array may have fewer points than the centerline.\r\n * * If there are one or fewer distinct input points, the return is undefined.\r\n * @param centerline points to reside in output planes.\r\n * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last\r\n * output planes are averaged and equated (cloned). Default false.\r\n */\r\n public static createBisectorPlanesForDistinctPoints(\r\n centerline: IndexedXYZCollection | Point3d[], wrapIfPhysicallyClosed: boolean = false,\r\n ): Plane3dByOriginAndUnitNormal[] | undefined {\r\n const packedPoints = PolylineOps.compressShortEdges(centerline, 2.0 * Geometry.smallMetricDistance); // double the tolerance to ensure normalized vectors exist.\r\n if (packedPoints.length < 2)\r\n return undefined;\r\n const bisectorPlanes: Plane3dByOriginAndUnitNormal[] = [];\r\n const point0 = packedPoints[0];\r\n const point1 = packedPoints[1];\r\n const unit01 = Vector3d.createNormalizedStartEnd(point0, point1)!;\r\n const perpendicular0 = Plane3dByOriginAndUnitNormal.create(point0, unit01)!;\r\n const perpendicular1 = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n // FIRST point gets simple perpendicular\r\n bisectorPlanes.push(perpendicular0.clone());\r\n // Each intermediate point gets average of adjacent perpendiculars\r\n for (let i = 1; i + 1 < packedPoints.length; i++) {\r\n Vector3d.createNormalizedStartEnd(packedPoints[i], packedPoints[i + 1], unit01);\r\n // remark: the prior pack should ensure the normalization is ok. But if it fails, we ignore this point...\r\n if (undefined !== Plane3dByOriginAndUnitNormal.create(packedPoints[i], unit01, perpendicular1)) {\r\n const newBisectorNormal = perpendicular0.getNormalRef().interpolate(0.5, perpendicular1.getNormalRef());\r\n const newBisectorPlane = Plane3dByOriginAndUnitNormal.create(packedPoints[i], newBisectorNormal);\r\n if (undefined !== newBisectorPlane)\r\n bisectorPlanes.push(newBisectorPlane);\r\n perpendicular0.setFrom(perpendicular1);\r\n }\r\n }\r\n // LAST point gets simple perpendicular inherited from last pass\r\n bisectorPlanes.push(Plane3dByOriginAndUnitNormal.create(packedPoints[packedPoints.length - 1], perpendicular0.getNormalRef())!);\r\n // reset end planes to their average plane, but leave them alone if the closure point is a cusp\r\n const lastIndex = bisectorPlanes.length - 1;\r\n if (lastIndex > 0 && wrapIfPhysicallyClosed) {\r\n const firstPlane = bisectorPlanes[0];\r\n const lastPlane = bisectorPlanes[lastIndex];\r\n if (Geometry.isSamePoint3d(firstPlane.getOriginRef(), lastPlane.getOriginRef())) {\r\n const newBisectorNormal = firstPlane.getNormalRef().plus(lastPlane.getNormalRef()); // could be zero vector at a cusp\r\n const newBisectorPlane = Plane3dByOriginAndUnitNormal.create(firstPlane.getOriginRef(), newBisectorNormal);\r\n if (undefined !== newBisectorPlane) {\r\n bisectorPlanes[0] = newBisectorPlane;\r\n bisectorPlanes[lastIndex] = Plane3dByOriginAndUnitNormal.create(lastPlane.getOriginRef(), newBisectorNormal)!;\r\n }\r\n }\r\n }\r\n return bisectorPlanes.length > 1 ? bisectorPlanes : undefined;\r\n }\r\n\r\n private static _workSegmentA?: LineSegment3d;\r\n private static _workSegmentB?: LineSegment3d;\r\n private static _workLocalDetailPair?: CurveLocationDetailPair;\r\n /**\r\n * Find smallest distance between polylines.\r\n * * For polylines with many points, it is more efficient to use [[LineString3dRangeTreeContext.searchForClosestApproach]].\r\n * @param pointsA first polyline\r\n * @param extendA how to extend polylineA forward/backward\r\n * @param pointsB second polyline\r\n * @param extendB how to extend polylineB forward/backward\r\n * @param dMax largest approach distance to consider\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns pair of details, one for each polyline, with field values:\r\n * * `a` is the closest approach distance\r\n * * `point` is the point of closest approach\r\n * * `fraction` is the global polyline fraction\r\n * * `childDetail.a` is the segment index\r\n * * `childDetail.fraction` is the local segment fraction\r\n */\r\n public static closestApproach(\r\n pointsA: Point3d[] | IndexedXYZCollection,\r\n extendA: VariantCurveExtendParameter,\r\n pointsB: Point3d[] | IndexedXYZCollection,\r\n extendB: VariantCurveExtendParameter,\r\n dMax: number = Number.MAX_VALUE,\r\n result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair | undefined {\r\n if (Array.isArray(pointsA))\r\n pointsA = new Point3dArrayCarrier(pointsA);\r\n if (Array.isArray(pointsB))\r\n pointsB = new Point3dArrayCarrier(pointsB);\r\n let dMin = dMax;\r\n let foundMin = false;\r\n const numSegmentA = pointsA.length - 1;\r\n const numSegmentB = pointsB.length - 1;\r\n const extendSegA = [CurveExtendMode.None, CurveExtendMode.None];\r\n const extendSegB = [CurveExtendMode.None, CurveExtendMode.None];\r\n // lambda to set extension for first and last segment of a polyline\r\n const convertExtend = (extendOut: CurveExtendMode[], extendIn: VariantCurveExtendParameter, segmentIndex: number, numSegments: number) => {\r\n extendOut[0] = extendOut[1] = CurveExtendMode.None;\r\n if (segmentIndex === 0)\r\n extendOut[0] = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 0);\r\n else if (segmentIndex === numSegments - 1)\r\n extendOut[1] = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 1);\r\n };\r\n // lambda to extract LineSegment3d from polyline\r\n const fillSegment = (points: IndexedXYZCollection, index: number, segment: LineSegment3d | undefined): LineSegment3d => {\r\n if (segment === undefined)\r\n return LineSegment3d.createCapture(points.getPoint3dAtUncheckedPointIndex(index), points.getPoint3dAtUncheckedPointIndex(index + 1));\r\n points.getPoint3dAtUncheckedPointIndex(index, segment.point0Ref);\r\n points.getPoint3dAtUncheckedPointIndex(index + 1, segment.point1Ref);\r\n return segment;\r\n };\r\n // just test the segments\r\n for (let indexA = 0; indexA < numSegmentA; indexA++) {\r\n this._workSegmentA = fillSegment(pointsA, indexA, this._workSegmentA);\r\n convertExtend(extendSegA, extendA, indexA, numSegmentA);\r\n for (let indexB = 0; indexB < numSegmentB; indexB++) {\r\n this._workSegmentB = fillSegment(pointsB, indexB, this._workSegmentB);\r\n convertExtend(extendSegB, extendB, indexB, numSegmentB);\r\n if (undefined !== (this._workLocalDetailPair = LineSegment3d.closestApproach(this._workSegmentA, extendSegA, this._workSegmentB, extendSegB, this._workLocalDetailPair))) {\r\n const d = this._workLocalDetailPair.detailA.a;\r\n if (d < dMin) {\r\n const childDetailA = result?.detailA.childDetail; // save and reuse\r\n const childDetailB = result?.detailB.childDetail;\r\n result = this._workLocalDetailPair.clone(result); // overwrite previous result\r\n LineString3d.convertLocalToGlobalDetail(result.detailA, indexA, numSegmentA, undefined, childDetailA);\r\n LineString3d.convertLocalToGlobalDetail(result.detailB, indexB, numSegmentB, undefined, childDetailB);\r\n if (result.detailA.childDetail && result.detailB.childDetail)\r\n result.detailA.childDetail.curve = result.detailB.childDetail.curve = undefined; // no CurvePrimitives survive in output\r\n dMin = d;\r\n foundMin = true;\r\n }\r\n }\r\n }\r\n }\r\n return foundMin ? result : undefined;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"PolylineOps.js","sourceRoot":"","sources":["../../../src/geometry3d/PolylineOps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,8DAA4G;AAE5G,0DAAuD;AACvD,wDAAqD;AACrD,0CAAuC;AACvC,yDAAsD;AAEtD,iFAA8E;AAC9E,+DAA4D;AAC5D,uDAAsD;AACtD,uFAA+E;AAC/E,mCAAkC;AAElC,sBAAsB;AACtB;;;GAGG;AACH,MAAa,WAAW;IACtB;;;O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W;4BAC1D,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,uCAAuC;wBAC1H,IAAI,GAAG,CAAC,CAAC;wBACT,QAAQ,GAAG,IAAI,CAAC;oBAClB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACvC,CAAC;CACF;AA3UD,kCA2UC","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/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { CurveExtendMode, CurveExtendOptions, VariantCurveExtendParameter } from \"../curve/CurveExtendMode\";\r\nimport { CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"./IndexedXYZCollection\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"./Plane3dByOriginAndUnitNormal\";\r\nimport { Point3dArrayCarrier } from \"./Point3dArrayCarrier\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { PolylineCompressionContext } from \"./PolylineCompressionByEdgeOffset\";\r\nimport { Range1d } from \"./Range\";\r\n\r\n// cspell:word Puecker\r\n/**\r\n * PolylineOps is a collection of static methods operating on polylines.\r\n * @public\r\n */\r\nexport class PolylineOps {\r\n /**\r\n * Return a Range1d with the shortest and longest edge lengths of the polyline.\r\n * @param points points to examine.\r\n */\r\n public static edgeLengthRange(points: Point3d[]): Range1d {\r\n const range = Range1d.createNull();\r\n for (let i = 1; i < points.length; i++) {\r\n range.extendX(points[i - 1].distance(points[i]));\r\n }\r\n return range;\r\n }\r\n /**\r\n * Return a simplified subset of given points.\r\n * * Points are removed by the Douglas-Puecker algorithm, viz https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm\r\n * * This is a global search, with multiple passes over the data.\r\n * @param source\r\n * @param chordTolerance\r\n */\r\n public static compressByChordError(source: Point3d[], chordTolerance: number): Point3d[] {\r\n return PolylineCompressionContext.compressPoint3dArrayByChordError(source, chordTolerance);\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points if very close to their neighbors.\r\n * * This is a local search, with a single pass over the data.\r\n * @param source input points\r\n * @param maxEdgeLength\r\n * @see [[GrowableXYZArray.cloneCompressed]]\r\n */\r\n public static compressShortEdges(source: Point3d[] | IndexedXYZCollection, maxEdgeLength: number): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n PolylineCompressionContext.compressInPlaceByShortEdgeLength(dest, maxEdgeLength);\r\n return dest.getPoint3dArray();\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points of the triangle with adjacent points is small.\r\n * * This is a local search, with a single pass over the data.\r\n * @param source input points\r\n * @param maxEdgeLength\r\n */\r\n public static compressSmallTriangles(source: Point3d[], maxTriangleArea: number): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n PolylineCompressionContext.compressInPlaceBySmallTriangleArea(dest, maxTriangleArea);\r\n return dest.getPoint3dArray();\r\n }\r\n\r\n /**\r\n * Return a simplified subset of given points, omitting points if close to the edge between neighboring points before and after\r\n * * This is a local search, with a single pass over the data for each pass.\r\n * @param source input points\r\n * @param maxDistance omit points if this close to edge between points before and after\r\n * @param numPass max number of times to run the filter. numPass=2 is observed to behave well.\r\n *\r\n */\r\n public static compressByPerpendicularDistance(source: Point3d[], maxDistance: number, numPass: number = 2): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n let num0 = dest.length;\r\n for (let pass = 0; pass < numPass; pass++) {\r\n PolylineCompressionContext.compressInPlaceByPerpendicularDistance(dest, maxDistance);\r\n const num1 = dest.length;\r\n if (num1 === num0)\r\n break;\r\n num0 = num1;\r\n }\r\n return dest.getPoint3dArray();\r\n }\r\n private static squaredDistanceToInterpolatedPoint(pointQ: Point3d, point0: Point3d, fraction: number, point1: Point3d): number {\r\n const g = 1.0 - fraction;\r\n const dx = pointQ.x - (g * point0.x + fraction * point1.x);\r\n const dy = pointQ.y - (g * point0.y + fraction * point1.y);\r\n const dz = pointQ.z - (g * point0.z + fraction * point1.z);\r\n return dx * dx + dy * dy + dz * dz;\r\n }\r\n /**\r\n * test if either\r\n * * points[indexA] matches pointQ\r\n * * line from points[indexA] to points[indexB] overlaps points[indexA] to pointQ\r\n * @param points\r\n * @param pointQ\r\n * @param tolerance\r\n */\r\n private static isDanglerConfiguration(points: Point3d[], indexA: number, indexB: number, pointQ: Point3d, squaredDistanceTolerance: number): boolean {\r\n if (indexA < 0 || indexA >= points.length)\r\n return false;\r\n const pointA = points[indexA];\r\n // simple point match ...\r\n const d2Q = pointA.distanceSquared(pointQ);\r\n if (d2Q <= squaredDistanceTolerance)\r\n return true;\r\n if (indexB < 0 || indexB >= points.length)\r\n return false;\r\n const pointB = points[indexB];\r\n // The expensive test .. does newPoint double back to an interior or extrapolation of the final dest segment?\r\n //\r\n // or pointQ\r\n const dot = pointA.dotVectorsToTargets(pointB, pointQ);\r\n // simple case -- pointB..pointA..pointQ continues forward\r\n if (dot <= 0.0)\r\n return false;\r\n const d2B = pointA.distanceSquared(pointB);\r\n let distanceSquared;\r\n if (d2Q >= d2B) {\r\n // pointB----------------------------------->>>>>>> pointA\r\n // pointQ<<<<---------------------------------------------------------\r\n const fraction = dot / d2Q; // safe to divide because of earlier d2Q test.\r\n distanceSquared = this.squaredDistanceToInterpolatedPoint(pointB, pointA, fraction, pointQ);\r\n } else {\r\n // pointB----------------------------------->>>>>>> pointA\r\n // pointQ<<<<----------------------\r\n const fraction = dot / d2B;\r\n distanceSquared = this.squaredDistanceToInterpolatedPoint(pointQ, pointA, fraction, pointB);\r\n }\r\n return distanceSquared < squaredDistanceTolerance;\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points on \"danglers\" that depart and return on a single path.\r\n * @param source input points\r\n * @param closed if true, an edge returning to point 0 is implied even if final point does not match.\r\n * @param tolerance tolerance for near-zero distance.\r\n */\r\n public static compressDanglers(source: Point3d[], closed: boolean = false, tolerance: number = Geometry.smallMetricDistance): Point3d[] {\r\n let n = source.length;\r\n const squaredDistanceTolerance = tolerance * tolerance;\r\n if (closed)\r\n while (n > 1 && source[n - 1].distanceSquared(source[0]) <= squaredDistanceTolerance)\r\n n--;\r\n const dest = [];\r\n dest.push(source[0].clone());\r\n for (let i = 1; i < n; i++) {\r\n const newPoint = source[i];\r\n while (this.isDanglerConfiguration(dest, dest.length - 1, dest.length - 2, newPoint, squaredDistanceTolerance))\r\n dest.pop();\r\n dest.push(newPoint.clone());\r\n }\r\n if (closed) {\r\n // No purge moving backwards. Last point\r\n let leftIndex = 0;\r\n let rightIndex = dest.length - 1;\r\n while (rightIndex > leftIndex + 2) {\r\n if (this.isDanglerConfiguration(dest, leftIndex, leftIndex + 1, dest[rightIndex], squaredDistanceTolerance)) {\r\n leftIndex++;\r\n } else if (this.isDanglerConfiguration(dest, rightIndex, rightIndex - 1, dest[leftIndex], squaredDistanceTolerance)) {\r\n rightIndex--;\r\n } else {\r\n break;\r\n }\r\n }\r\n if (rightIndex + 1 < dest.length)\r\n dest.length = rightIndex + 1;\r\n if (leftIndex > 0) {\r\n dest.splice(0, leftIndex);\r\n }\r\n }\r\n return dest;\r\n }\r\n /**\r\n * Add closure points to a polyline or array of polylines\r\n * @param data points.\r\n */\r\n public static addClosurePoint(data: Point3d[] | Point3d[][]) {\r\n if (data.length === 0)\r\n return;\r\n const q0 = data[0];\r\n if (Array.isArray(q0)) {\r\n for (const child of data) {\r\n if (Array.isArray(child))\r\n this.addClosurePoint(child);\r\n }\r\n return;\r\n }\r\n const q1 = data[data.length - 1];\r\n if (q0 instanceof Point3d && q1 instanceof Point3d && !q0.isAlmostEqual(q1)) {\r\n (data as Point3d[]).push(q0.clone());\r\n }\r\n }\r\n /**\r\n * Remove closure points of a polyline or array of polylines\r\n * @param data points.\r\n */\r\n public static removeClosurePoint(data: Point3d[] | Point3d[][]) {\r\n if (data.length === 0)\r\n return;\r\n const q0 = data[0];\r\n if (Array.isArray(q0)) {\r\n for (const child of data) {\r\n if (Array.isArray(child))\r\n this.removeClosurePoint(child);\r\n }\r\n return;\r\n }\r\n const q1 = data[data.length - 1];\r\n if (q0 instanceof Point3d && q1 instanceof Point3d && q0.isAlmostEqual(q1)) {\r\n (data as Point3d[]).pop();\r\n }\r\n }\r\n /**\r\n * Create an array of planes.\r\n * * First plane has origin at first centerline point, with unit normal directed at the next point.\r\n * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors\r\n * along the incoming and outgoing segments.\r\n * * Last plane has origin at last centerline point, with unit normal directed from previous point.\r\n * * All sets of adjacent coincident points are reduced to a single point.\r\n * * Hence the output array may have fewer points than the centerline.\r\n * * If there are one or fewer distinct input points, the return is undefined.\r\n * @param centerline points to reside in output planes.\r\n * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last\r\n * output planes are averaged and equated (cloned). Default false.\r\n */\r\n public static createBisectorPlanesForDistinctPoints(\r\n centerline: IndexedXYZCollection | Point3d[], wrapIfPhysicallyClosed: boolean = false,\r\n ): Plane3dByOriginAndUnitNormal[] | undefined {\r\n const packedPoints = PolylineOps.compressShortEdges(centerline, 2.0 * Geometry.smallMetricDistance); // double the tolerance to ensure normalized vectors exist.\r\n if (packedPoints.length < 2)\r\n return undefined;\r\n const bisectorPlanes: Plane3dByOriginAndUnitNormal[] = [];\r\n const point0 = packedPoints[0];\r\n const point1 = packedPoints[1];\r\n const unit01 = Vector3d.createNormalizedStartEnd(point0, point1)!;\r\n const perpendicular0 = Plane3dByOriginAndUnitNormal.create(point0, unit01)!;\r\n const perpendicular1 = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n // FIRST point gets simple perpendicular\r\n bisectorPlanes.push(perpendicular0.clone());\r\n // Each intermediate point gets average of adjacent perpendiculars\r\n for (let i = 1; i + 1 < packedPoints.length; i++) {\r\n Vector3d.createNormalizedStartEnd(packedPoints[i], packedPoints[i + 1], unit01);\r\n // remark: the prior pack should ensure the normalization is ok. But if it fails, we ignore this point...\r\n if (undefined !== Plane3dByOriginAndUnitNormal.create(packedPoints[i], unit01, perpendicular1)) {\r\n const newBisectorNormal = perpendicular0.getNormalRef().interpolate(0.5, perpendicular1.getNormalRef());\r\n const newBisectorPlane = Plane3dByOriginAndUnitNormal.create(packedPoints[i], newBisectorNormal);\r\n if (undefined !== newBisectorPlane)\r\n bisectorPlanes.push(newBisectorPlane);\r\n perpendicular0.setFrom(perpendicular1);\r\n }\r\n }\r\n // LAST point gets simple perpendicular inherited from last pass\r\n bisectorPlanes.push(Plane3dByOriginAndUnitNormal.create(packedPoints[packedPoints.length - 1], perpendicular0.getNormalRef())!);\r\n // reset end planes to their average plane, but leave them alone if the closure point is a cusp\r\n const lastIndex = bisectorPlanes.length - 1;\r\n if (lastIndex > 0 && wrapIfPhysicallyClosed) {\r\n const firstPlane = bisectorPlanes[0];\r\n const lastPlane = bisectorPlanes[lastIndex];\r\n if (Geometry.isSamePoint3d(firstPlane.getOriginRef(), lastPlane.getOriginRef())) {\r\n const newBisectorNormal = firstPlane.getNormalRef().plus(lastPlane.getNormalRef()); // could be zero vector at a cusp\r\n const newBisectorPlane = Plane3dByOriginAndUnitNormal.create(firstPlane.getOriginRef(), newBisectorNormal);\r\n if (undefined !== newBisectorPlane) {\r\n bisectorPlanes[0] = newBisectorPlane;\r\n bisectorPlanes[lastIndex] = Plane3dByOriginAndUnitNormal.create(lastPlane.getOriginRef(), newBisectorNormal)!;\r\n }\r\n }\r\n }\r\n return bisectorPlanes.length > 1 ? bisectorPlanes : undefined;\r\n }\r\n\r\n private static _workSegmentA?: LineSegment3d;\r\n private static _workSegmentB?: LineSegment3d;\r\n private static _workLocalDetailPair?: CurveLocationDetailPair;\r\n /**\r\n * Find smallest distance between polylines.\r\n * * For polylines with many points, it is more efficient to use [[LineString3dRangeTreeContext.searchForClosestApproach]].\r\n * @param pointsA first polyline\r\n * @param extendA how to extend polylineA forward/backward\r\n * @param pointsB second polyline\r\n * @param extendB how to extend polylineB forward/backward\r\n * @param dMax largest approach distance to consider\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns pair of details, one for each polyline, with field values:\r\n * * `a` is the closest approach distance\r\n * * `point` is the point of closest approach\r\n * * `fraction` is the global polyline fraction\r\n * * `childDetail.a` is the segment index\r\n * * `childDetail.fraction` is the local segment fraction\r\n */\r\n public static closestApproach(\r\n pointsA: Point3d[] | IndexedXYZCollection,\r\n extendA: VariantCurveExtendParameter,\r\n pointsB: Point3d[] | IndexedXYZCollection,\r\n extendB: VariantCurveExtendParameter,\r\n dMax: number = Number.MAX_VALUE,\r\n result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair | undefined {\r\n if (Array.isArray(pointsA))\r\n pointsA = new Point3dArrayCarrier(pointsA);\r\n if (Array.isArray(pointsB))\r\n pointsB = new Point3dArrayCarrier(pointsB);\r\n let dMin = dMax;\r\n let foundMin = false;\r\n const numSegmentA = pointsA.length - 1;\r\n const numSegmentB = pointsB.length - 1;\r\n const extendSegA = [CurveExtendMode.None, CurveExtendMode.None];\r\n const extendSegB = [CurveExtendMode.None, CurveExtendMode.None];\r\n // lambda to set extension for first and last segment of a polyline\r\n const convertExtend = (extendOut: CurveExtendMode[], extendIn: VariantCurveExtendParameter, segmentIndex: number, numSegments: number) => {\r\n extendOut[0] = extendOut[1] = CurveExtendMode.None;\r\n if (segmentIndex === 0)\r\n extendOut[0] = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 0);\r\n else if (segmentIndex === numSegments - 1)\r\n extendOut[1] = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 1);\r\n };\r\n // lambda to extract LineSegment3d from polyline\r\n const fillSegment = (points: IndexedXYZCollection, index: number, segment: LineSegment3d | undefined): LineSegment3d => {\r\n if (segment === undefined)\r\n return LineSegment3d.createCapture(points.getPoint3dAtUncheckedPointIndex(index), points.getPoint3dAtUncheckedPointIndex(index + 1));\r\n points.getPoint3dAtUncheckedPointIndex(index, segment.point0Ref);\r\n points.getPoint3dAtUncheckedPointIndex(index + 1, segment.point1Ref);\r\n return segment;\r\n };\r\n // just test the segments\r\n for (let indexA = 0; indexA < numSegmentA; indexA++) {\r\n this._workSegmentA = fillSegment(pointsA, indexA, this._workSegmentA);\r\n convertExtend(extendSegA, extendA, indexA, numSegmentA);\r\n for (let indexB = 0; indexB < numSegmentB; indexB++) {\r\n this._workSegmentB = fillSegment(pointsB, indexB, this._workSegmentB);\r\n convertExtend(extendSegB, extendB, indexB, numSegmentB);\r\n if (undefined !== (this._workLocalDetailPair = LineSegment3d.closestApproach(this._workSegmentA, extendSegA, this._workSegmentB, extendSegB, this._workLocalDetailPair))) {\r\n const d = this._workLocalDetailPair.detailA.a;\r\n if (d < dMin) {\r\n const childDetailA = result?.detailA.childDetail; // save and reuse\r\n const childDetailB = result?.detailB.childDetail;\r\n result = this._workLocalDetailPair.clone(result); // overwrite previous result\r\n LineString3d.convertLocalToGlobalDetail(result.detailA, indexA, numSegmentA, undefined, childDetailA);\r\n LineString3d.convertLocalToGlobalDetail(result.detailB, indexB, numSegmentB, undefined, childDetailB);\r\n if (result.detailA.childDetail && result.detailB.childDetail)\r\n result.detailA.childDetail.curve = result.detailB.childDetail.curve = undefined; // no CurvePrimitives survive in output\r\n dMin = d;\r\n foundMin = true;\r\n }\r\n }\r\n }\r\n }\r\n return foundMin ? result : undefined;\r\n }\r\n}\r\n"]}
@@ -15,26 +15,27 @@ export declare class SortableEdge extends Float64Array {
15
15
  get vertexIndexB(): number;
16
16
  /** Return the facet index. */
17
17
  get facetIndex(): number;
18
- /** return true if vertexIndexA is less than vertexIndexB */
18
+ /** return true if vertexIndexA is less than vertexIndexB. */
19
19
  get isLowHigh(): boolean;
20
- /** Return the vertex index with lower numeric value */
20
+ /** Return the vertex index with lower numeric value. */
21
21
  get lowVertexIndex(): number;
22
- /** Return the vertex index with higher numeric value */
22
+ /** Return the vertex index with higher numeric value. */
23
23
  get highVertexIndex(): number;
24
- /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order */
24
+ /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order. */
25
25
  static areDirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean;
26
- /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order */
26
+ /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order. */
27
27
  static areUndirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean;
28
- /** Return numeric relationship of edgeA and edgeB:
29
- * * 1 if they share start and end in the same order
30
- * * -1 if they share start and end in reversed order
28
+ /**
29
+ * Return numeric relationship of edgeA and edgeB:
30
+ * * 1 if they share start and end in the same order.
31
+ * * -1 if they share start and end in reversed order.
31
32
  * * 0 otherwise.
32
33
  */
33
34
  static relativeOrientation(edgeA: SortableEdge, edgeB: SortableEdge): number;
34
35
  get isNullEdge(): boolean;
35
36
  /**
36
- * lexical comparison of two edges.
37
- * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort
37
+ * Lexical comparison of two edges.
38
+ * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort.
38
39
  * * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.
39
40
  * @param edgeA first edge
40
41
  * @param edgeB second edge
@@ -47,23 +48,25 @@ export declare class SortableEdge extends Float64Array {
47
48
  }
48
49
  export type SortableEdgeCluster = SortableEdge | SortableEdge[];
49
50
  /**
50
- * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses (such as testing for closed mesh)
51
+ * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses
52
+ * (such as testing for closed mesh).
51
53
  */
52
54
  export declare class IndexedEdgeMatcher {
53
55
  edges: SortableEdge[];
54
56
  constructor();
55
57
  /**
56
- * push a new edge.
57
- * @returns the edge (as emplaced at the back of the sortableEdge array)
58
+ * Push a new edge.
58
59
  * @param vertexA start vertex
59
60
  * @param vertexB end vertex
60
61
  * @param facetIndex facet index
62
+ * @returns the edge (as emplaced at the back of the sortableEdge array)
61
63
  */
62
64
  addEdge(vertexA: number, vertexB: number, facetIndex: number): SortableEdge;
63
65
  /**
64
- * Push edges all around a facet, returning to vertexArray[0]
66
+ * Push edges all around a facet, returning to vertexArray[0].
65
67
  * @param vertexArray array of vertex indices around facet
66
- * @param facetIndex
68
+ * @param facetIndex facet index
69
+ * @param closeLoop true to add an edge from last to first vertex.
67
70
  */
68
71
  addPath(vertexArray: number[], facetIndex: number, closeLoop?: boolean): void;
69
72
  /** Sort the edge index array. */
@@ -71,16 +74,20 @@ export declare class IndexedEdgeMatcher {
71
74
  /** Create a single or compound SortableEdgeCluster in dest. */
72
75
  private collectSortableEdgeCluster;
73
76
  /**
74
- * sort the edges, and look for three categories of paired edges:
77
+ * Sort the edges, and look for three categories of paired edges:
75
78
  * * caller must allocate all result arrays of interest.
76
79
  * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.
77
- * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are merged into the target.
78
- * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array `allOther`, create `const allOther = []` as an empty array and call
80
+ * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are
81
+ * merged into the target.
82
+ * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array
83
+ * `allOther`, create `const allOther = []` as an empty array and call
79
84
  * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`
80
- * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior edges adjacent to two facets in opposing directions.
85
+ * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior
86
+ * edges adjacent to two facets in opposing directions.
81
87
  * @param singletons optional array to receive edges that are simple boundary edges.
82
88
  * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)
83
- * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense but not a simple directed pair.
89
+ * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense
90
+ * but not a simple directed pair.
84
91
  */
85
92
  sortAndCollectClusters(manifoldPairs: SortableEdgeCluster[] | undefined, singletons?: SortableEdgeCluster[], nullEdges?: SortableEdgeCluster[], allOtherClusters?: SortableEdgeCluster[]): void;
86
93
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedEdgeMatcher.d.ts","sourceRoot":"","sources":["../../../src/polyface/IndexedEdgeMatcher.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;;;;GAMG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAC5C,uEAAuE;IACvE,IAAW,YAAY,IAAI,MAAM,CAAoB;IACrD,wEAAwE;IACxE,IAAW,YAAY,IAAI,MAAM,CAAoB;IACrD,+BAA+B;IAC/B,IAAW,UAAU,IAAI,MAAM,CAAoB;IACnD,4DAA4D;IAC5D,IAAW,SAAS,IAAI,OAAO,CAA8B;IAC7D,uDAAuD;IACvD,IAAW,cAAc,IAAI,MAAM,CAAkD;IACrF,wDAAwD;IACxD,IAAW,eAAe,IAAI,MAAM,CAAkD;IACtF,gGAAgG;WAClF,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO;IACpF,6GAA6G;WAC/F,qBAAqB,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO;IAGtF;;;;OAIG;WACW,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM;IAMnF,IAAW,UAAU,IAAI,OAAO,CAAgC;IAChE;;;;;;OA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Aa,EAAE,mBAAmB,EAAE,GAAG,SAAS,EAChD,UAAU,CAAC,EAAE,mBAAmB,EAAE,EAClC,SAAS,CAAC,EAAE,mBAAmB,EAAE,EACjC,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,GACvC,IAAI;CA0BR"}
@@ -17,26 +17,41 @@ exports.IndexedEdgeMatcher = exports.SortableEdge = void 0;
17
17
  */
18
18
  class SortableEdge extends Float64Array {
19
19
  /** Return the vertex index that appears first in the order stored. */
20
- get vertexIndexA() { return this[0]; }
20
+ get vertexIndexA() {
21
+ return this[0];
22
+ }
21
23
  /** Return the vertex index that appears second in the order stored. */
22
- get vertexIndexB() { return this[1]; }
24
+ get vertexIndexB() {
25
+ return this[1];
26
+ }
23
27
  /** Return the facet index. */
24
- get facetIndex() { return this[2]; }
25
- /** return true if vertexIndexA is less than vertexIndexB */
26
- get isLowHigh() { return this[0] < this[1]; }
27
- /** Return the vertex index with lower numeric value */
28
- get lowVertexIndex() { return this[0] < this[1] ? this[0] : this[1]; }
29
- /** Return the vertex index with higher numeric value */
30
- get highVertexIndex() { return this[0] > this[1] ? this[0] : this[1]; }
31
- /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order */
32
- static areDirectedPartners(edgeA, edgeB) { return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]; }
33
- /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order */
28
+ get facetIndex() {
29
+ return this[2];
30
+ }
31
+ /** return true if vertexIndexA is less than vertexIndexB. */
32
+ get isLowHigh() {
33
+ return this[0] < this[1];
34
+ }
35
+ /** Return the vertex index with lower numeric value. */
36
+ get lowVertexIndex() {
37
+ return this[0] < this[1] ? this[0] : this[1];
38
+ }
39
+ /** Return the vertex index with higher numeric value. */
40
+ get highVertexIndex() {
41
+ return this[0] > this[1] ? this[0] : this[1];
42
+ }
43
+ /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order. */
44
+ static areDirectedPartners(edgeA, edgeB) {
45
+ return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0];
46
+ }
47
+ /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order. */
34
48
  static areUndirectedPartners(edgeA, edgeB) {
35
49
  return (edgeA[0] === edgeB[0] && edgeA[1] === edgeB[1]) || ((edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]));
36
50
  }
37
- /** Return numeric relationship of edgeA and edgeB:
38
- * * 1 if they share start and end in the same order
39
- * * -1 if they share start and end in reversed order
51
+ /**
52
+ * Return numeric relationship of edgeA and edgeB:
53
+ * * 1 if they share start and end in the same order.
54
+ * * -1 if they share start and end in reversed order.
40
55
  * * 0 otherwise.
41
56
  */
42
57
  static relativeOrientation(edgeA, edgeB) {
@@ -46,10 +61,12 @@ class SortableEdge extends Float64Array {
46
61
  return -1;
47
62
  return 0;
48
63
  }
49
- get isNullEdge() { return this[0] === this[1]; }
64
+ get isNullEdge() {
65
+ return this[0] === this[1];
66
+ }
50
67
  /**
51
- * lexical comparison of two edges.
52
- * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort
68
+ * Lexical comparison of two edges.
69
+ * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort.
53
70
  * * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.
54
71
  * @param edgeA first edge
55
72
  * @param edgeB second edge
@@ -77,7 +94,9 @@ class SortableEdge extends Float64Array {
77
94
  this[1] = vertexB;
78
95
  this[2] = facetIndex;
79
96
  }
80
- toJSON() { return [this[0], this[1], this[2]]; }
97
+ toJSON() {
98
+ return [this[0], this[1], this[2]];
99
+ }
81
100
  static clusterToJSON(data) {
82
101
  if (data instanceof SortableEdge)
83
102
  return data.toJSON();
@@ -94,18 +113,19 @@ class SortableEdge extends Float64Array {
94
113
  }
95
114
  exports.SortableEdge = SortableEdge;
96
115
  /**
97
- * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses (such as testing for closed mesh)
116
+ * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses
117
+ * (such as testing for closed mesh).
98
118
  */
99
119
  class IndexedEdgeMatcher {
100
120
  constructor() {
101
121
  this.edges = [];
102
122
  }
103
123
  /**
104
- * push a new edge.
105
- * @returns the edge (as emplaced at the back of the sortableEdge array)
124
+ * Push a new edge.
106
125
  * @param vertexA start vertex
107
126
  * @param vertexB end vertex
108
127
  * @param facetIndex facet index
128
+ * @returns the edge (as emplaced at the back of the sortableEdge array)
109
129
  */
110
130
  addEdge(vertexA, vertexB, facetIndex) {
111
131
  const edge = new SortableEdge(vertexA, vertexB, facetIndex);
@@ -113,9 +133,10 @@ class IndexedEdgeMatcher {
113
133
  return edge;
114
134
  }
115
135
  /**
116
- * Push edges all around a facet, returning to vertexArray[0]
136
+ * Push edges all around a facet, returning to vertexArray[0].
117
137
  * @param vertexArray array of vertex indices around facet
118
- * @param facetIndex
138
+ * @param facetIndex facet index
139
+ * @param closeLoop true to add an edge from last to first vertex.
119
140
  */
120
141
  addPath(vertexArray, facetIndex, closeLoop = true) {
121
142
  if (vertexArray.length === 0)
@@ -146,16 +167,20 @@ class IndexedEdgeMatcher {
146
167
  }
147
168
  }
148
169
  /**
149
- * sort the edges, and look for three categories of paired edges:
170
+ * Sort the edges, and look for three categories of paired edges:
150
171
  * * caller must allocate all result arrays of interest.
151
172
  * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.
152
- * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are merged into the target.
153
- * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array `allOther`, create `const allOther = []` as an empty array and call
173
+ * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are
174
+ * merged into the target.
175
+ * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array
176
+ * `allOther`, create `const allOther = []` as an empty array and call
154
177
  * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`
155
- * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior edges adjacent to two facets in opposing directions.
178
+ * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior
179
+ * edges adjacent to two facets in opposing directions.
156
180
  * @param singletons optional array to receive edges that are simple boundary edges.
157
181
  * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)
158
- * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense but not a simple directed pair.
182
+ * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense
183
+ * but not a simple directed pair.
159
184
  */
160
185
  sortAndCollectClusters(manifoldPairs, singletons, nullEdges, allOtherClusters) {
161
186
  this.sort();
@@ -172,7 +197,8 @@ class IndexedEdgeMatcher {
172
197
  for (let index0 = 0; index0 < n; index0 += clusterLength) {
173
198
  const baseEdge = this.edges[index0];
174
199
  clusterLength = 1;
175
- for (let index1 = index0 + 1; index1 < n && SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {
200
+ for (let index1 = index0 + 1; index1 < n &&
201
+ SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {
176
202
  clusterLength++;
177
203
  }
178
204
  if (this.edges[index0].isNullEdge) {
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedEdgeMatcher.js","sourceRoot":"","sources":["../../../src/polyface/IndexedEdgeMatcher.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH;;;;;;GAMG;AACH,MAAa,YAAa,SAAQ,YAAY;IAC5C,uEAAuE;IACvE,IAAW,YAAY,KAAa,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,wEAAwE;IACxE,IAAW,YAAY,KAAa,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,+BAA+B;IAC/B,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,4DAA4D;IAC5D,IAAW,SAAS,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC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AG,aAAa,EAAE,gBAAgB,CAAC,CAAC;YACpF,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAvFD,gDAuFC","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 Polyface\r\n */\r\n\r\n/**\r\n * * For boundary sorting, an edge is a (packed!) Float64Array.\r\n * * Fixed entry positions are:\r\n * * [0] is start vertex index (in CCW order around its facet)\r\n * * [1] is end vertex index (in CCW order around its facet)\r\n * * [2] is facet index.\r\n */\r\nexport class SortableEdge extends Float64Array {\r\n /** Return the vertex index that appears first in the order stored. */\r\n public get vertexIndexA(): number { return this[0]; }\r\n /** Return the vertex index that appears second in the order stored. */\r\n public get vertexIndexB(): number { return this[1]; }\r\n /** Return the facet index. */\r\n public get facetIndex(): number { return this[2]; }\r\n /** return true if vertexIndexA is less than vertexIndexB */\r\n public get isLowHigh(): boolean { return this[0] < this[1]; }\r\n /** Return the vertex index with lower numeric value */\r\n public get lowVertexIndex(): number { return this[0] < this[1] ? this[0] : this[1]; }\r\n /** Return the vertex index with higher numeric value */\r\n public get highVertexIndex(): number { return this[0] > this[1] ? this[0] : this[1]; }\r\n /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order */\r\n public static areDirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean { return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]; }\r\n /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order */\r\n public static areUndirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean {\r\n return (edgeA[0] === edgeB[0] && edgeA[1] === edgeB[1]) || ((edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]));\r\n }\r\n /** Return numeric relationship of edgeA and edgeB:\r\n * * 1 if they share start and end in the same order\r\n * * -1 if they share start and end in reversed order\r\n * * 0 otherwise.\r\n */\r\n public static relativeOrientation(edgeA: SortableEdge, edgeB: SortableEdge): number {\r\n if (edgeA[0] === edgeB[0] && edgeA[1] === edgeB[1]) return 1;\r\n if (edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]) return -1;\r\n return 0;\r\n }\r\n\r\n public get isNullEdge(): boolean { return this[0] === this[1]; }\r\n /**\r\n * lexical comparison of two edges.\r\n * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort\r\n * * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.\r\n * @param edgeA first edge\r\n * @param edgeB second edge\r\n */\r\n public static lessThan(edgeA: SortableEdge, edgeB: SortableEdge): number {\r\n // primary compare is based on indirect indices\r\n const lowA = edgeA.lowVertexIndex;\r\n const lowB = edgeB.lowVertexIndex;\r\n if (lowA < lowB)\r\n return -1;\r\n if (lowB < lowA)\r\n return 1;\r\n const highA = edgeA.highVertexIndex;\r\n const highB = edgeB.highVertexIndex;\r\n if (highA < highB)\r\n return -1;\r\n if (highB < highA)\r\n return 1;\r\n // undirected indices match ... use directed vertexIndexA\r\n return edgeA.vertexIndexA - edgeB.vertexIndexA;\r\n }\r\n public constructor(vertexA: number, vertexB: number, facetIndex: number) {\r\n super(3);\r\n this[0] = vertexA;\r\n this[1] = vertexB;\r\n this[2] = facetIndex;\r\n }\r\n public toJSON(): any { return [this[0], this[1], this[2]]; }\r\n public static clusterToJSON(data: SortableEdgeCluster): any {\r\n if (data instanceof SortableEdge)\r\n return data.toJSON();\r\n\r\n const result = [];\r\n for (const edge of data) result.push(edge.toJSON());\r\n }\r\n public static clusterArrayToJSON(data: SortableEdgeCluster[]) {\r\n const result = [];\r\n for (const cluster of data)\r\n result.push(SortableEdge.clusterToJSON(cluster));\r\n return result;\r\n }\r\n}\r\n\r\nexport type SortableEdgeCluster = SortableEdge | SortableEdge[];\r\n/**\r\n * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses (such as testing for closed mesh)\r\n */\r\nexport class IndexedEdgeMatcher {\r\n public edges: SortableEdge[];\r\n\r\n constructor() {\r\n this.edges = [];\r\n }\r\n /**\r\n * push a new edge.\r\n * @returns the edge (as emplaced at the back of the sortableEdge array)\r\n * @param vertexA start vertex\r\n * @param vertexB end vertex\r\n * @param facetIndex facet index\r\n */\r\n public addEdge(vertexA: number, vertexB: number, facetIndex: number): SortableEdge {\r\n const edge = new SortableEdge(vertexA, vertexB, facetIndex);\r\n this.edges.push(edge);\r\n return edge;\r\n }\r\n /**\r\n * Push edges all around a facet, returning to vertexArray[0]\r\n * @param vertexArray array of vertex indices around facet\r\n * @param facetIndex\r\n */\r\n public addPath(vertexArray: number[], facetIndex: number, closeLoop: boolean = true) {\r\n if (vertexArray.length === 0) return;\r\n const m = vertexArray.length - 1;\r\n for (let i = 0; i < m; i++) {\r\n this.addEdge(vertexArray[i], vertexArray[i + 1], facetIndex);\r\n }\r\n if (closeLoop)\r\n this.addEdge(vertexArray[m], vertexArray[0], facetIndex);\r\n }\r\n /** Sort the edge index array. */\r\n public sort() {\r\n this.edges.sort((edgeA, edgeB) => SortableEdge.lessThan(edgeA, edgeB));\r\n }\r\n /** Create a single or compound SortableEdgeCluster in dest. */\r\n private collectSortableEdgeCluster(index0: number, index1: number, dest: SortableEdgeCluster[] | undefined) {\r\n if (dest !== undefined && index1 > index0) {\r\n if (index1 === index0 + 1) {\r\n dest.push(this.edges[index0]);\r\n } else {\r\n const cluster = [];\r\n for (let i = index0; i < index1; i++)\r\n cluster.push(this.edges[i]);\r\n dest.push(cluster);\r\n }\r\n\r\n }\r\n }\r\n /**\r\n * sort the edges, and look for three categories of paired edges:\r\n * * caller must allocate all result arrays of interest.\r\n * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.\r\n * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are merged into the target.\r\n * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array `allOther`, create `const allOther = []` as an empty array and call\r\n * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`\r\n * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior edges adjacent to two facets in opposing directions.\r\n * @param singletons optional array to receive edges that are simple boundary edges.\r\n * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)\r\n * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense but not a simple directed pair.\r\n */\r\n public sortAndCollectClusters(manifoldPairs: SortableEdgeCluster[] | undefined, singletons?: SortableEdgeCluster[], nullEdges?: SortableEdgeCluster[], allOtherClusters?: SortableEdgeCluster[]) {\r\n this.sort();\r\n if (manifoldPairs) manifoldPairs.length = 0;\r\n if (singletons) singletons.length = 0;\r\n if (nullEdges) nullEdges.length = 0;\r\n if (allOtherClusters) allOtherClusters.length = 0;\r\n const n = this.edges.length;\r\n let clusterLength;\r\n for (let index0 = 0; index0 < n; index0 += clusterLength) {\r\n const baseEdge = this.edges[index0];\r\n clusterLength = 1;\r\n for (let index1 = index0 + 1; index1 < n && SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {\r\n clusterLength++;\r\n }\r\n if (this.edges[index0].isNullEdge) {\r\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, nullEdges);\r\n } else if (clusterLength === 2 && SortableEdge.areDirectedPartners(baseEdge, this.edges[index0 + 1])) {\r\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, manifoldPairs);\r\n } else if (clusterLength === 1) {\r\n this.collectSortableEdgeCluster(index0, index0 + 1, singletons);\r\n } else {\r\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, allOtherClusters);\r\n }\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"IndexedEdgeMatcher.js","sourceRoot":"","sources":["../../../src/polyface/IndexedEdgeMatcher.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH;;;;;;GAMG;AACH,MAAa,YAAa,SAAQ,YAAY;IAC5C,uEAAuE;IACvE,IAAW,YAAY;QACrB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0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,aAAa,CAAC,CAAC;YACjF,CAAC;iBAAM,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;gBAC/B,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;YAClE,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,gBAAgB,CAAC,CAAC;YACpF,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAjGD,gDAiGC","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 Polyface\r\n */\r\n\r\n/**\r\n * * For boundary sorting, an edge is a (packed!) Float64Array.\r\n * * Fixed entry positions are:\r\n * * [0] is start vertex index (in CCW order around its facet)\r\n * * [1] is end vertex index (in CCW order around its facet)\r\n * * [2] is facet index.\r\n */\r\nexport class SortableEdge extends Float64Array {\r\n /** Return the vertex index that appears first in the order stored. */\r\n public get vertexIndexA(): number {\r\n return this[0];\r\n }\r\n /** Return the vertex index that appears second in the order stored. */\r\n public get vertexIndexB(): number {\r\n return this[1];\r\n }\r\n /** Return the facet index. */\r\n public get facetIndex(): number {\r\n return this[2];\r\n }\r\n /** return true if vertexIndexA is less than vertexIndexB. */\r\n public get isLowHigh(): boolean {\r\n return this[0] < this[1];\r\n }\r\n /** Return the vertex index with lower numeric value. */\r\n public get lowVertexIndex(): number {\r\n return this[0] < this[1] ? this[0] : this[1];\r\n }\r\n /** Return the vertex index with higher numeric value. */\r\n public get highVertexIndex(): number {\r\n return this[0] > this[1] ? this[0] : this[1];\r\n }\r\n /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order. */\r\n public static areDirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean {\r\n return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0];\r\n }\r\n /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order. */\r\n public static areUndirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean {\r\n return (edgeA[0] === edgeB[0] && edgeA[1] === edgeB[1]) || ((edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]));\r\n }\r\n /**\r\n * Return numeric relationship of edgeA and edgeB:\r\n * * 1 if they share start and end in the same order.\r\n * * -1 if they share start and end in reversed order.\r\n * * 0 otherwise.\r\n */\r\n public static relativeOrientation(edgeA: SortableEdge, edgeB: SortableEdge): number {\r\n if (edgeA[0] === edgeB[0] && edgeA[1] === edgeB[1]) return 1;\r\n if (edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]) return -1;\r\n return 0;\r\n }\r\n\r\n public get isNullEdge(): boolean {\r\n return this[0] === this[1];\r\n }\r\n /**\r\n * Lexical comparison of two edges.\r\n * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort.\r\n * * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.\r\n * @param edgeA first edge\r\n * @param edgeB second edge\r\n */\r\n public static lessThan(edgeA: SortableEdge, edgeB: SortableEdge): number {\r\n // primary compare is based on indirect indices\r\n const lowA = edgeA.lowVertexIndex;\r\n const lowB = edgeB.lowVertexIndex;\r\n if (lowA < lowB)\r\n return -1;\r\n if (lowB < lowA)\r\n return 1;\r\n const highA = edgeA.highVertexIndex;\r\n const highB = edgeB.highVertexIndex;\r\n if (highA < highB)\r\n return -1;\r\n if (highB < highA)\r\n return 1;\r\n // undirected indices match ... use directed vertexIndexA\r\n return edgeA.vertexIndexA - edgeB.vertexIndexA;\r\n }\r\n public constructor(vertexA: number, vertexB: number, facetIndex: number) {\r\n super(3);\r\n this[0] = vertexA;\r\n this[1] = vertexB;\r\n this[2] = facetIndex;\r\n }\r\n public toJSON(): any {\r\n return [this[0], this[1], this[2]];\r\n }\r\n public static clusterToJSON(data: SortableEdgeCluster): any {\r\n if (data instanceof SortableEdge)\r\n return data.toJSON();\r\n const result = [];\r\n for (const edge of data) result.push(edge.toJSON());\r\n }\r\n public static clusterArrayToJSON(data: SortableEdgeCluster[]) {\r\n const result = [];\r\n for (const cluster of data)\r\n result.push(SortableEdge.clusterToJSON(cluster));\r\n return result;\r\n }\r\n}\r\nexport type SortableEdgeCluster = SortableEdge | SortableEdge[];\r\n/**\r\n * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses\r\n * (such as testing for closed mesh).\r\n */\r\nexport class IndexedEdgeMatcher {\r\n public edges: SortableEdge[];\r\n\r\n constructor() {\r\n this.edges = [];\r\n }\r\n /**\r\n * Push a new edge.\r\n * @param vertexA start vertex\r\n * @param vertexB end vertex\r\n * @param facetIndex facet index\r\n * @returns the edge (as emplaced at the back of the sortableEdge array)\r\n */\r\n public addEdge(vertexA: number, vertexB: number, facetIndex: number): SortableEdge {\r\n const edge = new SortableEdge(vertexA, vertexB, facetIndex);\r\n this.edges.push(edge);\r\n return edge;\r\n }\r\n /**\r\n * Push edges all around a facet, returning to vertexArray[0].\r\n * @param vertexArray array of vertex indices around facet\r\n * @param facetIndex facet index\r\n * @param closeLoop true to add an edge from last to first vertex.\r\n */\r\n public addPath(vertexArray: number[], facetIndex: number, closeLoop: boolean = true) {\r\n if (vertexArray.length === 0) return;\r\n const m = vertexArray.length - 1;\r\n for (let i = 0; i < m; i++) {\r\n this.addEdge(vertexArray[i], vertexArray[i + 1], facetIndex);\r\n }\r\n if (closeLoop)\r\n this.addEdge(vertexArray[m], vertexArray[0], facetIndex);\r\n }\r\n /** Sort the edge index array. */\r\n public sort() {\r\n this.edges.sort((edgeA, edgeB) => SortableEdge.lessThan(edgeA, edgeB));\r\n }\r\n /** Create a single or compound SortableEdgeCluster in dest. */\r\n private collectSortableEdgeCluster(index0: number, index1: number, dest: SortableEdgeCluster[] | undefined) {\r\n if (dest !== undefined && index1 > index0) {\r\n if (index1 === index0 + 1) {\r\n dest.push(this.edges[index0]);\r\n } else {\r\n const cluster = [];\r\n for (let i = index0; i < index1; i++)\r\n cluster.push(this.edges[i]);\r\n dest.push(cluster);\r\n }\r\n }\r\n }\r\n /**\r\n * Sort the edges, and look for three categories of paired edges:\r\n * * caller must allocate all result arrays of interest.\r\n * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.\r\n * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are\r\n * merged into the target.\r\n * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array\r\n * `allOther`, create `const allOther = []` as an empty array and call\r\n * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`\r\n * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior\r\n * edges adjacent to two facets in opposing directions.\r\n * @param singletons optional array to receive edges that are simple boundary edges.\r\n * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)\r\n * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense\r\n * but not a simple directed pair.\r\n */\r\n public sortAndCollectClusters(\r\n manifoldPairs: SortableEdgeCluster[] | undefined,\r\n singletons?: SortableEdgeCluster[],\r\n nullEdges?: SortableEdgeCluster[],\r\n allOtherClusters?: SortableEdgeCluster[],\r\n ): void {\r\n this.sort();\r\n if (manifoldPairs) manifoldPairs.length = 0;\r\n if (singletons) singletons.length = 0;\r\n if (nullEdges) nullEdges.length = 0;\r\n if (allOtherClusters) allOtherClusters.length = 0;\r\n const n = this.edges.length;\r\n let clusterLength;\r\n for (let index0 = 0; index0 < n; index0 += clusterLength) {\r\n const baseEdge = this.edges[index0];\r\n clusterLength = 1;\r\n for (let index1 = index0 + 1; index1 < n &&\r\n SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {\r\n clusterLength++;\r\n }\r\n if (this.edges[index0].isNullEdge) {\r\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, nullEdges);\r\n } else if (clusterLength === 2 && SortableEdge.areDirectedPartners(baseEdge, this.edges[index0 + 1])) {\r\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, manifoldPairs);\r\n } else if (clusterLength === 1) {\r\n this.collectSortableEdgeCluster(index0, index0 + 1, singletons);\r\n } else {\r\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, allOtherClusters);\r\n }\r\n }\r\n }\r\n}\r\n"]}
@@ -95,7 +95,8 @@ export declare class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor
95
95
  static createSubsetVisitor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap?: number): IndexedPolyfaceSubsetVisitor;
96
96
  /**
97
97
  * Advance the iterator to a particular facet in the subset of client polyface facets.
98
- * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within the client polyface.
98
+ * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within
99
+ * the client polyface.
99
100
  * @return whether the iterator was successfully moved.
100
101
  */
101
102
  moveToReadIndex(activeIndex: number): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedPolyfaceVisitor.d.ts","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,YAAa,YAAW,eAAe;IACjF,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAkB;I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facet in the subset of client polyface facets.
212
- * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within the client polyface.
212
+ * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within
213
+ * the client polyface.
213
214
  * @return whether the iterator was successfully moved.
214
215
  */
215
216
  moveToReadIndex(activeIndex) {