@itwin/core-geometry 4.9.0-dev.12 → 4.9.0-dev.14
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 +6 -1
- package/lib/cjs/Geometry.d.ts +57 -46
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +73 -53
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +128 -34
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +174 -20
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +2 -1
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +2 -1
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +19 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +39 -0
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/LineString3d.js +1 -1
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.d.ts +1 -1
- package/lib/cjs/curve/OffsetOptions.js +1 -1
- package/lib/cjs/curve/OffsetOptions.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 +2 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +23 -7
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +43 -35
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts +211 -0
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +1000 -0
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -0
- package/lib/cjs/geometry3d/Angle.d.ts +18 -5
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +23 -7
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +14 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +47 -12
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +6 -4
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +6 -4
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +2 -3
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +2 -3
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +6 -5
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +11 -10
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +6 -1
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +9 -3
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +1 -1
- package/lib/cjs/geometry3d/Transform.js +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts +3 -3
- package/lib/cjs/numerics/Newton.d.ts.map +1 -1
- package/lib/cjs/numerics/Newton.js +14 -16
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +2 -2
- package/lib/cjs/numerics/Polynomials.js +2 -2
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +7 -4
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +8 -4
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +3 -3
- package/lib/cjs/polyface/PolyfaceQuery.js +3 -3
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +2 -2
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +1 -1
- package/lib/cjs/topology/Graph.js +2 -2
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.d.ts +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts +57 -15
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +168 -127
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.d.ts +35 -35
- package/lib/cjs/topology/HalfEdgePositionDetail.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js +63 -41
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts +64 -12
- package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js +174 -75
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +16 -10
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +23 -30
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +57 -46
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +73 -53
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +128 -34
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +172 -19
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +2 -1
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +2 -1
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +19 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +39 -0
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/LineString3d.js +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.d.ts +1 -1
- package/lib/esm/curve/OffsetOptions.js +1 -1
- package/lib/esm/curve/OffsetOptions.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 +2 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +23 -7
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +43 -35
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts +211 -0
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +995 -0
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -0
- package/lib/esm/geometry3d/Angle.d.ts +18 -5
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +23 -7
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +14 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +47 -12
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +6 -4
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +6 -4
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +2 -3
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +2 -3
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +6 -5
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +11 -10
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +6 -1
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +9 -3
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +1 -1
- package/lib/esm/geometry3d/Transform.js +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts +3 -3
- package/lib/esm/numerics/Newton.d.ts.map +1 -1
- package/lib/esm/numerics/Newton.js +14 -16
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +2 -2
- package/lib/esm/numerics/Polynomials.js +2 -2
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +7 -4
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +8 -4
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +3 -3
- package/lib/esm/polyface/PolyfaceQuery.js +3 -3
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +2 -2
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +1 -1
- package/lib/esm/topology/Graph.js +2 -2
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.d.ts +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts +57 -15
- package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js +168 -127
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.d.ts +35 -35
- package/lib/esm/topology/HalfEdgePositionDetail.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js +63 -41
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.d.ts +64 -12
- package/lib/esm/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js +173 -74
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +16 -10
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +24 -31
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HalfEdgeNodeXYZUV.js","sourceRoot":"","sources":["../../../src/topology/HalfEdgeNodeXYZUV.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,0CAAuC;AACvC,mEAAwD;AACxD,mEAAwD;AAIxD;;GAEG;AACH;;;GAGG;AACH,MAAa,SAAS;IAOpB,kBAAkB;IAClB,YAAoB,IAAc,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QACvF,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IACD;;;OAGG;IACI,GAAG,CAAC,IAAc,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QAC9E,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,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AAE,MAAM,CAAC,CAAC;IAClD,CAAC;IACD,sDAAsD;IAC/C,SAAS,CAAC,MAAc,EAAE,GAAW;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;QAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;YACxB,OAAO,CAAC,CAAC;QACX,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD,sDAAsD;IAC/C,SAAS,CAAC,MAAc,EAAE,GAAW;QAC1C,MAAM,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;YACxB,OAAO,CAAC,CAAC;QACX,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF;AA9GD,8BA8GC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { HalfEdge } from \"./Graph\";\r\n\r\n/** @packageDocumentation\r\n * @module Topology\r\n */\r\n/**\r\n * Reference to a HalfEdge node with extra XYZ and UV data.\r\n * @internal\r\n */\r\nexport class NodeXYZUV {\r\n private _node: HalfEdge;\r\n private _x: number;\r\n private _y: number;\r\n private _z: number;\r\n private _u: number;\r\n private _v: number;\r\n /** Constructor */\r\n private constructor(node: HalfEdge, x: number, y: number, z: number, u: number, v: number) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._u = u;\r\n this._v = v;\r\n this._node = node;\r\n }\r\n /**\r\n * Set all content directly from args.\r\n * @returns `this` reference\r\n */\r\n public set(node: HalfEdge, x: number, y: number, z: number, u: number, v: number): NodeXYZUV {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._u = u;\r\n this._v = v;\r\n this._node = node;\r\n return this;\r\n }\r\n /** Set from `other` */\r\n public setFrom(other: NodeXYZUV): void {\r\n this._x = other.x;\r\n this._y = other.y;\r\n this._z = other.z;\r\n this._u = other.u;\r\n this._v = other.v;\r\n this._node = other.node;\r\n }\r\n /**\r\n * Create a `NodeXYZUV` with:\r\n * * node from the given HalfEdge.\r\n * * x,y,z as the coordinates of `node`.\r\n * * u as the xy dot product of vectorA with `ray.direction`, where vectorA is the vector from ray origin to\r\n * `node` coordinates.\r\n * * v as the xy cross product of `ray.direction` with vectorA.\r\n */\r\n public static createNodeAndRayOrigin(node: HalfEdge, ray: Ray3d, result?: NodeXYZUV): NodeXYZUV {\r\n const x = node.x;\r\n const y = node.y;\r\n const z = node.z;\r\n const dx = x - ray.origin.x;\r\n const dy = y - ray.origin.y;\r\n const u = Geometry.dotProductXYXY(dx, dy, ray.direction.x, ray.direction.y);\r\n const v = Geometry.crossProductXYXY(ray.direction.x, ray.direction.y, dx, dy);\r\n if (result)\r\n return result.set(node, x, y, z, u, v);\r\n return new NodeXYZUV(node, x, y, z, u, v);\r\n }\r\n /** Create a `NodeXYZUV` with explicit `node`, xyz, uv. */\r\n public static create(\r\n node: HalfEdge, x: number = 0, y: number = 0, z: number = 0, u: number = 0, v: number = 0,\r\n ): NodeXYZUV {\r\n return new NodeXYZUV(node, x, y, z, u, v);\r\n }\r\n /** Access the node. */\r\n public get node(): HalfEdge {\r\n return this._node;\r\n }\r\n /** Access the x coordinate. */\r\n public get x(): number {\r\n return this._x;\r\n }\r\n /** Access the y coordinate. */\r\n public get y(): number {\r\n return this._y;\r\n }\r\n /** Access the z coordinate. */\r\n public get z(): number {\r\n return this._z;\r\n }\r\n /** Access the u coordinate. */\r\n public get u(): number {\r\n return this._u;\r\n }\r\n /** Access the v coordinate. */\r\n public get v(): number {\r\n return this._v;\r\n }\r\n /** Access the x,y,z coordinates as Point3d with optional caller-supplied result. */\r\n public getXYZAsPoint3d(result?: Point3d): Point3d {\r\n return Point3d.create(this._x, this._y, this._z, result);\r\n }\r\n /** Access the uv coordinates as Point2d with optional caller-supplied result. */\r\n public getUVAsPoint2d(result?: Point2d): Point2d {\r\n return Point2d.create(this._u, this._v, result);\r\n }\r\n /** Toleranced comparison function for u coordinate */\r\n public classifyU(target: number, tol: number): number {\r\n const delta = this.u - target;\r\n if (Math.abs(delta) <= tol)\r\n return 0;\r\n return delta >= 0 ? 1 : -1;\r\n }\r\n /** Toleranced comparison function for v coordinate */\r\n public classifyV(target: number, tol: number): number {\r\n const delta = target - this._v;\r\n if (Math.abs(delta) <= tol)\r\n return 0;\r\n return delta >= 0 ? 1 : -1;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"HalfEdgeNodeXYZUV.js","sourceRoot":"","sources":["../../../src/topology/HalfEdgeNodeXYZUV.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,0CAAuC;AACvC,mEAAwD;AACxD,mEAAwD;AAIxD;;GAEG;AACH;;;GAGG;AACH,MAAa,SAAS;IAOpB,kBAAkB;IAClB,YAAoB,IAAc,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QACvF,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IACD;;;OAGG;IACI,GAAG,CA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AO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,iFAAiF;IAC1E,cAAc,CAAC,MAAgB;QACpC,OAAO,yBAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IACD,sDAAsD;IAC/C,SAAS,CAAC,MAAc,EAAE,GAAW;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;QAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;YACxB,OAAO,CAAC,CAAC;QACX,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD,sDAAsD;IAC/C,SAAS,CAAC,MAAc,EAAE,GAAW;QAC1C,MAAM,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;YACxB,OAAO,CAAC,CAAC;QACX,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF;AA9GD,8BA8GC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { HalfEdge } from \"./Graph\";\r\n\r\n/** @packageDocumentation\r\n * @module Topology\r\n */\r\n/**\r\n * Reference to a HalfEdge node with extra XYZ and UV data.\r\n * @internal\r\n */\r\nexport class NodeXYZUV {\r\n private _node: HalfEdge;\r\n private _x: number;\r\n private _y: number;\r\n private _z: number;\r\n private _u: number;\r\n private _v: number;\r\n /** Constructor */\r\n private constructor(node: HalfEdge, x: number, y: number, z: number, u: number, v: number) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._u = u;\r\n this._v = v;\r\n this._node = node;\r\n }\r\n /**\r\n * Set all content directly from args.\r\n * @returns `this` reference\r\n */\r\n public set(node: HalfEdge, x: number, y: number, z: number, u: number, v: number): NodeXYZUV {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._u = u;\r\n this._v = v;\r\n this._node = node;\r\n return this;\r\n }\r\n /** Set from `other` */\r\n public setFrom(other: NodeXYZUV): void {\r\n this._x = other.x;\r\n this._y = other.y;\r\n this._z = other.z;\r\n this._u = other.u;\r\n this._v = other.v;\r\n this._node = other.node;\r\n }\r\n /**\r\n * Create a `NodeXYZUV` with:\r\n * * node from the given HalfEdge.\r\n * * x,y,z as the coordinates of `node`.\r\n * * u as the xy dot product of vectorA with `ray.direction`, where vectorA is the vector from ray origin to\r\n * `node` coordinates (z is ignored).\r\n * * v as the xy cross product of `ray.direction` with vectorA.\r\n */\r\n public static createNodeAndRayOrigin(node: HalfEdge, ray: Ray3d, result?: NodeXYZUV): NodeXYZUV {\r\n const x = node.x;\r\n const y = node.y;\r\n const z = node.z;\r\n const dx = x - ray.origin.x;\r\n const dy = y - ray.origin.y;\r\n const u = Geometry.dotProductXYXY(dx, dy, ray.direction.x, ray.direction.y);\r\n const v = Geometry.crossProductXYXY(ray.direction.x, ray.direction.y, dx, dy);\r\n if (result)\r\n return result.set(node, x, y, z, u, v);\r\n return new NodeXYZUV(node, x, y, z, u, v);\r\n }\r\n /** Create a `NodeXYZUV` with explicit `node`, xyz, uv. */\r\n public static create(\r\n node: HalfEdge, x: number = 0, y: number = 0, z: number = 0, u: number = 0, v: number = 0,\r\n ): NodeXYZUV {\r\n return new NodeXYZUV(node, x, y, z, u, v);\r\n }\r\n /** Access the node. */\r\n public get node(): HalfEdge {\r\n return this._node;\r\n }\r\n /** Access the x coordinate. */\r\n public get x(): number {\r\n return this._x;\r\n }\r\n /** Access the y coordinate. */\r\n public get y(): number {\r\n return this._y;\r\n }\r\n /** Access the z coordinate. */\r\n public get z(): number {\r\n return this._z;\r\n }\r\n /** Access the u coordinate. */\r\n public get u(): number {\r\n return this._u;\r\n }\r\n /** Access the v coordinate. */\r\n public get v(): number {\r\n return this._v;\r\n }\r\n /** Access the x,y,z coordinates as Point3d with optional caller-supplied result. */\r\n public getXYZAsPoint3d(result?: Point3d): Point3d {\r\n return Point3d.create(this._x, this._y, this._z, result);\r\n }\r\n /** Access the uv coordinates as Point2d with optional caller-supplied result. */\r\n public getUVAsPoint2d(result?: Point2d): Point2d {\r\n return Point2d.create(this._u, this._v, result);\r\n }\r\n /** Toleranced comparison function for u coordinate */\r\n public classifyU(target: number, tol: number): number {\r\n const delta = this.u - target;\r\n if (Math.abs(delta) <= tol)\r\n return 0;\r\n return delta >= 0 ? 1 : -1;\r\n }\r\n /** Toleranced comparison function for v coordinate */\r\n public classifyV(target: number, tol: number): number {\r\n const delta = target - this._v;\r\n if (Math.abs(delta) <= tol)\r\n return 0;\r\n return delta >= 0 ? 1 : -1;\r\n }\r\n}\r\n"]}
|
|
@@ -2,32 +2,74 @@ import { Point3d } from "../geometry3d/Point3dVector3d";
|
|
|
2
2
|
import { Ray3d } from "../geometry3d/Ray3d";
|
|
3
3
|
import { HalfEdge } from "./Graph";
|
|
4
4
|
import { HalfEdgePositionDetail } from "./HalfEdgePositionDetail";
|
|
5
|
+
/**
|
|
6
|
+
* Return code from [PointSearchContext.reAimAroundFace]
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
5
9
|
export declare enum RayClassification {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
NoHits = 0,
|
|
11
|
+
TargetOnVertex = 1,
|
|
12
|
+
TargetOnEdge = 2,
|
|
13
|
+
Bracket = 3,
|
|
14
|
+
TargetBefore = 4,
|
|
15
|
+
TargetAfter = 5
|
|
12
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Context for searching for the location of an xy-point in a graph.
|
|
19
|
+
* * Assumptions: interior faces of the graph are convex, no edge has length less than `tol`.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
13
22
|
export declare class PointSearchContext {
|
|
14
23
|
private _tol;
|
|
15
24
|
private constructor();
|
|
16
25
|
static create(tol?: number): PointSearchContext;
|
|
17
26
|
private panic;
|
|
27
|
+
/**
|
|
28
|
+
* Reposition `edgeHit` to an adjacent face or vertex, or another position on the edge, that is closer to the
|
|
29
|
+
* target point.
|
|
30
|
+
* @param edgeHit start position on a graph edge, updated and returned.
|
|
31
|
+
* @param ray the ray to the target point. Origin is assumed to lie on the edge.
|
|
32
|
+
* @param targetDistance distance along the ray to the target point.
|
|
33
|
+
* @return detail closer to the target point.
|
|
34
|
+
*/
|
|
18
35
|
reAimFromEdge(edgeHit: HalfEdgePositionDetail, ray: Ray3d, targetDistance: number): HalfEdgePositionDetail;
|
|
19
|
-
reAimFromVertex(searchBase: HalfEdgePositionDetail, ray: Ray3d, targetDistance: number): HalfEdgePositionDetail;
|
|
20
|
-
reAimAroundFace(faceNode: HalfEdge, ray: Ray3d, targetDistance: number, // !< distance to target point
|
|
21
|
-
lastBefore: HalfEdgePositionDetail, // CALLER CREATED -- reset as first hit on negative side of ray.
|
|
22
|
-
firstAfter: HalfEdgePositionDetail): RayClassification;
|
|
23
36
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
37
|
+
* Reposition `vertexHit` to an adjacent face, edge, or vertex hit that is closer to the target point.
|
|
38
|
+
* @param vertexHit start position at a graph vertex, updated and returned.
|
|
39
|
+
* @param ray the ray to the target point, assumed to start exactly at the vertex.
|
|
40
|
+
* @param targetDistance distance along the ray to the target point.
|
|
41
|
+
* @return detail closer to the target point.
|
|
42
|
+
*/
|
|
43
|
+
reAimFromVertex(vertexHit: HalfEdgePositionDetail, ray: Ray3d, targetDistance: number): HalfEdgePositionDetail;
|
|
44
|
+
/**
|
|
45
|
+
* Visit all edges around the face, updating `lastBefore` and `firstAfter` to ray-edge intersections that
|
|
46
|
+
* lie directly before and/or after the target point on the ray, if at all.
|
|
47
|
+
* @param faceNode starting node on a graph face.
|
|
48
|
+
* @param ray the ray to the target point.
|
|
49
|
+
* @param targetDistance distance along the ray to the target point.
|
|
50
|
+
* @param lastBefore the detail to reset as the last hit on the ray before the target point (CALLER CREATED).
|
|
51
|
+
* @param firstAfter the detail to reset as the first hit on the ray after the target point (CALLER CREATED).
|
|
52
|
+
* @returns summary of the updated details:
|
|
53
|
+
* * [[RayClassification.TargetOnVertex]] - target lies at a vertex of the face (details are identical).
|
|
54
|
+
* * [[RayClassification.TargetOnEdge]] - target lies on an edge of the face (details are identical).
|
|
55
|
+
* * [[RayClassification.TargetBefore]] - target lies before the face; the ray intersects the face beyond
|
|
56
|
+
* the target point.
|
|
57
|
+
* * [[RayClassification.TargetAfter]] - target lies after the face; the ray intersects the face before
|
|
58
|
+
* the target point.
|
|
59
|
+
* * [[RayClassification.Bracket]] - target lies between intersections of the ray and the face; if the face
|
|
60
|
+
* is convex, this means the target lies inside the face.
|
|
61
|
+
* * [[RayClassification.NoHits]] - the face does not intersect the ray.
|
|
62
|
+
*/
|
|
63
|
+
reAimAroundFace(faceNode: HalfEdge, ray: Ray3d, targetDistance: number, lastBefore: HalfEdgePositionDetail, firstAfter: HalfEdgePositionDetail): RayClassification;
|
|
64
|
+
/**
|
|
65
|
+
* Initialize the input ray for topology search:
|
|
66
|
+
* * `origin` is at `start`
|
|
67
|
+
* * `direction` is the unit xy-vector from `start` towards `target`
|
|
68
|
+
* * `a` is the xy-distance from `start` to `target`
|
|
28
69
|
* @param start existing position
|
|
29
70
|
* @param target target xy coordinates
|
|
30
|
-
* @param ray
|
|
71
|
+
* @param ray updated in place
|
|
72
|
+
* @returns false if target is reached.
|
|
31
73
|
*/
|
|
32
74
|
setSearchRay(start: HalfEdgePositionDetail, target: Point3d, ray: Ray3d): boolean;
|
|
33
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HalfEdgePointInGraphSearch.d.ts","sourceRoot":"","sources":["../../../src/topology/HalfEdgePointInGraphSearch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HalfEdgePointInGraphSearch.d.ts","sourceRoot":"","sources":["../../../src/topology/HalfEdgePointInGraphSearch.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAgB,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAIlE;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,IAAA;IACN,cAAc,IAAA;IACd,YAAY,IAAA;IACZ,OAAO,IAAA;IACP,YAAY,IAAA;IACZ,WAAW,IAAA;CACZ;AAED;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO;WAGO,MAAM,CAAC,GAAG,GAAE,MAAqC;IAG/D,OAAO,CAAC,KAAK;IAab;;;;;;;OAOG;IACI,aAAa,CAClB,OAAO,EAAE,sBAAsB,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,GAClE,sBAAsB;IAsDzB;;;;;;OAMG;IACI,eAAe,CACpB,SAAS,EAAE,sBAAsB,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,GACpE,sBAAsB;IA0DzB;;;;;;;;;;;;;;;;;;OAkBG;IACI,eAAe,CACpB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,KAAK,EACV,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,sBAAsB,EAClC,UAAU,EAAE,sBAAsB,GACjC,iBAAiB;IA0DpB;;;;;;;;;OASG;IACI,YAAY,CAAC,KAAK,EAAE,sBAAsB,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO;CAWzF"}
|
|
@@ -8,21 +8,31 @@ exports.PointSearchContext = exports.RayClassification = void 0;
|
|
|
8
8
|
/** @packageDocumentation
|
|
9
9
|
* @module Topology
|
|
10
10
|
*/
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
11
12
|
const Geometry_1 = require("../Geometry");
|
|
12
13
|
const Point3dVector3d_1 = require("../geometry3d/Point3dVector3d");
|
|
14
|
+
const Graph_1 = require("./Graph");
|
|
13
15
|
const HalfEdgeNodeXYZUV_1 = require("./HalfEdgeNodeXYZUV");
|
|
14
16
|
const HalfEdgePositionDetail_1 = require("./HalfEdgePositionDetail");
|
|
15
|
-
|
|
17
|
+
// cspell:word Chebyshev
|
|
18
|
+
/**
|
|
19
|
+
* Return code from [PointSearchContext.reAimAroundFace]
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
16
22
|
var RayClassification;
|
|
17
23
|
(function (RayClassification) {
|
|
18
|
-
RayClassification[RayClassification["
|
|
19
|
-
RayClassification[RayClassification["
|
|
20
|
-
RayClassification[RayClassification["
|
|
21
|
-
RayClassification[RayClassification["
|
|
22
|
-
RayClassification[RayClassification["
|
|
23
|
-
RayClassification[RayClassification["
|
|
24
|
+
RayClassification[RayClassification["NoHits"] = 0] = "NoHits";
|
|
25
|
+
RayClassification[RayClassification["TargetOnVertex"] = 1] = "TargetOnVertex";
|
|
26
|
+
RayClassification[RayClassification["TargetOnEdge"] = 2] = "TargetOnEdge";
|
|
27
|
+
RayClassification[RayClassification["Bracket"] = 3] = "Bracket";
|
|
28
|
+
RayClassification[RayClassification["TargetBefore"] = 4] = "TargetBefore";
|
|
29
|
+
RayClassification[RayClassification["TargetAfter"] = 5] = "TargetAfter";
|
|
24
30
|
})(RayClassification || (exports.RayClassification = RayClassification = {}));
|
|
25
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Context for searching for the location of an xy-point in a graph.
|
|
33
|
+
* * Assumptions: interior faces of the graph are convex, no edge has length less than `tol`.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
26
36
|
class PointSearchContext {
|
|
27
37
|
constructor(tol) {
|
|
28
38
|
this._tol = tol;
|
|
@@ -31,10 +41,26 @@ class PointSearchContext {
|
|
|
31
41
|
return new PointSearchContext(tol);
|
|
32
42
|
}
|
|
33
43
|
panic() {
|
|
44
|
+
// A note on "unexpectedly" found in comments in this file:
|
|
45
|
+
// Though this class assumes all edges of the graph have length at least tolerance, the tests below account for
|
|
46
|
+
// edges with smaller length. This is because we are using two different metrics: Euclidean for distinguishing
|
|
47
|
+
// points matching user expectation, and Chebyshev, aka "max component", for efficiently testing ray-sector
|
|
48
|
+
// inclusion in the reAimXXX methods. In particular, epsilon-balls in the former metric are smaller than in the
|
|
49
|
+
// latter. Thus an edge can be inserted into the graph with Euclidean length (barely) greater than epsilon, but
|
|
50
|
+
// the edge's parallel and perpendicular components with respect to a ray can have Euclidean length *less* than
|
|
51
|
+
// epsilon, yielding a Chebyshev edge length less than epsilon. This discrepancy requires careful analysis below,
|
|
52
|
+
// and if this method is invoked, it is probably because we've missed a case where a dot/cross product lies just
|
|
53
|
+
// beyond the tolerance.
|
|
34
54
|
return HalfEdgePositionDetail_1.HalfEdgePositionDetail.create();
|
|
35
55
|
}
|
|
36
|
-
|
|
37
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Reposition `edgeHit` to an adjacent face or vertex, or another position on the edge, that is closer to the
|
|
58
|
+
* target point.
|
|
59
|
+
* @param edgeHit start position on a graph edge, updated and returned.
|
|
60
|
+
* @param ray the ray to the target point. Origin is assumed to lie on the edge.
|
|
61
|
+
* @param targetDistance distance along the ray to the target point.
|
|
62
|
+
* @return detail closer to the target point.
|
|
63
|
+
*/
|
|
38
64
|
reAimFromEdge(edgeHit, ray, targetDistance) {
|
|
39
65
|
const nodeA = edgeHit.node;
|
|
40
66
|
const dataA = HalfEdgeNodeXYZUV_1.NodeXYZUV.createNodeAndRayOrigin(nodeA, ray);
|
|
@@ -42,8 +68,7 @@ class PointSearchContext {
|
|
|
42
68
|
const sideA = -dataA.classifyV(0.0, this._tol);
|
|
43
69
|
const sideB = -dataB.classifyV(0.0, this._tol);
|
|
44
70
|
let result;
|
|
45
|
-
if (sideA * sideB < 0) {
|
|
46
|
-
// Simple crossing -- just aim into a face
|
|
71
|
+
if (sideA * sideB < 0) { // simple crossing; just aim into a face
|
|
47
72
|
if (sideA > 0) {
|
|
48
73
|
result = edgeHit.resetAsFace(dataA.node);
|
|
49
74
|
}
|
|
@@ -52,126 +77,150 @@ class PointSearchContext {
|
|
|
52
77
|
}
|
|
53
78
|
}
|
|
54
79
|
else if (sideA === 0 || sideB === 0) {
|
|
55
|
-
// The usual case is both 0 i.e. ray is clearly along the edge.
|
|
56
80
|
const alongA = dataA.classifyU(targetDistance, this._tol);
|
|
57
81
|
const alongB = dataB.classifyU(targetDistance, this._tol);
|
|
58
|
-
if (
|
|
82
|
+
if (sideA === 0 && alongA === 0) { // hit start vertex
|
|
59
83
|
result = edgeHit.resetAsVertex(dataA.node);
|
|
60
84
|
result.setITag(1);
|
|
61
85
|
}
|
|
62
|
-
else if (
|
|
86
|
+
else if (sideB === 0 && alongB === 0) { // hit end vertex
|
|
63
87
|
result = edgeHit.resetAsVertex(dataB.node);
|
|
64
88
|
result.setITag(1);
|
|
65
89
|
}
|
|
66
|
-
else if (
|
|
67
|
-
// target is within edge
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
result = edgeHit.resetAtEdgeAndFraction(dataA.node, edgeFraction);
|
|
72
|
-
result.setITag(1);
|
|
73
|
-
}
|
|
74
|
-
else if (alongA < 0 && alongB < 0) {
|
|
75
|
-
// target is beyond the edge -- move towards it.
|
|
76
|
-
if (dataA.u > dataB.u)
|
|
77
|
-
result = edgeHit.resetAsVertex(dataA.node);
|
|
78
|
-
else
|
|
79
|
-
result = edgeHit.resetAsVertex(dataB.node);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
// This shouldn't happen -- maybe as if the initial edge point was not within the edge???
|
|
83
|
-
if (Math.abs(dataA.u) < this._tol
|
|
84
|
-
&& Math.abs(dataA.v) < this._tol) {
|
|
85
|
-
result = edgeHit.resetAsVertex(dataA.node); // , dataA);
|
|
90
|
+
else if (sideA === 0 && sideB === 0) { // ray is clearly along the edge
|
|
91
|
+
if (alongA * alongB < 0) { // target is within edge
|
|
92
|
+
const edgeFraction = (targetDistance - dataA.u) / (dataB.u - dataA.u);
|
|
93
|
+
result = edgeHit.resetAtEdgeAndFraction(dataA.node, edgeFraction);
|
|
94
|
+
result.setITag(1);
|
|
86
95
|
}
|
|
87
|
-
else if (
|
|
88
|
-
|
|
89
|
-
|
|
96
|
+
else if (alongA < 0 && alongB < 0) { // target is beyond the edge; move towards it
|
|
97
|
+
if (dataA.u > dataB.u)
|
|
98
|
+
result = edgeHit.resetAsVertex(dataA.node);
|
|
99
|
+
else
|
|
100
|
+
result = edgeHit.resetAsVertex(dataB.node);
|
|
90
101
|
}
|
|
91
|
-
else {
|
|
102
|
+
else { // both vertices lie on the ray before or after the target; shouldn't happen for edgeHit between nodes
|
|
92
103
|
edgeHit.resetAsUnknown();
|
|
93
104
|
result = this.panic();
|
|
94
105
|
}
|
|
95
106
|
}
|
|
107
|
+
else if (sideA === 0) { // ray near start vertex but NOT parallel to the edge
|
|
108
|
+
if (0 === dataA.classifyU(0.0, this._tol))
|
|
109
|
+
result = edgeHit.resetAsVertex(dataA.node);
|
|
110
|
+
else
|
|
111
|
+
result = edgeHit.resetAsFace(sideB > 0 ? dataB.node : dataA.node);
|
|
112
|
+
}
|
|
113
|
+
else { // ray near end vertex but NOT parallel to the edge
|
|
114
|
+
(0, core_bentley_1.assert)(sideB === 0);
|
|
115
|
+
if (0 === dataB.classifyU(0.0, this._tol))
|
|
116
|
+
result = edgeHit.resetAsVertex(dataB.node);
|
|
117
|
+
else
|
|
118
|
+
result = edgeHit.resetAsFace(sideA > 0 ? dataA.node : dataB.node);
|
|
119
|
+
}
|
|
96
120
|
}
|
|
97
|
-
else {
|
|
98
|
-
// Both vertices are to same side of the line. This can't happen for edge point between nodes.
|
|
121
|
+
else { // both vertices are to same side of the ray; shouldn't happen for edgeHit between nodes
|
|
99
122
|
edgeHit.resetAsUnknown();
|
|
100
123
|
result = this.panic();
|
|
101
124
|
}
|
|
102
125
|
return result;
|
|
103
126
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Reposition `vertexHit` to an adjacent face, edge, or vertex hit that is closer to the target point.
|
|
129
|
+
* @param vertexHit start position at a graph vertex, updated and returned.
|
|
130
|
+
* @param ray the ray to the target point, assumed to start exactly at the vertex.
|
|
131
|
+
* @param targetDistance distance along the ray to the target point.
|
|
132
|
+
* @return detail closer to the target point.
|
|
133
|
+
*/
|
|
134
|
+
reAimFromVertex(vertexHit, ray, targetDistance) {
|
|
135
|
+
(0, core_bentley_1.assert)(ray.origin.isExactEqual(vertexHit));
|
|
136
|
+
const vertexNode = vertexHit.node;
|
|
109
137
|
let outboundEdge = vertexNode;
|
|
138
|
+
// lambda to handle the case where the target definitively lies in the same direction as outboundEdge
|
|
139
|
+
const advancePositionAlongOutboundEdge = (rayParam) => {
|
|
140
|
+
if (Math.abs(rayParam - targetDistance) <= this._tol) { // direct hit at far end of outBoundEdge
|
|
141
|
+
vertexHit.resetAsVertex(outboundEdge.faceSuccessor).setITag(1);
|
|
142
|
+
}
|
|
143
|
+
else if (rayParam > targetDistance) { // direct hit within outBoundEdge
|
|
144
|
+
vertexHit.resetAtEdgeAndFraction(outboundEdge, targetDistance / rayParam);
|
|
145
|
+
}
|
|
146
|
+
else if (rayParam > this._tol) { // far end of outBoundEdge is closer to target
|
|
147
|
+
vertexHit.resetAsVertex(outboundEdge.faceSuccessor);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
return true;
|
|
153
|
+
};
|
|
110
154
|
do {
|
|
111
|
-
//
|
|
112
|
-
// vu_getDPoint3d(& xyzBase, outboundEdge);
|
|
155
|
+
// examine the sector at the outboundEdge node; if ray lies in this sector, return updated detail
|
|
113
156
|
const data0 = HalfEdgeNodeXYZUV_1.NodeXYZUV.createNodeAndRayOrigin(outboundEdge.faceSuccessor, ray);
|
|
114
157
|
const data1 = HalfEdgeNodeXYZUV_1.NodeXYZUV.createNodeAndRayOrigin(outboundEdge.facePredecessor, ray);
|
|
158
|
+
// u0 is the length of projection of faceSuccessor to the ray and v0 is the length of projection of
|
|
159
|
+
// faceSuccessor to the ray perp line (90 degrees CCW). Similarly for u1 and v1 with facePredecessor.
|
|
115
160
|
const u0 = data0.u;
|
|
116
|
-
|
|
161
|
+
const u1 = data1.u;
|
|
117
162
|
const v0 = data0.v;
|
|
118
163
|
const v1 = data1.v;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
else if (u0 > targetDistance) {
|
|
127
|
-
// Direct hig within edge
|
|
128
|
-
const edgeFraction = targetDistance / u0;
|
|
129
|
-
result = searchBase.resetAtEdgeAndFraction(outboundEdge, edgeFraction);
|
|
130
|
-
return result;
|
|
131
|
-
}
|
|
132
|
-
else if (Math.abs(u0) <= this._tol) {
|
|
133
|
-
// Unexpected direct hit on the base of the search, but call it a hit....
|
|
134
|
-
result = searchBase.resetAsVertex(outboundEdge);
|
|
135
|
-
result.setITag(1);
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
|
-
else if (u0 > this._tol) {
|
|
139
|
-
// Advance to vertex ...
|
|
140
|
-
// double edgeFraction = targetDistance / u0;
|
|
141
|
-
result = searchBase.resetAsVertex(data0.node);
|
|
142
|
-
return result;
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
// Search direction is exactly opposite this edge.
|
|
146
|
-
// See if the other side of the sector is turned even beyond that ...
|
|
147
|
-
if (v1 > this._tol) {
|
|
148
|
-
result = searchBase.resetAsFace(outboundEdge, outboundEdge);
|
|
149
|
-
return result;
|
|
150
|
-
}
|
|
164
|
+
// examine dot and cross of ray with both edges defining this sector to see if ray lies between them
|
|
165
|
+
if (Math.abs(v0) <= this._tol) { // ray parallel to outBoundEdge
|
|
166
|
+
if (advancePositionAlongOutboundEdge(u0))
|
|
167
|
+
return vertexHit;
|
|
168
|
+
if (Math.abs(u0) <= this._tol) { // edge is unexpectedly* small
|
|
169
|
+
if (v0 <= 0 && v1 > this._tol && (u0 >= 0 || (u0 < 0 && u1 > this._tol)))
|
|
170
|
+
return vertexHit.resetAsFace(outboundEdge, outboundEdge);
|
|
151
171
|
}
|
|
172
|
+
// The only remaining case is u0 < -this._tol: ray points opposite outBoundEdge.
|
|
173
|
+
// By our convexity assumption, the only way that ray lies in this sector is if the lookBack
|
|
174
|
+
// vector points in the same direction as ray, but this would be handled in the next sector.
|
|
152
175
|
}
|
|
153
176
|
else if (v0 < -this._tol) {
|
|
154
|
-
if (v1 > this._tol)
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
177
|
+
if (v1 > this._tol) // ray definitely lies in this sector
|
|
178
|
+
return vertexHit.resetAsFace(outboundEdge, outboundEdge);
|
|
179
|
+
if (v1 >= -this._tol) { // ray and lookBack vector are parallel
|
|
180
|
+
// handle special cases not handled in the next sector
|
|
181
|
+
if (Math.abs(u1) <= this._tol) { // lookBack vector is unexpectedly* small...
|
|
182
|
+
if (v1 > 0 && (u1 >= 0 || (u0 > this._tol && u1 < 0))) // ...and ray is in this sector
|
|
183
|
+
return vertexHit.resetAsFace(outboundEdge, outboundEdge);
|
|
184
|
+
}
|
|
185
|
+
else if (u0 > this._tol && u1 < 0) { // ray and lookBack point in opposite directions
|
|
186
|
+
return vertexHit.resetAsVertex(outboundEdge.faceSuccessor); // far end is closer to target
|
|
187
|
+
}
|
|
158
188
|
}
|
|
189
|
+
// The only remaining case is v1 < -this._tol: ray definitely lies outside this sector.
|
|
159
190
|
}
|
|
160
|
-
//
|
|
191
|
+
// Proceed to the next sector around this vertex. We even examine the (concave) exterior sector at a boundary
|
|
192
|
+
// vertex in order to handle the case where the target lies in the direction of an exterior outboundEdge.
|
|
161
193
|
outboundEdge = outboundEdge.vertexSuccessor;
|
|
162
194
|
} while (outboundEdge !== vertexNode);
|
|
163
195
|
return this.panic();
|
|
164
196
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Visit all edges around the face, updating `lastBefore` and `firstAfter` to ray-edge intersections that
|
|
199
|
+
* lie directly before and/or after the target point on the ray, if at all.
|
|
200
|
+
* @param faceNode starting node on a graph face.
|
|
201
|
+
* @param ray the ray to the target point.
|
|
202
|
+
* @param targetDistance distance along the ray to the target point.
|
|
203
|
+
* @param lastBefore the detail to reset as the last hit on the ray before the target point (CALLER CREATED).
|
|
204
|
+
* @param firstAfter the detail to reset as the first hit on the ray after the target point (CALLER CREATED).
|
|
205
|
+
* @returns summary of the updated details:
|
|
206
|
+
* * [[RayClassification.TargetOnVertex]] - target lies at a vertex of the face (details are identical).
|
|
207
|
+
* * [[RayClassification.TargetOnEdge]] - target lies on an edge of the face (details are identical).
|
|
208
|
+
* * [[RayClassification.TargetBefore]] - target lies before the face; the ray intersects the face beyond
|
|
209
|
+
* the target point.
|
|
210
|
+
* * [[RayClassification.TargetAfter]] - target lies after the face; the ray intersects the face before
|
|
211
|
+
* the target point.
|
|
212
|
+
* * [[RayClassification.Bracket]] - target lies between intersections of the ray and the face; if the face
|
|
213
|
+
* is convex, this means the target lies inside the face.
|
|
214
|
+
* * [[RayClassification.NoHits]] - the face does not intersect the ray.
|
|
215
|
+
*/
|
|
216
|
+
reAimAroundFace(faceNode, ray, targetDistance, lastBefore, firstAfter) {
|
|
217
|
+
(0, core_bentley_1.assert)(!faceNode.isMaskSet(Graph_1.HalfEdgeMask.EXTERIOR));
|
|
170
218
|
lastBefore.resetAsUndefinedWithTag(-Number.MAX_VALUE);
|
|
171
219
|
firstAfter.resetAsUndefinedWithTag(Number.MAX_VALUE);
|
|
172
220
|
const data0 = HalfEdgeNodeXYZUV_1.NodeXYZUV.createNodeAndRayOrigin(faceNode, ray);
|
|
173
221
|
let data1;
|
|
174
222
|
let node0 = faceNode;
|
|
223
|
+
// find the intersection of the ray with each edge of the face to classify the ray hit
|
|
175
224
|
do {
|
|
176
225
|
const node1 = node0.faceSuccessor;
|
|
177
226
|
data1 = HalfEdgeNodeXYZUV_1.NodeXYZUV.createNodeAndRayOrigin(node1, ray, data1);
|
|
@@ -179,78 +228,70 @@ class PointSearchContext {
|
|
|
179
228
|
const u1 = data1.u;
|
|
180
229
|
const v0 = data0.v;
|
|
181
230
|
const v1 = data1.v;
|
|
182
|
-
if (Math.abs(v1) < this._tol) {
|
|
183
|
-
// Vertex hit ...
|
|
231
|
+
if (Math.abs(v1) < this._tol) { // ray parallel to edge
|
|
184
232
|
const vertexHit = HalfEdgePositionDetail_1.HalfEdgePositionDetail.createVertex(node1);
|
|
185
233
|
vertexHit.setDTag(u1);
|
|
186
234
|
if (Math.abs(u1 - targetDistance) < this._tol) {
|
|
187
235
|
firstAfter.setFrom(vertexHit);
|
|
188
236
|
lastBefore.setFrom(vertexHit);
|
|
189
|
-
return RayClassification.
|
|
237
|
+
return RayClassification.TargetOnVertex;
|
|
190
238
|
}
|
|
191
239
|
if (u1 > targetDistance && u1 < firstAfter.getDTag())
|
|
192
240
|
firstAfter.setFrom(vertexHit);
|
|
193
241
|
if (u1 < targetDistance && u1 > lastBefore.getDTag())
|
|
194
242
|
lastBefore.setFrom(vertexHit);
|
|
195
243
|
}
|
|
196
|
-
else if (v0 * v1 < 0.0) {
|
|
197
|
-
// Edge Crossing ...
|
|
244
|
+
else if (v0 * v1 < 0.0) { // ray crosses edge
|
|
198
245
|
const edgeFraction = -v0 / (v1 - v0);
|
|
199
|
-
const
|
|
246
|
+
const rayFraction = Geometry_1.Geometry.interpolate(u0, edgeFraction, u1);
|
|
200
247
|
const edgeHit = HalfEdgePositionDetail_1.HalfEdgePositionDetail.createEdgeAtFraction(data0.node, edgeFraction);
|
|
201
|
-
edgeHit.setDTag(
|
|
202
|
-
if (Math.abs(
|
|
248
|
+
edgeHit.setDTag(rayFraction);
|
|
249
|
+
if (Math.abs(rayFraction - targetDistance) <= this._tol) {
|
|
203
250
|
firstAfter.setFrom(edgeHit);
|
|
204
251
|
lastBefore.setFrom(edgeHit);
|
|
205
|
-
return RayClassification.
|
|
252
|
+
return RayClassification.TargetOnEdge;
|
|
206
253
|
}
|
|
207
|
-
if (
|
|
254
|
+
if (rayFraction > targetDistance && rayFraction < firstAfter.getDTag())
|
|
208
255
|
firstAfter.setFrom(edgeHit);
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
if (uEdge < targetDistance && uEdge > lastBefore.getDTag()) {
|
|
256
|
+
if (rayFraction < targetDistance && rayFraction > lastBefore.getDTag())
|
|
212
257
|
lastBefore.setFrom(edgeHit);
|
|
213
|
-
lastBefore.setDTag(uEdge);
|
|
214
|
-
}
|
|
215
258
|
}
|
|
216
259
|
data0.setFrom(data1);
|
|
217
260
|
node0 = node0.faceSuccessor;
|
|
218
261
|
} while (node0 !== faceNode);
|
|
219
|
-
//
|
|
220
|
-
const afterTag = firstAfter.getITag();
|
|
262
|
+
// returned to start node
|
|
221
263
|
firstAfter.setITag(0);
|
|
222
264
|
lastBefore.setITag(0);
|
|
223
265
|
if (lastBefore.isUnclassified) {
|
|
224
266
|
if (firstAfter.isUnclassified)
|
|
225
|
-
return RayClassification.
|
|
226
|
-
return RayClassification.
|
|
227
|
-
}
|
|
228
|
-
if (firstAfter.isUnclassified
|
|
229
|
-
|| (firstAfter.isEdge && afterTag && afterTag < 0)) {
|
|
230
|
-
return RayClassification.RC_TargetAfter;
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
return RayClassification.RC_Bracket;
|
|
267
|
+
return RayClassification.NoHits;
|
|
268
|
+
return RayClassification.TargetBefore;
|
|
234
269
|
}
|
|
270
|
+
if (firstAfter.isUnclassified)
|
|
271
|
+
return RayClassification.TargetAfter;
|
|
272
|
+
else
|
|
273
|
+
return RayClassification.Bracket; // face is locally convex; target lies inside this face
|
|
235
274
|
}
|
|
236
|
-
// Return false if target is reached !!!!
|
|
237
275
|
/**
|
|
238
|
-
*
|
|
239
|
-
* * `origin` at start
|
|
240
|
-
* * `direction` is unit vector from start towards target
|
|
241
|
-
* * `a` is distance from start to target
|
|
276
|
+
* Initialize the input ray for topology search:
|
|
277
|
+
* * `origin` is at `start`
|
|
278
|
+
* * `direction` is the unit xy-vector from `start` towards `target`
|
|
279
|
+
* * `a` is the xy-distance from `start` to `target`
|
|
242
280
|
* @param start existing position
|
|
243
281
|
* @param target target xy coordinates
|
|
244
|
-
* @param ray
|
|
282
|
+
* @param ray updated in place
|
|
283
|
+
* @returns false if target is reached.
|
|
245
284
|
*/
|
|
246
285
|
setSearchRay(start, target, ray) {
|
|
247
286
|
ray.origin.setFromPoint3d(start);
|
|
248
287
|
Point3dVector3d_1.Vector3d.createStartEnd(ray.origin, target, ray.direction);
|
|
249
288
|
ray.direction.z = 0.0;
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
289
|
+
const distanceToTargetXY = ray.direction.magnitudeXY();
|
|
290
|
+
if (distanceToTargetXY < this._tol)
|
|
291
|
+
return false; // no searching necessary, we are already at the target point
|
|
292
|
+
ray.a = distanceToTargetXY;
|
|
293
|
+
ray.direction.scaleInPlace(1 / distanceToTargetXY);
|
|
294
|
+
return true;
|
|
254
295
|
}
|
|
255
296
|
}
|
|
256
297
|
exports.PointSearchContext = PointSearchContext;
|