@itwin/core-geometry 4.1.0-dev.70 → 4.1.0-dev.71

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 (96) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +15 -17
  3. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  4. package/lib/cjs/clipping/AlternatingConvexClipTree.js +24 -20
  5. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  6. package/lib/cjs/clipping/BooleanClipFactory.d.ts +28 -28
  7. package/lib/cjs/clipping/BooleanClipFactory.d.ts.map +1 -1
  8. package/lib/cjs/clipping/BooleanClipFactory.js +28 -28
  9. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  10. package/lib/cjs/clipping/BooleanClipNode.d.ts +11 -11
  11. package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
  12. package/lib/cjs/clipping/BooleanClipNode.js +11 -11
  13. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  14. package/lib/cjs/clipping/ClipPlane.d.ts +73 -76
  15. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  16. package/lib/cjs/clipping/ClipPlane.js +105 -86
  17. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  18. package/lib/cjs/clipping/ClipPrimitive.d.ts +78 -47
  19. package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
  20. package/lib/cjs/clipping/ClipPrimitive.js +110 -54
  21. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  22. package/lib/cjs/clipping/ClipUtils.d.ts +54 -44
  23. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  24. package/lib/cjs/clipping/ClipUtils.js +33 -29
  25. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  26. package/lib/cjs/clipping/ClipVector.d.ts +39 -25
  27. package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
  28. package/lib/cjs/clipping/ClipVector.js +35 -23
  29. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  30. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +61 -38
  31. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  32. package/lib/cjs/clipping/ConvexClipPlaneSet.js +64 -41
  33. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  34. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +49 -30
  35. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  36. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +50 -30
  37. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  38. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +2 -2
  39. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  40. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
  41. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  42. package/lib/cjs/curve/CurvePrimitive.d.ts +4 -2
  43. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  44. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  45. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  46. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  47. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  48. package/lib/cjs/curve/LineString3d.js.map +1 -1
  49. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +15 -17
  50. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  51. package/lib/esm/clipping/AlternatingConvexClipTree.js +24 -20
  52. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  53. package/lib/esm/clipping/BooleanClipFactory.d.ts +28 -28
  54. package/lib/esm/clipping/BooleanClipFactory.d.ts.map +1 -1
  55. package/lib/esm/clipping/BooleanClipFactory.js +28 -28
  56. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  57. package/lib/esm/clipping/BooleanClipNode.d.ts +11 -11
  58. package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
  59. package/lib/esm/clipping/BooleanClipNode.js +11 -11
  60. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  61. package/lib/esm/clipping/ClipPlane.d.ts +73 -76
  62. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  63. package/lib/esm/clipping/ClipPlane.js +105 -86
  64. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  65. package/lib/esm/clipping/ClipPrimitive.d.ts +78 -47
  66. package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
  67. package/lib/esm/clipping/ClipPrimitive.js +110 -54
  68. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  69. package/lib/esm/clipping/ClipUtils.d.ts +54 -44
  70. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  71. package/lib/esm/clipping/ClipUtils.js +33 -29
  72. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  73. package/lib/esm/clipping/ClipVector.d.ts +39 -25
  74. package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
  75. package/lib/esm/clipping/ClipVector.js +35 -23
  76. package/lib/esm/clipping/ClipVector.js.map +1 -1
  77. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +61 -38
  78. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  79. package/lib/esm/clipping/ConvexClipPlaneSet.js +64 -41
  80. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  81. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +49 -30
  82. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  83. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +50 -30
  84. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  85. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +2 -2
  86. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  87. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
  88. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  89. package/lib/esm/curve/CurvePrimitive.d.ts +4 -2
  90. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  91. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  92. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  93. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  94. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  95. package/lib/esm/curve/LineString3d.js.map +1 -1
  96. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ClipPrimitive.js","sourceRoot":"","sources":["../../../src/clipping/ClipPrimitive.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,mEAAyD;AACzD,mEAAkE;AAClE,yDAAsD;AAGtD,uDAAoD;AAEpD,6CAA0E;AAC1E,6DAAyD;AACzD,2CAAwC;AACxC,2CAA4D;AAC5D,6DAA0D;AAC1D,6EAA2G;AAC3G,2EAAoE;AACpE,6DAA0D;AAC1D,2DAAwD;AAGxD,mBAAmB;AACnB,oBAAoB;AACpB;;;GAGG;AACH,IAAY,sBAmBX;AAnBD,WAAY,sBAAsB;IAChC,gBAAgB;IAChB,mEAAW,CAAA;IACX,kBAAkB;IAClB,mEAAW,CAAA;IACX,mBAAmB;IACnB,qEAAY,CAAA;IACZ,kBAAkB;IAClB,mEAAW,CAAA;IACX,mBAAmB;IACnB,qEAAY,CAAA;IACZ,kBAAkB;IAClB,oEAAW,CAAA;IACX,mBAAmB;IACnB,sEAAY,CAAA;IACZ,0CAA0C;IAC1C,sEAAY,CAAA;IACZ,mBAAmB;IACnB,kEAAU,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,KAAK,CAAC,CAAC;IAC1D,CAAC;CACF;AA5YD,8BA4YC","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 CartesianGeometry\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { TransformProps, XYZProps } from \"../geometry3d/XYZProps\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { HalfEdge, HalfEdgeGraph, HalfEdgeMask } from \"../topology/Graph\";\r\nimport { Triangulator } from \"../topology/Triangulation\";\r\nimport { ClipPlane } from \"./ClipPlane\";\r\nimport { Clipper, ClipPlaneContainment } from \"./ClipUtils\";\r\nimport { ConvexClipPlaneSet } from \"./ConvexClipPlaneSet\";\r\nimport { UnionOfConvexClipPlaneSets, UnionOfConvexClipPlaneSetsProps } from \"./UnionOfConvexClipPlaneSets\";\r\nimport { AlternatingCCTreeNode } from \"./AlternatingConvexClipTree\";\r\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\r\nimport { PolylineOps } from \"../geometry3d/PolylineOps\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\r\n// cspell:word zlow\r\n// cspell:word zhigh\r\n/**\r\n * Bit mask type for referencing subsets of 6 planes of range box.\r\n * @public\r\n */\r\nexport enum ClipMaskXYZRangePlanes {\r\n /** no planes */\r\n None = 0x00,\r\n /** low x plane */\r\n XLow = 0x01,\r\n /** high x plane */\r\n XHigh = 0x02,\r\n /** low y plane */\r\n YLow = 0x04,\r\n /** high y plane */\r\n YHigh = 0x08,\r\n /** low z plane */\r\n ZLow = 0x10,\r\n /** high z plane */\r\n ZHigh = 0x20,\r\n /** all x and y planes, neither z plane */\r\n XAndY = 0x0f,\r\n /** all 6 planes */\r\n All = 0x3f,\r\n}\r\n\r\n/** Wire format describing a [[ClipPrimitive]] defined by a set of clip planes.\r\n * @public\r\n */\r\nexport interface ClipPrimitivePlanesProps {\r\n planes?: {\r\n /** The set of clip planes. */\r\n clips?: UnionOfConvexClipPlaneSetsProps;\r\n /** `true` if the primitive is a hole. */\r\n invisible?: boolean;\r\n };\r\n}\r\n\r\n/** Wire format describing a [[ClipShape]].\r\n * @public\r\n */\r\nexport interface ClipPrimitiveShapeProps {\r\n /** The clip polygon. */\r\n shape?: {\r\n /** The points describing the polygon. */\r\n points?: XYZProps[];\r\n /** Transform applied to the polygon. */\r\n trans?: TransformProps;\r\n /** Lower bound on Z. */\r\n zlow?: number;\r\n /** Upper bound on Z. */\r\n zhigh?: number;\r\n /** `true` if this shape is a mask. */\r\n mask?: boolean;\r\n /** `true` if this shape is invisible. */\r\n invisible?: boolean;\r\n };\r\n}\r\n\r\n/** Wire format describing a [[ClipPrimitive]].\r\n * @public\r\n */\r\nexport type ClipPrimitiveProps = ClipPrimitivePlanesProps | ClipPrimitiveShapeProps;\r\n\r\n/**\r\n * * ClipPrimitive is a base class for clipping implementations that use\r\n * * A UnionOfConvexClipPlaneSets designated \"clipPlanes\"\r\n * * an \"invisible\" flag\r\n * * When constructed directly, objects of type ClipPrimitive (directly, not through a derived class) will have just planes\r\n * * Derived classes (e.g. ClipShape) carry additional data such as a swept shape.\r\n * * ClipPrimitive can be constructed with no planes.\r\n * * Derived class is responsible for filling the plane sets.\r\n * * At discretion of derived classes, plane construction can be done at construction time or \"on demand when\" queries call `ensurePlaneSets ()`\r\n * * ClipPrimitive can be constructed directly with planes (and no derived class).\r\n * * That the prevailing use is via a ClipShape derived class.\r\n * * The ClipShape has an \"isMask\" property\r\n * * isMask === false means the plane sets should cover the inside of its polygon\r\n * * isMask === true means the plane sets should cover the outside of its polygon.\r\n * * Note that the ClipShape's `isMask` property and the ClipPrimitive's `isInvisible` property are distinct controls.\r\n * * In normal usage, callers get \"outside\" clip behavior using ONLY the ClipShape isMask property.\r\n * * The ClipShape happens to pass the _invisible bit down to ClipPlanes that it creates.\r\n * * At that level, the flag controls whether the cut edges are produced on the plane\r\n * @public\r\n */\r\nexport class ClipPrimitive implements Clipper{\r\n /** The (union of) convex regions. */\r\n protected _clipPlanes?: UnionOfConvexClipPlaneSets;\r\n /** If true, pointInside inverts the sense of the pointInside for the _clipPlanes */\r\n protected _invisible: boolean;\r\n /** Get a reference to the `UnionOfConvexClipPlaneSets`.\r\n * * It triggers construction of the sets by `this.ensurePlaneSets()`.\r\n * * Derived class typically caches the set on the first such call.\r\n */\r\n public fetchClipPlanesRef(): UnionOfConvexClipPlaneSets | undefined { this.ensurePlaneSets(); return this._clipPlanes; }\r\n /** Ask if this primitive is a hole. */\r\n public get invisible(): boolean { return this._invisible; }\r\n\r\n protected constructor(planeSet?: UnionOfConvexClipPlaneSets | undefined, isInvisible: boolean = false) {\r\n this._clipPlanes = planeSet;\r\n this._invisible = isInvisible;\r\n }\r\n /**\r\n * Create a ClipPrimitive, capturing the supplied plane set as the clip planes.\r\n * @param planes clipper\r\n * @param isInvisible set the invisible flag on the ClipPrimitive\r\n */\r\n public static createCapture(planes: UnionOfConvexClipPlaneSets | ConvexClipPlaneSet | undefined, isInvisible: boolean = false): ClipPrimitive {\r\n let planeData;\r\n if (planes instanceof UnionOfConvexClipPlaneSets)\r\n planeData = planes;\r\n if (planes instanceof ConvexClipPlaneSet)\r\n planeData = UnionOfConvexClipPlaneSets.createConvexSets([planes]);\r\n\r\n return new ClipPrimitive(planeData, isInvisible);\r\n }\r\n /** Emit json form of the clip planes */\r\n public toJSON(): ClipPrimitiveProps {\r\n const planes: ClipPrimitivePlanesProps[\"planes\"] = {};\r\n if (this._clipPlanes)\r\n planes.clips = this._clipPlanes.toJSON();\r\n\r\n if (this._invisible)\r\n planes.invisible = true;\r\n\r\n return { planes };\r\n }\r\n\r\n /**\r\n * Returns true if the planes are present.\r\n * * This can be false (for instance) if a ClipShape is holding a polygon but has not yet been asked to construct the planes.\r\n */\r\n public arePlanesDefined(): boolean {\r\n return this._clipPlanes !== undefined;\r\n }\r\n /** Return a deep clone */\r\n public clone(): ClipPrimitive {\r\n const newPlanes = this._clipPlanes ? this._clipPlanes.clone() : undefined;\r\n const result = new ClipPrimitive(newPlanes, this._invisible);\r\n return result;\r\n }\r\n\r\n /**\r\n * * trigger (if needed) computation of plane sets (if applicable) in the derived class.\r\n * * Base class is no op.\r\n * * In derived class, on first call create planes sets from defining data (e.g. swept shape).\r\n * * In derived class, if planes are present leave them alone.\r\n */\r\n public ensurePlaneSets() { }\r\n /** Return true if the point lies inside/on this polygon (or not inside/on if this polygon is a mask). Otherwise, return false.\r\n * * Note that a derived class may choose to (a) implement its own test using its defining data, or (b) accept this implementation using planes that it inserted in the base class.\r\n */\r\n public pointInside(point: Point3d, onTolerance: number = Geometry.smallMetricDistanceSquared): boolean {\r\n this.ensurePlaneSets();\r\n let inside = true;\r\n if (this._clipPlanes)\r\n inside = this._clipPlanes.isPointOnOrInside(point, onTolerance);\r\n return inside;\r\n }\r\n\r\n /** Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public isPointOnOrInside(point: Point3d, onTolerance: number = Geometry.smallMetricDistanceSquared): boolean {\r\n this.ensurePlaneSets();\r\n let inside = true;\r\n if (this._clipPlanes)\r\n inside = this._clipPlanes.isPointOnOrInside(point, onTolerance);\r\n return inside;\r\n }\r\n /** Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean {\r\n this.ensurePlaneSets();\r\n let hasInsideParts = false;\r\n if (this._clipPlanes)\r\n hasInsideParts = this._clipPlanes.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce);\r\n return hasInsideParts;\r\n }\r\n /** Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n this.ensurePlaneSets();\r\n let hasInsideParts = false;\r\n if (this._clipPlanes)\r\n hasInsideParts = this._clipPlanes.announceClippedArcIntervals(arc, announce);\r\n return hasInsideParts;\r\n }\r\n\r\n /**\r\n * Multiply all ClipPlanes DPoint4d by matrix.\r\n * @param matrix matrix to apply.\r\n * @param invert if true, use in verse of the matrix.\r\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter)\r\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding effect on the plane is the inverse transpose of matrixA\r\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\r\n * * Both params default to true to get the full effect of transforming space.\r\n * @param matrix matrix to apply\r\n */\r\n public multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\r\n if (invert) { // form inverse once here, reuse for all planes\r\n const inverse = matrix.createInverse();\r\n if (!inverse)\r\n return false;\r\n return this.multiplyPlanesByMatrix4d(inverse, false, transpose);\r\n }\r\n\r\n if (this._clipPlanes)\r\n this._clipPlanes.multiplyPlanesByMatrix4d(matrix);\r\n return true;\r\n }\r\n\r\n /** Apply a transform to the clipper (e.g. transform all planes) */\r\n public transformInPlace(transform: Transform): boolean {\r\n if (this._clipPlanes)\r\n this._clipPlanes.transformInPlace(transform);\r\n\r\n return true;\r\n }\r\n\r\n /** Sets both the clip plane set and the mask set visibility */\r\n public setInvisible(invisible: boolean) {\r\n this._invisible = invisible;\r\n }\r\n\r\n /**\r\n * Return true if any plane of the primary clipPlanes has (a) non-zero z component in its normal vector and (b) finite distance from origin.\r\n */\r\n public containsZClip(): boolean {\r\n if (this.fetchClipPlanesRef() !== undefined)\r\n for (const convexSet of this._clipPlanes!.convexSets)\r\n for (const plane of convexSet.planes)\r\n if (Math.abs(plane.inwardNormalRef.z) > 1.0e-6 && Math.abs(plane.distance) !== Number.MAX_VALUE)\r\n return true;\r\n return false;\r\n }\r\n\r\n /**\r\n * Quick test of whether the given points fall completely inside or outside.\r\n * @param points points to test\r\n * @param ignoreInvisibleSetting if true, do the test with the clip planes and return that, ignoring the invisible setting.\r\n */\r\n public classifyPointContainment(points: Point3d[], ignoreInvisibleSetting: boolean): ClipPlaneContainment {\r\n this.ensurePlaneSets();\r\n const planes = this._clipPlanes;\r\n let inside = ClipPlaneContainment.StronglyInside;\r\n if (planes)\r\n inside = planes.classifyPointContainment(points, false);\r\n if (this._invisible && !ignoreInvisibleSetting)\r\n switch (inside) {\r\n case ClipPlaneContainment.StronglyInside:\r\n return ClipPlaneContainment.StronglyOutside;\r\n case ClipPlaneContainment.StronglyOutside:\r\n return ClipPlaneContainment.StronglyInside;\r\n case ClipPlaneContainment.Ambiguous:\r\n return ClipPlaneContainment.Ambiguous;\r\n }\r\n return inside;\r\n }\r\n /** Promote json object form to class instance\r\n * * First try to convert to a ClipShape\r\n * * then try as a standalone instance of the base class ClipPrimitive.\r\n */\r\n public static fromJSON(json: ClipPrimitiveProps | undefined): ClipPrimitive | undefined {\r\n if (!json)\r\n return undefined;\r\n\r\n const shape = ClipShape.fromClipShapeJSON(json as ClipPrimitiveShapeProps);\r\n if (shape)\r\n return shape;\r\n\r\n return ClipPrimitive.fromJSONClipPrimitive(json as ClipPrimitivePlanesProps);\r\n }\r\n /** Specific converter producing the base class ClipPrimitive. */\r\n public static fromJSONClipPrimitive(json: ClipPrimitivePlanesProps | undefined): ClipPrimitive | undefined {\r\n const planes = json?.planes;\r\n if (!planes)\r\n return undefined;\r\n\r\n const clipPlanes = planes.clips ? UnionOfConvexClipPlaneSets.fromJSON(planes.clips) : undefined;\r\n const invisible = undefined !== planes.invisible ? planes.invisible : false;\r\n return new ClipPrimitive(clipPlanes, invisible);\r\n }\r\n}\r\n\r\n/** Internal helper class holding XYZ components that serves as a representation of polygon edges defined by clip planes */\r\nclass PolyEdge {\r\n public pointA: Point3d;\r\n public pointB: Point3d;\r\n public normal: Vector3d;\r\n\r\n public constructor(origin: Point3d, next: Point3d, normal: Vector3d, z: number) {\r\n this.pointA = Point3d.create(origin.x, origin.y, z);\r\n this.pointB = Point3d.create(next.x, next.y, z);\r\n this.normal = normal;\r\n }\r\n // Assume both normals are unit length.\r\n // old logic: use difference of (previously computed) normals as perpendicular to bisector.\r\n public static makeUnitPerpendicularToBisector(edgeA: PolyEdge, edgeB: PolyEdge, reverse: boolean): Vector3d | undefined{\r\n let candidate = edgeB.normal.minus(edgeA.normal);\r\n if (candidate.normalize(candidate) === undefined) {\r\n candidate = Vector3d.createStartEnd(edgeA.pointA, edgeB.pointB);\r\n if (candidate.normalize(candidate) === undefined)\r\n return undefined;\r\n }\r\n if (reverse)\r\n candidate.scale(-1.0, candidate);\r\n return candidate;\r\n }\r\n}\r\n/**\r\n * A clipping volume defined by a shape (an array of 3d points using only x and y dimensions).\r\n * May be given either a ClipPlaneSet to store directly, or an array of polygon points as well as other parameters\r\n * for parsing ClipPlanes from the shape later.\r\n * @public\r\n */\r\nexport class ClipShape extends ClipPrimitive {\r\n /** Points of the polygon, in the xy plane of the local coordinate system. */\r\n protected _polygon: Point3d[];\r\n /** optional low z (in local coordinates) */\r\n protected _zLow?: number;\r\n /** optional high z (in local coordinates) */\r\n protected _zHigh?: number;\r\n /** true if this is considered a hole (keep geometry outside of the polygon.) */\r\n protected _isMask: boolean;\r\n /** transform from local to world */\r\n protected _transformFromClip?: Transform;\r\n /** Transform from world to local */\r\n protected _transformToClip?: Transform;\r\n protected constructor(polygon: Point3d[] = [], zLow?: number, zHigh?: number, transform?: Transform, isMask: boolean = false, invisible: boolean = false) {\r\n super(undefined, invisible); // ClipPlaneSets will be set up later after storing points\r\n this._isMask = false;\r\n this._polygon = polygon;\r\n this.initSecondaryProps(isMask, zLow, zHigh, transform);\r\n }\r\n /** Returns true if this ClipShape is marked as invisible. */\r\n public override get invisible(): boolean { return this._invisible; }\r\n /** Return this transformFromClip, which may be undefined. */\r\n public get transformFromClip(): Transform | undefined { return this._transformFromClip; }\r\n /** Return this transformToClip, which may be undefined. */\r\n public get transformToClip(): Transform | undefined { return this._transformToClip; }\r\n /** Returns true if this ClipShape's transforms are currently set. */\r\n public get transformValid(): boolean { return this.transformFromClip !== undefined; }\r\n /** Returns true if this ClipShape's lower z boundary is set. */\r\n public get zLowValid(): boolean { return this._zLow !== undefined; }\r\n /** Returns true if this ClipShape's upper z boundary is set. */\r\n public get zHighValid(): boolean { return this._zHigh !== undefined; }\r\n /** Return true if this ClipShape has a local to world transform */\r\n public get transformIsValid(): boolean { return this._transformFromClip !== undefined; }\r\n /** Return this zLow, which may be undefined. */\r\n public get zLow(): number | undefined { return this._zLow; }\r\n /** Return this zHigh, which may be undefined. */\r\n public get zHigh(): number | undefined { return this._zHigh; }\r\n /** Returns a reference to this ClipShape's polygon array. */\r\n public get polygon(): Point3d[] { return this._polygon; }\r\n /** Returns true if this ClipShape is a masking set. */\r\n public get isMask(): boolean { return this._isMask; }\r\n /** Sets the polygon points array of this ClipShape to the array given (by reference). */\r\n public setPolygon(polygon: Point3d[]) {\r\n // Add closure point\r\n if (!polygon[0].isAlmostEqual(polygon[polygon.length - 1]))\r\n polygon.push(polygon[0].clone());\r\n this._polygon = polygon;\r\n }\r\n /**\r\n * * If the ClipShape's associated `UnionOfConvexClipPlaneSets` is defined, do nothing.\r\n * * If the ClipShape's associated `UnionOfConvexClipPlaneSets` is undefined, generate it from the `ClipShape` and transform.\r\n */\r\n public override ensurePlaneSets() {\r\n if (this._clipPlanes !== undefined)\r\n return;\r\n this._clipPlanes = UnionOfConvexClipPlaneSets.createEmpty();\r\n this.parseClipPlanes(this._clipPlanes);\r\n if (this._transformFromClip)\r\n this._clipPlanes.transformInPlace(this._transformFromClip);\r\n }\r\n /**\r\n * Initialize the members of the ClipShape class that may at times be undefined.\r\n * zLow and zHigh default to Number.MAX_VALUE, and the transform defaults to an identity transform\r\n */\r\n public initSecondaryProps(isMask: boolean, zLow?: number, zHigh?: number, transform?: Transform) {\r\n this._isMask = isMask;\r\n this._zLow = zLow;\r\n this._zHigh = zHigh;\r\n\r\n if (transform !== undefined) {\r\n this._transformFromClip = transform;\r\n this._transformToClip = transform.inverse(); // could be undefined\r\n } else {\r\n this._transformFromClip = Transform.createIdentity();\r\n this._transformToClip = Transform.createIdentity();\r\n }\r\n }\r\n\r\n /** emit json object form */\r\n public override toJSON(): ClipPrimitiveShapeProps {\r\n const shape: ClipPrimitiveShapeProps[\"shape\"] = {\r\n points: this._polygon.map((pt) => pt.toJSON()),\r\n };\r\n\r\n if (this.invisible)\r\n shape.invisible = true;\r\n\r\n if (this._transformFromClip && !this._transformFromClip.isIdentity)\r\n shape.trans = this._transformFromClip.toJSON();\r\n\r\n if (this.isMask)\r\n shape.mask = true;\r\n\r\n if (typeof (this.zLow) !== \"undefined\" && this.zLow !== -Number.MAX_VALUE)\r\n shape.zlow = this.zLow;\r\n\r\n if (typeof (this.zHigh) !== \"undefined\" && this.zHigh !== Number.MAX_VALUE)\r\n shape.zhigh = this.zHigh;\r\n\r\n return { shape };\r\n }\r\n\r\n /** parse `json` to a clip shape. */\r\n public static fromClipShapeJSON(json: ClipPrimitiveShapeProps | undefined, result?: ClipShape): ClipShape | undefined {\r\n const shape = json?.shape;\r\n if (!shape)\r\n return undefined;\r\n\r\n const points: Point3d[] = shape.points ? shape.points.map((pt) => Point3d.fromJSON(pt)) : [];\r\n const trans = shape.trans ? Transform.fromJSON(shape.trans) : undefined;\r\n const zLow = typeof shape.zlow === \"number\" ? shape.zlow : undefined;\r\n const zHigh = typeof shape.zhigh === \"number\" ? shape.zhigh : undefined;\r\n const isMask = typeof shape.mask === \"boolean\" && shape.mask;\r\n const invisible = typeof shape.invisible === \"boolean\" && shape.invisible;\r\n\r\n return ClipShape.createShape(points, zLow, zHigh, trans, isMask, invisible, result);\r\n }\r\n\r\n /** Returns a new ClipShape that is a deep copy of the ClipShape given */\r\n public static createFrom(other: ClipShape, result?: ClipShape): ClipShape {\r\n const retVal = ClipShape.createEmpty(false, false, undefined, result);\r\n retVal._invisible = other._invisible;\r\n for (const point of other._polygon) {\r\n retVal._polygon.push(point.clone());\r\n }\r\n retVal._isMask = other._isMask;\r\n retVal._zLow = other._zLow;\r\n retVal._zHigh = other._zHigh;\r\n retVal._transformToClip = other._transformToClip ? other._transformToClip.clone() : undefined;\r\n retVal._transformFromClip = other._transformFromClip ? other._transformFromClip.clone() : undefined;\r\n return retVal;\r\n }\r\n /** Create a new ClipShape from an array of points that make up a 2d shape (stores a deep copy of these points). */\r\n public static createShape(polygon: Point3d[] = [], zLow?: number, zHigh?: number, transform?: Transform, isMask: boolean = false, invisible: boolean = false, result?: ClipShape): ClipShape | undefined {\r\n if (polygon.length < 3)\r\n return undefined;\r\n const pPoints = polygon.slice(0);\r\n // Add closure point.\r\n if (pPoints[0].isAlmostEqual(pPoints[pPoints.length - 1]))\r\n pPoints[0].clone(pPoints[pPoints.length - 1]);\r\n else\r\n pPoints.push(pPoints[0].clone());\r\n if (result) {\r\n result._clipPlanes = undefined; // Start as undefined\r\n result._invisible = invisible;\r\n result._polygon = pPoints;\r\n result.initSecondaryProps(isMask, zLow, zHigh, transform);\r\n return result;\r\n } else {\r\n return new ClipShape(pPoints, zLow, zHigh, transform, isMask, invisible);\r\n }\r\n }\r\n /**\r\n * Create a ClipShape that exists as a 3 dimensional box of the range given. Optionally choose to\r\n * also store this shape's zLow and zHigh members from the range through the use of a RangePlaneBitMask.\r\n */\r\n public static createBlock(extremities: Range3d, clipMask: ClipMaskXYZRangePlanes, isMask: boolean = false, invisible: boolean = false, transform?: Transform, result?: ClipShape): ClipShape {\r\n const low = extremities.low;\r\n const high = extremities.high;\r\n const blockPoints: Point3d[] = [];\r\n for (let i = 0; i < 5; i++)\r\n blockPoints.push(Point3d.create());\r\n blockPoints[0].x = blockPoints[3].x = blockPoints[4].x = low.x;\r\n blockPoints[1].x = blockPoints[2].x = high.x;\r\n blockPoints[0].y = blockPoints[1].y = blockPoints[4].y = low.y;\r\n blockPoints[2].y = blockPoints[3].y = high.y;\r\n return ClipShape.createShape(blockPoints, (ClipMaskXYZRangePlanes.None !== (clipMask & ClipMaskXYZRangePlanes.ZLow)) ? low.z : undefined, ClipMaskXYZRangePlanes.None !== (clipMask & ClipMaskXYZRangePlanes.ZHigh) ? high.z : undefined, transform, isMask, invisible, result)!;\r\n }\r\n /** Creates a new ClipShape with undefined members and a polygon points array of zero length. */\r\n public static createEmpty(isMask = false, invisible: boolean = false, transform?: Transform, result?: ClipShape): ClipShape {\r\n if (result) {\r\n result._clipPlanes = undefined;\r\n result._invisible = invisible;\r\n result._polygon.length = 0;\r\n result.initSecondaryProps(isMask, undefined, undefined, transform);\r\n return result;\r\n }\r\n return new ClipShape([], undefined, undefined, transform, isMask, invisible);\r\n }\r\n /** Checks to ensure that the member polygon has an area, and that the polygon is closed. */\r\n public get isValidPolygon(): boolean {\r\n if (this._polygon.length < 3)\r\n return false;\r\n if (!this._polygon[0].isExactEqual(this._polygon[this._polygon.length - 1]))\r\n return false;\r\n return true;\r\n }\r\n /** Returns a deep copy of this instance of ClipShape, storing in an optional result */\r\n public override clone(result?: ClipShape): ClipShape {\r\n return ClipShape.createFrom(this, result);\r\n }\r\n /** Given the current polygon data, parses clip planes that together form an object, storing the result in the set given, either clipplanes or maskplanes. */\r\n private parseClipPlanes(set: UnionOfConvexClipPlaneSets) {\r\n const points = this._polygon;\r\n if (points.length === 3 && !this._isMask && points[0].isExactEqual(points[points.length - 1])) {\r\n this.parseLinearPlanes(set, this._polygon[0], this._polygon[1]);\r\n return true;\r\n }\r\n\r\n if (!this.isMask){\r\n const direction = PolygonOps.testXYPolygonTurningDirections(this.polygon);\r\n if (direction !== 0){\r\n this.parseConvexPolygonPlanes(set, this._polygon, direction, false);\r\n return true;\r\n }\r\n }\r\n\r\n // REMARK: Pass all polygons to non-convex case. It will funnel\r\n // to concave case as appropriate.\r\n this.parsePolygonPlanes(set, this._polygon, this.isMask);\r\n return true;\r\n }\r\n /** Given a start and end point, populate the given UnionOfConvexClipPlaneSets with ConvexClipPlaneSets defining the bounded region of linear planes. Returns true if successful. */\r\n private parseLinearPlanes(set: UnionOfConvexClipPlaneSets, start: Point3d, end: Point3d, cameraFocalLength?: number): boolean {\r\n // Handles the degenerate case of 2 distinct points (used by select by line).\r\n const normal = start.vectorTo(end);\r\n if (normal.magnitude() === 0.0)\r\n return false;\r\n normal.normalize(normal);\r\n const convexSet = ConvexClipPlaneSet.createEmpty();\r\n if (cameraFocalLength === undefined) {\r\n const perpendicular = Vector2d.create(-normal.y, normal.x);\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(Vector3d.create(normal.x, normal.y), Point3d.createFrom(start), this._invisible)!);\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(Vector3d.create(-normal.x, -normal.y), Point3d.createFrom(end), this._invisible)!);\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(Vector3d.create(perpendicular.x, perpendicular.y), Point3d.createFrom(start), this._invisible)!);\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(Vector3d.create(-perpendicular.x, -perpendicular.y), Point3d.createFrom(start), this._invisible)!);\r\n } else {\r\n const start3d = Point3d.create(start.x, start.y, -cameraFocalLength);\r\n const end3d = Point3d.create(end.x, end.y, -cameraFocalLength);\r\n const vecEnd3d = Vector3d.createFrom(end3d);\r\n const perpendicular = vecEnd3d.crossProduct(Vector3d.createFrom(start3d)).normalize();\r\n let endNormal = Vector3d.createFrom(start3d).crossProduct(perpendicular!).normalize();\r\n convexSet.planes.push(ClipPlane.createNormalAndDistance(perpendicular!, 0.0, this._invisible)!);\r\n convexSet.planes.push(ClipPlane.createNormalAndDistance(endNormal!, 0.0, this._invisible)!);\r\n perpendicular!.negate();\r\n endNormal = vecEnd3d.crossProduct(perpendicular!).normalize();\r\n convexSet.planes.push(ClipPlane.createNormalAndDistance(perpendicular!, 0.0, this._invisible)!);\r\n convexSet.planes.push(ClipPlane.createNormalAndDistance(endNormal!, 0.0, this._invisible)!);\r\n }\r\n convexSet.addZClipPlanes(this._invisible, this._zLow, this._zHigh);\r\n set.addConvexSet(convexSet);\r\n return true;\r\n }\r\n\r\n /** Given a convex polygon defined as an array of points, populate the given UnionOfConvexClipPlaneSets with ConvexClipPlaneSets defining the bounded region. Returns true if successful. */\r\n private parseConvexPolygonPlanes(set: UnionOfConvexClipPlaneSets, polygon: Point3d[], direction: number, buildExteriorClipper: boolean, cameraFocalLength?: number): boolean {\r\n const samePointTolerance = 1.0e-8; // This could possibly be replaced with more widely used constants\r\n const edges: PolyEdge[] = [];\r\n // const reverse = (direction < 0) !== this._isMask;\r\n const reverse = direction < 0;\r\n for (let i = 0; i < polygon.length - 1; i++) {\r\n const z = (cameraFocalLength === undefined) ? 0.0 : -cameraFocalLength;\r\n const dir = Vector3d.createStartEnd (polygon[i], polygon[i + 1]);\r\n const magnitude = dir.magnitude();\r\n dir.normalize(dir);\r\n if (magnitude > samePointTolerance) {\r\n const normal = Vector3d.create(reverse ? dir.y : -dir.y, reverse ? -dir.x : dir.x);\r\n edges.push(new PolyEdge(polygon[i], polygon[i + 1], normal, z));\r\n }\r\n }\r\n if (edges.length < 3) {\r\n return false;\r\n }\r\n if (buildExteriorClipper) {\r\n const last = edges.length - 1;\r\n for (let i = 0; i <= last; i++) {\r\n const edge = edges[i];\r\n const prevEdge = edges[i ? (i - 1) : last];\r\n const nextEdge = edges[(i === last) ? 0 : (i + 1)];\r\n const convexSet = ConvexClipPlaneSet.createEmpty();\r\n const previousPerpendicular = PolyEdge.makeUnitPerpendicularToBisector(prevEdge, edge, !reverse);\r\n const nextPerpendicular = PolyEdge.makeUnitPerpendicularToBisector(edge, nextEdge, reverse);\r\n // Create three-sided fans from each edge. Note we could define the correct region\r\n // with only two planes for edge, but cannot then designate the \"interior\" status of the edges accurately.\r\n\r\n if (previousPerpendicular)\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(previousPerpendicular, edge.pointA, this._invisible, true)!);\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(edge.normal, edge.pointB, this._invisible, false)!);\r\n if (nextPerpendicular)\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(nextPerpendicular, nextEdge.pointA, this._invisible, true)!);\r\n set.addConvexSet(convexSet);\r\n set.addOutsideZClipSets(this._invisible, this._zLow, this._zHigh);\r\n }\r\n } else {\r\n const convexSet = ConvexClipPlaneSet.createEmpty();\r\n if (cameraFocalLength === undefined) {\r\n for (const edge of edges)\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(Vector3d.create(edge.normal.x, edge.normal.y), edge.pointA)!);\r\n } else {\r\n if (reverse)\r\n for (const edge of edges)\r\n convexSet.planes.push(ClipPlane.createNormalAndDistance(Vector3d.createFrom(edge.pointA).crossProduct(Vector3d.createFrom(edge.pointB)).normalize()!, 0.0)!);\r\n else\r\n for (const edge of edges)\r\n convexSet.planes.push(ClipPlane.createNormalAndDistance(Vector3d.createFrom(edge.pointB).crossProduct(Vector3d.createFrom(edge.pointA)).normalize()!, 0.0)!);\r\n }\r\n convexSet.addZClipPlanes(this._invisible, this._zLow, this._zHigh);\r\n set.addConvexSet(convexSet);\r\n }\r\n return true;\r\n }\r\n /** Given a (possibly non-convex) polygon defined as an array of points, populate the given UnionOfConvexClipPlaneSets with multiple ConvexClipPlaneSets defining the bounded region. Returns true if successful. */\r\n private parsePolygonPlanes(set: UnionOfConvexClipPlaneSets, polygon: Point3d[], isMask: boolean, cameraFocalLength?: number): boolean {\r\n const cleanPolygon = PolylineOps.compressDanglers(polygon, true);\r\n const announceFace = (_graph: HalfEdgeGraph, edge: HalfEdge): boolean => {\r\n if (!edge.isMaskSet(HalfEdgeMask.EXTERIOR)) {\r\n const convexFacetPoints = edge.collectAroundFace((node: HalfEdge): any => {\r\n if (!node.isMaskSet(HalfEdgeMask.EXTERIOR))\r\n return Point3d.create(node.x, node.y, 0);\r\n });\r\n // parseConvexPolygonPlanes expects a closed loop (pushing the reference doesn't matter)\r\n convexFacetPoints.push(convexFacetPoints[0].clone());\r\n const direction = PolygonOps.testXYPolygonTurningDirections(convexFacetPoints); // ###TODO: Can we expect a direction coming out of graph facet?\r\n this.parseConvexPolygonPlanes(set, convexFacetPoints, direction, false, cameraFocalLength);\r\n }\r\n return true;\r\n };\r\n if (isMask) {\r\n const polygonA = Point3dArray.clonePoint3dArray ( cleanPolygon);\r\n const hullAndInlets = AlternatingCCTreeNode.createHullAndInletsForPolygon(polygonA);\r\n const allLoops = hullAndInlets.extractLoops();\r\n if (allLoops.length === 0)\r\n return false;\r\n const hull = allLoops[0];\r\n const direction1 = PolygonOps.testXYPolygonTurningDirections(hull); // ###TODO: Can we expect a direction coming out of graph facet?\r\n this.parseConvexPolygonPlanes(set, hull, -direction1, true, cameraFocalLength);\r\n for (let i = 1; i < allLoops.length; i++) {\r\n const triangulatedPolygon = Triangulator.createTriangulatedGraphFromSingleLoop(allLoops[i]);\r\n if (triangulatedPolygon) {\r\n Triangulator.flipTriangles(triangulatedPolygon);\r\n triangulatedPolygon.announceFaceLoops(announceFace);\r\n }\r\n }\r\n return true;\r\n } else {\r\n const triangulatedPolygon = Triangulator.createTriangulatedGraphFromSingleLoop(cleanPolygon);\r\n if (triangulatedPolygon === undefined)\r\n return false;\r\n Triangulator.flipTriangles(triangulatedPolygon);\r\n triangulatedPolygon.announceFaceLoops(announceFace);\r\n }\r\n return true;\r\n }\r\n /**\r\n * Multiply all ClipPlanes DPoint4d by matrix.\r\n * @param matrix matrix to apply.\r\n * @param invert if true, use in verse of the matrix.\r\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter)\r\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding effect on the plane is the inverse transpose of matrixA\r\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\r\n * * Both params default to true to get the full effect of transforming space.\r\n * @param matrix matrix to apply\r\n */\r\n public override multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\r\n this.ensurePlaneSets();\r\n return super.multiplyPlanesByMatrix4d(matrix, invert, transpose);\r\n }\r\n /** Apply `transform` to the local to world (`transformFromClip`) transform.\r\n * * The world to local transform (`transformToClip` is recomputed from the (changed) `transformToClip`\r\n * * the transform is passed to the base class to be applied to clip plane form of the clipper.\r\n */\r\n public override transformInPlace(transform: Transform): boolean {\r\n if (transform.isIdentity)\r\n return true;\r\n super.transformInPlace(transform);\r\n if (this._transformFromClip)\r\n transform.multiplyTransformTransform(this._transformFromClip, this._transformFromClip);\r\n else\r\n this._transformFromClip = transform.clone();\r\n this._transformToClip = this._transformFromClip.inverse(); // could be undefined\r\n return true;\r\n }\r\n /** Return true if\r\n * * at least one point is defined\r\n * * The local to world transform (transformFromClip) either\r\n * * is undefined\r\n * * has no xy parts in its column Z (local frame Z is parallel to global Z)\r\n */\r\n public get isXYPolygon(): boolean {\r\n if (this._polygon.length === 0) // Note: This is a lenient check, as points array could also contain less than 3 points (not a polygon)\r\n return false;\r\n if (this._transformFromClip === undefined)\r\n return true;\r\n const zVector = this._transformFromClip.matrix.columnZ();\r\n return zVector.magnitudeXY() < 1.0e-8;\r\n }\r\n /** Transform the input point in place using this instance's `transformToClip` member */\r\n public performTransformToClip(point: Point3d): void {\r\n if (this._transformToClip !== undefined)\r\n this._transformToClip.multiplyPoint3d(point, point);\r\n }\r\n /** Transform the input point in place using this instance's `transformFromClip` member */\r\n public performTransformFromClip(point: Point3d): void {\r\n if (this._transformFromClip !== undefined)\r\n this._transformFromClip.multiplyPoint3d(point, point);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ClipPrimitive.js","sourceRoot":"","sources":["../../../src/clipping/ClipPrimitive.ts"],"names":[],"mappings":";AAAA;;;+FAG+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,CAAC,MAAM,KAAK,CAAC,EAAE,uGAAuG;YACrI,OAAO,KAAK,CAAC;QACf,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS;YACvC,OAAO,IAAI,CAAC;QACd,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACzD,OAAO,OAAO,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC;IACxC,CAAC;IACD,wFAAwF;IACjF,sBAAsB,CAAC,KAAc;QAC1C,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS;YACrC,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;IACD,0FAA0F;IACnF,wBAAwB,CAAC,KAAc;QAC5C,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS;YACvC,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;CACF;AA1dD,8BA0dC","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 CartesianGeometry\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { TransformProps, XYZProps } from \"../geometry3d/XYZProps\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { HalfEdge, HalfEdgeGraph, HalfEdgeMask } from \"../topology/Graph\";\r\nimport { Triangulator } from \"../topology/Triangulation\";\r\nimport { ClipPlane } from \"./ClipPlane\";\r\nimport { Clipper, ClipPlaneContainment } from \"./ClipUtils\";\r\nimport { ConvexClipPlaneSet } from \"./ConvexClipPlaneSet\";\r\nimport { UnionOfConvexClipPlaneSets, UnionOfConvexClipPlaneSetsProps } from \"./UnionOfConvexClipPlaneSets\";\r\nimport { AlternatingCCTreeNode } from \"./AlternatingConvexClipTree\";\r\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\r\nimport { PolylineOps } from \"../geometry3d/PolylineOps\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\r\n// cspell:word zlow\r\n// cspell:word zhigh\r\n/**\r\n * Bit mask type for referencing subsets of 6 planes of range box.\r\n * @public\r\n */\r\nexport enum ClipMaskXYZRangePlanes {\r\n /** no planes */\r\n None = 0x00,\r\n /** low x plane */\r\n XLow = 0x01,\r\n /** high x plane */\r\n XHigh = 0x02,\r\n /** low y plane */\r\n YLow = 0x04,\r\n /** high y plane */\r\n YHigh = 0x08,\r\n /** low z plane */\r\n ZLow = 0x10,\r\n /** high z plane */\r\n ZHigh = 0x20,\r\n /** all x and y planes, neither z plane */\r\n XAndY = 0x0f,\r\n /** all 6 planes */\r\n All = 0x3f,\r\n}\r\n\r\n/**\r\n * Wire format describing a [[ClipPrimitive]] defined by a set of clip planes.\r\n * @public\r\n */\r\nexport interface ClipPrimitivePlanesProps {\r\n planes?: {\r\n /** The set of clip planes. */\r\n clips?: UnionOfConvexClipPlaneSetsProps;\r\n /** `true` if the primitive is a hole. */\r\n invisible?: boolean;\r\n };\r\n}\r\n\r\n/**\r\n * Wire format describing a [[ClipShape]].\r\n * @public\r\n */\r\nexport interface ClipPrimitiveShapeProps {\r\n /** The clip polygon. */\r\n shape?: {\r\n /** The points describing the polygon. */\r\n points?: XYZProps[];\r\n /** Transform applied to the polygon. */\r\n trans?: TransformProps;\r\n /** Lower bound on Z. */\r\n zlow?: number;\r\n /** Upper bound on Z. */\r\n zhigh?: number;\r\n /** `true` if this shape is a mask. */\r\n mask?: boolean;\r\n /** `true` if this shape is invisible. */\r\n invisible?: boolean;\r\n };\r\n}\r\n\r\n/** Wire format describing a [[ClipPrimitive]].\r\n * @public\r\n */\r\nexport type ClipPrimitiveProps = ClipPrimitivePlanesProps | ClipPrimitiveShapeProps;\r\n\r\n/**\r\n * * ClipPrimitive is a base class for clipping implementations that use\r\n * * A UnionOfConvexClipPlaneSets designated \"clipPlanes\".\r\n * * An \"invisible\" flag.\r\n * * When constructed directly, objects of type ClipPrimitive (directly, not through a derived class) will have just planes.\r\n * * Derived classes (e.g. ClipShape) carry additional data such as a swept shape.\r\n * * ClipPrimitive can be constructed with no planes.\r\n * * Derived class is responsible for filling the plane sets.\r\n * * At discretion of derived classes, plane construction can be done at construction time or \"on demand when\" queries\r\n * call `ensurePlaneSets ()`\r\n * * ClipPrimitive can be constructed directly with planes (and no derived class).\r\n * * That the prevailing use is via a ClipShape derived class.\r\n * * The ClipShape has an \"isMask\" property\r\n * * isMask === false means the plane sets should cover the inside of its polygon.\r\n * * isMask === true means the plane sets should cover the outside of its polygon.\r\n * * Note that the ClipShape's `isMask` property and the ClipPrimitive's `isInvisible` property are distinct controls.\r\n * * In normal usage, callers get \"outside\" clip behavior using ONLY the ClipShape isMask property.\r\n * * The ClipShape happens to pass the _invisible bit down to ClipPlanes that it creates.\r\n * * At that level, the flag controls whether the cut edges are produced on the plane\r\n * @public\r\n */\r\nexport class ClipPrimitive implements Clipper {\r\n /** The (union of) convex regions. */\r\n protected _clipPlanes?: UnionOfConvexClipPlaneSets;\r\n /** If true, pointInside inverts the sense of the pointInside for the _clipPlanes */\r\n protected _invisible: boolean;\r\n /**\r\n * Get a reference to the `UnionOfConvexClipPlaneSets`.\r\n * * It triggers construction of the sets by `this.ensurePlaneSets()`.\r\n * * Derived class typically caches the set on the first such call.\r\n */\r\n public fetchClipPlanesRef(): UnionOfConvexClipPlaneSets | undefined {\r\n this.ensurePlaneSets();\r\n return this._clipPlanes;\r\n }\r\n /** Ask if this primitive is a hole. */\r\n public get invisible(): boolean {\r\n return this._invisible;\r\n }\r\n protected constructor(planeSet?: UnionOfConvexClipPlaneSets | undefined, isInvisible: boolean = false) {\r\n this._clipPlanes = planeSet;\r\n this._invisible = isInvisible;\r\n }\r\n /**\r\n * Create a ClipPrimitive, capturing the supplied plane set as the clip planes.\r\n * @param planes clipper\r\n * @param isInvisible set the invisible flag on the ClipPrimitive\r\n */\r\n public static createCapture(\r\n planes: UnionOfConvexClipPlaneSets | ConvexClipPlaneSet | undefined, isInvisible: boolean = false,\r\n ): ClipPrimitive {\r\n let planeData;\r\n if (planes instanceof UnionOfConvexClipPlaneSets)\r\n planeData = planes;\r\n if (planes instanceof ConvexClipPlaneSet)\r\n planeData = UnionOfConvexClipPlaneSets.createConvexSets([planes]);\r\n\r\n return new ClipPrimitive(planeData, isInvisible);\r\n }\r\n /** Emit json form of the clip planes */\r\n public toJSON(): ClipPrimitiveProps {\r\n const planes: ClipPrimitivePlanesProps[\"planes\"] = {};\r\n if (this._clipPlanes)\r\n planes.clips = this._clipPlanes.toJSON();\r\n\r\n if (this._invisible)\r\n planes.invisible = true;\r\n\r\n return { planes };\r\n }\r\n /**\r\n * Returns true if the planes are present.\r\n * * This can be false (for instance) if a ClipShape is holding a polygon but has not yet been asked to construct\r\n * the planes.\r\n */\r\n public arePlanesDefined(): boolean {\r\n return this._clipPlanes !== undefined;\r\n }\r\n /** Return a deep clone. */\r\n public clone(): ClipPrimitive {\r\n const newPlanes = this._clipPlanes ? this._clipPlanes.clone() : undefined;\r\n const result = new ClipPrimitive(newPlanes, this._invisible);\r\n return result;\r\n }\r\n /**\r\n * Trigger (if needed) computation of plane sets (if applicable) in the derived class.\r\n * * Base class is no op.\r\n * * In derived class, on first call create planes sets from defining data (e.g. swept shape).\r\n * * In derived class, if planes are present leave them alone.\r\n */\r\n public ensurePlaneSets() { }\r\n /**\r\n * Return true if the point lies inside/on this polygon (or not inside/on if this polygon is a mask). Otherwise,\r\n * return false.\r\n * * Note that a derived class may choose to (a) implement its own test using its defining data, or (b) accept\r\n * this implementation using planes that it inserted in the base class.\r\n */\r\n public pointInside(point: Point3d, onTolerance: number = Geometry.smallMetricDistanceSquared): boolean {\r\n this.ensurePlaneSets();\r\n let inside = true;\r\n if (this._clipPlanes)\r\n inside = this._clipPlanes.isPointOnOrInside(point, onTolerance);\r\n return inside;\r\n }\r\n /**\r\n * Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public isPointOnOrInside(point: Point3d, onTolerance: number = Geometry.smallMetricDistanceSquared): boolean {\r\n this.ensurePlaneSets();\r\n let inside = true;\r\n if (this._clipPlanes)\r\n inside = this._clipPlanes.isPointOnOrInside(point, onTolerance);\r\n return inside;\r\n }\r\n /**\r\n * Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public announceClippedSegmentIntervals(\r\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber,\r\n ): boolean {\r\n this.ensurePlaneSets();\r\n let hasInsideParts = false;\r\n if (this._clipPlanes)\r\n hasInsideParts = this._clipPlanes.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce);\r\n return hasInsideParts;\r\n }\r\n /**\r\n * Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n this.ensurePlaneSets();\r\n let hasInsideParts = false;\r\n if (this._clipPlanes)\r\n hasInsideParts = this._clipPlanes.announceClippedArcIntervals(arc, announce);\r\n return hasInsideParts;\r\n }\r\n /**\r\n * Multiply all ClipPlanes DPoint4d by matrix.\r\n * @param matrix matrix to apply.\r\n * @param invert if true, use in verse of the matrix.\r\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter).\r\n * @param matrix matrix to apply.\r\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding\r\n * effect on the plane is the inverse transpose of matrixA.\r\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\r\n * * Both params default to true to get the full effect of transforming space.\r\n */\r\n public multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\r\n if (invert) { // form inverse once here, reuse for all planes\r\n const inverse = matrix.createInverse();\r\n if (!inverse)\r\n return false;\r\n return this.multiplyPlanesByMatrix4d(inverse, false, transpose);\r\n }\r\n if (this._clipPlanes)\r\n this._clipPlanes.multiplyPlanesByMatrix4d(matrix);\r\n return true;\r\n }\r\n /** Apply a transform to the clipper (e.g. transform all planes). */\r\n public transformInPlace(transform: Transform): boolean {\r\n if (this._clipPlanes)\r\n this._clipPlanes.transformInPlace(transform);\r\n return true;\r\n }\r\n /** Sets both the clip plane set and the mask set visibility */\r\n public setInvisible(invisible: boolean) {\r\n this._invisible = invisible;\r\n }\r\n /**\r\n * Return true if any plane of the primary clipPlanes has (a) non-zero z component in its normal vector and\r\n * (b) finite distance from origin.\r\n */\r\n public containsZClip(): boolean {\r\n if (this.fetchClipPlanesRef() !== undefined)\r\n for (const convexSet of this._clipPlanes!.convexSets)\r\n for (const plane of convexSet.planes)\r\n if (Math.abs(plane.inwardNormalRef.z) > 1.0e-6 && Math.abs(plane.distance) !== Number.MAX_VALUE)\r\n return true;\r\n return false;\r\n }\r\n /**\r\n * Quick test of whether the given points fall completely inside or outside.\r\n * @param points points to test.\r\n * @param ignoreInvisibleSetting if true, do the test with the clip planes and return that, ignoring the\r\n * invisible setting.\r\n */\r\n public classifyPointContainment(points: Point3d[], ignoreInvisibleSetting: boolean): ClipPlaneContainment {\r\n this.ensurePlaneSets();\r\n const planes = this._clipPlanes;\r\n let inside = ClipPlaneContainment.StronglyInside;\r\n if (planes)\r\n inside = planes.classifyPointContainment(points, false);\r\n if (this._invisible && !ignoreInvisibleSetting)\r\n switch (inside) {\r\n case ClipPlaneContainment.StronglyInside:\r\n return ClipPlaneContainment.StronglyOutside;\r\n case ClipPlaneContainment.StronglyOutside:\r\n return ClipPlaneContainment.StronglyInside;\r\n case ClipPlaneContainment.Ambiguous:\r\n return ClipPlaneContainment.Ambiguous;\r\n }\r\n return inside;\r\n }\r\n /**\r\n * Promote json object form to class instance.\r\n * * First try to convert to a ClipShape.\r\n * * then try as a standalone instance of the base class ClipPrimitive.\r\n */\r\n public static fromJSON(json: ClipPrimitiveProps | undefined): ClipPrimitive | undefined {\r\n if (!json)\r\n return undefined;\r\n const shape = ClipShape.fromClipShapeJSON(json as ClipPrimitiveShapeProps);\r\n if (shape)\r\n return shape;\r\n return ClipPrimitive.fromJSONClipPrimitive(json as ClipPrimitivePlanesProps);\r\n }\r\n /** Specific converter producing the base class ClipPrimitive. */\r\n public static fromJSONClipPrimitive(json: ClipPrimitivePlanesProps | undefined): ClipPrimitive | undefined {\r\n const planes = json?.planes;\r\n if (!planes)\r\n return undefined;\r\n\r\n const clipPlanes = planes.clips ? UnionOfConvexClipPlaneSets.fromJSON(planes.clips) : undefined;\r\n const invisible = undefined !== planes.invisible ? planes.invisible : false;\r\n return new ClipPrimitive(clipPlanes, invisible);\r\n }\r\n}\r\n\r\n/** Internal helper class holding XYZ components that serves as a representation of polygon edges defined by clip planes */\r\nclass PolyEdge {\r\n public pointA: Point3d;\r\n public pointB: Point3d;\r\n public normal: Vector3d;\r\n\r\n public constructor(origin: Point3d, next: Point3d, normal: Vector3d, z: number) {\r\n this.pointA = Point3d.create(origin.x, origin.y, z);\r\n this.pointB = Point3d.create(next.x, next.y, z);\r\n this.normal = normal;\r\n }\r\n // Assume both normals are unit length.\r\n // old logic: use difference of (previously computed) normals as perpendicular to bisector.\r\n public static makeUnitPerpendicularToBisector(edgeA: PolyEdge, edgeB: PolyEdge, reverse: boolean): Vector3d | undefined {\r\n let candidate = edgeB.normal.minus(edgeA.normal);\r\n if (candidate.normalize(candidate) === undefined) {\r\n candidate = Vector3d.createStartEnd(edgeA.pointA, edgeB.pointB);\r\n if (candidate.normalize(candidate) === undefined)\r\n return undefined;\r\n }\r\n if (reverse)\r\n candidate.scale(-1.0, candidate);\r\n return candidate;\r\n }\r\n}\r\n\r\n/**\r\n * A clipping volume defined by a shape (an array of 3d points using only x and y dimensions).\r\n * May be given either a ClipPlaneSet to store directly, or an array of polygon points as well as other parameters\r\n * for parsing ClipPlanes from the shape later.\r\n * @public\r\n */\r\nexport class ClipShape extends ClipPrimitive {\r\n /** Points of the polygon, in the xy plane of the local coordinate system. */\r\n protected _polygon: Point3d[];\r\n /** optional low z (in local coordinates). */\r\n protected _zLow?: number;\r\n /** optional high z (in local coordinates). */\r\n protected _zHigh?: number;\r\n /** true if this is considered a hole (keep geometry outside of the polygon). */\r\n protected _isMask: boolean;\r\n /** transform from local to world. */\r\n protected _transformFromClip?: Transform;\r\n /** Transform from world to local. */\r\n protected _transformToClip?: Transform;\r\n\r\n protected constructor(\r\n polygon: Point3d[] = [], zLow?: number, zHigh?: number, transform?: Transform, isMask: boolean = false, invisible: boolean = false,\r\n ) {\r\n super(undefined, invisible); // ClipPlaneSets will be set up later after storing points\r\n this._isMask = false;\r\n this._polygon = polygon;\r\n this.initSecondaryProps(isMask, zLow, zHigh, transform);\r\n }\r\n /** Returns true if this ClipShape is marked as invisible. */\r\n public override get invisible(): boolean {\r\n return this._invisible;\r\n }\r\n /** Return this transformFromClip, which may be undefined. */\r\n public get transformFromClip(): Transform | undefined {\r\n return this._transformFromClip;\r\n }\r\n /** Return this transformToClip, which may be undefined. */\r\n public get transformToClip(): Transform | undefined {\r\n return this._transformToClip;\r\n }\r\n /** Returns true if this ClipShape's transforms are currently set. */\r\n public get transformValid(): boolean {\r\n return this.transformFromClip !== undefined;\r\n }\r\n /** Returns true if this ClipShape's lower z boundary is set. */\r\n public get zLowValid(): boolean {\r\n return this._zLow !== undefined;\r\n }\r\n /** Returns true if this ClipShape's upper z boundary is set. */\r\n public get zHighValid(): boolean {\r\n return this._zHigh !== undefined;\r\n }\r\n /** Return true if this ClipShape has a local to world transform */\r\n public get transformIsValid(): boolean {\r\n return this._transformFromClip !== undefined;\r\n }\r\n /** Return this zLow, which may be undefined. */\r\n public get zLow(): number | undefined {\r\n return this._zLow;\r\n }\r\n /** Return this zHigh, which may be undefined. */\r\n public get zHigh(): number | undefined {\r\n return this._zHigh;\r\n }\r\n /** Returns a reference to this ClipShape's polygon array. */\r\n public get polygon(): Point3d[] {\r\n return this._polygon;\r\n }\r\n /** Returns true if this ClipShape is a masking set. */\r\n public get isMask(): boolean {\r\n return this._isMask;\r\n }\r\n /** Sets the polygon points array of this ClipShape to the array given (by reference). */\r\n public setPolygon(polygon: Point3d[]) {\r\n // Add closure point\r\n if (!polygon[0].isAlmostEqual(polygon[polygon.length - 1]))\r\n polygon.push(polygon[0].clone());\r\n this._polygon = polygon;\r\n }\r\n /**\r\n * If the ClipShape's associated `UnionOfConvexClipPlaneSets` is defined, do nothing.\r\n * If the ClipShape's associated `UnionOfConvexClipPlaneSets` is undefined, generate it from the `ClipShape`\r\n * and transform.\r\n */\r\n public override ensurePlaneSets() {\r\n if (this._clipPlanes !== undefined)\r\n return;\r\n this._clipPlanes = UnionOfConvexClipPlaneSets.createEmpty();\r\n this.parseClipPlanes(this._clipPlanes);\r\n if (this._transformFromClip)\r\n this._clipPlanes.transformInPlace(this._transformFromClip);\r\n }\r\n /**\r\n * Initialize the members of the ClipShape class that may at times be undefined.\r\n * zLow and zHigh default to Number.MAX_VALUE, and the transform defaults to an identity transform.\r\n */\r\n public initSecondaryProps(isMask: boolean, zLow?: number, zHigh?: number, transform?: Transform) {\r\n this._isMask = isMask;\r\n this._zLow = zLow;\r\n this._zHigh = zHigh;\r\n\r\n if (transform !== undefined) {\r\n this._transformFromClip = transform;\r\n this._transformToClip = transform.inverse(); // could be undefined\r\n } else {\r\n this._transformFromClip = Transform.createIdentity();\r\n this._transformToClip = Transform.createIdentity();\r\n }\r\n }\r\n /** Emit json object form */\r\n public override toJSON(): ClipPrimitiveShapeProps {\r\n const shape: ClipPrimitiveShapeProps[\"shape\"] = {\r\n points: this._polygon.map((pt) => pt.toJSON()),\r\n };\r\n if (this.invisible)\r\n shape.invisible = true;\r\n if (this._transformFromClip && !this._transformFromClip.isIdentity)\r\n shape.trans = this._transformFromClip.toJSON();\r\n if (this.isMask)\r\n shape.mask = true;\r\n if (typeof (this.zLow) !== \"undefined\" && this.zLow !== -Number.MAX_VALUE)\r\n shape.zlow = this.zLow;\r\n if (typeof (this.zHigh) !== \"undefined\" && this.zHigh !== Number.MAX_VALUE)\r\n shape.zhigh = this.zHigh;\r\n return { shape };\r\n }\r\n /** Parse `json` to a clip shape. */\r\n public static fromClipShapeJSON(json: ClipPrimitiveShapeProps | undefined, result?: ClipShape): ClipShape | undefined {\r\n const shape = json?.shape;\r\n if (!shape)\r\n return undefined;\r\n const points: Point3d[] = shape.points ? shape.points.map((pt) => Point3d.fromJSON(pt)) : [];\r\n const trans = shape.trans ? Transform.fromJSON(shape.trans) : undefined;\r\n const zLow = typeof shape.zlow === \"number\" ? shape.zlow : undefined;\r\n const zHigh = typeof shape.zhigh === \"number\" ? shape.zhigh : undefined;\r\n const isMask = typeof shape.mask === \"boolean\" && shape.mask;\r\n const invisible = typeof shape.invisible === \"boolean\" && shape.invisible;\r\n\r\n return ClipShape.createShape(points, zLow, zHigh, trans, isMask, invisible, result);\r\n }\r\n /** Returns a new ClipShape that is a deep copy of the ClipShape given */\r\n public static createFrom(other: ClipShape, result?: ClipShape): ClipShape {\r\n const retVal = ClipShape.createEmpty(false, false, undefined, result);\r\n retVal._invisible = other._invisible;\r\n for (const point of other._polygon) {\r\n retVal._polygon.push(point.clone());\r\n }\r\n retVal._isMask = other._isMask;\r\n retVal._zLow = other._zLow;\r\n retVal._zHigh = other._zHigh;\r\n retVal._transformToClip = other._transformToClip ? other._transformToClip.clone() : undefined;\r\n retVal._transformFromClip = other._transformFromClip ? other._transformFromClip.clone() : undefined;\r\n return retVal;\r\n }\r\n /** Create a new ClipShape from an array of points that make up a 2d shape (stores a deep copy of these points). */\r\n public static createShape(\r\n polygon: Point3d[] = [],\r\n zLow?: number,\r\n zHigh?: number,\r\n transform?: Transform,\r\n isMask: boolean = false,\r\n invisible: boolean = false,\r\n result?: ClipShape,\r\n ): ClipShape | undefined {\r\n if (polygon.length < 3)\r\n return undefined;\r\n const pPoints = polygon.slice(0);\r\n // Add closure point.\r\n if (pPoints[0].isAlmostEqual(pPoints[pPoints.length - 1]))\r\n pPoints[0].clone(pPoints[pPoints.length - 1]);\r\n else\r\n pPoints.push(pPoints[0].clone());\r\n if (result) {\r\n result._clipPlanes = undefined; // Start as undefined\r\n result._invisible = invisible;\r\n result._polygon = pPoints;\r\n result.initSecondaryProps(isMask, zLow, zHigh, transform);\r\n return result;\r\n } else {\r\n return new ClipShape(pPoints, zLow, zHigh, transform, isMask, invisible);\r\n }\r\n }\r\n /**\r\n * Create a ClipShape that exists as a 3 dimensional box of the range given. Optionally choose to\r\n * also store this shape's zLow and zHigh members from the range through the use of a RangePlaneBitMask.\r\n */\r\n public static createBlock(\r\n extremities: Range3d,\r\n clipMask: ClipMaskXYZRangePlanes,\r\n isMask: boolean = false,\r\n invisible: boolean = false,\r\n transform?: Transform,\r\n result?: ClipShape,\r\n ): ClipShape {\r\n const low = extremities.low;\r\n const high = extremities.high;\r\n const blockPoints: Point3d[] = [];\r\n for (let i = 0; i < 5; i++)\r\n blockPoints.push(Point3d.create());\r\n blockPoints[0].x = blockPoints[3].x = blockPoints[4].x = low.x;\r\n blockPoints[1].x = blockPoints[2].x = high.x;\r\n blockPoints[0].y = blockPoints[1].y = blockPoints[4].y = low.y;\r\n blockPoints[2].y = blockPoints[3].y = high.y;\r\n return ClipShape.createShape(\r\n blockPoints,\r\n (ClipMaskXYZRangePlanes.None !== (clipMask & ClipMaskXYZRangePlanes.ZLow)) ? low.z : undefined,\r\n (ClipMaskXYZRangePlanes.None !== (clipMask & ClipMaskXYZRangePlanes.ZHigh)) ? high.z : undefined,\r\n transform,\r\n isMask,\r\n invisible,\r\n result,\r\n )!;\r\n }\r\n /** Creates a new ClipShape with undefined members and a polygon points array of zero length. */\r\n public static createEmpty(\r\n isMask = false, invisible: boolean = false, transform?: Transform, result?: ClipShape,\r\n ): ClipShape {\r\n if (result) {\r\n result._clipPlanes = undefined;\r\n result._invisible = invisible;\r\n result._polygon.length = 0;\r\n result.initSecondaryProps(isMask, undefined, undefined, transform);\r\n return result;\r\n }\r\n return new ClipShape([], undefined, undefined, transform, isMask, invisible);\r\n }\r\n /** Checks to ensure that the member polygon has an area, and that the polygon is closed. */\r\n public get isValidPolygon(): boolean {\r\n if (this._polygon.length < 3)\r\n return false;\r\n if (!this._polygon[0].isExactEqual(this._polygon[this._polygon.length - 1]))\r\n return false;\r\n return true;\r\n }\r\n /** Returns a deep copy of this instance of ClipShape, storing in an optional result. */\r\n public override clone(result?: ClipShape): ClipShape {\r\n return ClipShape.createFrom(this, result);\r\n }\r\n /**\r\n * Given the current polygon data, parses clip planes that together form an object, storing the result in\r\n * the set given, either clip planes or mask planes.\r\n */\r\n private parseClipPlanes(set: UnionOfConvexClipPlaneSets) {\r\n const points = this._polygon;\r\n if (points.length === 3 && !this._isMask && points[0].isExactEqual(points[points.length - 1])) {\r\n this.parseLinearPlanes(set, this._polygon[0], this._polygon[1]);\r\n return true;\r\n }\r\n if (!this.isMask) {\r\n const direction = PolygonOps.testXYPolygonTurningDirections(this.polygon);\r\n if (direction !== 0) {\r\n this.parseConvexPolygonPlanes(set, this._polygon, direction, false);\r\n return true;\r\n }\r\n }\r\n // REMARK: Pass all polygons to non-convex case. It will funnel\r\n // to concave case as appropriate.\r\n this.parsePolygonPlanes(set, this._polygon, this.isMask);\r\n return true;\r\n }\r\n /**\r\n * Given a start and end point, populate the given UnionOfConvexClipPlaneSets with ConvexClipPlaneSets\r\n * defining the bounded region of linear planes. Returns true if successful.\r\n */\r\n private parseLinearPlanes(\r\n set: UnionOfConvexClipPlaneSets, start: Point3d, end: Point3d, cameraFocalLength?: number,\r\n ): boolean {\r\n // Handles the degenerate case of 2 distinct points (used by select by line).\r\n const normal = start.vectorTo(end);\r\n if (normal.magnitude() === 0.0)\r\n return false;\r\n normal.normalize(normal);\r\n const convexSet = ConvexClipPlaneSet.createEmpty();\r\n if (cameraFocalLength === undefined) {\r\n const perpendicular = Vector2d.create(-normal.y, normal.x);\r\n convexSet.planes.push(\r\n ClipPlane.createNormalAndPoint(Vector3d.create(normal.x, normal.y), Point3d.createFrom(start), this._invisible)!,\r\n );\r\n convexSet.planes.push(\r\n ClipPlane.createNormalAndPoint(Vector3d.create(-normal.x, -normal.y), Point3d.createFrom(end), this._invisible)!,\r\n );\r\n convexSet.planes.push(\r\n ClipPlane.createNormalAndPoint(Vector3d.create(perpendicular.x, perpendicular.y), Point3d.createFrom(start), this._invisible)!,\r\n );\r\n convexSet.planes.push(\r\n ClipPlane.createNormalAndPoint(Vector3d.create(-perpendicular.x, -perpendicular.y), Point3d.createFrom(start), this._invisible)!,\r\n );\r\n } else {\r\n const start3d = Point3d.create(start.x, start.y, -cameraFocalLength);\r\n const end3d = Point3d.create(end.x, end.y, -cameraFocalLength);\r\n const vecEnd3d = Vector3d.createFrom(end3d);\r\n const perpendicular = vecEnd3d.crossProduct(Vector3d.createFrom(start3d)).normalize();\r\n let endNormal = Vector3d.createFrom(start3d).crossProduct(perpendicular!).normalize();\r\n convexSet.planes.push(ClipPlane.createNormalAndDistance(perpendicular!, 0.0, this._invisible)!);\r\n convexSet.planes.push(ClipPlane.createNormalAndDistance(endNormal!, 0.0, this._invisible)!);\r\n perpendicular!.negate();\r\n endNormal = vecEnd3d.crossProduct(perpendicular!).normalize();\r\n convexSet.planes.push(ClipPlane.createNormalAndDistance(perpendicular!, 0.0, this._invisible)!);\r\n convexSet.planes.push(ClipPlane.createNormalAndDistance(endNormal!, 0.0, this._invisible)!);\r\n }\r\n convexSet.addZClipPlanes(this._invisible, this._zLow, this._zHigh);\r\n set.addConvexSet(convexSet);\r\n return true;\r\n }\r\n /**\r\n * Given a convex polygon defined as an array of points, populate the given UnionOfConvexClipPlaneSets with\r\n * ConvexClipPlaneSets defining the bounded region. Returns true if successful.\r\n */\r\n private parseConvexPolygonPlanes(\r\n set: UnionOfConvexClipPlaneSets,\r\n polygon: Point3d[],\r\n direction: number,\r\n buildExteriorClipper: boolean,\r\n cameraFocalLength?: number,\r\n ): boolean {\r\n const samePointTolerance = 1.0e-8; // This could possibly be replaced with more widely used constants\r\n const edges: PolyEdge[] = [];\r\n // const reverse = (direction < 0) !== this._isMask;\r\n const reverse = direction < 0;\r\n for (let i = 0; i < polygon.length - 1; i++) {\r\n const z = (cameraFocalLength === undefined) ? 0.0 : -cameraFocalLength;\r\n const dir = Vector3d.createStartEnd(polygon[i], polygon[i + 1]);\r\n const magnitude = dir.magnitude();\r\n dir.normalize(dir);\r\n if (magnitude > samePointTolerance) {\r\n const normal = Vector3d.create(reverse ? dir.y : -dir.y, reverse ? -dir.x : dir.x);\r\n edges.push(new PolyEdge(polygon[i], polygon[i + 1], normal, z));\r\n }\r\n }\r\n if (edges.length < 3) {\r\n return false;\r\n }\r\n if (buildExteriorClipper) {\r\n const last = edges.length - 1;\r\n for (let i = 0; i <= last; i++) {\r\n const edge = edges[i];\r\n const prevEdge = edges[i ? (i - 1) : last];\r\n const nextEdge = edges[(i === last) ? 0 : (i + 1)];\r\n const convexSet = ConvexClipPlaneSet.createEmpty();\r\n const previousPerpendicular = PolyEdge.makeUnitPerpendicularToBisector(prevEdge, edge, !reverse);\r\n const nextPerpendicular = PolyEdge.makeUnitPerpendicularToBisector(edge, nextEdge, reverse);\r\n // Create three-sided fans from each edge. Note we could define the correct region\r\n // with only two planes for edge, but cannot then designate the \"interior\" status of the edges accurately.\r\n\r\n if (previousPerpendicular)\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(previousPerpendicular, edge.pointA, this._invisible, true)!);\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(edge.normal, edge.pointB, this._invisible, false)!);\r\n if (nextPerpendicular)\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(nextPerpendicular, nextEdge.pointA, this._invisible, true)!);\r\n set.addConvexSet(convexSet);\r\n set.addOutsideZClipSets(this._invisible, this._zLow, this._zHigh);\r\n }\r\n } else {\r\n const convexSet = ConvexClipPlaneSet.createEmpty();\r\n if (cameraFocalLength === undefined) {\r\n for (const edge of edges)\r\n convexSet.planes.push(ClipPlane.createNormalAndPoint(Vector3d.create(edge.normal.x, edge.normal.y), edge.pointA)!);\r\n } else {\r\n if (reverse)\r\n for (const edge of edges)\r\n convexSet.planes.push(\r\n ClipPlane.createNormalAndDistance(\r\n Vector3d.createFrom(edge.pointA).crossProduct(Vector3d.createFrom(edge.pointB)).normalize()!, 0.0,\r\n )!,\r\n );\r\n else\r\n for (const edge of edges)\r\n convexSet.planes.push(\r\n ClipPlane.createNormalAndDistance(\r\n Vector3d.createFrom(edge.pointB).crossProduct(Vector3d.createFrom(edge.pointA)).normalize()!, 0.0,\r\n )!,\r\n );\r\n }\r\n convexSet.addZClipPlanes(this._invisible, this._zLow, this._zHigh);\r\n set.addConvexSet(convexSet);\r\n }\r\n return true;\r\n }\r\n /**\r\n * Given a (possibly non-convex) polygon defined as an array of points, populate the given UnionOfConvexClipPlaneSets\r\n * with multiple ConvexClipPlaneSets defining the bounded region. Returns true if successful.\r\n */\r\n private parsePolygonPlanes(set: UnionOfConvexClipPlaneSets, polygon: Point3d[], isMask: boolean, cameraFocalLength?: number,\r\n ): boolean {\r\n const cleanPolygon = PolylineOps.compressDanglers(polygon, true);\r\n const announceFace = (_graph: HalfEdgeGraph, edge: HalfEdge): boolean => {\r\n if (!edge.isMaskSet(HalfEdgeMask.EXTERIOR)) {\r\n const convexFacetPoints = edge.collectAroundFace((node: HalfEdge): any => {\r\n if (!node.isMaskSet(HalfEdgeMask.EXTERIOR))\r\n return Point3d.create(node.x, node.y, 0);\r\n });\r\n // parseConvexPolygonPlanes expects a closed loop (pushing the reference doesn't matter)\r\n convexFacetPoints.push(convexFacetPoints[0].clone());\r\n const direction = PolygonOps.testXYPolygonTurningDirections(convexFacetPoints); // ###TODO: Can we expect a direction coming out of graph facet?\r\n this.parseConvexPolygonPlanes(set, convexFacetPoints, direction, false, cameraFocalLength);\r\n }\r\n return true;\r\n };\r\n if (isMask) {\r\n const polygonA = Point3dArray.clonePoint3dArray(cleanPolygon);\r\n const hullAndInlets = AlternatingCCTreeNode.createHullAndInletsForPolygon(polygonA);\r\n const allLoops = hullAndInlets.extractLoops();\r\n if (allLoops.length === 0)\r\n return false;\r\n const hull = allLoops[0];\r\n const direction1 = PolygonOps.testXYPolygonTurningDirections(hull); // ###TODO: Can we expect a direction coming out of graph facet?\r\n this.parseConvexPolygonPlanes(set, hull, -direction1, true, cameraFocalLength);\r\n for (let i = 1; i < allLoops.length; i++) {\r\n const triangulatedPolygon = Triangulator.createTriangulatedGraphFromSingleLoop(allLoops[i]);\r\n if (triangulatedPolygon) {\r\n Triangulator.flipTriangles(triangulatedPolygon);\r\n triangulatedPolygon.announceFaceLoops(announceFace);\r\n }\r\n }\r\n return true;\r\n } else {\r\n const triangulatedPolygon = Triangulator.createTriangulatedGraphFromSingleLoop(cleanPolygon);\r\n if (triangulatedPolygon === undefined)\r\n return false;\r\n Triangulator.flipTriangles(triangulatedPolygon);\r\n triangulatedPolygon.announceFaceLoops(announceFace);\r\n }\r\n return true;\r\n }\r\n /**\r\n * Multiply all ClipPlanes DPoint4d by matrix.\r\n * @param matrix matrix to apply.\r\n * @param invert if true, use in verse of the matrix.\r\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter).\r\n * @param matrix matrix to apply.\r\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding effect\r\n * on the plane is the inverse transpose of matrixA.\r\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\r\n * * Both params default to true to get the full effect of transforming space.\r\n */\r\n public override multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\r\n this.ensurePlaneSets();\r\n return super.multiplyPlanesByMatrix4d(matrix, invert, transpose);\r\n }\r\n /**\r\n * Apply `transform` to the local to world (`transformFromClip`) transform.\r\n * * The world to local transform (`transformToClip` is recomputed from the (changed) `transformToClip`\r\n * * the transform is passed to the base class to be applied to clip plane form of the clipper.\r\n */\r\n public override transformInPlace(transform: Transform): boolean {\r\n if (transform.isIdentity)\r\n return true;\r\n super.transformInPlace(transform);\r\n if (this._transformFromClip)\r\n transform.multiplyTransformTransform(this._transformFromClip, this._transformFromClip);\r\n else\r\n this._transformFromClip = transform.clone();\r\n this._transformToClip = this._transformFromClip.inverse(); // could be undefined\r\n return true;\r\n }\r\n /**\r\n * Return true if\r\n * * at least one point is defined\r\n * * The local to world transform (transformFromClip) either\r\n * * is undefined\r\n * * has no xy parts in its column Z (local frame Z is parallel to global Z)\r\n */\r\n public get isXYPolygon(): boolean {\r\n if (this._polygon.length === 0) // Note: This is a lenient check, as points array could also contain less than 3 points (not a polygon)\r\n return false;\r\n if (this._transformFromClip === undefined)\r\n return true;\r\n const zVector = this._transformFromClip.matrix.columnZ();\r\n return zVector.magnitudeXY() < 1.0e-8;\r\n }\r\n /** Transform the input point in place using this instance's `transformToClip` member */\r\n public performTransformToClip(point: Point3d): void {\r\n if (this._transformToClip !== undefined)\r\n this._transformToClip.multiplyPoint3d(point, point);\r\n }\r\n /** Transform the input point in place using this instance's `transformFromClip` member */\r\n public performTransformFromClip(point: Point3d): void {\r\n if (this._transformFromClip !== undefined)\r\n this._transformFromClip.multiplyPoint3d(point, point);\r\n }\r\n}\r\n"]}
@@ -18,77 +18,85 @@ import { ClipPrimitive } from "./ClipPrimitive";
18
18
  import { ClipVector } from "./ClipVector";
19
19
  import { ConvexClipPlaneSet } from "./ConvexClipPlaneSet";
20
20
  import { UnionOfConvexClipPlaneSets } from "./UnionOfConvexClipPlaneSets";
21
- /** Enumerated type for describing where geometry lies with respect to clipping planes.
21
+ /**
22
+ * Enumerated type for describing where geometry lies with respect to clipping planes.
22
23
  * @public
23
24
  */
24
25
  export declare enum ClipPlaneContainment {
25
- /** All points inside */
26
+ /** All points inside. */
26
27
  StronglyInside = 1,
27
28
  /** Inside/outside state unknown. */
28
29
  Ambiguous = 2,
29
- /** All points outside */
30
+ /** All points outside. */
30
31
  StronglyOutside = 3
31
32
  }
32
33
  /**
33
- * Enumeration of ways to handle an intermediate fragment from a clipping step
34
+ * Enumeration of ways to handle an intermediate fragment from a clipping step.
34
35
  * @public
35
36
  */
36
37
  export declare enum ClipStepAction {
37
- /** Pass fragments directly to final accepted "in" state */
38
+ /** Pass fragments directly to final accepted "in" state. */
38
39
  acceptIn = 1,
39
- /** Pass fragments directly to final accepted "out" state */
40
+ /** Pass fragments directly to final accepted "out" state. */
40
41
  acceptOut = -1,
41
- /** forward fragments to subsequent steps. */
42
+ /** Forward fragments to subsequent steps. */
42
43
  passToNextStep = 0
43
44
  }
44
- /** Enumerated type for describing what must yet be done to clip a piece of geometry.
45
+ /**
46
+ * Enumerated type for describing what must yet be done to clip a piece of geometry.
45
47
  * @public
46
48
  */
47
49
  export declare enum ClipStatus {
48
- /** some geometry may cross the clip boundaries */
50
+ /** Some geometry may cross the clip boundaries */
49
51
  ClipRequired = 0,
50
- /** geometry is clearly outside */
52
+ /** Geometry is clearly outside */
51
53
  TrivialReject = 1,
52
- /** geometry is clearly inside */
54
+ /** Geometry is clearly inside */
53
55
  TrivialAccept = 2
54
56
  }
55
- /** An object containing clipping planes that can be used to clip geometry.
57
+ /**
58
+ * An object containing clipping planes that can be used to clip geometry.
56
59
  * @public
57
60
  */
58
61
  export interface Clipper {
59
- /** test if `point` is on or inside the Clipper's volume. */
62
+ /** Test if `point` is on or inside the Clipper's volume. */
60
63
  isPointOnOrInside(point: Point3d, tolerance?: number): boolean;
61
- /** Find the parts of the line segment (if any) that is within the convex clip volume.
62
- * * The input fractional interval from fraction0 to fraction1 (increasing!!) is the active part to consider.
64
+ /**
65
+ * Find the parts of the line segment (if any) that is within the convex clip volume.
66
+ * * The line segment is defined by `pointA` and `pointB`.
67
+ * * The input fractional interval from `fraction0` to `fraction1` (increasing) is the active part to consider.
63
68
  * * To clip to the usual bounded line segment, start with fractions (0,1).
64
69
  * If the clip volume is unbounded, the line interval may also be unbounded.
65
- * * An unbounded line portion will have fraction coordinates positive or negative Number.MAX_VALUE.
66
- * @param f0 fraction that is the initial lower fraction of the active interval. (e.g. 0.0 for bounded segment)
67
- * @param f1 fraction that is the initial upper fraction of the active interval. (e.g. 1.0 for bounded segment)
70
+ * * An unbounded line portion will have fraction coordinates positive or negative `Number.MAX_VALUE`.
71
+ * @param f0 fraction that is the initial lower fraction of the active interval (e.g., 0.0 for bounded segment).
72
+ * @param f1 fraction that is the initial upper fraction of the active interval (e.g., 1.0 for bounded segment).
68
73
  * @param pointA segment start (fraction 0)
69
74
  * @param pointB segment end (fraction 1)
70
75
  * @param announce function to be called to announce a fraction interval that is within the convex clip volume.
71
76
  * @returns true if a segment was announced, false if entirely outside.
72
77
  */
73
78
  announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean;
74
- /** Find the portion (or portions) of the arc (if any) that are within the convex clip volume.
75
- * * The input fractional interval from fraction0 to fraction1 (increasing!!) is the active part to consider.
76
- * @param announce function to be called to announce a fraction interval that is within the convex clip volume.
79
+ /**
80
+ * Find the portion (or portions) of the arc (if any) that are within the convex clip volume.
81
+ * @param arc the arc to be clipped.
82
+ * @param announce function to be called to announce a fraction intervals that are within the convex clip volume.
77
83
  * @returns true if one or more arcs portions were announced, false if entirely outside.
78
84
  */
79
85
  announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
80
- /** Optional polygon clip method.
81
- * * This is expected to be implemented by planar clip structures.
82
- * * This is unimplemented for curve clippers (e.g. sphere) for which polygon clip result has
83
- * curved edges.
86
+ /**
87
+ * Optional polygon clip method.
88
+ * * This is expected to be implemented by planar clip structures.
89
+ * * This is unimplemented for curve clippers (e.g. sphere) for which polygon clip result has curved edges.
84
90
  */
85
91
  appendPolygonClip?: AppendPolygonClipFunction;
86
92
  }
87
93
  /**
88
94
  * Signature of method to execute polygon clip, distributing fragments of xyz among insideFragments and outsideFragments
89
- * @param xyz input polygon. This is not changed.
90
- * @param insideFragments Array to receive "inside" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.
91
- * @param outsideFragments Array to receive "outside" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.
95
+ * @param xyz input polygon. This is not changed.
96
+ * @param insideFragments Array to receive "inside" fragments. Each fragment is a GrowableXYZArray grabbed from
97
+ * the cache. This is NOT cleared.
98
+ * @param outsideFragments Array to receive "outside" fragments. Each fragment is a GrowableXYZArray grabbed from
99
+ * the cache. This is NOT cleared.
92
100
  * @param arrayCache cache for reusable GrowableXYZArray.
93
101
  */
94
102
  type AppendPolygonClipFunction = (xyz: GrowableXYZArray, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache) => void;
@@ -102,7 +110,8 @@ type AppendPolygonClipFunction = (xyz: GrowableXYZArray, insideFragments: Growab
102
110
  export interface PolygonClipper {
103
111
  appendPolygonClip: AppendPolygonClipFunction;
104
112
  }
105
- /** Class whose various static methods are functions for clipping geometry
113
+ /**
114
+ * Class whose various static methods are functions for clipping geometry
106
115
  * @public
107
116
  */
108
117
  export declare class ClipUtilities {
@@ -118,13 +127,14 @@ export declare class ClipUtilities {
118
127
  */
119
128
  static selectIntervals01(curve: CurvePrimitive, unsortedFractions: GrowableFloat64Array, clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
120
129
  /**
121
- * Announce triples of (low, high, cp) for each entry in intervals
130
+ * Announce triples of (low, high, cp) for each entry in intervals.
122
131
  * @param intervals source array
123
132
  * @param cp CurvePrimitive for announcement
124
133
  * @param announce function to receive data
125
134
  */
126
135
  static announceNNC(intervals: Range1d[], cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
127
- /** Find portions of the curve that are within the clipper.
136
+ /**
137
+ * Find portions of the curve that are within the clipper.
128
138
  * Collect them into an array of curve primitives.
129
139
  */
130
140
  static collectClippedCurves(curve: CurvePrimitive, clipper: Clipper): CurvePrimitive[];
@@ -138,7 +148,8 @@ export declare class ClipUtilities {
138
148
  * @return An multidimensional array of points, where each array is the boundary of part of the remaining polygon.
139
149
  */
140
150
  static clipPolygonToClipShapeReturnGrowableXYZArrays(polygon: Point3d[], clipShape: ClipPrimitive): GrowableXYZArray[];
141
- /** Given an array of points, test for trivial containment conditions.
151
+ /**
152
+ * Given an array of points, test for trivial containment conditions.
142
153
  * * ClipStatus.TrivialAccept if all points are in any one of the convexSet's.
143
154
  * * ClipStatus.ClipRequired if (in any single convexSet) there were points on both sides of any single plane.
144
155
  * * ClipStatus.TrivialReject if neither of those occurred.
@@ -154,8 +165,9 @@ export declare class ClipUtilities {
154
165
  */
155
166
  static announceLoopsOfConvexClipPlaneSetIntersectRange(convexSet: ConvexClipPlaneSet | ClipPlane, range: Range3d, loopFunction: (loopPoints: GrowableXYZArray) => void, includeConvexSetFaces?: boolean, includeRangeFaces?: boolean, ignoreInvisiblePlanes?: boolean): void;
156
167
  /**
157
- * Return a (possibly empty) array of geometry (Loops !!) which are facets of the intersection of the convex set intersecting a range.
158
- * * return zero length array for (a) null range or (b) no intersections
168
+ * Return a (possibly empty) array of geometry (Loops !!) which are facets of the intersection of the convex set
169
+ * intersecting a range.
170
+ * * Return zero length array for (a) null range or (b) no intersections
159
171
  * @param allClippers convex or union clipper
160
172
  * @param range range to intersect
161
173
  * @param includeConvexSetFaces if false, do not compute facets originating as convex set planes.
@@ -208,7 +220,8 @@ export declare class ClipUtilities {
208
220
  * @param ignoreInvisiblePlanes if true, do NOT compute a facet for convex set faces marked invisible.
209
221
  */
210
222
  static doesConvexClipPlaneSetIntersectRange(convexSet: ConvexClipPlaneSet, range: Range3d, includeConvexSetFaces?: boolean, includeRangeFaces?: boolean, ignoreInvisiblePlanes?: boolean): boolean;
211
- /** Test for intersection of two ranges in different local coordinates.
223
+ /**
224
+ * Test for intersection of two ranges in different local coordinates.
212
225
  * * Useful for clash detection of elements in iModels, using their stored (tight) local ranges and placement transforms.
213
226
  * @param range0 range in local coordinates of first geometry
214
227
  * @param local0ToWorld placement transform for first geometry
@@ -229,8 +242,8 @@ export declare class ClipUtilities {
229
242
  * * If there are more than baseCount+1 fragments:
230
243
  * * drop them all to the cache
231
244
  * * push a copy of the singleton.
232
- * * The use case for this is that a multi-step clipper (e.g. UnionOfConvexClipPlaneSets) may produce many fragments, and then be able to determine
233
- * that they really are the original pre-clip polygon unchanged.
245
+ * * The use case for this is that a multi-step clipper (e.g. UnionOfConvexClipPlaneSets) may produce many fragments,
246
+ * and then be able to determine that they really are the original pre-clip polygon unchanged.
234
247
  * * The baseCount+1 case is the case where the entire original singleton is still a singleton and can be left alone.
235
248
  * * Calling this replacer shuffles the original back into the fragment array, and drops the fragments.
236
249
  * * This determination is solely within the logic of the caller.
@@ -250,8 +263,7 @@ export declare class ClipUtilities {
250
263
  * @alpha
251
264
  */
252
265
  static createXYOffsetClipFromLineString(points: Point3d[] | IndexedXYZCollection, leftOffset: number, rightOffset: number, z0: number, z1: number): UnionOfConvexClipPlaneSets;
253
- /** if data.length >= minLength threshold, push it to destination; if smaller drop it back to the cache.
254
- */
266
+ /** If data.length >= minLength threshold, push it to destination; if smaller drop it back to the cache. */
255
267
  static captureOrDrop(data: GrowableXYZArray, minLength: number, destination: GrowableXYZArray[], cache: GrowableXYZArrayCache): void;
256
268
  /**
257
269
  * Find the portion of a line within a half-plane clip.
@@ -339,13 +351,11 @@ export declare class ClipUtilities {
339
351
  * @param finalCandidateAction
340
352
  */
341
353
  static doPolygonClipSequence(xyz: GrowableXYZArray, clippers: Clipper[], acceptedIn: GrowableXYZArray[] | undefined, acceptedOut: GrowableXYZArray[] | undefined, finalCandidates: GrowableXYZArray[] | undefined, inAction: ClipStepAction, outAction: ClipStepAction, finalFragmentAction: ClipStepAction, arrayCache: GrowableXYZArrayCache | undefined): void;
342
- /**
343
- * Pass polygon `xyz` through a sequence of PolygonClip steps with "parity" rules
344
- */
354
+ /** Pass polygon `xyz` through a sequence of PolygonClip steps with "parity" rules */
345
355
  static doPolygonClipParitySequence(xyz: GrowableXYZArray, clippers: Clipper[], acceptedIn: GrowableXYZArray[] | undefined, acceptedOut: GrowableXYZArray[] | undefined, arrayCache: GrowableXYZArrayCache | undefined): void;
346
- /** For each plane of clipper, construct a UnionOfConvexClipPlaneSets for an outer (infinite) convex volume that
356
+ /**
357
+ * For each plane of clipper, construct a UnionOfConvexClipPlaneSets for an outer (infinite) convex volume that
347
358
  * abuts the outer volume of the neighbor faces.
348
- *
349
359
  */
350
360
  static createComplementaryClips(clipper: ConvexClipPlaneSet): UnionOfConvexClipPlaneSets;
351
361
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ClipUtils.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipUtils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACnH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAE1F,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM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