@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,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAIxD;;GAEG;AACH;;;GAGG;AACH,MAAM,OAAO,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,EAA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IAC1E,cAAc,CAAC,MAAgB;QACpC,OAAO,OAAO,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","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,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAIxD;;GAEG;AACH;;;GAGG;AACH,MAAM,OAAO,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,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C/B,IAAW,CAAC;QACV,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IACD,+BAA+B;IAC/B,IAAW,CAAC;QACV,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IACD,oFAAoF;IAC7E,eAAe,CAAC,MAAgB;QACrC,OAAO,OAAO,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,OAAO,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","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"}
|
|
@@ -5,21 +5,31 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Topology
|
|
7
7
|
*/
|
|
8
|
+
import { assert } from "@itwin/core-bentley";
|
|
8
9
|
import { Geometry } from "../Geometry";
|
|
9
10
|
import { Vector3d } from "../geometry3d/Point3dVector3d";
|
|
11
|
+
import { HalfEdgeMask } from "./Graph";
|
|
10
12
|
import { NodeXYZUV } from "./HalfEdgeNodeXYZUV";
|
|
11
13
|
import { HalfEdgePositionDetail } from "./HalfEdgePositionDetail";
|
|
12
|
-
|
|
14
|
+
// cspell:word Chebyshev
|
|
15
|
+
/**
|
|
16
|
+
* Return code from [PointSearchContext.reAimAroundFace]
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
13
19
|
export var RayClassification;
|
|
14
20
|
(function (RayClassification) {
|
|
15
|
-
RayClassification[RayClassification["
|
|
16
|
-
RayClassification[RayClassification["
|
|
17
|
-
RayClassification[RayClassification["
|
|
18
|
-
RayClassification[RayClassification["
|
|
19
|
-
RayClassification[RayClassification["
|
|
20
|
-
RayClassification[RayClassification["
|
|
21
|
+
RayClassification[RayClassification["NoHits"] = 0] = "NoHits";
|
|
22
|
+
RayClassification[RayClassification["TargetOnVertex"] = 1] = "TargetOnVertex";
|
|
23
|
+
RayClassification[RayClassification["TargetOnEdge"] = 2] = "TargetOnEdge";
|
|
24
|
+
RayClassification[RayClassification["Bracket"] = 3] = "Bracket";
|
|
25
|
+
RayClassification[RayClassification["TargetBefore"] = 4] = "TargetBefore";
|
|
26
|
+
RayClassification[RayClassification["TargetAfter"] = 5] = "TargetAfter";
|
|
21
27
|
})(RayClassification || (RayClassification = {}));
|
|
22
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Context for searching for the location of an xy-point in a graph.
|
|
30
|
+
* * Assumptions: interior faces of the graph are convex, no edge has length less than `tol`.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
23
33
|
export class PointSearchContext {
|
|
24
34
|
constructor(tol) {
|
|
25
35
|
this._tol = tol;
|
|
@@ -28,10 +38,26 @@ export class PointSearchContext {
|
|
|
28
38
|
return new PointSearchContext(tol);
|
|
29
39
|
}
|
|
30
40
|
panic() {
|
|
41
|
+
// A note on "unexpectedly" found in comments in this file:
|
|
42
|
+
// Though this class assumes all edges of the graph have length at least tolerance, the tests below account for
|
|
43
|
+
// edges with smaller length. This is because we are using two different metrics: Euclidean for distinguishing
|
|
44
|
+
// points matching user expectation, and Chebyshev, aka "max component", for efficiently testing ray-sector
|
|
45
|
+
// inclusion in the reAimXXX methods. In particular, epsilon-balls in the former metric are smaller than in the
|
|
46
|
+
// latter. Thus an edge can be inserted into the graph with Euclidean length (barely) greater than epsilon, but
|
|
47
|
+
// the edge's parallel and perpendicular components with respect to a ray can have Euclidean length *less* than
|
|
48
|
+
// epsilon, yielding a Chebyshev edge length less than epsilon. This discrepancy requires careful analysis below,
|
|
49
|
+
// and if this method is invoked, it is probably because we've missed a case where a dot/cross product lies just
|
|
50
|
+
// beyond the tolerance.
|
|
31
51
|
return HalfEdgePositionDetail.create();
|
|
32
52
|
}
|
|
33
|
-
|
|
34
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Reposition `edgeHit` to an adjacent face or vertex, or another position on the edge, that is closer to the
|
|
55
|
+
* target point.
|
|
56
|
+
* @param edgeHit start position on a graph edge, updated and returned.
|
|
57
|
+
* @param ray the ray to the target point. Origin is assumed to lie on the edge.
|
|
58
|
+
* @param targetDistance distance along the ray to the target point.
|
|
59
|
+
* @return detail closer to the target point.
|
|
60
|
+
*/
|
|
35
61
|
reAimFromEdge(edgeHit, ray, targetDistance) {
|
|
36
62
|
const nodeA = edgeHit.node;
|
|
37
63
|
const dataA = NodeXYZUV.createNodeAndRayOrigin(nodeA, ray);
|
|
@@ -39,8 +65,7 @@ export class PointSearchContext {
|
|
|
39
65
|
const sideA = -dataA.classifyV(0.0, this._tol);
|
|
40
66
|
const sideB = -dataB.classifyV(0.0, this._tol);
|
|
41
67
|
let result;
|
|
42
|
-
if (sideA * sideB < 0) {
|
|
43
|
-
// Simple crossing -- just aim into a face
|
|
68
|
+
if (sideA * sideB < 0) { // simple crossing; just aim into a face
|
|
44
69
|
if (sideA > 0) {
|
|
45
70
|
result = edgeHit.resetAsFace(dataA.node);
|
|
46
71
|
}
|
|
@@ -49,126 +74,150 @@ export class PointSearchContext {
|
|
|
49
74
|
}
|
|
50
75
|
}
|
|
51
76
|
else if (sideA === 0 || sideB === 0) {
|
|
52
|
-
// The usual case is both 0 i.e. ray is clearly along the edge.
|
|
53
77
|
const alongA = dataA.classifyU(targetDistance, this._tol);
|
|
54
78
|
const alongB = dataB.classifyU(targetDistance, this._tol);
|
|
55
|
-
if (
|
|
79
|
+
if (sideA === 0 && alongA === 0) { // hit start vertex
|
|
56
80
|
result = edgeHit.resetAsVertex(dataA.node);
|
|
57
81
|
result.setITag(1);
|
|
58
82
|
}
|
|
59
|
-
else if (
|
|
83
|
+
else if (sideB === 0 && alongB === 0) { // hit end vertex
|
|
60
84
|
result = edgeHit.resetAsVertex(dataB.node);
|
|
61
85
|
result.setITag(1);
|
|
62
86
|
}
|
|
63
|
-
else if (
|
|
64
|
-
// target is within edge
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
result = edgeHit.resetAtEdgeAndFraction(dataA.node, edgeFraction);
|
|
69
|
-
result.setITag(1);
|
|
70
|
-
}
|
|
71
|
-
else if (alongA < 0 && alongB < 0) {
|
|
72
|
-
// target is beyond the edge -- move towards it.
|
|
73
|
-
if (dataA.u > dataB.u)
|
|
74
|
-
result = edgeHit.resetAsVertex(dataA.node);
|
|
75
|
-
else
|
|
76
|
-
result = edgeHit.resetAsVertex(dataB.node);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
// This shouldn't happen -- maybe as if the initial edge point was not within the edge???
|
|
80
|
-
if (Math.abs(dataA.u) < this._tol
|
|
81
|
-
&& Math.abs(dataA.v) < this._tol) {
|
|
82
|
-
result = edgeHit.resetAsVertex(dataA.node); // , dataA);
|
|
87
|
+
else if (sideA === 0 && sideB === 0) { // ray is clearly along the edge
|
|
88
|
+
if (alongA * alongB < 0) { // target is within edge
|
|
89
|
+
const edgeFraction = (targetDistance - dataA.u) / (dataB.u - dataA.u);
|
|
90
|
+
result = edgeHit.resetAtEdgeAndFraction(dataA.node, edgeFraction);
|
|
91
|
+
result.setITag(1);
|
|
83
92
|
}
|
|
84
|
-
else if (
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
else if (alongA < 0 && alongB < 0) { // target is beyond the edge; move towards it
|
|
94
|
+
if (dataA.u > dataB.u)
|
|
95
|
+
result = edgeHit.resetAsVertex(dataA.node);
|
|
96
|
+
else
|
|
97
|
+
result = edgeHit.resetAsVertex(dataB.node);
|
|
87
98
|
}
|
|
88
|
-
else {
|
|
99
|
+
else { // both vertices lie on the ray before or after the target; shouldn't happen for edgeHit between nodes
|
|
89
100
|
edgeHit.resetAsUnknown();
|
|
90
101
|
result = this.panic();
|
|
91
102
|
}
|
|
92
103
|
}
|
|
104
|
+
else if (sideA === 0) { // ray near start vertex but NOT parallel to the edge
|
|
105
|
+
if (0 === dataA.classifyU(0.0, this._tol))
|
|
106
|
+
result = edgeHit.resetAsVertex(dataA.node);
|
|
107
|
+
else
|
|
108
|
+
result = edgeHit.resetAsFace(sideB > 0 ? dataB.node : dataA.node);
|
|
109
|
+
}
|
|
110
|
+
else { // ray near end vertex but NOT parallel to the edge
|
|
111
|
+
assert(sideB === 0);
|
|
112
|
+
if (0 === dataB.classifyU(0.0, this._tol))
|
|
113
|
+
result = edgeHit.resetAsVertex(dataB.node);
|
|
114
|
+
else
|
|
115
|
+
result = edgeHit.resetAsFace(sideA > 0 ? dataA.node : dataB.node);
|
|
116
|
+
}
|
|
93
117
|
}
|
|
94
|
-
else {
|
|
95
|
-
// Both vertices are to same side of the line. This can't happen for edge point between nodes.
|
|
118
|
+
else { // both vertices are to same side of the ray; shouldn't happen for edgeHit between nodes
|
|
96
119
|
edgeHit.resetAsUnknown();
|
|
97
120
|
result = this.panic();
|
|
98
121
|
}
|
|
99
122
|
return result;
|
|
100
123
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Reposition `vertexHit` to an adjacent face, edge, or vertex hit that is closer to the target point.
|
|
126
|
+
* @param vertexHit start position at a graph vertex, updated and returned.
|
|
127
|
+
* @param ray the ray to the target point, assumed to start exactly at the vertex.
|
|
128
|
+
* @param targetDistance distance along the ray to the target point.
|
|
129
|
+
* @return detail closer to the target point.
|
|
130
|
+
*/
|
|
131
|
+
reAimFromVertex(vertexHit, ray, targetDistance) {
|
|
132
|
+
assert(ray.origin.isExactEqual(vertexHit));
|
|
133
|
+
const vertexNode = vertexHit.node;
|
|
106
134
|
let outboundEdge = vertexNode;
|
|
135
|
+
// lambda to handle the case where the target definitively lies in the same direction as outboundEdge
|
|
136
|
+
const advancePositionAlongOutboundEdge = (rayParam) => {
|
|
137
|
+
if (Math.abs(rayParam - targetDistance) <= this._tol) { // direct hit at far end of outBoundEdge
|
|
138
|
+
vertexHit.resetAsVertex(outboundEdge.faceSuccessor).setITag(1);
|
|
139
|
+
}
|
|
140
|
+
else if (rayParam > targetDistance) { // direct hit within outBoundEdge
|
|
141
|
+
vertexHit.resetAtEdgeAndFraction(outboundEdge, targetDistance / rayParam);
|
|
142
|
+
}
|
|
143
|
+
else if (rayParam > this._tol) { // far end of outBoundEdge is closer to target
|
|
144
|
+
vertexHit.resetAsVertex(outboundEdge.faceSuccessor);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
return true;
|
|
150
|
+
};
|
|
107
151
|
do {
|
|
108
|
-
//
|
|
109
|
-
// vu_getDPoint3d(& xyzBase, outboundEdge);
|
|
152
|
+
// examine the sector at the outboundEdge node; if ray lies in this sector, return updated detail
|
|
110
153
|
const data0 = NodeXYZUV.createNodeAndRayOrigin(outboundEdge.faceSuccessor, ray);
|
|
111
154
|
const data1 = NodeXYZUV.createNodeAndRayOrigin(outboundEdge.facePredecessor, ray);
|
|
155
|
+
// u0 is the length of projection of faceSuccessor to the ray and v0 is the length of projection of
|
|
156
|
+
// faceSuccessor to the ray perp line (90 degrees CCW). Similarly for u1 and v1 with facePredecessor.
|
|
112
157
|
const u0 = data0.u;
|
|
113
|
-
|
|
158
|
+
const u1 = data1.u;
|
|
114
159
|
const v0 = data0.v;
|
|
115
160
|
const v1 = data1.v;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
else if (u0 > targetDistance) {
|
|
124
|
-
// Direct hig within edge
|
|
125
|
-
const edgeFraction = targetDistance / u0;
|
|
126
|
-
result = searchBase.resetAtEdgeAndFraction(outboundEdge, edgeFraction);
|
|
127
|
-
return result;
|
|
128
|
-
}
|
|
129
|
-
else if (Math.abs(u0) <= this._tol) {
|
|
130
|
-
// Unexpected direct hit on the base of the search, but call it a hit....
|
|
131
|
-
result = searchBase.resetAsVertex(outboundEdge);
|
|
132
|
-
result.setITag(1);
|
|
133
|
-
return result;
|
|
134
|
-
}
|
|
135
|
-
else if (u0 > this._tol) {
|
|
136
|
-
// Advance to vertex ...
|
|
137
|
-
// double edgeFraction = targetDistance / u0;
|
|
138
|
-
result = searchBase.resetAsVertex(data0.node);
|
|
139
|
-
return result;
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
// Search direction is exactly opposite this edge.
|
|
143
|
-
// See if the other side of the sector is turned even beyond that ...
|
|
144
|
-
if (v1 > this._tol) {
|
|
145
|
-
result = searchBase.resetAsFace(outboundEdge, outboundEdge);
|
|
146
|
-
return result;
|
|
147
|
-
}
|
|
161
|
+
// examine dot and cross of ray with both edges defining this sector to see if ray lies between them
|
|
162
|
+
if (Math.abs(v0) <= this._tol) { // ray parallel to outBoundEdge
|
|
163
|
+
if (advancePositionAlongOutboundEdge(u0))
|
|
164
|
+
return vertexHit;
|
|
165
|
+
if (Math.abs(u0) <= this._tol) { // edge is unexpectedly* small
|
|
166
|
+
if (v0 <= 0 && v1 > this._tol && (u0 >= 0 || (u0 < 0 && u1 > this._tol)))
|
|
167
|
+
return vertexHit.resetAsFace(outboundEdge, outboundEdge);
|
|
148
168
|
}
|
|
169
|
+
// The only remaining case is u0 < -this._tol: ray points opposite outBoundEdge.
|
|
170
|
+
// By our convexity assumption, the only way that ray lies in this sector is if the lookBack
|
|
171
|
+
// vector points in the same direction as ray, but this would be handled in the next sector.
|
|
149
172
|
}
|
|
150
173
|
else if (v0 < -this._tol) {
|
|
151
|
-
if (v1 > this._tol)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
174
|
+
if (v1 > this._tol) // ray definitely lies in this sector
|
|
175
|
+
return vertexHit.resetAsFace(outboundEdge, outboundEdge);
|
|
176
|
+
if (v1 >= -this._tol) { // ray and lookBack vector are parallel
|
|
177
|
+
// handle special cases not handled in the next sector
|
|
178
|
+
if (Math.abs(u1) <= this._tol) { // lookBack vector is unexpectedly* small...
|
|
179
|
+
if (v1 > 0 && (u1 >= 0 || (u0 > this._tol && u1 < 0))) // ...and ray is in this sector
|
|
180
|
+
return vertexHit.resetAsFace(outboundEdge, outboundEdge);
|
|
181
|
+
}
|
|
182
|
+
else if (u0 > this._tol && u1 < 0) { // ray and lookBack point in opposite directions
|
|
183
|
+
return vertexHit.resetAsVertex(outboundEdge.faceSuccessor); // far end is closer to target
|
|
184
|
+
}
|
|
155
185
|
}
|
|
186
|
+
// The only remaining case is v1 < -this._tol: ray definitely lies outside this sector.
|
|
156
187
|
}
|
|
157
|
-
//
|
|
188
|
+
// Proceed to the next sector around this vertex. We even examine the (concave) exterior sector at a boundary
|
|
189
|
+
// vertex in order to handle the case where the target lies in the direction of an exterior outboundEdge.
|
|
158
190
|
outboundEdge = outboundEdge.vertexSuccessor;
|
|
159
191
|
} while (outboundEdge !== vertexNode);
|
|
160
192
|
return this.panic();
|
|
161
193
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
194
|
+
/**
|
|
195
|
+
* Visit all edges around the face, updating `lastBefore` and `firstAfter` to ray-edge intersections that
|
|
196
|
+
* lie directly before and/or after the target point on the ray, if at all.
|
|
197
|
+
* @param faceNode starting node on a graph face.
|
|
198
|
+
* @param ray the ray to the target point.
|
|
199
|
+
* @param targetDistance distance along the ray to the target point.
|
|
200
|
+
* @param lastBefore the detail to reset as the last hit on the ray before the target point (CALLER CREATED).
|
|
201
|
+
* @param firstAfter the detail to reset as the first hit on the ray after the target point (CALLER CREATED).
|
|
202
|
+
* @returns summary of the updated details:
|
|
203
|
+
* * [[RayClassification.TargetOnVertex]] - target lies at a vertex of the face (details are identical).
|
|
204
|
+
* * [[RayClassification.TargetOnEdge]] - target lies on an edge of the face (details are identical).
|
|
205
|
+
* * [[RayClassification.TargetBefore]] - target lies before the face; the ray intersects the face beyond
|
|
206
|
+
* the target point.
|
|
207
|
+
* * [[RayClassification.TargetAfter]] - target lies after the face; the ray intersects the face before
|
|
208
|
+
* the target point.
|
|
209
|
+
* * [[RayClassification.Bracket]] - target lies between intersections of the ray and the face; if the face
|
|
210
|
+
* is convex, this means the target lies inside the face.
|
|
211
|
+
* * [[RayClassification.NoHits]] - the face does not intersect the ray.
|
|
212
|
+
*/
|
|
213
|
+
reAimAroundFace(faceNode, ray, targetDistance, lastBefore, firstAfter) {
|
|
214
|
+
assert(!faceNode.isMaskSet(HalfEdgeMask.EXTERIOR));
|
|
167
215
|
lastBefore.resetAsUndefinedWithTag(-Number.MAX_VALUE);
|
|
168
216
|
firstAfter.resetAsUndefinedWithTag(Number.MAX_VALUE);
|
|
169
217
|
const data0 = NodeXYZUV.createNodeAndRayOrigin(faceNode, ray);
|
|
170
218
|
let data1;
|
|
171
219
|
let node0 = faceNode;
|
|
220
|
+
// find the intersection of the ray with each edge of the face to classify the ray hit
|
|
172
221
|
do {
|
|
173
222
|
const node1 = node0.faceSuccessor;
|
|
174
223
|
data1 = NodeXYZUV.createNodeAndRayOrigin(node1, ray, data1);
|
|
@@ -176,78 +225,70 @@ export class PointSearchContext {
|
|
|
176
225
|
const u1 = data1.u;
|
|
177
226
|
const v0 = data0.v;
|
|
178
227
|
const v1 = data1.v;
|
|
179
|
-
if (Math.abs(v1) < this._tol) {
|
|
180
|
-
// Vertex hit ...
|
|
228
|
+
if (Math.abs(v1) < this._tol) { // ray parallel to edge
|
|
181
229
|
const vertexHit = HalfEdgePositionDetail.createVertex(node1);
|
|
182
230
|
vertexHit.setDTag(u1);
|
|
183
231
|
if (Math.abs(u1 - targetDistance) < this._tol) {
|
|
184
232
|
firstAfter.setFrom(vertexHit);
|
|
185
233
|
lastBefore.setFrom(vertexHit);
|
|
186
|
-
return RayClassification.
|
|
234
|
+
return RayClassification.TargetOnVertex;
|
|
187
235
|
}
|
|
188
236
|
if (u1 > targetDistance && u1 < firstAfter.getDTag())
|
|
189
237
|
firstAfter.setFrom(vertexHit);
|
|
190
238
|
if (u1 < targetDistance && u1 > lastBefore.getDTag())
|
|
191
239
|
lastBefore.setFrom(vertexHit);
|
|
192
240
|
}
|
|
193
|
-
else if (v0 * v1 < 0.0) {
|
|
194
|
-
// Edge Crossing ...
|
|
241
|
+
else if (v0 * v1 < 0.0) { // ray crosses edge
|
|
195
242
|
const edgeFraction = -v0 / (v1 - v0);
|
|
196
|
-
const
|
|
243
|
+
const rayFraction = Geometry.interpolate(u0, edgeFraction, u1);
|
|
197
244
|
const edgeHit = HalfEdgePositionDetail.createEdgeAtFraction(data0.node, edgeFraction);
|
|
198
|
-
edgeHit.setDTag(
|
|
199
|
-
if (Math.abs(
|
|
245
|
+
edgeHit.setDTag(rayFraction);
|
|
246
|
+
if (Math.abs(rayFraction - targetDistance) <= this._tol) {
|
|
200
247
|
firstAfter.setFrom(edgeHit);
|
|
201
248
|
lastBefore.setFrom(edgeHit);
|
|
202
|
-
return RayClassification.
|
|
249
|
+
return RayClassification.TargetOnEdge;
|
|
203
250
|
}
|
|
204
|
-
if (
|
|
251
|
+
if (rayFraction > targetDistance && rayFraction < firstAfter.getDTag())
|
|
205
252
|
firstAfter.setFrom(edgeHit);
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
if (uEdge < targetDistance && uEdge > lastBefore.getDTag()) {
|
|
253
|
+
if (rayFraction < targetDistance && rayFraction > lastBefore.getDTag())
|
|
209
254
|
lastBefore.setFrom(edgeHit);
|
|
210
|
-
lastBefore.setDTag(uEdge);
|
|
211
|
-
}
|
|
212
255
|
}
|
|
213
256
|
data0.setFrom(data1);
|
|
214
257
|
node0 = node0.faceSuccessor;
|
|
215
258
|
} while (node0 !== faceNode);
|
|
216
|
-
//
|
|
217
|
-
const afterTag = firstAfter.getITag();
|
|
259
|
+
// returned to start node
|
|
218
260
|
firstAfter.setITag(0);
|
|
219
261
|
lastBefore.setITag(0);
|
|
220
262
|
if (lastBefore.isUnclassified) {
|
|
221
263
|
if (firstAfter.isUnclassified)
|
|
222
|
-
return RayClassification.
|
|
223
|
-
return RayClassification.
|
|
224
|
-
}
|
|
225
|
-
if (firstAfter.isUnclassified
|
|
226
|
-
|| (firstAfter.isEdge && afterTag && afterTag < 0)) {
|
|
227
|
-
return RayClassification.RC_TargetAfter;
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
return RayClassification.RC_Bracket;
|
|
264
|
+
return RayClassification.NoHits;
|
|
265
|
+
return RayClassification.TargetBefore;
|
|
231
266
|
}
|
|
267
|
+
if (firstAfter.isUnclassified)
|
|
268
|
+
return RayClassification.TargetAfter;
|
|
269
|
+
else
|
|
270
|
+
return RayClassification.Bracket; // face is locally convex; target lies inside this face
|
|
232
271
|
}
|
|
233
|
-
// Return false if target is reached !!!!
|
|
234
272
|
/**
|
|
235
|
-
*
|
|
236
|
-
* * `origin` at start
|
|
237
|
-
* * `direction` is unit vector from start towards target
|
|
238
|
-
* * `a` is distance from start to target
|
|
273
|
+
* Initialize the input ray for topology search:
|
|
274
|
+
* * `origin` is at `start`
|
|
275
|
+
* * `direction` is the unit xy-vector from `start` towards `target`
|
|
276
|
+
* * `a` is the xy-distance from `start` to `target`
|
|
239
277
|
* @param start existing position
|
|
240
278
|
* @param target target xy coordinates
|
|
241
|
-
* @param ray
|
|
279
|
+
* @param ray updated in place
|
|
280
|
+
* @returns false if target is reached.
|
|
242
281
|
*/
|
|
243
282
|
setSearchRay(start, target, ray) {
|
|
244
283
|
ray.origin.setFromPoint3d(start);
|
|
245
284
|
Vector3d.createStartEnd(ray.origin, target, ray.direction);
|
|
246
285
|
ray.direction.z = 0.0;
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
286
|
+
const distanceToTargetXY = ray.direction.magnitudeXY();
|
|
287
|
+
if (distanceToTargetXY < this._tol)
|
|
288
|
+
return false; // no searching necessary, we are already at the target point
|
|
289
|
+
ray.a = distanceToTargetXY;
|
|
290
|
+
ray.direction.scaleInPlace(1 / distanceToTargetXY);
|
|
291
|
+
return true;
|
|
251
292
|
}
|
|
252
293
|
}
|
|
253
294
|
//# sourceMappingURL=HalfEdgePointInGraphSearch.js.map
|