@itwin/core-geometry 3.7.0-dev.1 → 3.7.0-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/lib/cjs/Geometry.d.ts +23 -0
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +25 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/curve/Loop.d.ts +2 -2
- package/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +2 -1
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +3 -2
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +2 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +3 -2
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +195 -8
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +459 -11
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.d.ts +22 -7
- package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js +41 -5
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +58 -4
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +102 -4
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts +10 -0
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js +14 -0
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +0 -6
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +0 -6
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +38 -41
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +39 -42
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +14 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +33 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +120 -10
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +412 -12
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.d.ts +264 -0
- package/lib/cjs/polyface/FacetLocationDetail.d.ts.map +1 -0
- package/lib/cjs/polyface/FacetLocationDetail.js +378 -0
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -0
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -5
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +5 -2
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +13 -13
- package/lib/cjs/polyface/PolyfaceBuilder.js +13 -13
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +22 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +52 -2
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +5 -5
- package/lib/cjs/solid/Sphere.js +5 -5
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/esm/Geometry.d.ts +23 -0
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +24 -0
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts +2 -2
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +2 -1
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +3 -2
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +2 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +3 -2
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts +195 -8
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +459 -12
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.d.ts +22 -7
- package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js +41 -5
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +58 -4
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +103 -5
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts +10 -0
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js +14 -0
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +0 -6
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +0 -6
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +38 -41
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +39 -42
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +14 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +33 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +120 -10
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +411 -12
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.d.ts +264 -0
- package/lib/esm/polyface/FacetLocationDetail.d.ts.map +1 -0
- package/lib/esm/polyface/FacetLocationDetail.js +371 -0
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -0
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -5
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +5 -2
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +13 -13
- package/lib/esm/polyface/PolyfaceBuilder.js +13 -13
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +22 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +52 -2
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +5 -5
- package/lib/esm/solid/Sphere.js +5 -5
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegionOpsClassificationSweeps.js","sourceRoot":"","sources":["../../../src/curve/RegionOpsClassificationSweeps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAY,aAAa,EAAE,YAAY,EAAwB,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EA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kBAA6D;QACtG,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC9C,MAAM,eAAe,GAAG,mBAAmB,CAAC,iDAAiD,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAChH,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE;YAC5C,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,cAAc,CAAC,CAAC;YACrD,SAAS,CAAC,aAAa,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;YACxE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACnC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { HalfEdge, HalfEdgeGraph, HalfEdgeMask, NodeToNumberFunction } from \"../topology/Graph\";\nimport { HalfEdgeGraphSearch } from \"../topology/HalfEdgeGraphSearch\";\nimport { HalfEdgeGraphMerge } from \"../topology/Merging\";\nimport { RegularizationContext } from \"../topology/RegularizeFace\";\nimport { MultiLineStringDataVariant } from \"../topology/Triangulation\";\nimport { GraphCheckPointFunction, RegionBinaryOpType, RegionOps } from \"./RegionOps\";\nimport { ParityRegion } from \"./ParityRegion\";\nimport { Loop } from \"./Loop\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { CurveCurve } from \"./CurveCurve\";\nimport { PlanarSubdivision } from \"./Query/PlanarSubdivision\";\nimport { Geometry } from \"../Geometry\";\nimport { AnyRegion } from \"./CurveChain\";\nimport { UnionRegion } from \"./UnionRegion\";\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\nimport { XAndY } from \"../geometry3d/XYZProps\";\nimport { LineSegment3d } from \"./LineSegment3d\";\nimport { Arc3d } from \"./Arc3d\";\nimport { Range2d, Range3d } from \"../geometry3d/Range\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\n\n/**\n * base class for callbacks during region sweeps.\n * * At start of a component, `startComponent(node)` is called announcing a representative node on the outermost face.\n * * A Component in this usage is a component that is edge connected when ignoring \"exterior bridge edges\".\n * * As each face is entered, `enterFace(facePathStack, newFaceNode)` is called\n * * facePathStack[0] is the outermost node of the path from the outer face.\n * * facePathStack[1] is its inside mate.\n * * facePathStack[2k] is the outside node at crossing to face at depth k.\n * * facePathStack[2k+1] is the node where face at depth k was entered.\n * * newFaceNode is the entry node (redundant of stack tip)\n * * On retreat from a face, `leaveFace(facePathStack, faceNode)` is called.\n * * At end of component, `finishComponent (node)` is called.\n * * The base class is fully implemented to do nothing during the sweep.\n * @internal\n */\nabstract class RegionOpsFaceToFaceSearchCallbacks {\n /** Announce a representative node on the outer face of a component */\n public startComponent(_node: HalfEdge): boolean { return true; }\n /** Announce return to outer face */\n public finishComponent(_node: HalfEdge): boolean { return true; }\n /** Announce face entry */\n public enterFace(_facePathStack: HalfEdge[], _newFaceNode: HalfEdge): boolean { return true; }\n /** Announce face exit */\n public leaveFace(_facePathStack: HalfEdge[], _newFaceNode: HalfEdge): boolean { return true; }\n}\n/** Function signature to test if a pair of boolean states is to be accepted by area booleans (during face-to-face sweeps)\n * @internal\n */\ntype BinaryBooleanAcceptFunction = (stateA: boolean, stateB: boolean) => boolean;\n/** Function signature ot announce classification of a face.\n * The `faceType` parameters are\n * * -1 for a fully exterior face. This is a negative area face.\n * * 0 for a positive area face classified as \"out\" for the boolean.\n * * 1 for a positive area face classified as \"in\" for the boolean.\n */\ntype AnnounceClassifiedFace = (graph: HalfEdgeGraph, faceSeed: HalfEdge, faceType: -1 | 0 | 1, area: number) => void;\n/**\n * Implementation of `RegionOpsFaceToFaceSearchCallbacks` for binary boolean sweep with polygonal regions.\n * * For this linear-boundary case the boundary geometry is carried entirely from the coordinates in the half edges.\n * * This assumes the each node in the graph has edgeTag set to:\n * * `edgeTag === undefined` if the edge crossing does not change classification.\n * * for example, an edge added by regularization\n * * `edgeTag === 1` if this is a boundary for the first of the boolean input regions\n * * `edgeTag === 2` if this is a boundary for the second of the boolean input regions\n * * constructor\n * * takes caller-supplied function to decide whether to accept a face given its state relative to the two boolean terms.\n * * sets the in/out status of both terms to false.\n * * `startComponent` marks the entire outer face as `EXTERIOR`\n * * `enterFace`\n * * if this is a bounding edge (according to `node.faceTag`) toggle the in/out status if this boolean term.\n * * ask the faceAcceptFunction if the current term states combine to in/out for the result\n * * if out, set the `EXTERIOR` mask around the face.\n * * `leaveFace`\n * * if this is a bounding edge (according to `node.faceTag`) toggle the in/out status if this boolean term.\n * * `finishComponent` is not reimplemented.\n * @internal\n */\nclass RegionOpsBinaryBooleanSweepCallbacks extends RegionOpsFaceToFaceSearchCallbacks {\n private _faceSelectFunction: BinaryBooleanAcceptFunction;\n private _inComponent: boolean[];\n private _exteriorMask: HalfEdgeMask;\n public constructor(acceptFaceFunction: BinaryBooleanAcceptFunction, exteriorMask: HalfEdgeMask) {\n super();\n this._inComponent = [false, false, false]; // entry 0 is never reused.\n this._exteriorMask = exteriorMask;\n this._faceSelectFunction = acceptFaceFunction;\n }\n /** Mark this face as exterior */\n public override startComponent(node: HalfEdge): boolean { node.setMaskAroundFace(this._exteriorMask); return true; }\n /**\n * * If necessary, toggle a term state.\n * * if indicated, mark this face exterior.\n */\n public override enterFace(_facePathStack: HalfEdge[], node: HalfEdge): boolean {\n const thisFaceIndex = node.edgeTag;\n if (node.edgeTag === 1 || node.edgeTag === 2)\n this._inComponent[thisFaceIndex] = !this._inComponent[thisFaceIndex];\n if (!this._faceSelectFunction(this._inComponent[1], this._inComponent[2]))\n node.setMaskAroundFace(this._exteriorMask);\n return true;\n }\n /**\n * * If necessary, toggle a term state.\n */\n public override leaveFace(_facePathStack: HalfEdge[], node: HalfEdge): boolean {\n const thisFaceIndex = node.edgeTag;\n if (node.edgeTag === 1 || node.edgeTag === 2)\n this._inComponent[thisFaceIndex] = !this._inComponent[thisFaceIndex];\n return true;\n }\n}\n/**\n * Low level graph search for face classification.\n * @internal\n */\nexport class RegionOpsFaceToFaceSearch {\n /**\n * run a DFS with face-to-face step announcements.\n * * false return from any function terminates search immediately.\n * * all reachable nodes assumed to have both visit masks clear.\n * @param graph containing graph.\n * @param seed first node to visit.\n * @param faceHasBeenVisited mask marking faces that have been seen.\n * @param nodeHasBeenVisited mask marking node-to-node step around face.\n *\n */\n public static faceToFaceSearchFromOuterLoop(_graph: HalfEdgeGraph, seed: HalfEdge, faceHasBeenVisited: HalfEdgeMask, nodeHasBeenVisited: HalfEdgeMask, callbacks: RegionOpsFaceToFaceSearchCallbacks) {\n if (seed.isMaskSet(faceHasBeenVisited))\n return;\n if (!callbacks.startComponent(seed))\n return;\n const facePathStack = [];\n seed.setMaskAroundFace(faceHasBeenVisited);\n let faceWalker = seed;\n do {\n let entryNode = faceWalker;\n let mate = faceWalker.edgeMate;\n if (!mate.isMaskSet(faceHasBeenVisited)) {\n // the faceWalker seed is always on the base of the stack.\n // the stack then contains even-odd pairs of (entryNode, currentNode)\n // * entryNode is the node where a face was entered.\n // * faceNode is another node around that face.\n facePathStack.push(faceWalker);\n facePathStack.push(mate);\n let faceNode = mate.faceSuccessor;\n mate.setMaskAroundFace(faceHasBeenVisited);\n entryNode = mate;\n if (callbacks.enterFace(facePathStack, mate)) {\n for (; ;) {\n mate = faceNode.edgeMate;\n if (!mate.isMaskSet(faceHasBeenVisited)) {\n mate.setMaskAroundFace(faceHasBeenVisited);\n if (!callbacks.enterFace(facePathStack, mate))\n return;\n facePathStack.push(faceNode);\n facePathStack.push(mate);\n faceNode = mate;\n entryNode = mate;\n }\n faceNode.setMask(nodeHasBeenVisited);\n faceNode = faceNode.faceSuccessor;\n if (faceNode === entryNode) {\n callbacks.leaveFace(facePathStack, faceNode);\n if (facePathStack.length <= 2) {\n break;\n }\n facePathStack.pop();\n faceNode = facePathStack[facePathStack.length - 1];\n facePathStack.pop();\n entryNode = facePathStack[facePathStack.length - 1];\n }\n if (faceNode.isMaskSet(nodeHasBeenVisited)) {\n // this is disaster !!!\n return;\n }\n }\n }\n }\n // continue at outermost level .....\n faceWalker = faceWalker.faceSuccessor;\n } while (faceWalker !== seed);\n callbacks.finishComponent(seed);\n }\n /** Complete multi-step process for polygon binary booleans starting with arrays of coordinates.\n * * Each of the binary input terms is a collection of loops\n * * Within the binary term, in/out is determined by edge-crossing parity rules.\n * * Processing steps are\n * * Build the loops for each set.\n * * Each edge labeled with 1 or 2 as binary term identifier.\n * * find crossings among the edges.\n * * Edges are split as needed, but split preserves the edgeTag\n * * sort edges around vertices\n * * add regularization edges so holes are connected to their parent.\n */\n public static doPolygonBoolean(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, faceSelectFunction: (inA: boolean, inB: boolean) => boolean, graphCheckPoint?: GraphCheckPointFunction): HalfEdgeGraph | undefined {\n const graph = new HalfEdgeGraph();\n const baseMask = HalfEdgeMask.BOUNDARY_EDGE | HalfEdgeMask.PRIMARY_EDGE;\n const seedA = RegionOps.addLoopsWithEdgeTagToGraph(graph, loopsA, baseMask, 1);\n const seedB = RegionOps.addLoopsWithEdgeTagToGraph(graph, loopsB, baseMask, 2);\n if (graphCheckPoint)\n graphCheckPoint(\"unmerged loops\", graph, \"U\");\n if (seedA || seedB) {\n // split edges where they cross . . .\n HalfEdgeGraphMerge.splitIntersectingEdges(graph);\n if (graphCheckPoint)\n graphCheckPoint(\"After splitIntersectingEdges\", graph, \"S\");\n // sort radially around vertices.\n HalfEdgeGraphMerge.clusterAndMergeXYTheta(graph);\n if (graphCheckPoint)\n graphCheckPoint(\"After clusterAndMergeXYTheta\", graph, \"M\");\n // add edges to connect various components (e.g. holes!!!)\n const context = new RegularizationContext(graph);\n context.regularizeGraph(true, true);\n if (graphCheckPoint)\n graphCheckPoint(\"After regularize\", graph, \"MR\");\n const exteriorHalfEdge = HalfEdgeGraphSearch.findMinimumAreaFace(graph);\n const exteriorMask = HalfEdgeMask.EXTERIOR;\n const faceVisitedMask = graph.grabMask();\n const nodeVisitedMask = graph.grabMask();\n const allMasksToClear = exteriorMask | faceVisitedMask | nodeVisitedMask;\n graph.clearMask(allMasksToClear);\n const callbacks = new RegionOpsBinaryBooleanSweepCallbacks(faceSelectFunction, exteriorMask);\n this.faceToFaceSearchFromOuterLoop(graph, exteriorHalfEdge, faceVisitedMask, nodeVisitedMask, callbacks);\n if (graphCheckPoint)\n graphCheckPoint(\"After faceToFaceSearchFromOuterLoop\", graph, \"MRX\");\n graph.dropMask(faceVisitedMask);\n graph.dropMask(nodeVisitedMask);\n return graph;\n }\n return undefined;\n }\n\n /** Complete multi-step process for polygon binary booleans starting with arrays of coordinates.\n * * the manyLoopsAndParitySets input is an array.\n * * Each entry is one or more loops.\n * * An entry that is \"just points\" is a simple loop.\n * * An entry that is itself an array of arrays of points is a set of loops with \"parity\" -- relation:\n * * typically the first is an outer loop an others are holes.\n * * but if there is self intersection or multiple outer loops, parity rules are applied to decide inner and outer.\n * * Processing steps are\n * * Build the loops for each set.\n * * Each edge labeled with index to the outer array.\n * * find crossings among the edges.\n * * Edges are split as needed, but split preserves the edgeTag\n * * sort edges around vertices\n * * add regularization edges so holes are connected to their parent.\n * * assign inside/outside by parity within each set and overall union.\n */\n public static doBinaryBooleanBetweenMultiLoopInputs(\n dataA: MultiLineStringDataVariant[],\n opA: RegionGroupOpType,\n binaryOp: RegionBinaryOpType,\n dataB: MultiLineStringDataVariant[],\n opB: RegionGroupOpType,\n purgeSliverExteriorFaces: boolean\n ): HalfEdgeGraph | undefined {\n const graph = new HalfEdgeGraph();\n const baseMask = HalfEdgeMask.BOUNDARY_EDGE | HalfEdgeMask.PRIMARY_EDGE;\n const callbacks = RegionBooleanContext.create(opA, opB);\n callbacks.graph = graph;\n callbacks.faceAreaFunction = HalfEdgeGraphSearch.signedFaceArea;\n\n // Add all the members in groupA ..\n for (const data of dataA) {\n if (data.length > 2){\n const member = new RegionGroupMember(data, callbacks.groupA);\n RegionOps.addLoopsWithEdgeTagToGraph(graph, data, baseMask, member);\n }\n }\n for (const data of dataB) {\n if (data.length > 2){\n const member = new RegionGroupMember(data, callbacks.groupB);\n RegionOps.addLoopsWithEdgeTagToGraph(graph, data, baseMask, member);\n }\n }\n // split edges where they cross . . .\n HalfEdgeGraphMerge.splitIntersectingEdges(graph);\n // sort radially around vertices.\n HalfEdgeGraphMerge.clusterAndMergeXYTheta(graph);\n // add edges to connect various components (e.g. holes!!!)\n const context = new RegularizationContext(graph);\n context.regularizeGraph(true, true);\n callbacks.runClassificationSweep(binaryOp);\n if (purgeSliverExteriorFaces)\n callbacks.unmaskMaskedNullFaces(HalfEdgeMask.EXTERIOR);\n return graph;\n }\n}\n\n/**\n * Enumeration of operation types \"within a group operand\" for a `RegionBooleanContext`.\n * @internal\n */\nexport enum RegionGroupOpType {\n Union = 0,\n Parity = 1,\n Intersection = 2,\n NonBounding = -1,\n}\n/**\n * Each loop or parity region in a `RegionBooleanContext` is recorded as a `RegionGroupMember`, which carries\n * * the Loop or parityRegion object\n * * a numeric indication of the sweep state (parity) during the classification search.\n * * a reference to the parent group (which in turn leads back to the `RegionBooleanContext`)\n * @internal\n */\nclass RegionGroupMember {\n public region: Loop | ParityRegion | CurvePrimitive | MultiLineStringDataVariant;\n public sweepState: number;\n public parentGroup: RegionGroup;\n public constructor(region: Loop | ParityRegion | CurvePrimitive | MultiLineStringDataVariant, parentGroup: RegionGroup) {\n this.region = region;\n this.parentGroup = parentGroup;\n this.sweepState = 0;\n }\n public clearState() { this.sweepState = 0; }\n}\n/**\n * A `RegionGroup` is\n * * An array of `RegionGroupMembers`, carrying the regions of the Ai or Bi part of the boolean expression.\n * * The `RegionGroupOpType` to be applied among those members.\n * * Pointer to the containing context\n * * The count of number of regions known to be \"in\" as the search progresses.\n * @internal\n */\nexport class RegionGroup {\n public members: RegionGroupMember[];\n public groupOpType: RegionGroupOpType;\n public parent: RegionBooleanContext;\n private _numIn: number;\n public constructor(parent: RegionBooleanContext, groupOpType: RegionGroupOpType) {\n this.members = [];\n this.parent = parent;\n this.groupOpType = groupOpType;\n this._numIn = 0;\n }\n /** deep clear of state data -- group header plus all members */\n public clearState() {\n for (const member of this.members)\n member.clearState();\n this._numIn = 0;\n }\n public range(): Range3d {\n const range = Range3d.createNull();\n for (const m of this.members) {\n if (m.region instanceof GeometryQuery)\n m.region.extendRange(range);\n else {\n const range1 = Range3d.createFromVariantData(m.region);\n range.extendRange(range1);\n }\n }\n return range;\n }\n /** Ask if the current _numIn count qualifies as an \"in\" for this operation type.\n */\n public getInOut(): boolean {\n // UNION is true if one or more members are IN\n if (this.groupOpType === RegionGroupOpType.Union)\n return this._numIn > 0;\n // PARITY is true if an odd number of regions are IN\n if (this.groupOpType === RegionGroupOpType.Parity)\n return Geometry.isOdd(this._numIn);\n // INTERSECTION is true if ALL the regions are IN\n if (this.groupOpType === RegionGroupOpType.Intersection)\n return this._numIn === this.members.length;\n return false;\n }\n // push new members into the group.\n public addMember(data: AnyRegion | AnyRegion[] | LineSegment3d | undefined, allowLineSegment: boolean = false) {\n if (data instanceof Loop || data instanceof ParityRegion) {\n const cleanerData = data.clone() as (ParityRegion | Loop);\n RegionOps.consolidateAdjacentPrimitives(cleanerData);\n this.members.push(new RegionGroupMember(cleanerData, this));\n } else if (data instanceof UnionRegion) {\n for (const child of data.children) {\n this.addMember(child);\n }\n } else if (Array.isArray(data)) {\n for (const item of data) {\n this.addMember(item);\n }\n } else if (allowLineSegment && data instanceof LineSegment3d) {\n this.members.push(new RegionGroupMember(data, this));\n\n }\n }\n // update the \"in\" count _numIn according to old and new states (parity counts) for some member region.\n public recordMemberStateChange(oldState: number, newState: number) {\n const oldIn = Geometry.isOdd(oldState);\n const newIn = Geometry.isOdd(newState);\n if (!oldIn && newIn)\n this._numIn++;\n else if (oldIn && !newIn)\n this._numIn--;\n }\n}\n/**\n * A `RegionBooleanContext` carries structure and operations for binary operations between two sets of regions.\n * * In the binary operation OP (union, intersection, parity, difference), the left and right operands\n * are each a composite union, difference, or parity among multiple inputs, i.e.\n * * (operationA among Ai) OP (operationB among Bi)\n * * where the Ai are one set of regions, being combined by operationA\n * * and the Bi are the another set of regions, being combined by operationB\n * * Each group of Ai and Bi is a `RegionGroup`\n * * This is an extremely delicate structure.\n * * Members are public because of the unique variety of queries, but should only be used for queries.\n * * The graph and curves in the booleans are connected by an extended pointer chain:\n * * (HalfEdge in Graph).edgeTag points to a CurveLocationDetail\n * * (CurveLocationDetail).curve points to a curve\n * * (Curve).parent points to RegionGroupMember\n * * (RegionGroupMember) points to RegionGroup\n * * (RegionGroup) points to RegionBooleanBinaryContext\n * * So..when a graph sweep crosses an edge,\n * * the chain leads to a parity count in the RegionGroupMember\n * * that can change the number of members active in the RegionGroup\n * * which can change the state of the context.\n * @internal\n */\nexport class RegionBooleanContext implements RegionOpsFaceToFaceSearchCallbacks {\n public groupA!: RegionGroup;\n public groupB!: RegionGroup;\n public extraGeometry!: RegionGroup;\n public graph!: HalfEdgeGraph;\n public faceAreaFunction!: NodeToNumberFunction;\n public binaryOp: RegionBinaryOpType;\n\n private constructor(groupTypeA: RegionGroupOpType, groupTypeB: RegionGroupOpType) {\n this.groupA = new RegionGroup(this, groupTypeA);\n this.groupB = new RegionGroup(this, groupTypeB);\n this.extraGeometry = new RegionGroup(this, RegionGroupOpType.NonBounding);\n this.binaryOp = RegionBinaryOpType.Union; // it will be revised on can calls.\n }\n /**\n * Create a context with both A and B groups empty.\n * * Caller follows up by calls to `context.groupA.addMember (loopOrParityRegion)` or `context.groupB.addMember (loopOrParityRegion)`\n * @param groupTypeA\n * @param groupTypeB\n */\n public static create(groupTypeA: RegionGroupOpType, groupTypeB: RegionGroupOpType): RegionBooleanContext {\n return new RegionBooleanContext(groupTypeA, groupTypeB);\n }\n public addMembers(dataA: AnyRegion | AnyRegion[] | undefined, dataB: AnyRegion | AnyRegion[] | undefined) {\n this.groupA.addMember(dataA);\n this.groupB.addMember(dataB);\n // const doConnectives = 1;\n // if (doConnectives !== 0)\n this.addConnectives();\n }\n\n private _workSegment?: LineSegment3d;\n private static _bridgeDirection = Vector3d.createNormalized(1.0, -0.12328974132467)!; // magic unit direction to minimize vertex hits\n /**\n * The sweep operations require access to all geometry by edge crossings and face walk.\n * If input loops are non-overlapping, there may be disconnected islands not reachable.\n * This method:\n * * finds the total range\n * * creates parallel rays from the extreme point of each loop and extending beyond the overall range\n * * places those lines in the extraGeometry group\n */\n public addConnectives() {\n const rangeA = this.groupA.range();\n const rangeB = this.groupB.range();\n const rangeAB = rangeA.union(rangeB);\n const areaTol = RegionOps.computeXYAreaTolerance(rangeAB);\n let margin = 0.1;\n this._workSegment = PlaneAltitudeRangeContext.findExtremePointsInDirection(rangeAB.corners(), RegionBooleanContext._bridgeDirection, this._workSegment);\n if (this._workSegment)\n margin *= this._workSegment.point0Ref.distanceXY(this._workSegment.point1Ref); // how much further to extend each bridge ray\n\n const maxPoints: Point3d[] = [];\n const findExtremePointsInLoop = (region: Loop) => {\n const area = RegionOps.computeXYArea(region);\n if (area === undefined || Math.abs(area) < areaTol)\n return; // avoid bridging trivial faces\n this._workSegment = PlaneAltitudeRangeContext.findExtremePointsInDirection(region, RegionBooleanContext._bridgeDirection, this._workSegment);\n if (this._workSegment)\n maxPoints.push(this._workSegment.point1Ref);\n };\n\n for (const groupMembers of [this.groupA.members, this.groupB.members]) {\n for (const m of groupMembers) {\n if (m.region instanceof Loop) {\n findExtremePointsInLoop(m.region);\n } else if (m.region instanceof ParityRegion) {\n for (const loop of m.region.children)\n findExtremePointsInLoop(loop);\n }\n }\n }\n\n const ray = Ray3d.createZero();\n for (const p of maxPoints) {\n // Make a line from...\n // 1) exactly the max point of the loops to\n // 2) a point clearly outside the big range\n // If p came from some inner loop this will...\n // 1) create a bridge from the inner loop through any containing loops (always)\n // 2) avoid crossing any containing loop at a vertex. (with high probability, but not absolutely always)\n const bridgeLength = margin + Ray3d.create(p, RegionBooleanContext._bridgeDirection, ray).intersectionWithRange3d(rangeAB).high;\n const outside = Point3d.createAdd2Scaled(p, 1.0, RegionBooleanContext._bridgeDirection, bridgeLength);\n const bridgeLine = LineSegment3d.createXYXY(p.x, p.y, outside.x, outside.y);\n this.extraGeometry.addMember(bridgeLine, true);\n }\n }\n\n /**\n * Markup and assembly steps for geometry in the RegionGroups.\n * * Annotate connection from group to curves.\n * * groups with point data but no curves get no further annotation.\n * * compute intersections.\n * * assemble and merge the HalfEdgeGraph.\n */\n public annotateAndMergeCurvesInGraph() {\n const allPrimitives: CurvePrimitive[] = [];\n // ASSUME loops have fine-grained types -- no linestrings !!\n for (const group of [this.groupA, this.groupB, this.extraGeometry]) {\n for (const member of group.members) {\n let k = allPrimitives.length;\n if (member.region instanceof GeometryQuery) {\n RegionOps.collectCurvePrimitives(member.region, allPrimitives, true, true);\n for (; k < allPrimitives.length; k++)\n allPrimitives[k].parent = member;\n }\n }\n }\n // const range = RegionOps.curveArrayRange(allPrimitives);\n const intersections = CurveCurve.allIntersectionsAmongPrimitivesXY(allPrimitives);\n const graph = PlanarSubdivision.assembleHalfEdgeGraph(allPrimitives, intersections);\n this.graph = graph;\n this.faceAreaFunction = faceAreaFromCurvedEdgeData;\n }\n private _announceFaceFunction?: AnnounceClassifiedFace;\n /**\n * Sweep through the graph to assign in/out classifications to all faces.\n * * the classification is announced in two ways:\n * * the EXTERNAL mask is set on all half edges that are NOT interior faces.\n * * the announceFaceFunction is called once for each face.\n * @param binaryOp\n * @param announceFaceFunction\n */\n public runClassificationSweep(\n binaryOp: RegionBinaryOpType,\n announceFaceFunction?: AnnounceClassifiedFace) {\n this._announceFaceFunction = announceFaceFunction;\n this.binaryOp = binaryOp;\n this.graph.clearMask(HalfEdgeMask.EXTERIOR);\n for (const group of [this.groupA, this.groupB]) {\n group.clearState();\n }\n const faceHasBeenVisitedMask = this.graph.grabMask();\n const nodeHasBeenVisitedMask = this.graph.grabMask();\n const componentArray = GraphComponentArray.create(this.graph);\n for (const component of componentArray.components) {\n const exteriorHalfEdge = HalfEdgeGraphSearch.findMinimumAreaFace(component.faces, this.faceAreaFunction);\n if (exteriorHalfEdge) {\n const exteriorMask = HalfEdgeMask.EXTERIOR;\n const allMasksToClear = exteriorMask | faceHasBeenVisitedMask | nodeHasBeenVisitedMask;\n this.graph.clearMask(allMasksToClear);\n RegionOpsFaceToFaceSearch.faceToFaceSearchFromOuterLoop(this.graph, exteriorHalfEdge, faceHasBeenVisitedMask, nodeHasBeenVisitedMask, this);\n }\n }\n this.graph.dropMask(faceHasBeenVisitedMask);\n this.graph.dropMask(nodeHasBeenVisitedMask);\n }\n // search the graph for faces with\n // .. exactly 2 edges\n // .. both with given mask\n // .. at least one mate is not exterior.\n // .. clear that mark\n public unmaskMaskedNullFaces(mask: number) {\n for (const nodeA of this.graph.allHalfEdges) {\n const nodeB = nodeA.faceSuccessor;\n if (nodeB.faceSuccessor === nodeA) {\n if (nodeA.getMask(mask) && nodeB.getMask(mask)) {\n if (!nodeA.edgeMate.getMask(mask) || !nodeB.edgeMate.getMask(mask)) {\n nodeA.clearMask(mask);\n nodeB.clearMask(mask);\n }\n }\n }\n }\n }\n private getInOut(): boolean {\n if (this.binaryOp === RegionBinaryOpType.Union)\n return this.groupA.getInOut() || this.groupB.getInOut();\n if (this.binaryOp === RegionBinaryOpType.Intersection)\n return this.groupA.getInOut() && this.groupB.getInOut();\n if (this.binaryOp === RegionBinaryOpType.AMinusB)\n return this.groupA.getInOut() && !this.groupB.getInOut();\n if (this.binaryOp === RegionBinaryOpType.BMinusA)\n return !this.groupA.getInOut() && this.groupB.getInOut();\n if (this.binaryOp === RegionBinaryOpType.Parity)\n return this.groupA.getInOut() !== this.groupB.getInOut();\n return false;\n }\n /**\n * Record transition across an edge as entry or exit from a RegionGroup.\n * * Work backward from the node to a RegionGroup. This path can be:\n * * If the node points to a CurveLocationDetail of a (possibly partial) curve, the path is (take a deep breath)\n * * node points to CurveLocation Detail\n * * CurveLocationDetail points to curve\n * * curve points to RegionGroupMember\n * * If the node points directly to a RegionGroup, it's ready to go!!!\n * @param node\n * @param delta\n */\n private recordTransitionAcrossEdge(node: HalfEdge, delta: number): RegionGroupMember | undefined {\n const updateRegionGroupMemberState = (member: RegionGroupMember): RegionGroupMember => {\n if (member.parentGroup.groupOpType === RegionGroupOpType.NonBounding)\n return member; // no transition across a bridge edge\n if (delta !== 0) {\n const oldSweepState = member.sweepState;\n member.sweepState += delta;\n member.parentGroup.recordMemberStateChange(oldSweepState, member.sweepState);\n }\n return member;\n };\n\n const data = node.edgeTag;\n if (data instanceof RegionGroupMember)\n return updateRegionGroupMemberState(data);\n\n if (data instanceof CurveLocationDetail) {\n // We trust that the caller has linked from the graph node to a curve which has a RegionGroupMember as its parent.\n const member = data.curve!.parent;\n if (member instanceof RegionGroupMember)\n return updateRegionGroupMemberState(member);\n }\n return undefined;\n }\n // obligations to act as sweep callback ...\n /** Announce a representative node on the outer face of a component */\n public startComponent(outerFaceNode: HalfEdge): boolean {\n outerFaceNode.setMaskAroundFace(HalfEdgeMask.EXTERIOR);\n if (this._announceFaceFunction)\n this._announceFaceFunction(this.graph, outerFaceNode, -1, faceAreaFromCurvedEdgeData(outerFaceNode));\n return true;\n }\n /** Announce return to outer face */\n public finishComponent(_node: HalfEdge): boolean {\n return true;\n }\n /** Announce entry to a graph face.\n * * Both both sides of a graph edge are from the same RegionGroupMember.\n * * Hence \"crossing that edge\" changes the parity count for the RegionGroupMember that owns that edge by 1.\n * * The parity count for other RegionGroupMembers are never affected by this crossing.\n * * Crossing a bridge edge does not change the parity count.\n */\n public enterFace(_facePathStack: HalfEdge[], newFaceNode: HalfEdge): boolean {\n this.recordTransitionAcrossEdge(newFaceNode, 1);\n const state = this.getInOut();\n if (!state)\n newFaceNode.setMaskAroundFace(HalfEdgeMask.EXTERIOR);\n if (this._announceFaceFunction)\n this._announceFaceFunction(this.graph, newFaceNode, state ? 1 : 0, faceAreaFromCurvedEdgeData(newFaceNode));\n return true;\n }\n /** Announce face exit */\n public leaveFace(_facePathStack: HalfEdge[], oldFaceNode: HalfEdge): boolean {\n this.recordTransitionAcrossEdge(oldFaceNode, -1);\n return true;\n }\n}\n/** return xy area between a (part of a) curve and the x axis through a reference point.\n * If detail is undefined or does not have both start and end fractions, just do trapezoid area\n */\nfunction areaUnderPartialCurveXY(detail: CurveLocationDetail | undefined, xyStart: XAndY, xyEnd: XAndY, referencePoint: XAndY): number {\n // area between trapezoid and axis\n let trapezoidArea;\n if (detail && detail.point1) {\n trapezoidArea = -(detail.point1.x - detail.point.x) * (0.5 * (detail.point.y + detail.point1.y) - referencePoint.y);\n } else {\n trapezoidArea = -(xyEnd.x - xyStart.x) * (0.5 * (xyStart.y + xyEnd.y) - referencePoint.y);\n }\n let areaToChord = 0.0;\n if (detail && detail.curve && detail.hasFraction1) {\n\n if (detail.curve instanceof LineSegment3d) {\n // ah .. nothing to do for a line segment\n } else if (detail.curve instanceof Arc3d) {\n areaToChord = detail.curve.areaToChordXY(detail.fraction, detail.fraction1!);\n }\n }\n return trapezoidArea + areaToChord;\n}\n/** Compute face area for a face whose edges are decorated with CurveLocationDetail for their (partial) curves */\nfunction faceAreaFromCurvedEdgeData(faceSeed: HalfEdge): number {\n let area = 0.0;\n let edge = faceSeed;\n do {\n area += (edge.sortData as number) * areaUnderPartialCurveXY((edge.edgeTag as CurveLocationDetail), edge, edge.faceSuccessor, faceSeed);\n } while ((edge = edge.faceSuccessor) !== faceSeed);\n return area;\n}\n\n/**\n * Function to accumulate area under edges\n * Array of nodes representing faces in a subset of a graph.\n * @internal\n */\nexport type NodeAndRangeFunction = (edge: HalfEdge, range: Range2d) => void;\n/**\n * Array of nodes representing faces in a subset of a graph.\n * @internal\n */\nexport class GraphComponent {\n public faces: HalfEdge[];\n public faceAreas: number[];\n public range: Range2d;\n public constructor(faces: HalfEdge[]) {\n this.faces = faces;\n this.range = Range2d.createNull();\n this.faceAreas = [];\n }\n /**\n * visit all vertices and edges in the component to build face area array and composite range.\n *\n * @param extendRangeForEdge optional function to compute edge range. If undefined, linear edge is assumed.\n * @param faceAreaFunction optional function to compute face area. If undefined, linear edges are assumed.\n */\n public buildFaceData(extendRangeForEdge: NodeAndRangeFunction | undefined, faceAreaFunction: NodeToNumberFunction | undefined) {\n const vertexFunction = (node: HalfEdge) => {\n if (extendRangeForEdge)\n extendRangeForEdge(node, this.range);\n else\n this.range.extendXY(node.x, node.y);\n return 0;\n };\n this.range.setNull();\n for (const f of this.faces) {\n f.sumAroundFace(vertexFunction);\n }\n this.faceAreas.length = 0;\n if (!faceAreaFunction)\n faceAreaFunction = HalfEdgeGraphSearch.signedFaceArea;\n for (const f of this.faces) {\n this.faceAreas.push(faceAreaFunction(f));\n }\n }\n}\n/** build and hold an array of component data for a HalfEdgeGraph.\n * @internal\n */\nexport class GraphComponentArray {\n public components: GraphComponent[];\n public graph: HalfEdgeGraph;\n private constructor(graph: HalfEdgeGraph) {\n this.graph = graph;\n this.components = [];\n }\n public static create(graph: HalfEdgeGraph, extendRangeForEdge?: (edge: HalfEdge, range: Range2d) => void): GraphComponentArray {\n const result = new GraphComponentArray(graph);\n const componentArrays = HalfEdgeGraphSearch.collectConnectedComponentsWithExteriorParityMasks(graph, undefined);\n for (const componentFaces of componentArrays) {\n const component = new GraphComponent(componentFaces);\n component.buildFaceData(extendRangeForEdge, faceAreaFromCurvedEdgeData);\n result.components.push(component);\n }\n return result;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RegionOpsClassificationSweeps.js","sourceRoot":"","sources":["../../../src/curve/RegionOpsClassificationSweeps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAY,aAAa,EAAE,YAAY,EAAwB,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EA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M,CAAC,MAAM,CAAC,KAAoB,EAAE,kBAA6D;QACtG,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC9C,MAAM,eAAe,GAAG,mBAAmB,CAAC,iDAAiD,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAChH,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE;YAC5C,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,cAAc,CAAC,CAAC;YACrD,SAAS,CAAC,aAAa,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;YACxE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACnC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { HalfEdge, HalfEdgeGraph, HalfEdgeMask, NodeToNumberFunction } from \"../topology/Graph\";\nimport { HalfEdgeGraphSearch } from \"../topology/HalfEdgeGraphSearch\";\nimport { HalfEdgeGraphMerge } from \"../topology/Merging\";\nimport { RegularizationContext } from \"../topology/RegularizeFace\";\nimport { MultiLineStringDataVariant } from \"../topology/Triangulation\";\nimport { GraphCheckPointFunction, RegionBinaryOpType, RegionOps } from \"./RegionOps\";\nimport { ParityRegion } from \"./ParityRegion\";\nimport { Loop } from \"./Loop\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { CurveCurve } from \"./CurveCurve\";\nimport { PlanarSubdivision } from \"./Query/PlanarSubdivision\";\nimport { Geometry } from \"../Geometry\";\nimport { AnyRegion } from \"./CurveChain\";\nimport { UnionRegion } from \"./UnionRegion\";\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\nimport { XAndY } from \"../geometry3d/XYZProps\";\nimport { LineSegment3d } from \"./LineSegment3d\";\nimport { Arc3d } from \"./Arc3d\";\nimport { Range2d, Range3d } from \"../geometry3d/Range\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\n\n/**\n * base class for callbacks during region sweeps.\n * * At start of a component, `startComponent(node)` is called announcing a representative node on the outermost face.\n * * A Component in this usage is a component that is edge connected when ignoring \"exterior bridge edges\".\n * * As each face is entered, `enterFace(facePathStack, newFaceNode)` is called\n * * facePathStack[0] is the outermost node of the path from the outer face.\n * * facePathStack[1] is its inside mate.\n * * facePathStack[2k] is the outside node at crossing to face at depth k.\n * * facePathStack[2k+1] is the node where face at depth k was entered.\n * * newFaceNode is the entry node (redundant of stack tip)\n * * On retreat from a face, `leaveFace(facePathStack, faceNode)` is called.\n * * At end of component, `finishComponent (node)` is called.\n * * The base class is fully implemented to do nothing during the sweep.\n * @internal\n */\nabstract class RegionOpsFaceToFaceSearchCallbacks {\n /** Announce a representative node on the outer face of a component */\n public startComponent(_node: HalfEdge): boolean { return true; }\n /** Announce return to outer face */\n public finishComponent(_node: HalfEdge): boolean { return true; }\n /** Announce face entry */\n public enterFace(_facePathStack: HalfEdge[], _newFaceNode: HalfEdge): boolean { return true; }\n /** Announce face exit */\n public leaveFace(_facePathStack: HalfEdge[], _newFaceNode: HalfEdge): boolean { return true; }\n}\n/** Function signature to test if a pair of boolean states is to be accepted by area booleans (during face-to-face sweeps)\n * @internal\n */\ntype BinaryBooleanAcceptFunction = (stateA: boolean, stateB: boolean) => boolean;\n/** Function signature ot announce classification of a face.\n * The `faceType` parameters are\n * * -1 for a fully exterior face. This is a negative area face.\n * * 0 for a positive area face classified as \"out\" for the boolean.\n * * 1 for a positive area face classified as \"in\" for the boolean.\n */\ntype AnnounceClassifiedFace = (graph: HalfEdgeGraph, faceSeed: HalfEdge, faceType: -1 | 0 | 1, area: number) => void;\n/**\n * Implementation of `RegionOpsFaceToFaceSearchCallbacks` for binary boolean sweep with polygonal regions.\n * * For this linear-boundary case the boundary geometry is carried entirely from the coordinates in the half edges.\n * * This assumes the each node in the graph has edgeTag set to:\n * * `edgeTag === undefined` if the edge crossing does not change classification.\n * * for example, an edge added by regularization\n * * `edgeTag === 1` if this is a boundary for the first of the boolean input regions\n * * `edgeTag === 2` if this is a boundary for the second of the boolean input regions\n * * constructor\n * * takes caller-supplied function to decide whether to accept a face given its state relative to the two boolean terms.\n * * sets the in/out status of both terms to false.\n * * `startComponent` marks the entire outer face as `EXTERIOR`\n * * `enterFace`\n * * if this is a bounding edge (according to `node.faceTag`) toggle the in/out status if this boolean term.\n * * ask the faceAcceptFunction if the current term states combine to in/out for the result\n * * if out, set the `EXTERIOR` mask around the face.\n * * `leaveFace`\n * * if this is a bounding edge (according to `node.faceTag`) toggle the in/out status if this boolean term.\n * * `finishComponent` is not reimplemented.\n * @internal\n */\nclass RegionOpsBinaryBooleanSweepCallbacks extends RegionOpsFaceToFaceSearchCallbacks {\n private _faceSelectFunction: BinaryBooleanAcceptFunction;\n private _inComponent: boolean[];\n private _exteriorMask: HalfEdgeMask;\n public constructor(acceptFaceFunction: BinaryBooleanAcceptFunction, exteriorMask: HalfEdgeMask) {\n super();\n this._inComponent = [false, false, false]; // entry 0 is never reused.\n this._exteriorMask = exteriorMask;\n this._faceSelectFunction = acceptFaceFunction;\n }\n /** Mark this face as exterior */\n public override startComponent(node: HalfEdge): boolean { node.setMaskAroundFace(this._exteriorMask); return true; }\n /**\n * * If necessary, toggle a term state.\n * * if indicated, mark this face exterior.\n */\n public override enterFace(_facePathStack: HalfEdge[], node: HalfEdge): boolean {\n const thisFaceIndex = node.edgeTag;\n if (node.edgeTag === 1 || node.edgeTag === 2)\n this._inComponent[thisFaceIndex] = !this._inComponent[thisFaceIndex];\n if (!this._faceSelectFunction(this._inComponent[1], this._inComponent[2]))\n node.setMaskAroundFace(this._exteriorMask);\n return true;\n }\n /**\n * * If necessary, toggle a term state.\n */\n public override leaveFace(_facePathStack: HalfEdge[], node: HalfEdge): boolean {\n const thisFaceIndex = node.edgeTag;\n if (node.edgeTag === 1 || node.edgeTag === 2)\n this._inComponent[thisFaceIndex] = !this._inComponent[thisFaceIndex];\n return true;\n }\n}\n/**\n * Low level graph search for face classification.\n * @internal\n */\nexport class RegionOpsFaceToFaceSearch {\n /**\n * run a DFS with face-to-face step announcements.\n * * false return from any function terminates search immediately.\n * * all reachable nodes assumed to have both visit masks clear.\n * @param graph containing graph.\n * @param seed first node to visit.\n * @param faceHasBeenVisited mask marking faces that have been seen.\n * @param nodeHasBeenVisited mask marking node-to-node step around face.\n *\n */\n public static faceToFaceSearchFromOuterLoop(_graph: HalfEdgeGraph, seed: HalfEdge, faceHasBeenVisited: HalfEdgeMask, nodeHasBeenVisited: HalfEdgeMask, callbacks: RegionOpsFaceToFaceSearchCallbacks) {\n if (seed.isMaskSet(faceHasBeenVisited))\n return;\n if (!callbacks.startComponent(seed))\n return;\n const facePathStack = [];\n seed.setMaskAroundFace(faceHasBeenVisited);\n let faceWalker = seed;\n do {\n let entryNode = faceWalker;\n let mate = faceWalker.edgeMate;\n if (!mate.isMaskSet(faceHasBeenVisited)) {\n // the faceWalker seed is always on the base of the stack.\n // the stack then contains even-odd pairs of (entryNode, currentNode)\n // * entryNode is the node where a face was entered.\n // * faceNode is another node around that face.\n facePathStack.push(faceWalker);\n facePathStack.push(mate);\n let faceNode = mate.faceSuccessor;\n mate.setMaskAroundFace(faceHasBeenVisited);\n entryNode = mate;\n if (callbacks.enterFace(facePathStack, mate)) {\n for (; ;) {\n mate = faceNode.edgeMate;\n if (!mate.isMaskSet(faceHasBeenVisited)) {\n mate.setMaskAroundFace(faceHasBeenVisited);\n if (!callbacks.enterFace(facePathStack, mate))\n return;\n facePathStack.push(faceNode);\n facePathStack.push(mate);\n faceNode = mate;\n entryNode = mate;\n }\n faceNode.setMask(nodeHasBeenVisited);\n faceNode = faceNode.faceSuccessor;\n if (faceNode === entryNode) {\n callbacks.leaveFace(facePathStack, faceNode);\n if (facePathStack.length <= 2) {\n break;\n }\n facePathStack.pop();\n faceNode = facePathStack[facePathStack.length - 1];\n facePathStack.pop();\n entryNode = facePathStack[facePathStack.length - 1];\n }\n if (faceNode.isMaskSet(nodeHasBeenVisited)) {\n // this is disaster !!!\n return;\n }\n }\n }\n }\n // continue at outermost level .....\n faceWalker = faceWalker.faceSuccessor;\n } while (faceWalker !== seed);\n callbacks.finishComponent(seed);\n }\n /** Complete multi-step process for polygon binary booleans starting with arrays of coordinates.\n * * Each of the binary input terms is a collection of loops\n * * Within the binary term, in/out is determined by edge-crossing parity rules.\n * * Processing steps are\n * * Build the loops for each set.\n * * Each edge labeled with 1 or 2 as binary term identifier.\n * * find crossings among the edges.\n * * Edges are split as needed, but split preserves the edgeTag\n * * sort edges around vertices\n * * add regularization edges so holes are connected to their parent.\n */\n public static doPolygonBoolean(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, faceSelectFunction: (inA: boolean, inB: boolean) => boolean, graphCheckPoint?: GraphCheckPointFunction): HalfEdgeGraph | undefined {\n const graph = new HalfEdgeGraph();\n const baseMask = HalfEdgeMask.BOUNDARY_EDGE | HalfEdgeMask.PRIMARY_EDGE;\n const seedA = RegionOps.addLoopsWithEdgeTagToGraph(graph, loopsA, baseMask, 1);\n const seedB = RegionOps.addLoopsWithEdgeTagToGraph(graph, loopsB, baseMask, 2);\n if (graphCheckPoint)\n graphCheckPoint(\"unmerged loops\", graph, \"U\");\n if (seedA || seedB) {\n // split edges where they cross . . .\n HalfEdgeGraphMerge.splitIntersectingEdges(graph);\n if (graphCheckPoint)\n graphCheckPoint(\"After splitIntersectingEdges\", graph, \"S\");\n // sort radially around vertices.\n HalfEdgeGraphMerge.clusterAndMergeXYTheta(graph);\n if (graphCheckPoint)\n graphCheckPoint(\"After clusterAndMergeXYTheta\", graph, \"M\");\n // add edges to connect various components (e.g. holes!!!)\n const context = new RegularizationContext(graph);\n context.regularizeGraph(true, true);\n if (graphCheckPoint)\n graphCheckPoint(\"After regularize\", graph, \"MR\");\n const exteriorHalfEdge = HalfEdgeGraphSearch.findMinimumAreaFace(graph);\n const exteriorMask = HalfEdgeMask.EXTERIOR;\n const faceVisitedMask = graph.grabMask();\n const nodeVisitedMask = graph.grabMask();\n const allMasksToClear = exteriorMask | faceVisitedMask | nodeVisitedMask;\n graph.clearMask(allMasksToClear);\n const callbacks = new RegionOpsBinaryBooleanSweepCallbacks(faceSelectFunction, exteriorMask);\n this.faceToFaceSearchFromOuterLoop(graph, exteriorHalfEdge, faceVisitedMask, nodeVisitedMask, callbacks);\n if (graphCheckPoint)\n graphCheckPoint(\"After faceToFaceSearchFromOuterLoop\", graph, \"MRX\");\n graph.dropMask(faceVisitedMask);\n graph.dropMask(nodeVisitedMask);\n return graph;\n }\n return undefined;\n }\n\n /** Complete multi-step process for polygon binary booleans starting with arrays of coordinates.\n * * the manyLoopsAndParitySets input is an array.\n * * Each entry is one or more loops.\n * * An entry that is \"just points\" is a simple loop.\n * * An entry that is itself an array of arrays of points is a set of loops with \"parity\" -- relation:\n * * typically the first is an outer loop an others are holes.\n * * but if there is self intersection or multiple outer loops, parity rules are applied to decide inner and outer.\n * * Processing steps are\n * * Build the loops for each set.\n * * Each edge labeled with index to the outer array.\n * * find crossings among the edges.\n * * Edges are split as needed, but split preserves the edgeTag\n * * sort edges around vertices\n * * add regularization edges so holes are connected to their parent.\n * * assign inside/outside by parity within each set and overall union.\n */\n public static doBinaryBooleanBetweenMultiLoopInputs(\n dataA: MultiLineStringDataVariant[],\n opA: RegionGroupOpType,\n binaryOp: RegionBinaryOpType,\n dataB: MultiLineStringDataVariant[],\n opB: RegionGroupOpType,\n purgeSliverExteriorFaces: boolean\n ): HalfEdgeGraph | undefined {\n const graph = new HalfEdgeGraph();\n const baseMask = HalfEdgeMask.BOUNDARY_EDGE | HalfEdgeMask.PRIMARY_EDGE;\n const callbacks = RegionBooleanContext.create(opA, opB);\n callbacks.graph = graph;\n callbacks.faceAreaFunction = HalfEdgeGraphSearch.signedFaceArea;\n\n // Add all the members in groupA ..\n for (const data of dataA) {\n if (data.length > 2){\n const member = new RegionGroupMember(data, callbacks.groupA);\n RegionOps.addLoopsWithEdgeTagToGraph(graph, data, baseMask, member);\n }\n }\n for (const data of dataB) {\n if (data.length > 2){\n const member = new RegionGroupMember(data, callbacks.groupB);\n RegionOps.addLoopsWithEdgeTagToGraph(graph, data, baseMask, member);\n }\n }\n // split edges where they cross . . .\n HalfEdgeGraphMerge.splitIntersectingEdges(graph);\n // sort radially around vertices.\n HalfEdgeGraphMerge.clusterAndMergeXYTheta(graph);\n // add edges to connect various components (e.g. holes!!!)\n const context = new RegularizationContext(graph);\n context.regularizeGraph(true, true);\n callbacks.runClassificationSweep(binaryOp);\n if (purgeSliverExteriorFaces)\n callbacks.unmaskMaskedNullFaces(HalfEdgeMask.EXTERIOR);\n return graph;\n }\n}\n\n/**\n * Enumeration of operation types \"within a group operand\" for a `RegionBooleanContext`.\n * @internal\n */\nexport enum RegionGroupOpType {\n Union = 0,\n Parity = 1,\n Intersection = 2,\n NonBounding = -1,\n}\n/**\n * Each loop or parity region in a `RegionBooleanContext` is recorded as a `RegionGroupMember`, which carries\n * * the Loop or parityRegion object\n * * a numeric indication of the sweep state (parity) during the classification search.\n * * a reference to the parent group (which in turn leads back to the `RegionBooleanContext`)\n * @internal\n */\nclass RegionGroupMember {\n public region: Loop | ParityRegion | CurvePrimitive | MultiLineStringDataVariant;\n public sweepState: number;\n public parentGroup: RegionGroup;\n public constructor(region: Loop | ParityRegion | CurvePrimitive | MultiLineStringDataVariant, parentGroup: RegionGroup) {\n this.region = region;\n this.parentGroup = parentGroup;\n this.sweepState = 0;\n }\n public clearState() { this.sweepState = 0; }\n}\n/**\n * A `RegionGroup` is\n * * An array of `RegionGroupMembers`, carrying the regions of the Ai or Bi part of the boolean expression.\n * * The `RegionGroupOpType` to be applied among those members.\n * * Pointer to the containing context\n * * The count of number of regions known to be \"in\" as the search progresses.\n * @internal\n */\nexport class RegionGroup {\n public members: RegionGroupMember[];\n public groupOpType: RegionGroupOpType;\n public parent: RegionBooleanContext;\n private _numIn: number;\n public constructor(parent: RegionBooleanContext, groupOpType: RegionGroupOpType) {\n this.members = [];\n this.parent = parent;\n this.groupOpType = groupOpType;\n this._numIn = 0;\n }\n /** deep clear of state data -- group header plus all members */\n public clearState() {\n for (const member of this.members)\n member.clearState();\n this._numIn = 0;\n }\n public range(): Range3d {\n const range = Range3d.createNull();\n for (const m of this.members) {\n if (m.region instanceof GeometryQuery)\n m.region.extendRange(range);\n else {\n const range1 = Range3d.createFromVariantData(m.region);\n range.extendRange(range1);\n }\n }\n return range;\n }\n /** Ask if the current _numIn count qualifies as an \"in\" for this operation type.\n */\n public getInOut(): boolean {\n // UNION is true if one or more members are IN\n if (this.groupOpType === RegionGroupOpType.Union)\n return this._numIn > 0;\n // PARITY is true if an odd number of regions are IN\n if (this.groupOpType === RegionGroupOpType.Parity)\n return Geometry.isOdd(this._numIn);\n // INTERSECTION is true if ALL the regions are IN\n if (this.groupOpType === RegionGroupOpType.Intersection)\n return this._numIn === this.members.length;\n return false;\n }\n // push new members into the group.\n public addMember(data: AnyRegion | AnyRegion[] | LineSegment3d | undefined, allowLineSegment: boolean = false) {\n if (data instanceof Loop || data instanceof ParityRegion) {\n const cleanerData = data.clone() as (ParityRegion | Loop);\n RegionOps.consolidateAdjacentPrimitives(cleanerData);\n this.members.push(new RegionGroupMember(cleanerData, this));\n } else if (data instanceof UnionRegion) {\n for (const child of data.children) {\n this.addMember(child);\n }\n } else if (Array.isArray(data)) {\n for (const item of data) {\n this.addMember(item);\n }\n } else if (allowLineSegment && data instanceof LineSegment3d) {\n this.members.push(new RegionGroupMember(data, this));\n\n }\n }\n // update the \"in\" count _numIn according to old and new states (parity counts) for some member region.\n public recordMemberStateChange(oldState: number, newState: number) {\n const oldIn = Geometry.isOdd(oldState);\n const newIn = Geometry.isOdd(newState);\n if (!oldIn && newIn)\n this._numIn++;\n else if (oldIn && !newIn)\n this._numIn--;\n }\n}\n/**\n * A `RegionBooleanContext` carries structure and operations for binary operations between two sets of regions.\n * * In the binary operation OP (union, intersection, parity, difference), the left and right operands\n * are each a composite union, difference, or parity among multiple inputs, i.e.\n * * (operationA among Ai) OP (operationB among Bi)\n * * where the Ai are one set of regions, being combined by operationA\n * * and the Bi are the another set of regions, being combined by operationB\n * * Each group of Ai and Bi is a `RegionGroup`\n * * This is an extremely delicate structure.\n * * Members are public because of the unique variety of queries, but should only be used for queries.\n * * The graph and curves in the booleans are connected by an extended pointer chain:\n * * (HalfEdge in Graph).edgeTag points to a CurveLocationDetail\n * * (CurveLocationDetail).curve points to a curve\n * * (Curve).parent points to RegionGroupMember\n * * (RegionGroupMember) points to RegionGroup\n * * (RegionGroup) points to RegionBooleanBinaryContext\n * * So..when a graph sweep crosses an edge,\n * * the chain leads to a parity count in the RegionGroupMember\n * * that can change the number of members active in the RegionGroup\n * * which can change the state of the context.\n * @internal\n */\nexport class RegionBooleanContext implements RegionOpsFaceToFaceSearchCallbacks {\n public groupA!: RegionGroup;\n public groupB!: RegionGroup;\n public extraGeometry!: RegionGroup;\n public graph!: HalfEdgeGraph;\n public faceAreaFunction!: NodeToNumberFunction;\n public binaryOp: RegionBinaryOpType;\n\n private constructor(groupTypeA: RegionGroupOpType, groupTypeB: RegionGroupOpType) {\n this.groupA = new RegionGroup(this, groupTypeA);\n this.groupB = new RegionGroup(this, groupTypeB);\n this.extraGeometry = new RegionGroup(this, RegionGroupOpType.NonBounding);\n this.binaryOp = RegionBinaryOpType.Union; // it will be revised on can calls.\n }\n /**\n * Create a context with both A and B groups empty.\n * * Caller follows up by calls to `context.groupA.addMember (loopOrParityRegion)` or `context.groupB.addMember (loopOrParityRegion)`\n * @param groupTypeA\n * @param groupTypeB\n */\n public static create(groupTypeA: RegionGroupOpType, groupTypeB: RegionGroupOpType): RegionBooleanContext {\n return new RegionBooleanContext(groupTypeA, groupTypeB);\n }\n public addMembers(dataA: AnyRegion | AnyRegion[] | undefined, dataB: AnyRegion | AnyRegion[] | undefined) {\n this.groupA.addMember(dataA);\n this.groupB.addMember(dataB);\n // const doConnectives = 1;\n // if (doConnectives !== 0)\n this.addConnectives();\n }\n\n private _workSegment?: LineSegment3d;\n private static _bridgeDirection = Vector3d.createNormalized(1.0, -0.12328974132467)!; // magic unit direction to minimize vertex hits\n /**\n * The sweep operations require access to all geometry by edge crossings and face walk.\n * If input loops are non-overlapping, there may be disconnected islands not reachable.\n * This method:\n * * finds the total range\n * * creates parallel rays from the extreme point of each loop and extending beyond the overall range\n * * places those lines in the extraGeometry group\n */\n public addConnectives() {\n const rangeA = this.groupA.range();\n const rangeB = this.groupB.range();\n const rangeAB = rangeA.union(rangeB);\n const areaTol = RegionOps.computeXYAreaTolerance(rangeAB);\n let margin = 0.1;\n this._workSegment = PlaneAltitudeRangeContext.findExtremePointsInDirection(rangeAB.corners(), RegionBooleanContext._bridgeDirection, this._workSegment);\n if (this._workSegment)\n margin *= this._workSegment.point0Ref.distanceXY(this._workSegment.point1Ref); // how much further to extend each bridge ray\n\n const maxPoints: Point3d[] = [];\n const findExtremePointsInLoop = (region: Loop) => {\n const area = RegionOps.computeXYArea(region);\n if (area === undefined || Math.abs(area) < areaTol)\n return; // avoid bridging trivial faces\n this._workSegment = PlaneAltitudeRangeContext.findExtremePointsInDirection(region, RegionBooleanContext._bridgeDirection, this._workSegment);\n if (this._workSegment)\n maxPoints.push(this._workSegment.point1Ref);\n };\n\n for (const groupMembers of [this.groupA.members, this.groupB.members]) {\n for (const m of groupMembers) {\n if (m.region instanceof Loop) {\n findExtremePointsInLoop(m.region);\n } else if (m.region instanceof ParityRegion) {\n for (const loop of m.region.children)\n findExtremePointsInLoop(loop);\n }\n }\n }\n\n const ray = Ray3d.createZero();\n for (const p of maxPoints) {\n // Make a line from...\n // 1) exactly the max point of the loops to\n // 2) a point clearly outside the big range\n // If p came from some inner loop this will...\n // 1) create a bridge from the inner loop through any containing loops (always)\n // 2) avoid crossing any containing loop at a vertex. (with high probability, but not absolutely always)\n const bridgeLength = margin + Ray3d.create(p, RegionBooleanContext._bridgeDirection, ray).intersectionWithRange3d(rangeAB).high;\n const outside = Point3d.createAdd2Scaled(p, 1.0, RegionBooleanContext._bridgeDirection, bridgeLength);\n const bridgeLine = LineSegment3d.createXYXY(p.x, p.y, outside.x, outside.y);\n this.extraGeometry.addMember(bridgeLine, true);\n }\n }\n\n /**\n * Markup and assembly steps for geometry in the RegionGroups.\n * * Annotate connection from group to curves.\n * * groups with point data but no curves get no further annotation.\n * * compute intersections.\n * * assemble and merge the HalfEdgeGraph.\n * @param mergeTolerance absolute distance tolerance for merging loops\n */\n public annotateAndMergeCurvesInGraph(mergeTolerance: number = Geometry.smallMetricDistance) {\n const allPrimitives: CurvePrimitive[] = [];\n // ASSUME loops have fine-grained types -- no linestrings !!\n for (const group of [this.groupA, this.groupB, this.extraGeometry]) {\n for (const member of group.members) {\n let k = allPrimitives.length;\n if (member.region instanceof GeometryQuery) {\n RegionOps.collectCurvePrimitives(member.region, allPrimitives, true, true);\n for (; k < allPrimitives.length; k++)\n allPrimitives[k].parent = member;\n }\n }\n }\n // const range = RegionOps.curveArrayRange(allPrimitives);\n const intersections = CurveCurve.allIntersectionsAmongPrimitivesXY(allPrimitives, mergeTolerance);\n const graph = PlanarSubdivision.assembleHalfEdgeGraph(allPrimitives, intersections);\n this.graph = graph;\n this.faceAreaFunction = faceAreaFromCurvedEdgeData;\n }\n private _announceFaceFunction?: AnnounceClassifiedFace;\n /**\n * Sweep through the graph to assign in/out classifications to all faces.\n * * the classification is announced in two ways:\n * * the EXTERNAL mask is set on all half edges that are NOT interior faces.\n * * the announceFaceFunction is called once for each face.\n * @param binaryOp\n * @param announceFaceFunction\n */\n public runClassificationSweep(\n binaryOp: RegionBinaryOpType,\n announceFaceFunction?: AnnounceClassifiedFace) {\n this._announceFaceFunction = announceFaceFunction;\n this.binaryOp = binaryOp;\n this.graph.clearMask(HalfEdgeMask.EXTERIOR);\n for (const group of [this.groupA, this.groupB]) {\n group.clearState();\n }\n const faceHasBeenVisitedMask = this.graph.grabMask();\n const nodeHasBeenVisitedMask = this.graph.grabMask();\n const componentArray = GraphComponentArray.create(this.graph);\n for (const component of componentArray.components) {\n const exteriorHalfEdge = HalfEdgeGraphSearch.findMinimumAreaFace(component.faces, this.faceAreaFunction);\n if (exteriorHalfEdge) {\n const exteriorMask = HalfEdgeMask.EXTERIOR;\n const allMasksToClear = exteriorMask | faceHasBeenVisitedMask | nodeHasBeenVisitedMask;\n this.graph.clearMask(allMasksToClear);\n RegionOpsFaceToFaceSearch.faceToFaceSearchFromOuterLoop(this.graph, exteriorHalfEdge, faceHasBeenVisitedMask, nodeHasBeenVisitedMask, this);\n }\n }\n this.graph.dropMask(faceHasBeenVisitedMask);\n this.graph.dropMask(nodeHasBeenVisitedMask);\n }\n // search the graph for faces with\n // .. exactly 2 edges\n // .. both with given mask\n // .. at least one mate is not exterior.\n // .. clear that mark\n public unmaskMaskedNullFaces(mask: number) {\n for (const nodeA of this.graph.allHalfEdges) {\n const nodeB = nodeA.faceSuccessor;\n if (nodeB.faceSuccessor === nodeA) {\n if (nodeA.getMask(mask) && nodeB.getMask(mask)) {\n if (!nodeA.edgeMate.getMask(mask) || !nodeB.edgeMate.getMask(mask)) {\n nodeA.clearMask(mask);\n nodeB.clearMask(mask);\n }\n }\n }\n }\n }\n private getInOut(): boolean {\n if (this.binaryOp === RegionBinaryOpType.Union)\n return this.groupA.getInOut() || this.groupB.getInOut();\n if (this.binaryOp === RegionBinaryOpType.Intersection)\n return this.groupA.getInOut() && this.groupB.getInOut();\n if (this.binaryOp === RegionBinaryOpType.AMinusB)\n return this.groupA.getInOut() && !this.groupB.getInOut();\n if (this.binaryOp === RegionBinaryOpType.BMinusA)\n return !this.groupA.getInOut() && this.groupB.getInOut();\n if (this.binaryOp === RegionBinaryOpType.Parity)\n return this.groupA.getInOut() !== this.groupB.getInOut();\n return false;\n }\n /**\n * Record transition across an edge as entry or exit from a RegionGroup.\n * * Work backward from the node to a RegionGroup. This path can be:\n * * If the node points to a CurveLocationDetail of a (possibly partial) curve, the path is (take a deep breath)\n * * node points to CurveLocation Detail\n * * CurveLocationDetail points to curve\n * * curve points to RegionGroupMember\n * * If the node points directly to a RegionGroup, it's ready to go!!!\n * @param node\n * @param delta\n */\n private recordTransitionAcrossEdge(node: HalfEdge, delta: number): RegionGroupMember | undefined {\n const updateRegionGroupMemberState = (member: RegionGroupMember): RegionGroupMember => {\n if (member.parentGroup.groupOpType === RegionGroupOpType.NonBounding)\n return member; // no transition across a bridge edge\n if (delta !== 0) {\n const oldSweepState = member.sweepState;\n member.sweepState += delta;\n member.parentGroup.recordMemberStateChange(oldSweepState, member.sweepState);\n }\n return member;\n };\n\n const data = node.edgeTag;\n if (data instanceof RegionGroupMember)\n return updateRegionGroupMemberState(data);\n\n if (data instanceof CurveLocationDetail) {\n // We trust that the caller has linked from the graph node to a curve which has a RegionGroupMember as its parent.\n const member = data.curve!.parent;\n if (member instanceof RegionGroupMember)\n return updateRegionGroupMemberState(member);\n }\n return undefined;\n }\n // obligations to act as sweep callback ...\n /** Announce a representative node on the outer face of a component */\n public startComponent(outerFaceNode: HalfEdge): boolean {\n outerFaceNode.setMaskAroundFace(HalfEdgeMask.EXTERIOR);\n if (this._announceFaceFunction)\n this._announceFaceFunction(this.graph, outerFaceNode, -1, faceAreaFromCurvedEdgeData(outerFaceNode));\n return true;\n }\n /** Announce return to outer face */\n public finishComponent(_node: HalfEdge): boolean {\n return true;\n }\n /** Announce entry to a graph face.\n * * Both both sides of a graph edge are from the same RegionGroupMember.\n * * Hence \"crossing that edge\" changes the parity count for the RegionGroupMember that owns that edge by 1.\n * * The parity count for other RegionGroupMembers are never affected by this crossing.\n * * Crossing a bridge edge does not change the parity count.\n */\n public enterFace(_facePathStack: HalfEdge[], newFaceNode: HalfEdge): boolean {\n this.recordTransitionAcrossEdge(newFaceNode, 1);\n const state = this.getInOut();\n if (!state)\n newFaceNode.setMaskAroundFace(HalfEdgeMask.EXTERIOR);\n if (this._announceFaceFunction)\n this._announceFaceFunction(this.graph, newFaceNode, state ? 1 : 0, faceAreaFromCurvedEdgeData(newFaceNode));\n return true;\n }\n /** Announce face exit */\n public leaveFace(_facePathStack: HalfEdge[], oldFaceNode: HalfEdge): boolean {\n this.recordTransitionAcrossEdge(oldFaceNode, -1);\n return true;\n }\n}\n/** return xy area between a (part of a) curve and the x axis through a reference point.\n * If detail is undefined or does not have both start and end fractions, just do trapezoid area\n */\nfunction areaUnderPartialCurveXY(detail: CurveLocationDetail | undefined, xyStart: XAndY, xyEnd: XAndY, referencePoint: XAndY): number {\n // area between trapezoid and axis\n let trapezoidArea;\n if (detail && detail.point1) {\n trapezoidArea = -(detail.point1.x - detail.point.x) * (0.5 * (detail.point.y + detail.point1.y) - referencePoint.y);\n } else {\n trapezoidArea = -(xyEnd.x - xyStart.x) * (0.5 * (xyStart.y + xyEnd.y) - referencePoint.y);\n }\n let areaToChord = 0.0;\n if (detail && detail.curve && detail.hasFraction1) {\n\n if (detail.curve instanceof LineSegment3d) {\n // ah .. nothing to do for a line segment\n } else if (detail.curve instanceof Arc3d) {\n areaToChord = detail.curve.areaToChordXY(detail.fraction, detail.fraction1!);\n }\n }\n return trapezoidArea + areaToChord;\n}\n/** Compute face area for a face whose edges are decorated with CurveLocationDetail for their (partial) curves */\nfunction faceAreaFromCurvedEdgeData(faceSeed: HalfEdge): number {\n let area = 0.0;\n let edge = faceSeed;\n do {\n area += (edge.sortData as number) * areaUnderPartialCurveXY((edge.edgeTag as CurveLocationDetail), edge, edge.faceSuccessor, faceSeed);\n } while ((edge = edge.faceSuccessor) !== faceSeed);\n return area;\n}\n\n/**\n * Function to accumulate area under edges\n * Array of nodes representing faces in a subset of a graph.\n * @internal\n */\nexport type NodeAndRangeFunction = (edge: HalfEdge, range: Range2d) => void;\n/**\n * Array of nodes representing faces in a subset of a graph.\n * @internal\n */\nexport class GraphComponent {\n public faces: HalfEdge[];\n public faceAreas: number[];\n public range: Range2d;\n public constructor(faces: HalfEdge[]) {\n this.faces = faces;\n this.range = Range2d.createNull();\n this.faceAreas = [];\n }\n /**\n * visit all vertices and edges in the component to build face area array and composite range.\n *\n * @param extendRangeForEdge optional function to compute edge range. If undefined, linear edge is assumed.\n * @param faceAreaFunction optional function to compute face area. If undefined, linear edges are assumed.\n */\n public buildFaceData(extendRangeForEdge: NodeAndRangeFunction | undefined, faceAreaFunction: NodeToNumberFunction | undefined) {\n const vertexFunction = (node: HalfEdge) => {\n if (extendRangeForEdge)\n extendRangeForEdge(node, this.range);\n else\n this.range.extendXY(node.x, node.y);\n return 0;\n };\n this.range.setNull();\n for (const f of this.faces) {\n f.sumAroundFace(vertexFunction);\n }\n this.faceAreas.length = 0;\n if (!faceAreaFunction)\n faceAreaFunction = HalfEdgeGraphSearch.signedFaceArea;\n for (const f of this.faces) {\n this.faceAreas.push(faceAreaFunction(f));\n }\n }\n}\n/** build and hold an array of component data for a HalfEdgeGraph.\n * @internal\n */\nexport class GraphComponentArray {\n public components: GraphComponent[];\n public graph: HalfEdgeGraph;\n private constructor(graph: HalfEdgeGraph) {\n this.graph = graph;\n this.components = [];\n }\n public static create(graph: HalfEdgeGraph, extendRangeForEdge?: (edge: HalfEdge, range: Range2d) => void): GraphComponentArray {\n const result = new GraphComponentArray(graph);\n const componentArrays = HalfEdgeGraphSearch.collectConnectedComponentsWithExteriorParityMasks(graph, undefined);\n for (const componentFaces of componentArrays) {\n const component = new GraphComponent(componentFaces);\n component.buildFaceData(extendRangeForEdge, faceAreaFromCurvedEdgeData);\n result.components.push(component);\n }\n return result;\n }\n}\n"]}
|
|
@@ -1,14 +1,67 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module CartesianGeometry
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { PolygonLocation } from "../Geometry";
|
|
5
|
+
import { Point3d, Vector3d } from "./Point3dVector3d";
|
|
6
|
+
import { Ray3d } from "./Ray3d";
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
8
|
+
* Carries data about a location in the plane of a triangle.
|
|
9
|
+
* * Each instance carries both world and barycentric coordinates for the point, and provides query services on the latter.
|
|
10
|
+
* * No tolerance is used when querying barycentric coordinates (e.g., `isInsideOrOn`, `classify`). Use `snapLocalToEdge`
|
|
11
|
+
* to adjust the barycentric coordinates to a triangle edge if they lie within a parametric tolerance.
|
|
12
|
+
*
|
|
13
|
+
* Properties of the barycentric coordinates (b0, b1, b2) of a point p in the plane of a triangle T with vertices p0, p1, p2:
|
|
14
|
+
* * 1 = b0 + b1 + b2
|
|
15
|
+
* * p = b0 * p0 + b1 * p1 + b2 * p2
|
|
16
|
+
* * If T is spanned by the vectors U=p1-p0 and V=p2-p0, then the vector P=p-p0 can be written P = b1 * U + b2 * V.
|
|
17
|
+
* * The coordinates are all nonnegative if and only if p is inside or on T.
|
|
18
|
+
* * Exactly one coordinate is zero if and only if p lies on an (infinitely extended) edge of T.
|
|
19
|
+
* * Exactly two coordinates are zero if and only if p coincides with a vertex of T.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare class TriangleLocationDetail {
|
|
23
|
+
/** The Cartesian coordinates of the point p. */
|
|
24
|
+
world: Point3d;
|
|
25
|
+
/** The barycentric coordinates of p with respect to the triangle. Assumed to sum to one. */
|
|
26
|
+
local: Point3d;
|
|
27
|
+
/** Application-specific number */
|
|
28
|
+
a: number;
|
|
29
|
+
/** Index of the triangle vertex at the base of the edge closest to p. */
|
|
30
|
+
closestEdgeIndex: number;
|
|
31
|
+
/** The parameter along the closest edge of the projection of p. */
|
|
32
|
+
closestEdgeParam: number;
|
|
33
|
+
private constructor();
|
|
34
|
+
/** Invalidate this detail. */
|
|
35
|
+
invalidate(): void;
|
|
36
|
+
/** Create an invalid detail.
|
|
37
|
+
* @param result optional pre-allocated object to fill and return
|
|
38
|
+
*/
|
|
39
|
+
static create(result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
40
|
+
/** Set the instance contents from the other detail.
|
|
41
|
+
* @param other detail to clone
|
|
42
|
+
*/
|
|
43
|
+
copyContentsFrom(other: TriangleLocationDetail): void;
|
|
44
|
+
/** Whether this detail is invalid. */
|
|
45
|
+
get isValid(): boolean;
|
|
46
|
+
/** Queries the barycentric coordinates to determine whether this instance specifies a location inside or on the triangle.
|
|
47
|
+
* @see classify
|
|
48
|
+
*/
|
|
49
|
+
get isInsideOrOn(): boolean;
|
|
50
|
+
/** Queries this detail to classify the location of this instance with respect to the triangle.
|
|
51
|
+
* @returns location code
|
|
52
|
+
* @see isInsideOrOn
|
|
53
|
+
*/
|
|
54
|
+
get classify(): PolygonLocation;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 3 points defining a triangle to be evaluated with barycentric coordinates.
|
|
7
58
|
* @public
|
|
8
59
|
*/
|
|
9
60
|
export declare class BarycentricTriangle {
|
|
10
61
|
/** Array of 3 point coordinates for the triangle. */
|
|
11
62
|
points: Point3d[];
|
|
63
|
+
/** Edge length squared cache, indexed by opposite vertex index */
|
|
64
|
+
protected edgeLength2: number[];
|
|
12
65
|
/** Constructor.
|
|
13
66
|
* * Point references are CAPTURED
|
|
14
67
|
*/
|
|
@@ -26,18 +79,129 @@ export declare class BarycentricTriangle {
|
|
|
26
79
|
get aspectRatio(): number;
|
|
27
80
|
/** Return the area of the triangle. */
|
|
28
81
|
get area(): number;
|
|
82
|
+
/** Return the perimeter of the triangle */
|
|
83
|
+
get perimeter(): number;
|
|
29
84
|
/** Sum the points with given scales.
|
|
30
|
-
* *
|
|
31
|
-
* * If scales do not
|
|
85
|
+
* * If the scales sum to 1, they are barycentric coordinates, and hence the result point is in the plane of the triangle.
|
|
86
|
+
* * If the scales do not sum to 1, the point is in the triangle scaled (by the scale sum) from the origin.
|
|
87
|
+
* @param b0 scale to apply to vertex 0
|
|
88
|
+
* @param b1 scale to apply to vertex 1
|
|
89
|
+
* @param b2 scale to apply to vertex 2
|
|
90
|
+
* @param result optional pre-allocated point to fill and return
|
|
91
|
+
* @return linear combination of the vertices of this triangle
|
|
92
|
+
* @see pointToFraction
|
|
93
|
+
*/
|
|
94
|
+
fractionToPoint(b0: number, b1: number, b2: number, result?: Point3d): Point3d;
|
|
95
|
+
private static _workPoint?;
|
|
96
|
+
private static _workVector0?;
|
|
97
|
+
private static _workVector1?;
|
|
98
|
+
private static _workRay?;
|
|
99
|
+
private static _workMatrix?;
|
|
100
|
+
/** Compute the projection of the given point onto the plane of this triangle.
|
|
101
|
+
* @param point point p to project
|
|
102
|
+
* @param result optional pre-allocated object to fill and return
|
|
103
|
+
* @returns details d of the projection point P = `d.point`:
|
|
104
|
+
* * `d.isValid` returns true if and only if `this.normal()` is defined.
|
|
105
|
+
* * `d.classify` can be used to determine where P lies with respect to the triangle.
|
|
106
|
+
* * `d.a` is the signed projection distance: P = p + a * `this.normal()`.
|
|
107
|
+
* @see fractionToPoint
|
|
108
|
+
*/
|
|
109
|
+
pointToFraction(point: Point3d, result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
110
|
+
/** Convert from opposite-vertex to start-vertex edge indexing. */
|
|
111
|
+
static edgeOppositeVertexIndexToStartVertexIndex(edgeIndex: number): number;
|
|
112
|
+
/** Convert from start-vertex to opposite-vertex edge indexing. */
|
|
113
|
+
static edgeStartVertexIndexToOppositeVertexIndex(startVertexIndex: number): number;
|
|
114
|
+
/** Examine a point's barycentric coordinates to determine if it lies inside the triangle but not on an edge/vertex.
|
|
115
|
+
* * No parametric tolerance is used.
|
|
116
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
117
|
+
* @returns whether the point with barycentric coordinates is strictly inside the triangle.
|
|
118
|
+
*/
|
|
119
|
+
static isInsideTriangle(b0: number, b1: number, b2: number): boolean;
|
|
120
|
+
/** Examine a point's barycentric coordinates to determine if it lies inside the triangle or on an edge/vertex.
|
|
121
|
+
* * No parametric tolerance is used.
|
|
122
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
123
|
+
* @returns whether the point with barycentric coordinates is inside or on the triangle.
|
|
32
124
|
*/
|
|
33
|
-
|
|
125
|
+
static isInsideOrOnTriangle(b0: number, b1: number, b2: number): boolean;
|
|
126
|
+
/** Examine a point's barycentric coordinates to determine if it lies "outside" an edge of the triangle.
|
|
127
|
+
* * No parametric tolerance is used.
|
|
128
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
129
|
+
* @returns index of vertex/edge i for which b_i < 0 and b_j >= 0 and b_k >= 0, or -1
|
|
130
|
+
*/
|
|
131
|
+
private static isInRegionBeyondEdge;
|
|
132
|
+
/** Examine a point's barycentric coordinates to determine if it lies "outside" a vertex of the triangle.
|
|
133
|
+
* * No parametric tolerance is used.
|
|
134
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
135
|
+
* @returns index of vertex i for which and b_j < 0 and b_k < 0, or -1
|
|
136
|
+
*/
|
|
137
|
+
private static isInRegionBeyondVertex;
|
|
138
|
+
/** Examine a point's barycentric coordinates to determine if it lies on a vertex of the triangle.
|
|
139
|
+
* * No parametric tolerance is used.
|
|
140
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
141
|
+
* @returns index of vertex i for which b_i = 1 and b_j = b_k = 0, or -1
|
|
142
|
+
*/
|
|
143
|
+
private static isOnVertex;
|
|
144
|
+
/** Examine a point's barycentric coordinates to determine if it lies on a bounded edge of the triangle.
|
|
145
|
+
* * No parametric tolerance is used.
|
|
146
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
147
|
+
* @returns index of vertex/edge i for which b_i = 0 and b_j > 0 and b_k > 0, or -1
|
|
148
|
+
*/
|
|
149
|
+
private static isOnBoundedEdge;
|
|
150
|
+
/** @returns edge/vertex index (0,1,2) for which the function has a minimum value */
|
|
151
|
+
private static indexOfMinimum;
|
|
152
|
+
/** Return the index of the closest triangle vertex to the point given by its barycentric coordinates. */
|
|
153
|
+
closestVertexIndex(b0: number, b1: number, b2: number): number;
|
|
154
|
+
/** Compute the projection of barycentric point p onto the (unbounded) edge e_k(v_i,v_j) of the triangle T(v_i,v_j,v_k).
|
|
155
|
+
* @param k vertex v_k is opposite the edge e_k
|
|
156
|
+
* @param b barycentric coordinates of point to project
|
|
157
|
+
* @returns parameter s along e_k, such that:
|
|
158
|
+
* * the projection point is q = v_i + s * (v_j - v_i)
|
|
159
|
+
* * the barycentric coords of the projection are q_ijk = (1 - s, s, 0)
|
|
160
|
+
*/
|
|
161
|
+
private computeProjectionToEdge;
|
|
162
|
+
/** Compute the projection of a barycentric point p to the triangle T(v_0,v_1,v_2).
|
|
163
|
+
* @param b0 barycentric coordinate of p corresponding to v_0
|
|
164
|
+
* @param b1 barycentric coordinate of p corresponding to v_1
|
|
165
|
+
* @param b2 barycentric coordinate of p corresponding to v_2
|
|
166
|
+
* @returns closest edge start vertex index i and projection parameter u such that the projection q = v_i + u * (v_j - v_i).
|
|
167
|
+
*/
|
|
168
|
+
closestPoint(b0: number, b1: number, b2: number): {
|
|
169
|
+
closestEdgeIndex: number;
|
|
170
|
+
closestEdgeParam: number;
|
|
171
|
+
};
|
|
172
|
+
/** Compute the intersection of a line (parameterized as a ray) with the plane of this triangle.
|
|
173
|
+
* @param ray infinite line to intersect, as a ray
|
|
174
|
+
* @param result optional pre-allocated object to fill and return
|
|
175
|
+
* @returns details d of the line-plane intersection `d.point`:
|
|
176
|
+
* * `d.isValid` returns true if and only if the line intersects the plane.
|
|
177
|
+
* * `d.classify` can be used to determine where the intersection lies with respect to the triangle.
|
|
178
|
+
* * `d.a` is the intersection parameter. If `d.a` >= 0, the ray intersects the plane of the triangle.
|
|
179
|
+
* @see pointToFraction
|
|
180
|
+
*/
|
|
181
|
+
intersectRay3d(ray: Ray3d, result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
182
|
+
/** Compute the intersection of a line (parameterized as a line segment) with the plane of this triangle.
|
|
183
|
+
* @param point0 start point of segment on line to intersect
|
|
184
|
+
* @param point1 end point of segment on line to intersect
|
|
185
|
+
* @param result optional pre-allocated object to fill and return
|
|
186
|
+
* @returns details d of the line-plane intersection `d.point`:
|
|
187
|
+
* * `d.isValid` returns true if and only if the line intersects the plane.
|
|
188
|
+
* * `d.classify` can be used to determine where the intersection lies with respect to the triangle.
|
|
189
|
+
* * `d.a` is the intersection parameter. If `d.a` is in [0,1], the segment intersects the plane of the triangle.
|
|
190
|
+
* @see intersectRay3d
|
|
191
|
+
*/
|
|
192
|
+
intersectSegment(point0: Point3d, point1: Point3d, result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
193
|
+
/** Adjust the location to an edge of the triangle if within either given tolerance.
|
|
194
|
+
* @param location details of a point in the plane of the triangle, `location.local` and `location.world` possibly updated to lie on a triangle edge
|
|
195
|
+
* @param distanceTolerance absolute distance tolerance (or zero to ignore)
|
|
196
|
+
* @param parameterTolerance barycentric coordinate fractional tolerance (or zero to ignore)
|
|
197
|
+
* @return whether the location was adjusted
|
|
198
|
+
*/
|
|
199
|
+
snapLocationToEdge(location: TriangleLocationDetail, distanceTolerance?: number, parameterTolerance?: number): boolean;
|
|
34
200
|
/** Copy all values from `other`
|
|
35
201
|
*/
|
|
36
202
|
setFrom(other: BarycentricTriangle): void;
|
|
37
|
-
/**
|
|
203
|
+
/** Copy contents of (not pointers to) the given points. A vertex is zeroed if its corresponding input point is undefined. */
|
|
38
204
|
set(point0: Point3d | undefined, point1: Point3d | undefined, point2: Point3d | undefined): void;
|
|
39
|
-
private static _workVector0?;
|
|
40
|
-
private static _workVector1?;
|
|
41
205
|
/**
|
|
42
206
|
* * For `this` and `other` BarycentricTriangles, compute cross products of vectors from point0 to point1 and from point0 to point2.
|
|
43
207
|
* * return the dot product of those two
|
|
@@ -45,7 +209,30 @@ export declare class BarycentricTriangle {
|
|
|
45
209
|
dotProductOfCrossProductsFromOrigin(other: BarycentricTriangle): number;
|
|
46
210
|
/** Return the centroid of the 3 points. */
|
|
47
211
|
centroid(result?: Point3d): Point3d;
|
|
212
|
+
/** Return the incenter of the triangle. */
|
|
213
|
+
incenter(result?: Point3d): Point3d;
|
|
214
|
+
/** Return the circumcenter of the triangle. */
|
|
215
|
+
circumcenter(result?: Point3d): Point3d;
|
|
216
|
+
/** Return the unit normal of the triangle.
|
|
217
|
+
* @param result optional pre-allocated vector to fill and return.
|
|
218
|
+
* @returns unit normal, or undefined if cross product length is too small.
|
|
219
|
+
*/
|
|
220
|
+
normal(result?: Vector3d): Vector3d | undefined;
|
|
48
221
|
/** test for point-by-point `isAlmostEqual` relationship. */
|
|
49
222
|
isAlmostEqual(other: BarycentricTriangle): boolean;
|
|
223
|
+
/** Compute length of the triangle edge opposite the vertex with the given index.
|
|
224
|
+
* @see edgeStartVertexIndexToOppositeVertexIndex
|
|
225
|
+
*/
|
|
226
|
+
edgeLength(oppositeVertexIndex: number): number;
|
|
227
|
+
/** Compute squared length of the triangle edge opposite the vertex with the given index.
|
|
228
|
+
* @see edgeStartVertexIndexToOppositeVertexIndex
|
|
229
|
+
*/
|
|
230
|
+
edgeLengthSquared(oppositeVertexIndex: number): number;
|
|
231
|
+
/** Compute dot product of the edge vectors based at the vertex with the given index. */
|
|
232
|
+
dotProductOfEdgeVectorsAtVertex(baseVertexIndex: number): number;
|
|
233
|
+
/** Compute the squared distance between two points given by their barycentric coordinates.
|
|
234
|
+
* * It is assumed that a0 + a1 + a2 = b0 + b1 + b2 = 1.
|
|
235
|
+
*/
|
|
236
|
+
distanceSquared(a0: number, a1: number, a2: number, b0: number, b1: number, b2: number): number;
|
|
50
237
|
}
|
|
51
238
|
//# sourceMappingURL=BarycentricTriangle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarycentricTriangle.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BarycentricTriangle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"BarycentricTriangle.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BarycentricTriangle.ts"],"names":[],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