@itwin/core-geometry 4.4.0-dev.8 → 4.5.0-dev.0
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 +17 -0
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +14 -0
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +3 -2
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +3 -2
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +2 -2
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +3 -3
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.d.ts +7 -6
- package/lib/cjs/curve/CurveExtendMode.d.ts.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js +7 -6
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +23 -18
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +14 -4
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +107 -2
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +41 -8
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +53 -15
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.js +1 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +2 -2
- package/lib/cjs/curve/Query/PlanarSubdivision.js +2 -2
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +1 -2
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +5 -8
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +12 -12
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +2 -2
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +2 -3
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +18 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +13 -0
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +1 -2
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.d.ts +1 -1
- package/lib/cjs/geometry3d/PointStreaming.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js +3 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +68 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +152 -4
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +23 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +73 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +1 -1
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts +7 -5
- package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js +8 -6
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +13 -1
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +13 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.d.ts +28 -5
- package/lib/cjs/polyface/FacetLocationDetail.d.ts.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js +50 -15
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +1 -1
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +7 -3
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +23 -0
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.d.ts +52 -0
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -0
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js +78 -0
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -0
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.d.ts +60 -0
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.d.ts.map +1 -0
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js +96 -0
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -0
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +57 -0
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -0
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js +73 -0
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -0
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +57 -0
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -0
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js +84 -0
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +274 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +505 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +204 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +383 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -0
- package/lib/cjs/serialization/GeometrySamples.d.ts +36 -3
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +93 -4
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +1 -1
- package/lib/cjs/solid/LinearSweep.js +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +2 -2
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +5 -6
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +7 -6
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +4 -4
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +5 -5
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +108 -71
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +223 -109
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +1 -1
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.d.ts +13 -13
- package/lib/cjs/topology/SignedDataSummary.d.ts.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js +3 -3
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +1 -12
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.d.ts +27 -21
- package/lib/cjs/topology/XYParitySearchContext.d.ts.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js +73 -71
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Geometry.d.ts +17 -0
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +14 -0
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +3 -2
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +3 -2
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +2 -2
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +3 -3
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.d.ts +7 -6
- package/lib/esm/curve/CurveExtendMode.d.ts.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js +7 -6
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +23 -18
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +14 -4
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +108 -3
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +41 -8
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +53 -15
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.js +1 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts +2 -2
- package/lib/esm/curve/Query/PlanarSubdivision.js +2 -2
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +1 -2
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +1 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +5 -8
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +12 -12
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +2 -2
- package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +2 -3
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +18 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +13 -0
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +1 -2
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.d.ts +1 -1
- package/lib/esm/geometry3d/PointStreaming.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js +3 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +68 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +150 -3
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +23 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +73 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +1 -1
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Transform.js +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.d.ts +7 -5
- package/lib/esm/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js +8 -6
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +13 -1
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +13 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.d.ts +28 -5
- package/lib/esm/polyface/FacetLocationDetail.d.ts.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js +48 -14
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +1 -1
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +7 -3
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +23 -0
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.d.ts +52 -0
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -0
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js +74 -0
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -0
- package/lib/esm/polyface/RangeTree/MinimumValueTester.d.ts +60 -0
- package/lib/esm/polyface/RangeTree/MinimumValueTester.d.ts.map +1 -0
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js +92 -0
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -0
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +57 -0
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -0
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js +69 -0
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -0
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +57 -0
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -0
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js +80 -0
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -0
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +274 -0
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -0
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +497 -0
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -0
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +204 -0
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -0
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +374 -0
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -0
- package/lib/esm/serialization/GeometrySamples.d.ts +36 -3
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +93 -4
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +1 -1
- package/lib/esm/solid/LinearSweep.js +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +2 -2
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +5 -6
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +7 -6
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +4 -4
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +5 -5
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +108 -71
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +223 -109
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +1 -1
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.d.ts +13 -13
- package/lib/esm/topology/SignedDataSummary.d.ts.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js +3 -3
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +1 -12
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.d.ts +27 -21
- package/lib/esm/topology/XYParitySearchContext.d.ts.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js +73 -71
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -39,6 +39,29 @@ export declare class PolygonLocationDetail {
|
|
|
39
39
|
get isValid(): boolean;
|
|
40
40
|
/** Whether this instance specifies a location inside or on the polygon. */
|
|
41
41
|
get isInsideOrOn(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Set point, index, and fraction for an "at vertex" or "along edge" PolygonLocationDetail.
|
|
44
|
+
* * Point is not captured; its coordinates are copied.
|
|
45
|
+
*/
|
|
46
|
+
static createAtVertexOrEdge(point: Point3d, index: number, fraction?: number): PolygonLocationDetail;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A pair of PolygonLocationDetail.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export declare class PolygonLocationDetailPair {
|
|
53
|
+
/** The first of the two details. */
|
|
54
|
+
detailA: PolygonLocationDetail;
|
|
55
|
+
/** The second of the two details. */
|
|
56
|
+
detailB: PolygonLocationDetail;
|
|
57
|
+
/** Constructor, captures inputs */
|
|
58
|
+
private constructor();
|
|
59
|
+
/** Create an instance by capturing inputs */
|
|
60
|
+
static create(detailA: PolygonLocationDetail, detailB: PolygonLocationDetail, result?: PolygonLocationDetailPair): PolygonLocationDetailPair;
|
|
61
|
+
/** Make a deep copy of this PolygonLocationDetailPair */
|
|
62
|
+
clone(result?: PolygonLocationDetailPair): PolygonLocationDetailPair;
|
|
63
|
+
/** Swap the details of A, B */
|
|
64
|
+
swapDetails(): void;
|
|
42
65
|
}
|
|
43
66
|
/**
|
|
44
67
|
* Carrier for a loop extracted from clip operation, annotated for sorting
|
|
@@ -268,18 +291,33 @@ export declare class PolygonOps {
|
|
|
268
291
|
*/
|
|
269
292
|
static sortOuterAndHoleLoops(loops: IndexedReadWriteXYZCollection[], defaultNormal: Vector3d | undefined): IndexedReadWriteXYZCollection[][];
|
|
270
293
|
/** Compute the closest point on the polygon boundary to the given point.
|
|
294
|
+
* * Compare to [[closestPoint]].
|
|
271
295
|
* @param polygon points of the polygon, closure point optional
|
|
272
296
|
* @param testPoint point p to project onto the polygon edges. Works best when p is in the plane of the polygon.
|
|
273
297
|
* @param tolerance optional distance tolerance to determine point-vertex and point-edge coincidence.
|
|
274
298
|
* @param result optional pre-allocated object to fill and return
|
|
275
299
|
* @returns details d of the closest point `d.point`:
|
|
276
300
|
* * `d.isValid()` returns true if and only if the polygon is nontrivial.
|
|
277
|
-
* * `d.edgeIndex` and `d.edgeParam` specify the location of the closest point
|
|
301
|
+
* * `d.edgeIndex` and `d.edgeParam` specify the location of the closest point.
|
|
278
302
|
* * `d.code` classifies the closest point as a vertex (`PolygonLocation.OnPolygonVertex`) or as a point on an edge (`PolygonLocation.OnPolygonEdgeInterior`).
|
|
279
303
|
* * `d.a` is the distance from testPoint to the closest point.
|
|
280
304
|
* * `d.v` can be used to classify p (if p and polygon are coplanar): if n is the polygon normal then `d.v.dotProduct(n)` is +/-/0 if and only if p is inside/outside/on the polygon.
|
|
281
305
|
*/
|
|
282
306
|
static closestPointOnBoundary(polygon: Point3d[] | IndexedXYZCollection, testPoint: Point3d, tolerance?: number, result?: PolygonLocationDetail): PolygonLocationDetail;
|
|
307
|
+
/**
|
|
308
|
+
* Compute the closest point on the polygon boundary or its interior to the given point.
|
|
309
|
+
* * Compare to [[closestPointOnBoundary]].
|
|
310
|
+
* @param polygon points of the polygon, closure point optional
|
|
311
|
+
* @param testPoint point p to project onto the polygon edges. Works best when p is in the plane of the polygon.
|
|
312
|
+
* @param tolerance optional distance tolerance for distinguishing boundary versus interior closest point.
|
|
313
|
+
* @param result optional pre-allocated object to fill and return
|
|
314
|
+
* @returns details d of the closest point `d.point`:
|
|
315
|
+
* * `d.isValid()` returns true if and only if the polygon is nontrivial.
|
|
316
|
+
* * `d.edgeIndex` and `d.edgeParam` specify the location of the (nearest) boundary point.
|
|
317
|
+
* * `d.code` classifies the closest point: `PolygonLocation.OnPolygonVertex`, `PolygonLocation.OnPolygonEdgeInterior`, `PolygonLocation.InsidePolygonProjectsToVertex`, or `PolygonLocation.InsidePolygonProjectsToEdgeInterior`.
|
|
318
|
+
* * `d.a` is the distance from testPoint to the closest point.
|
|
319
|
+
*/
|
|
320
|
+
static closestPoint(polygon: Point3d[] | IndexedXYZCollection, testPoint: Point3d, tolerance?: number, result?: PolygonLocationDetail): PolygonLocationDetail;
|
|
283
321
|
private static _workXYZ?;
|
|
284
322
|
private static _workXY0?;
|
|
285
323
|
private static _workXY1?;
|
|
@@ -343,6 +381,35 @@ export declare class PolygonOps {
|
|
|
343
381
|
* @see BarycentricTriangle.pointToFraction
|
|
344
382
|
*/
|
|
345
383
|
static convexBarycentricCoordinates(polygon: Point3d[] | IndexedXYZCollection, point: Point3d, tolerance?: number): number[] | undefined;
|
|
384
|
+
/**
|
|
385
|
+
* Force the polygon to be closed.
|
|
386
|
+
* * If first and last points are not within tolerance, push copy of first point
|
|
387
|
+
* * If first and last points are within tolerance, set last point equal to first
|
|
388
|
+
* @param polygon input polygon
|
|
389
|
+
* @param tolerance closure distance tolerance
|
|
390
|
+
*/
|
|
391
|
+
static forceClosure(polygon: Point3d[] | GrowableXYZArray, tolerance?: number): void;
|
|
392
|
+
/**
|
|
393
|
+
* Return a closed polygon, cloning only if necessary.
|
|
394
|
+
* * If the first and last points are not identical, call [[forceClosure]] on a clone of the polygon and return it.
|
|
395
|
+
* * If the first and last points are already identical, just return the input.
|
|
396
|
+
* @param polygon input polygon
|
|
397
|
+
* @param tolerance closure distance tolerance
|
|
398
|
+
*/
|
|
399
|
+
static ensureClosed(polygon: Point3d[] | IndexedXYZCollection, tolerance?: number): Point3d[] | IndexedXYZCollection;
|
|
400
|
+
private static _workCLDPair?;
|
|
401
|
+
/**
|
|
402
|
+
* Find smallest distance between polygons.
|
|
403
|
+
* * For efficiency, input polygons should include closure edge.
|
|
404
|
+
* * If searching interiors for close approaches, the polygons are assumed to be convex.
|
|
405
|
+
* @param polygonA first polygon
|
|
406
|
+
* @param polygonB second polygon
|
|
407
|
+
* @param dMax optional largest approach distance to consider
|
|
408
|
+
* @param _searchInterior If true, include (convex) polygon interiors in computations (currently unimplemented).
|
|
409
|
+
* If false (default): return closest approach between polygon boundaries only, using [[PolylineOps.closestApproach]].
|
|
410
|
+
* @return pair of details, one per polygon. The `a` field of each detail stores the closest approach distance.
|
|
411
|
+
*/
|
|
412
|
+
static closestApproach(polygonA: Point3d[] | IndexedXYZCollection, polygonB: Point3d[] | IndexedXYZCollection, dMax?: number, _searchInterior?: boolean): PolygonLocationDetailPair | undefined;
|
|
346
413
|
}
|
|
347
414
|
/**
|
|
348
415
|
* `IndexedXYZCollectionPolygonOps` class contains _static_ methods for typical operations on polygons carried as `IndexedXYZCollection`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolygonOps.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/PolygonOps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PolygonOps.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/PolygonOps.ts"],"names":[],"mappings":"AAUA,OAAO,EAAuB,sBAAsB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG7F,OAAO,EAAE,OAAO,EAAY,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAU,MAAM,YAAY,CAAC;AAE3C;;;GAGG;AACH,qBAAa,qBAAqB;IAChC,sCAAsC;IAC/B,KAAK,EAAE,OAAO,CAAC;IACtB,kCAAkC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAC3B,CAAC,EAAE,QAAQ,CAAC;IACnB,iFAAiF;IAC1E,IAAI,EAAE,eAAe,CAAC;IAC7B,wEAAwE;IACjE,gBAAgB,EAAE,MAAM,CAAC;IAChC,mEAAmE;IAC5D,gBAAgB,EAAE,MAAM,CAAC;IAEhC,OAAO;IASP,8BAA8B;IACvB,UAAU;IASjB;;OAEG;WACW,MAAM,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,qBAAqB;IAQ3E;;OAEG;IACI,gBAAgB,CAAC,KAAK,EAAE,q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,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI;IAI9G;;;;;OAKG;WACW,wBAAwB,CAAC,KAAK,EAAE,sBAAsB,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,SAAS,GAAE,MAAqC;CA0CpK"}
|
|
@@ -18,6 +18,7 @@ import { Plane3dByOriginAndUnitNormal } from "./Plane3dByOriginAndUnitNormal";
|
|
|
18
18
|
import { Point2d, Vector2d } from "./Point2dVector2d";
|
|
19
19
|
import { Point3dArrayCarrier } from "./Point3dArrayCarrier";
|
|
20
20
|
import { Point3d, Vector3d } from "./Point3dVector3d";
|
|
21
|
+
import { PolylineOps } from "./PolylineOps";
|
|
21
22
|
import { Ray3d } from "./Ray3d";
|
|
22
23
|
import { SortablePolygon } from "./SortablePolygon";
|
|
23
24
|
/**
|
|
@@ -73,6 +74,51 @@ export class PolygonLocationDetail {
|
|
|
73
74
|
this.code === PolygonLocation.OnPolygonVertex || this.code === PolygonLocation.OnPolygonEdgeInterior ||
|
|
74
75
|
this.code === PolygonLocation.InsidePolygonProjectsToVertex || this.code === PolygonLocation.InsidePolygonProjectsToEdgeInterior;
|
|
75
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Set point, index, and fraction for an "at vertex" or "along edge" PolygonLocationDetail.
|
|
79
|
+
* * Point is not captured; its coordinates are copied.
|
|
80
|
+
*/
|
|
81
|
+
static createAtVertexOrEdge(point, index, fraction = 0) {
|
|
82
|
+
const detail = new PolygonLocationDetail();
|
|
83
|
+
detail.point.setFrom(point);
|
|
84
|
+
detail.closestEdgeIndex = index;
|
|
85
|
+
detail.closestEdgeParam = fraction;
|
|
86
|
+
fraction = Geometry.clamp(fraction, 0, 1);
|
|
87
|
+
detail.code = (fraction > 0 && fraction < 1) ? PolygonLocation.OnPolygonEdgeInterior : PolygonLocation.OnPolygonVertex;
|
|
88
|
+
return detail;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A pair of PolygonLocationDetail.
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export class PolygonLocationDetailPair {
|
|
96
|
+
/** Constructor, captures inputs */
|
|
97
|
+
constructor(detailA, detailB) {
|
|
98
|
+
this.detailA = detailA ? detailA : PolygonLocationDetail.create();
|
|
99
|
+
this.detailB = detailB ? detailB : PolygonLocationDetail.create();
|
|
100
|
+
}
|
|
101
|
+
/** Create an instance by capturing inputs */
|
|
102
|
+
static create(detailA, detailB, result) {
|
|
103
|
+
if (!result)
|
|
104
|
+
return new PolygonLocationDetailPair(detailA, detailB);
|
|
105
|
+
result.detailA = detailA;
|
|
106
|
+
result.detailB = detailB;
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
109
|
+
/** Make a deep copy of this PolygonLocationDetailPair */
|
|
110
|
+
clone(result) {
|
|
111
|
+
result = result ? result : new PolygonLocationDetailPair();
|
|
112
|
+
result.detailA.copyContentsFrom(this.detailA);
|
|
113
|
+
result.detailB.copyContentsFrom(this.detailB);
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
/** Swap the details of A, B */
|
|
117
|
+
swapDetails() {
|
|
118
|
+
const q = this.detailA;
|
|
119
|
+
this.detailA = this.detailB;
|
|
120
|
+
this.detailB = q;
|
|
121
|
+
}
|
|
76
122
|
}
|
|
77
123
|
/**
|
|
78
124
|
* Carrier for a loop extracted from clip operation, annotated for sorting
|
|
@@ -794,13 +840,14 @@ class PolygonOps {
|
|
|
794
840
|
return sortedLoopsArray;
|
|
795
841
|
}
|
|
796
842
|
/** Compute the closest point on the polygon boundary to the given point.
|
|
843
|
+
* * Compare to [[closestPoint]].
|
|
797
844
|
* @param polygon points of the polygon, closure point optional
|
|
798
845
|
* @param testPoint point p to project onto the polygon edges. Works best when p is in the plane of the polygon.
|
|
799
846
|
* @param tolerance optional distance tolerance to determine point-vertex and point-edge coincidence.
|
|
800
847
|
* @param result optional pre-allocated object to fill and return
|
|
801
848
|
* @returns details d of the closest point `d.point`:
|
|
802
849
|
* * `d.isValid()` returns true if and only if the polygon is nontrivial.
|
|
803
|
-
* * `d.edgeIndex` and `d.edgeParam` specify the location of the closest point
|
|
850
|
+
* * `d.edgeIndex` and `d.edgeParam` specify the location of the closest point.
|
|
804
851
|
* * `d.code` classifies the closest point as a vertex (`PolygonLocation.OnPolygonVertex`) or as a point on an edge (`PolygonLocation.OnPolygonEdgeInterior`).
|
|
805
852
|
* * `d.a` is the distance from testPoint to the closest point.
|
|
806
853
|
* * `d.v` can be used to classify p (if p and polygon are coplanar): if n is the polygon normal then `d.v.dotProduct(n)` is +/-/0 if and only if p is inside/outside/on the polygon.
|
|
@@ -853,7 +900,7 @@ class PolygonOps {
|
|
|
853
900
|
}
|
|
854
901
|
if (distToStart2 < minDist2) {
|
|
855
902
|
if (polygon.dotProductIndexIndexXYAndZ(iBase, iPrev, testPoint) <= 0.0) {
|
|
856
|
-
// update candidate (to edge start) only if previous edge
|
|
903
|
+
// update candidate (to edge start) only if testPoint projected beyond previous edge end
|
|
857
904
|
polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
|
|
858
905
|
result.a = Math.sqrt(distToStart2);
|
|
859
906
|
polygon.crossProductIndexIndexIndex(iBase, iPrev, iNext, result.v);
|
|
@@ -917,6 +964,41 @@ class PolygonOps {
|
|
|
917
964
|
}
|
|
918
965
|
return result;
|
|
919
966
|
}
|
|
967
|
+
/**
|
|
968
|
+
* Compute the closest point on the polygon boundary or its interior to the given point.
|
|
969
|
+
* * Compare to [[closestPointOnBoundary]].
|
|
970
|
+
* @param polygon points of the polygon, closure point optional
|
|
971
|
+
* @param testPoint point p to project onto the polygon edges. Works best when p is in the plane of the polygon.
|
|
972
|
+
* @param tolerance optional distance tolerance for distinguishing boundary versus interior closest point.
|
|
973
|
+
* @param result optional pre-allocated object to fill and return
|
|
974
|
+
* @returns details d of the closest point `d.point`:
|
|
975
|
+
* * `d.isValid()` returns true if and only if the polygon is nontrivial.
|
|
976
|
+
* * `d.edgeIndex` and `d.edgeParam` specify the location of the (nearest) boundary point.
|
|
977
|
+
* * `d.code` classifies the closest point: `PolygonLocation.OnPolygonVertex`, `PolygonLocation.OnPolygonEdgeInterior`, `PolygonLocation.InsidePolygonProjectsToVertex`, or `PolygonLocation.InsidePolygonProjectsToEdgeInterior`.
|
|
978
|
+
* * `d.a` is the distance from testPoint to the closest point.
|
|
979
|
+
*/
|
|
980
|
+
static closestPoint(polygon, testPoint, tolerance = Geometry.smallMetricDistance, result) {
|
|
981
|
+
if (!(polygon instanceof IndexedXYZCollection))
|
|
982
|
+
return this.closestPoint(new Point3dArrayCarrier(polygon), testPoint, tolerance, result);
|
|
983
|
+
if (!this.unitNormal(polygon, this._normal))
|
|
984
|
+
return PolygonLocationDetail.create(result); // invalid
|
|
985
|
+
const polygonPlane = this._workPlane = Plane3dByOriginAndUnitNormal.createXYZUVW(polygon.getXAtUncheckedPointIndex(0), polygon.getYAtUncheckedPointIndex(0), polygon.getZAtUncheckedPointIndex(0), this._normal.x, this._normal.y, this._normal.z, this._workPlane);
|
|
986
|
+
const planePoint = this._workXYZ = polygonPlane.projectPointToPlane(testPoint, this._workXYZ);
|
|
987
|
+
result = this.closestPointOnBoundary(polygon, planePoint, tolerance, result);
|
|
988
|
+
if (result.isValid) {
|
|
989
|
+
const dot = result.v.dotProduct(this._normal);
|
|
990
|
+
if (dot > 0.0) { // planePoint is inside, so return it instead of the closest boundary point
|
|
991
|
+
result.point.setFrom(planePoint);
|
|
992
|
+
if (PolygonLocation.OnPolygonVertex === result.code)
|
|
993
|
+
result.code = PolygonLocation.InsidePolygonProjectsToVertex;
|
|
994
|
+
else if (PolygonLocation.OnPolygonEdgeInterior === result.code)
|
|
995
|
+
result.code = PolygonLocation.InsidePolygonProjectsToEdgeInterior;
|
|
996
|
+
}
|
|
997
|
+
result.a = testPoint.distance(result.point);
|
|
998
|
+
result.v.setZero(); // not relevant
|
|
999
|
+
}
|
|
1000
|
+
return result;
|
|
1001
|
+
}
|
|
920
1002
|
/** Compute the intersection of a line (parameterized as a ray) with the plane of this polygon.
|
|
921
1003
|
* @param polygon points of the polygon, closure point optional
|
|
922
1004
|
* @param ray infinite line to intersect, as a ray
|
|
@@ -934,7 +1016,7 @@ class PolygonOps {
|
|
|
934
1016
|
if (!this.unitNormal(polygon, this._normal))
|
|
935
1017
|
return PolygonLocationDetail.create(result); // invalid
|
|
936
1018
|
this._workPlane = Plane3dByOriginAndUnitNormal.createXYZUVW(polygon.getXAtUncheckedPointIndex(0), polygon.getYAtUncheckedPointIndex(0), polygon.getZAtUncheckedPointIndex(0), this._normal.x, this._normal.y, this._normal.z, this._workPlane);
|
|
937
|
-
const intersectionPoint = Point3d.createZero(this._workXYZ);
|
|
1019
|
+
const intersectionPoint = this._workXYZ = Point3d.createZero(this._workXYZ);
|
|
938
1020
|
const rayParam = ray.intersectionWithPlane(this._workPlane, intersectionPoint);
|
|
939
1021
|
if (undefined === rayParam)
|
|
940
1022
|
return PolygonLocationDetail.create(result);
|
|
@@ -1107,6 +1189,71 @@ class PolygonOps {
|
|
|
1107
1189
|
coords[i] *= scale; // normalized
|
|
1108
1190
|
return coords;
|
|
1109
1191
|
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Force the polygon to be closed.
|
|
1194
|
+
* * If first and last points are not within tolerance, push copy of first point
|
|
1195
|
+
* * If first and last points are within tolerance, set last point equal to first
|
|
1196
|
+
* @param polygon input polygon
|
|
1197
|
+
* @param tolerance closure distance tolerance
|
|
1198
|
+
*/
|
|
1199
|
+
static forceClosure(polygon, tolerance = Geometry.smallMetricDistance) {
|
|
1200
|
+
if (polygon.length >= 2) {
|
|
1201
|
+
if (polygon instanceof GrowableXYZArray) {
|
|
1202
|
+
polygon.forceClosure(tolerance);
|
|
1203
|
+
}
|
|
1204
|
+
else if (polygon[0].distance(polygon[polygon.length - 1]) > tolerance) {
|
|
1205
|
+
polygon.push(polygon[0].clone());
|
|
1206
|
+
}
|
|
1207
|
+
else {
|
|
1208
|
+
polygon[polygon.length - 1].setFromPoint3d(polygon[0]);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Return a closed polygon, cloning only if necessary.
|
|
1214
|
+
* * If the first and last points are not identical, call [[forceClosure]] on a clone of the polygon and return it.
|
|
1215
|
+
* * If the first and last points are already identical, just return the input.
|
|
1216
|
+
* @param polygon input polygon
|
|
1217
|
+
* @param tolerance closure distance tolerance
|
|
1218
|
+
*/
|
|
1219
|
+
static ensureClosed(polygon, tolerance = Geometry.smallMetricDistance) {
|
|
1220
|
+
if (polygon.length >= 2) {
|
|
1221
|
+
let forceClosure = false;
|
|
1222
|
+
if (polygon instanceof IndexedXYZCollection)
|
|
1223
|
+
forceClosure = !polygon.almostEqualIndexIndex(0, polygon.length - 1, 0.0);
|
|
1224
|
+
else
|
|
1225
|
+
forceClosure = !polygon[0].isExactEqual(polygon[polygon.length - 1]);
|
|
1226
|
+
if (forceClosure) {
|
|
1227
|
+
const cloned = GrowableXYZArray.create(polygon);
|
|
1228
|
+
this.forceClosure(cloned, tolerance);
|
|
1229
|
+
polygon = cloned;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
return polygon;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Find smallest distance between polygons.
|
|
1236
|
+
* * For efficiency, input polygons should include closure edge.
|
|
1237
|
+
* * If searching interiors for close approaches, the polygons are assumed to be convex.
|
|
1238
|
+
* @param polygonA first polygon
|
|
1239
|
+
* @param polygonB second polygon
|
|
1240
|
+
* @param dMax optional largest approach distance to consider
|
|
1241
|
+
* @param _searchInterior If true, include (convex) polygon interiors in computations (currently unimplemented).
|
|
1242
|
+
* If false (default): return closest approach between polygon boundaries only, using [[PolylineOps.closestApproach]].
|
|
1243
|
+
* @return pair of details, one per polygon. The `a` field of each detail stores the closest approach distance.
|
|
1244
|
+
*/
|
|
1245
|
+
static closestApproach(polygonA, polygonB, dMax = Number.MAX_VALUE, _searchInterior = false) {
|
|
1246
|
+
// TODO: handle interior close approaches as well...
|
|
1247
|
+
let result;
|
|
1248
|
+
const polyA = this.ensureClosed(polygonA);
|
|
1249
|
+
const polyB = this.ensureClosed(polygonB);
|
|
1250
|
+
const cld = this._workCLDPair = PolylineOps.closestApproach(polyA, false, polyB, false, dMax, this._workCLDPair);
|
|
1251
|
+
if (cld && cld.detailA.childDetail && cld.detailB.childDetail) {
|
|
1252
|
+
result = PolygonLocationDetailPair.create(PolygonLocationDetail.createAtVertexOrEdge(cld.detailA.point, cld.detailA.childDetail.a, cld.detailA.childDetail.fraction), PolygonLocationDetail.createAtVertexOrEdge(cld.detailB.point, cld.detailB.childDetail.a, cld.detailB.childDetail.fraction));
|
|
1253
|
+
result.detailA.a = result.detailB.a = cld.detailA.a;
|
|
1254
|
+
}
|
|
1255
|
+
return result;
|
|
1256
|
+
}
|
|
1110
1257
|
}
|
|
1111
1258
|
/** These values are the integrated area moment products [xx,xy,xz, x]
|
|
1112
1259
|
* for a right triangle in the first quadrant at the origin -- (0,0),(1,0),(0,1)
|