@itwin/core-geometry 4.10.0-dev.3 → 4.10.0-dev.31
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 +36 -1
- package/lib/cjs/Geometry.d.ts +2 -2
- package/lib/cjs/Geometry.js +2 -2
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +7 -7
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +1 -1
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +1 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +21 -10
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +66 -38
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +27 -8
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +44 -25
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +11 -13
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +19 -46
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +2 -2
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -4
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -0
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +40 -65
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +22 -7
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +131 -70
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +14 -11
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +5 -5
- package/lib/cjs/geometry3d/Angle.js +5 -5
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +101 -13
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +156 -57
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +4 -4
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +35 -31
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +55 -31
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -5
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +6 -5
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +2 -2
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +2 -2
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +4 -2
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +4 -2
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.d.ts +5 -5
- package/lib/cjs/geometry4d/Map4d.js +5 -5
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.d.ts +4 -7
- package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +4 -7
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +2 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts +3 -0
- package/lib/cjs/numerics/Newton.d.ts.map +1 -1
- package/lib/cjs/numerics/Newton.js +2 -5
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +46 -201
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +132 -445
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.d.ts +164 -0
- package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -0
- package/lib/cjs/numerics/SmallSystem.js +321 -0
- package/lib/cjs/numerics/SmallSystem.js.map +1 -0
- package/lib/cjs/polyface/PolyfaceClip.d.ts +3 -3
- package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +7 -7
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +2 -2
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js +2 -2
- package/lib/cjs/topology/InsertAndRetriangulateContext.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 +2 -2
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/esm/Geometry.d.ts +2 -2
- package/lib/esm/Geometry.js +2 -2
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +7 -7
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +1 -1
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +1 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +21 -10
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +66 -38
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +27 -8
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +44 -25
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +11 -13
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +17 -44
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +4 -3
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -0
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +35 -60
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +22 -7
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +130 -69
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +14 -11
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +5 -5
- package/lib/esm/geometry3d/Angle.js +5 -5
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +101 -13
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +156 -57
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +35 -31
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +55 -31
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -5
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +6 -5
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +2 -2
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +4 -2
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +4 -2
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.d.ts +5 -5
- package/lib/esm/geometry4d/Map4d.js +5 -5
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.d.ts +4 -7
- package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +4 -7
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +2 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts +3 -0
- package/lib/esm/numerics/Newton.d.ts.map +1 -1
- package/lib/esm/numerics/Newton.js +1 -4
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +46 -201
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +132 -444
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.d.ts +164 -0
- package/lib/esm/numerics/SmallSystem.d.ts.map +1 -0
- package/lib/esm/numerics/SmallSystem.js +317 -0
- package/lib/esm/numerics/SmallSystem.js.map +1 -0
- package/lib/esm/polyface/PolyfaceClip.d.ts +3 -3
- package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js +4 -4
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +1 -1
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.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 +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/package.json +7 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveFactory.js","sourceRoot":"","sources":["../../../src/curve/CurveFactory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,6DAA6D;AAE7D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAA0B,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAGtD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,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,QAAQ,EAC5B,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAC5B,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAC5B,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACjG,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CAEF;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,OAAiB,EAAE,OAAiB,EAAE,WAAqB,EAAE,MAAiB;IACvG,gEAAgE;IAChE,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,CAAC,GAAG,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACzD,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\n// import { Geometry, Angle, AngleSweep } from \"../Geometry\";\r\n\r\nimport { AxisIndex, AxisOrder, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { AngleSweep } from \"../geometry3d/AngleSweep\";\r\nimport { Ellipsoid, GeodesicPathPoint } from \"../geometry3d/Ellipsoid\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3dArrayCarrier } from \"../geometry3d/Point3dArrayCarrier\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolylineOps } from \"../geometry3d/PolylineOps\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Segment1d } from \"../geometry3d/Segment1d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XAndY } from \"../geometry3d/XYZProps\";\r\nimport { SmallSystem } from \"../numerics/Polynomials\";\r\nimport { IndexedPolyface } from \"../polyface/Polyface\";\r\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\r\nimport { Cone } from \"../solid/Cone\";\r\nimport { RuledSweep } from \"../solid/RuledSweep\";\r\nimport { TorusPipe } from \"../solid/TorusPipe\";\r\nimport { Arc3d, ArcBlendData } from \"./Arc3d\";\r\nimport { AnyCurve } from \"./CurveTypes\";\r\nimport { CurveChain } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineSegment3d } from \"./LineSegment3d\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { Loop } from \"./Loop\";\r\nimport { Path } from \"./Path\";\r\nimport { IntegratedSpiral3d } from \"./spiral/IntegratedSpiral3d\";\r\nimport { IntegratedSpiralTypeName } from \"./spiral/TransitionSpiral3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n// cspell:word CCWXY\r\n\r\n/**\r\n * Interface to carry parallel arrays of planes and sections, and optional geometry assembled from them, as returned by [CurveFactory.createMiteredSweepSections].\r\n * @public\r\n */\r\nexport interface SectionSequenceWithPlanes {\r\n /** the plane of each section */\r\n planes: Plane3dByOriginAndUnitNormal[];\r\n /** section curve projected onto the corresponding plane */\r\n sections: AnyCurve[];\r\n /**\r\n * Optional `RuledSweep` generated from the sections.\r\n * * The `RuledSweep` and sections array refer to the same section objects.\r\n */\r\n ruledSweep?: RuledSweep;\r\n /** Optional mesh generated from the `RuledSweep` generated from the sections. */\r\n mesh?: IndexedPolyface;\r\n}\r\n\r\n/**\r\n * Enumeration of geometric output for [CurveFactory.createMiteredSweepSections].\r\n * @public\r\n */\r\nexport enum MiteredSweepOutputSelect {\r\n /** Output only the parallel arrays of planes and sections. */\r\n Sections = 0,\r\n /** Output planes and sections, as well as the assembled ruled sweep. */\r\n AlsoRuledSweep = 1,\r\n /** Output planes and sections, as well as the assembled ruled sweep and its stroked mesh. */\r\n AlsoMesh = 2,\r\n}\r\n\r\n/**\r\n * Interface bundling options for [CurveFactory.createMiteredSweepSections].\r\n * @public\r\n */\r\nexport interface MiteredSweepOptions {\r\n /** Whether first and last planes are averaged and equated when the centerline is physically closed. Default value is `false`. */\r\n wrapIfPhysicallyClosed?: boolean;\r\n /** Whether to output sections only, or sections plus optional geometry constructed from them. Default value is `MiteredSweepOutputSelect.Sections`. */\r\n outputSelect?: MiteredSweepOutputSelect;\r\n /** How to stroke the ruled sweep if outputting a mesh. If undefined, default stroke options are used. */\r\n strokeOptions?: StrokeOptions;\r\n /** Whether to cap the ruled sweep if outputting a ruled sweep or mesh. Default value is `false`. */\r\n capped?: boolean;\r\n}\r\n\r\n/**\r\n * The `CurveFactory` class contains methods for specialized curve constructions.\r\n * @public\r\n */\r\nexport class CurveFactory {\r\n /** (cautiously) construct and save a line segment between fractional positions. */\r\n private static addPartialSegment(path: Path, allowBackup: boolean, pointA: Point3d | undefined, pointB: Point3d | undefined, fraction0: number, fraction1: number) {\r\n if (allowBackup || (fraction1 > fraction0)) {\r\n if (pointA !== undefined && pointB !== undefined && !Geometry.isAlmostEqualNumber(fraction0, fraction1))\r\n path.tryAddChild(LineSegment3d.create(pointA.interpolate(fraction0, pointB), pointA.interpolate(fraction1, pointB)));\r\n }\r\n }\r\n\r\n /**\r\n * Create a circular arc from start point, tangent at start, and another point (endpoint) on the arc.\r\n * @param pointA\r\n * @param tangentA\r\n * @param pointB\r\n */\r\n public static createArcPointTangentPoint(pointA: Point3d, tangentA: Vector3d, pointB: Point3d): Arc3d | undefined {\r\n const vectorV = Vector3d.createStartEnd(pointA, pointB);\r\n const frame = Matrix3d.createRigidFromColumns(tangentA, vectorV, AxisOrder.XYZ);\r\n if (frame !== undefined) {\r\n const vv = vectorV.dotProduct(vectorV);\r\n const vw = frame.dotColumnY(vectorV);\r\n const alpha = Geometry.conditionalDivideCoordinate(vv, 2 * vw);\r\n if (alpha !== undefined) {\r\n const vector0 = frame.columnY();\r\n vector0.scaleInPlace(-alpha);\r\n const vector90 = frame.columnX();\r\n vector90.scaleInPlace(alpha);\r\n const centerToEnd = vector0.plus(vectorV);\r\n const sweepAngle = vector0.angleTo(centerToEnd);\r\n let sweepRadians = sweepAngle.radians; // That's always positive and less than PI.\r\n if (tangentA.dotProduct(centerToEnd) < 0.0) // ah, sweepRadians is the wrong way\r\n sweepRadians = 2.0 * Math.PI - sweepRadians;\r\n const center = pointA.plusScaled(vector0, -1.0);\r\n return Arc3d.create(center, vector0, vector90, AngleSweep.createStartEndRadians(0.0, sweepRadians));\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.\r\n * * If the radius parameter is a number, that radius is used throughout.\r\n * * If the radius parameter is an array of numbers, `radius[i]` is applied at `point[i]`.\r\n * * Note that since no fillet is constructed at the initial or final point, those entries in `radius[]` are never referenced.\r\n * * A zero radius for any point indicates to leave the as a simple corner.\r\n * @param points point source\r\n * @param radius fillet radius or array of radii indexed to correspond to the points.\r\n * @param allowBackupAlongEdge true to allow edges to be created going \"backwards\" along edges if needed to create the blend.\r\n */\r\n public static createFilletsInLineString(points: LineString3d | IndexedXYZCollection | Point3d[], radius: number | number[], allowBackupAlongEdge: boolean = true): Path | undefined {\r\n if (Array.isArray(points))\r\n return this.createFilletsInLineString(new Point3dArrayCarrier(points), radius, allowBackupAlongEdge);\r\n if (points instanceof LineString3d)\r\n return this.createFilletsInLineString(points.packedPoints, radius, allowBackupAlongEdge);\r\n\r\n const n = points.length;\r\n if (n <= 1)\r\n return undefined;\r\n const pointA = points.getPoint3dAtCheckedPointIndex(0)!;\r\n const pointB = points.getPoint3dAtCheckedPointIndex(1)!;\r\n // remark: n=2 and n=3 cases should fall out from loop logic\r\n const blendArray: ArcBlendData[] = [];\r\n // build one-sided blends at each end . .\r\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointA.clone() });\r\n\r\n for (let i = 1; i + 1 < n; i++) {\r\n const pointC = points.getPoint3dAtCheckedPointIndex(i + 1)!;\r\n let thisRadius = 0;\r\n if (Array.isArray(radius)) {\r\n if (i < radius.length)\r\n thisRadius = radius[i];\r\n } else if (Number.isFinite(radius))\r\n thisRadius = radius;\r\n\r\n if (thisRadius !== 0.0)\r\n blendArray.push(Arc3d.createFilletArc(pointA, pointB, pointC, thisRadius));\r\n else\r\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });\r\n pointA.setFromPoint3d(pointB);\r\n pointB.setFromPoint3d(pointC);\r\n }\r\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });\r\n if (!allowBackupAlongEdge) {\r\n // suppress arcs that have overlap with both neighbors or flood either neighbor ..\r\n for (let i = 1; i + 1 < n; i++) {\r\n const b = blendArray[i];\r\n if (b.fraction10 > 1.0\r\n || b.fraction12 > 1.0\r\n || 1.0 - b.fraction10 < blendArray[i - 1].fraction12\r\n || b.fraction12 > 1.0 - blendArray[i + 1].fraction10) {\r\n b.fraction10 = 0.0;\r\n b.fraction12 = 0.0;\r\n blendArray[i].arc = undefined;\r\n }\r\n }\r\n /* The \"1-b\" logic above prevents this loop from ever doing anything.\r\n // on edge with conflict, suppress the arc with larger fraction\r\n for (let i = 1; i < n; i++) {\r\n const b0 = blendArray[i - 1];\r\n const b1 = blendArray[i];\r\n if (b0.fraction12 > 1 - b1.fraction10) {\r\n const b = b0.fraction12 > b1.fraction12 ? b1 : b0;\r\n b.fraction10 = 0.0;\r\n b.fraction12 = 0.0;\r\n blendArray[i].arc = undefined;\r\n }\r\n } */\r\n }\r\n const path = Path.create();\r\n this.addPartialSegment(path, allowBackupAlongEdge, blendArray[0].point, blendArray[1].point, blendArray[0].fraction12, 1.0 - blendArray[1].fraction10);\r\n // add each path and successor edge ...\r\n for (let i = 1; i + 1 < points.length; i++) {\r\n const b0 = blendArray[i];\r\n const b1 = blendArray[i + 1];\r\n path.tryAddChild(b0.arc);\r\n this.addPartialSegment(path, allowBackupAlongEdge, b0.point, b1.point, b0.fraction12, 1.0 - b1.fraction10);\r\n }\r\n return path;\r\n }\r\n\r\n /** Create a `Loop` with given xy corners and fixed z.\r\n * * The corners always proceed counter clockwise from lower left.\r\n * * If the radius is too large for the outer rectangle size, it is reduced to half of the the smaller x or y size.\r\n */\r\n public static createRectangleXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, filletRadius?: number): Loop {\r\n let radius = Geometry.correctSmallMetricDistance(filletRadius);\r\n const xMin = Math.min(x0, x1);\r\n const xMax = Math.max(x0, x1);\r\n const yMin = Math.min(y0, y1);\r\n const yMax = Math.max(y0, y1);\r\n radius = Math.min(Math.abs(radius), 0.5 * (xMax - xMin), 0.5 * (yMax - yMin));\r\n if (radius === 0.0)\r\n return Loop.createPolygon([Point3d.create(xMin, yMin, z), Point3d.create(xMax, yMin, z), Point3d.create(xMax, yMax, z), Point3d.create(xMin, yMax, z), Point3d.create(xMin, yMin, z)]);\r\n else {\r\n const vectorU = Vector3d.create(radius, 0, 0);\r\n const vectorV = Vector3d.create(0, radius, 0);\r\n const x0A = xMin + radius;\r\n const y0A = yMin + radius;\r\n const x1A = xMax - radius;\r\n const y1A = yMax - radius;\r\n const centers = [Point3d.create(x1A, y1A, z), Point3d.create(x0A, y1A, z), Point3d.create(x0A, y0A, z), Point3d.create(x1A, y0A, z)];\r\n const loop = Loop.create();\r\n for (let i = 0; i < 4; i++) {\r\n const center = centers[i];\r\n const nextCenter = centers[(i + 1) % 4];\r\n const edgeVector = Vector3d.createStartEnd(center, nextCenter);\r\n const arc = Arc3d.create(center, vectorU, vectorV, AngleSweep.createStartEndDegrees(0, 90));\r\n loop.tryAddChild(arc);\r\n const arcEnd = arc.endPoint();\r\n if (!edgeVector.isAlmostZero)\r\n loop.tryAddChild(LineSegment3d.create(arcEnd, arcEnd.plus(edgeVector)));\r\n vectorU.rotate90CCWXY(vectorU);\r\n vectorV.rotate90CCWXY(vectorV);\r\n }\r\n return loop;\r\n }\r\n }\r\n\r\n /**\r\n * If `arcB` is a continuation of `arcA`, extend `arcA` (in place) to include the range of `arcB`\r\n * * This only succeeds if the two arcs are part of identical complete arcs and end of `arcA` matches the beginning of `arcB`.\r\n * @param arcA first arc, modified in place\r\n * @param arcB second arc, unmodified\r\n * @param allowReversed whether to consolidate even when second arc is reversed\r\n * @returns whether `arcA` was modified\r\n */\r\n public static appendToArcInPlace(arcA: Arc3d, arcB: Arc3d, allowReverse: boolean = false): boolean {\r\n if (arcA.center.isAlmostEqual(arcB.center)) {\r\n const sweepSign = Geometry.split3WaySign(arcA.sweep.sweepRadians * arcB.sweep.sweepRadians, -1, 0, 1);\r\n // evaluate derivatives wrt radians (not fraction!), but adjust direction for sweep signs\r\n const endA = arcA.angleToPointAndDerivative(arcA.sweep.fractionToAngle(1.0));\r\n if (arcA.sweep.sweepRadians < 0)\r\n endA.direction.scaleInPlace(-1.0);\r\n const startB = arcB.angleToPointAndDerivative(arcB.sweep.fractionToAngle(0.0));\r\n if (arcB.sweep.sweepRadians < 0)\r\n startB.direction.scaleInPlace(-1.0);\r\n\r\n if (endA.isAlmostEqual(startB)) {\r\n arcA.sweep.setStartEndRadians(arcA.sweep.startRadians, arcA.sweep.startRadians + arcA.sweep.sweepRadians + sweepSign * arcB.sweep.sweepRadians);\r\n return true;\r\n }\r\n // Also ok if negated tangent . ..\r\n if (allowReverse) {\r\n startB.direction.scaleInPlace(-1.0);\r\n if (endA.isAlmostEqual(startB)) {\r\n arcA.sweep.setStartEndRadians(arcA.sweep.startRadians, arcA.sweep.startRadians + arcA.sweep.sweepRadians - sweepSign * arcB.sweep.sweepRadians);\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Return a `Path` containing arcs are on the surface of an ellipsoid and pass through a sequence of points.\r\n * * Each arc passes through the two given endpoints and in the plane containing the true surface normal at given `fractionForIntermediateNormal`\r\n * @param ellipsoid\r\n * @param pathPoints\r\n * @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.\r\n */\r\n public static assembleArcChainOnEllipsoid(ellipsoid: Ellipsoid, pathPoints: GeodesicPathPoint[], fractionForIntermediateNormal: number = 0.5): Path {\r\n const arcPath = Path.create();\r\n for (let i = 0; i + 1 < pathPoints.length; i++) {\r\n const arc = ellipsoid.sectionArcWithIntermediateNormal(\r\n pathPoints[i].toAngles(),\r\n fractionForIntermediateNormal,\r\n pathPoints[i + 1].toAngles());\r\n arcPath.tryAddChild(arc);\r\n }\r\n return arcPath;\r\n }\r\n\r\n private static appendGeometryQueryArray(candidate: GeometryQuery | GeometryQuery[] | undefined, result: GeometryQuery[]) {\r\n if (candidate instanceof GeometryQuery)\r\n result.push(candidate);\r\n else if (Array.isArray(candidate)) {\r\n for (const p of candidate)\r\n this.appendGeometryQueryArray(p, result);\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Create solid primitives for pipe segments (e.g. Cone or TorusPipe) around line and arc primitives.\r\n * @param centerline centerline geometry/\r\n * @param pipeRadius radius of pipe.\r\n */\r\n public static createPipeSegments(centerline: CurvePrimitive | CurveChain, pipeRadius: number): GeometryQuery | GeometryQuery[] | undefined {\r\n if (centerline instanceof LineSegment3d) {\r\n return Cone.createAxisPoints(centerline.startPoint(), centerline.endPoint(), pipeRadius, pipeRadius, false);\r\n } else if (centerline instanceof Arc3d) {\r\n return TorusPipe.createAlongArc(centerline, pipeRadius, false);\r\n } else if (centerline instanceof CurvePrimitive) {\r\n const builder = PolyfaceBuilder.create();\r\n builder.addMiteredPipes(centerline, pipeRadius);\r\n return builder.claimPolyface();\r\n } else if (centerline instanceof CurveChain) {\r\n const result: GeometryQuery[] = [];\r\n for (const p of centerline.children) {\r\n const pipe = this.createPipeSegments(p, pipeRadius);\r\n this.appendGeometryQueryArray(pipe, result);\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * * Create section arcs for mitered pipe.\r\n * * At each end of each pipe, the pipe is cut by the plane that bisects the angle between successive pipe centerlines.\r\n * * The arc definitions are constructed so that lines between corresponding fractional positions on the arcs are\r\n * axial lines on the pipes.\r\n * * This means that each arc definition axes (aka vector0 and vector90) are _not_ perpendicular to each other.\r\n * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis lengths, or a full Arc3d.\r\n * * For semi-axis length input, x corresponds to an ellipse local axis nominally situated parallel to the xy-plane.\r\n * * The center of Arc3d input is translated to the centerline start point to act as initial cross section.\r\n * @param centerline centerline of pipe\r\n * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d\r\n */\r\n public static createMiteredPipeSections(centerline: IndexedXYZCollection, sectionData: number | XAndY | Arc3d): Arc3d[] {\r\n const arcs: Arc3d[] = [];\r\n if (centerline.length < 2)\r\n return [];\r\n\r\n const vector0 = Vector3d.create();\r\n const vector90 = Vector3d.create();\r\n const vectorBC = Vector3d.create();\r\n const currentCenter = Point3d.create();\r\n centerline.vectorIndexIndex(0, 1, vectorBC)!;\r\n centerline.getPoint3dAtUncheckedPointIndex(0, currentCenter);\r\n\r\n let initialSection: Arc3d;\r\n if (sectionData instanceof Arc3d) {\r\n initialSection = sectionData.clone();\r\n initialSection.center.setFrom(currentCenter);\r\n vector0.setFrom(sectionData.vector0);\r\n vector90.setFrom(sectionData.vector90);\r\n } else if (typeof sectionData === \"number\" || Point3d.isXAndY(sectionData)) {\r\n const length0 = (typeof sectionData === \"number\") ? sectionData : sectionData.x;\r\n const length90 = (typeof sectionData === \"number\") ? sectionData : sectionData.y;\r\n const baseFrame = Matrix3d.createRigidHeadsUp(vectorBC, AxisOrder.ZXY);\r\n baseFrame.columnX(vector0).scaleInPlace(length0);\r\n baseFrame.columnY(vector90).scaleInPlace(length90);\r\n initialSection = Arc3d.create(currentCenter, vector0, vector90, AngleSweep.create360());\r\n } else {\r\n return [];\r\n }\r\n arcs.push(initialSection);\r\n\r\n const vectorAB = Vector3d.create();\r\n const bisector = Vector3d.create();\r\n for (let i = 1; i < centerline.length; i++) {\r\n vectorAB.setFromVector3d(vectorBC);\r\n centerline.getPoint3dAtUncheckedPointIndex(i, currentCenter);\r\n if (i + 1 < centerline.length) {\r\n centerline.vectorIndexIndex(i, i + 1, vectorBC)!;\r\n } else {\r\n vectorBC.setFromVector3d(vectorAB);\r\n }\r\n if (vectorAB.normalizeInPlace() && vectorBC.normalizeInPlace()) {\r\n vectorAB.interpolate(0.5, vectorBC, bisector);\r\n // On the end ellipse for this pipe section. ..\r\n // center comes directly from centerline[i]\r\n // vector0 and vector90 are obtained by sweeping the corresponding vectors of the start ellipse to the split plane.\r\n moveVectorToPlane(vector0, vectorAB, bisector, vector0);\r\n moveVectorToPlane(vector90, vectorAB, bisector, vector90);\r\n arcs.push(Arc3d.create(currentCenter, vector0, vector90, AngleSweep.create360()));\r\n }\r\n }\r\n return arcs;\r\n }\r\n\r\n /**\r\n * Sweep the initialSection along each segment of the centerLine until it hits the bisector plane at the next vertex.\r\n * * The caller should place the initialSection on a plane perpendicular to the first edge.\r\n * * This plane is commonly (but not necessarily) through the start point itself.\r\n * * If the geometry is not \"on a perpendicular plane\", the output geometry will still be flattened onto the various planes.\r\n * * In the \"open path\" case (i.e when wrapIfPhysicallyClosed is false or the path does not have matched first and last points)\r\n * the first/last output plane will be at the start/end of the first/last edge and on a perpendicular plane.\r\n * * In the \"closed path\" case, the output plane for the first and last point is the bisector of the start and end planes from the \"open path\" case,\r\n * and the first/last section geometry may be different from `initialSection`.\r\n * * The centerline path does NOT have to be planar, however twisting effects effects will appear in the various bisector planes.\r\n * @param centerline sweep path, e.g., as stroked from a smooth centerline curve\r\n * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the first segment of the centerline.\r\n * @param options options for computation and output\r\n * @return array of sections, starting with `initialSection` projected along the first edge to the first plane.\r\n */\r\n public static createMiteredSweepSections(centerline: IndexedXYZCollection | Point3d[], initialSection: AnyCurve, options: MiteredSweepOptions): SectionSequenceWithPlanes | undefined {\r\n const sectionData: SectionSequenceWithPlanes = { sections: [], planes: [] };\r\n const planes = PolylineOps.createBisectorPlanesForDistinctPoints(centerline, options.wrapIfPhysicallyClosed);\r\n if (planes !== undefined && planes.length > 1) {\r\n // Projection to target plane, constructing sweep direction from two given planes.\r\n // If successful, push the target plane and swept section to the output arrays and return the swept section.\r\n // If unsuccessful, leave the output arrays alone and return the input section.\r\n const doSweepToPlane = function (edgePlane0: Plane3dByOriginAndUnitNormal, edgePlane1: Plane3dByOriginAndUnitNormal,\r\n targetPlane: Plane3dByOriginAndUnitNormal,\r\n section: AnyCurve) {\r\n const sweepVector = Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());\r\n const transform = Transform.createFlattenAlongVectorToPlane(sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef());\r\n if (transform === undefined)\r\n return section;\r\n const section1 = section.cloneTransformed(transform);\r\n if (section1 === undefined)\r\n return section;\r\n sectionData.planes.push(targetPlane);\r\n sectionData.sections.push(section1);\r\n return section1;\r\n };\r\n\r\n let currentSection = doSweepToPlane(planes[0], planes[1], planes[0], initialSection);\r\n for (let i = 1; i < planes.length; i++) {\r\n currentSection = doSweepToPlane(planes[i - 1], planes[i], planes[i], currentSection);\r\n }\r\n\r\n if (options.outputSelect) {\r\n const ruledSweep = RuledSweep.create(sectionData.sections, options.capped ?? false);\r\n if (ruledSweep) {\r\n sectionData.ruledSweep = ruledSweep;\r\n if (MiteredSweepOutputSelect.AlsoMesh === options.outputSelect) {\r\n const builder = PolyfaceBuilder.create(options.strokeOptions);\r\n builder.addRuledSweep(ruledSweep);\r\n sectionData.mesh = builder.claimPolyface();\r\n }\r\n }\r\n }\r\n return sectionData;\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep\r\n * * The vector from start point to center is in the direction of upVector crossed with tangentA.\r\n * @param pointA start point\r\n * @param tangentA vector in tangent direction at the start\r\n * @param radius signed radius.\r\n * @param upVector optional out-of-plane vector. Defaults to positive Z\r\n * @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).\r\n *\r\n */\r\n public static createArcPointTangentRadius(pointA: Point3d, tangentA: Vector3d, radius: number, upVector?: Vector3d, sweep?: Angle | AngleSweep): Arc3d | undefined {\r\n if (upVector === undefined)\r\n upVector = Vector3d.unitZ();\r\n const vector0 = upVector.unitCrossProduct(tangentA);\r\n if (vector0 === undefined)\r\n return undefined;\r\n const center = pointA.plusScaled(vector0, radius);\r\n // reverse the A-to-center vector and bring it up to scale ...\r\n vector0.scaleInPlace(-radius);\r\n const vector90 = tangentA.scaleToLength(Math.abs(radius))!; // (Cannot fail -- prior unitCrossProduct would have failed first)\r\n return Arc3d.create(center, vector0, vector90, AngleSweep.create(sweep));\r\n }\r\n\r\n /**\r\n * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.\r\n * * First spiral begins at given start point.\r\n * * first tangent aims at shoulder\r\n * * outbound spiral joins line from shoulder to target.\r\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE\r\n * @param startPoint inbound start point.\r\n * @param shoulder point target point for (both) spiral-to-line tangencies\r\n * @return array with the computed spirals, or undefined if failure.\r\n */\r\n public static createLineSpiralSpiralLine(\r\n spiralType: IntegratedSpiralTypeName,\r\n startPoint: Point3d,\r\n shoulderPoint: Point3d,\r\n targetPoint: Point3d,\r\n ): GeometryQuery[] | undefined {\r\n const vectorAB = Vector3d.createStartEnd(startPoint, shoulderPoint);\r\n const vectorBC0 = Vector3d.createStartEnd(shoulderPoint, targetPoint);\r\n const referenceLength = vectorAB.magnitude();\r\n const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);\r\n const lineTurnRadians = vectorAB.angleToXY(vectorBC0);\r\n const spiralTurnRadians = 0.5 * lineTurnRadians.radians;\r\n const radiansBC = radiansAB + lineTurnRadians.radians;\r\n const axesA = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansAB));\r\n const frameA = Transform.createRefs(startPoint.clone(), axesA);\r\n // We know how much it has to turn, and but not the length or end radius.\r\n // make a spiral of referenceLength and scale it back to the junction line\r\n const spiralARefLength = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined,\r\n Angle.createRadians(0), Angle.createRadians(spiralTurnRadians), referenceLength, undefined, frameA);\r\n if (spiralARefLength) {\r\n const midPlanePerpendicularRadians = radiansAB + spiralTurnRadians;\r\n const midPlanePerpendicularVector = Vector3d.createPolar(1.0, Angle.createRadians(midPlanePerpendicularRadians));\r\n const altitudeB = midPlanePerpendicularVector.dotProductStartEnd(startPoint, shoulderPoint);\r\n const altitudeSpiralEnd = midPlanePerpendicularVector.dotProductStartEnd(startPoint, spiralARefLength.endPoint());\r\n const scaleFactor = altitudeB / altitudeSpiralEnd;\r\n const spiralA = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined,\r\n Angle.createRadians(0), Angle.createRadians(spiralTurnRadians), referenceLength * scaleFactor, undefined, frameA)!;\r\n const distanceAB = vectorAB.magnitude();\r\n const vectorBC = Vector3d.createStartEnd(shoulderPoint, targetPoint);\r\n vectorBC.scaleToLength(distanceAB, vectorBC);\r\n const pointC = shoulderPoint.plus(vectorBC);\r\n const axesC = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansBC + Math.PI));\r\n const frameC = Transform.createRefs(pointC, axesC);\r\n const spiralC = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\r\n 0, -spiralA.radius01.x1, Angle.zero(), undefined, spiralA.curveLength(), Segment1d.create(1, 0), frameC)!;\r\n return [spiralA, spiralC];\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.\r\n * * Spiral length is given.\r\n * * tangency points float on both lines.\r\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE\r\n * @param pointA inbound start point.\r\n * @param shoulder point target point for (both) spiral-to-line tangencies\r\n * @param spiralLength for each part of the spiral pair.\r\n * @return array with the computed spirals, or undefined if failure.\r\n */\r\n public static createLineSpiralSpiralLineWithSpiralLength(\r\n spiralType: IntegratedSpiralTypeName,\r\n pointA: Point3d,\r\n pointB: Point3d,\r\n pointC: Point3d,\r\n spiralLength: number,\r\n ): GeometryQuery[] | undefined {\r\n const vectorAB = Vector3d.createStartEnd(pointA, pointB);\r\n const vectorBC = Vector3d.createStartEnd(pointB, pointC);\r\n const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);\r\n const lineTurnAngle = vectorAB.angleToXY(vectorBC);\r\n const spiralTurnRadians = 0.5 * lineTurnAngle.radians;\r\n const bisectorRadians = 0.5 * (Math.PI - lineTurnAngle.radians);\r\n const radiansCB = Math.atan2(-vectorBC.y, -vectorBC.x);\r\n const spiralAB0 = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, Angle.zero(), Angle.createRadians(spiralTurnRadians),\r\n spiralLength, undefined, Transform.createIdentity());\r\n if (spiralAB0) {\r\n const localEndPoint = spiralAB0.fractionToPoint(1);\r\n const distanceAB = pointA.distance(pointB);\r\n const distanceCB = pointC.distance(pointB);\r\n // The spiral eventually has to end on the bisector, at localEndPoint.y height from the inbound line\r\n // distance from shoulder to projection of that point to point E on the inbound line is\r\n const distanceBE = localEndPoint.y / Math.tan(bisectorRadians);\r\n const xFractionAB = Geometry.conditionalDivideFraction(distanceAB - distanceBE - localEndPoint.x, distanceAB);\r\n const xFractionCB = Geometry.conditionalDivideFraction(distanceCB - distanceBE - localEndPoint.x, distanceCB);\r\n if (xFractionAB !== undefined && xFractionCB !== undefined) {\r\n const axesA = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansAB));\r\n const frameAOrigin = pointA.interpolate(xFractionAB, pointB);\r\n const frameA = Transform.createRefs(frameAOrigin, axesA);\r\n const spiralAB = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, Angle.zero(), Angle.createRadians(spiralTurnRadians),\r\n spiralLength, undefined, frameA)!;\r\n const axesB = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansCB));\r\n const frameBOrigin = pointC.interpolate(xFractionCB, pointB);\r\n const frameB = Transform.createRefs(frameBOrigin, axesB);\r\n const spiralBC = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, Angle.zero(), Angle.createRadians(-spiralTurnRadians),\r\n spiralLength, undefined, frameB)!;\r\n return [spiralAB, spiralBC];\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Compute 2 spirals and an arc (all in XY) for a symmetric line-to-line transition.\r\n * Spiral lengths and arc radius are given. (e.g. from design speed standards.)\r\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE\r\n * @param pointA inbound start point.\r\n * @param pointB shoulder (target) point for (both) spiral-to-line tangencies\r\n * @param lengthA inbound spiral length\r\n * @param lengthB outbound spiral length\r\n * @return array with the computed spirals, or undefined if failure.\r\n */\r\n public static createLineSpiralArcSpiralLine(\r\n spiralType: IntegratedSpiralTypeName,\r\n pointA: Point3d,\r\n pointB: Point3d,\r\n pointC: Point3d,\r\n lengthA: number,\r\n lengthB: number,\r\n arcRadius: number,\r\n ): GeometryQuery[] | undefined {\r\n const vectorAB = Vector3d.createStartEnd(pointA, pointB); vectorAB.z = 0;\r\n const vectorCB = Vector3d.createStartEnd(pointC, pointB); vectorCB.z = 0;\r\n const unitAB = vectorAB.normalize();\r\n const unitCB = vectorCB.normalize();\r\n if (unitAB === undefined || unitCB === undefined)\r\n return undefined;\r\n const unitPerpAB = unitAB.unitPerpendicularXY();\r\n const unitPerpCB = unitCB.unitPerpendicularXY();\r\n const thetaABC = vectorAB.angleToXY(vectorCB);\r\n const sideA = Geometry.split3WaySign(thetaABC.radians, 1, -1, -1);\r\n const sideB = - sideA;\r\n const radiusA = sideA * Math.abs(arcRadius);\r\n const radiusB = sideB * Math.abs(arcRadius);\r\n const spiralA = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\r\n 0, radiusA, Angle.zero(), undefined, lengthA, undefined, Transform.createIdentity())!;\r\n const spiralB = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\r\n 0, radiusB, Angle.zero(), undefined, lengthB, undefined, Transform.createIdentity())!;\r\n const spiralEndA = spiralA.fractionToPointAndUnitTangent(1.0);\r\n const spiralEndB = spiralB.fractionToPointAndUnitTangent(1.0);\r\n // From the end of spiral, step away to arc center (and this is in local coordinates of each spiral)\r\n const sA = spiralEndA.origin.x - radiusA * spiralEndA.direction.y;\r\n const tA = spiralEndA.origin.y + radiusA * spiralEndA.direction.x;\r\n\r\n const sB = spiralEndB.origin.x - radiusB * spiralEndB.direction.y;\r\n const tB = spiralEndB.origin.y + radiusB * spiralEndB.direction.x;\r\n\r\n // Those local coordinates are rotated to unitAB and unitBC ...\r\n const vectorA = Vector3d.createAdd2Scaled(unitAB, sA, unitPerpAB, tA);\r\n const vectorB = Vector3d.createAdd2Scaled(unitCB, sB, unitPerpCB, tB);\r\n const uv = Vector2d.create();\r\n if (SmallSystem.linearSystem2d(\r\n unitAB.x, -unitCB.x,\r\n unitAB.y, -unitCB.y,\r\n vectorB.x - vectorA.x, vectorB.y - vectorA.y, uv)) {\r\n const tangencyAB = pointB.plusScaled(unitAB, uv.x);\r\n const tangencyCB = pointB.plusScaled(unitCB, uv.y);\r\n const frameA = Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB, Vector3d.unitZ());\r\n const frameB = Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB, Vector3d.unitZ());\r\n spiralA.tryTransformInPlace(frameA);\r\n spiralB.tryTransformInPlace(frameB);\r\n const rayA1 = spiralA.fractionToPointAndUnitTangent(1.0);\r\n const rayB0 = spiralB.fractionToPointAndUnitTangent(1.0);\r\n rayB0.direction.scaleInPlace(-1.0);\r\n const sweep = rayA1.direction.angleToXY(rayB0.direction);\r\n if (radiusA < 0)\r\n sweep.setRadians(- sweep.radians);\r\n const arc = CurveFactory.createArcPointTangentRadius(rayA1.origin, rayA1.direction, radiusA, undefined, sweep)!;\r\n return [spiralA, arc, spiralB];\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return the intersection point of 3 planes.\r\n * @param planeA\r\n * @param planeB\r\n * @param planeC\r\n */\r\n public static planePlaneIntersectionRay(\r\n planeA: PlaneAltitudeEvaluator, planeB: PlaneAltitudeEvaluator): Ray3d | undefined {\r\n const altitudeA = planeA.altitudeXYZ(0, 0, 0);\r\n const altitudeB = planeB.altitudeXYZ(0, 0, 0);\r\n const normalAx = planeA.normalX();\r\n const normalAy = planeA.normalY();\r\n const normalAz = planeA.normalZ();\r\n const normalBx = planeB.normalX();\r\n const normalBy = planeB.normalY();\r\n const normalBz = planeB.normalZ();\r\n const normalCx = Geometry.crossProductXYXY(normalAy, normalAz, normalBy, normalBz);\r\n const normalCy = Geometry.crossProductXYXY(normalAz, normalAx, normalBz, normalBx);\r\n const normalCz = Geometry.crossProductXYXY(normalAx, normalAy, normalBx, normalBy);\r\n const rayOrigin = SmallSystem.linearSystem3d(\r\n normalAx, normalAy, normalAz,\r\n normalBx, normalBy, normalBz,\r\n normalCx, normalCy, normalCz,\r\n -altitudeA, -altitudeB, 0.0);\r\n if (rayOrigin !== undefined) {\r\n return Ray3d.createXYZUVW(rayOrigin.x, rayOrigin.y, rayOrigin.z, normalCx, normalCy, normalCz);\r\n }\r\n return undefined;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Starting at vectorR, move parallel to vectorV until perpendicular to planeNormal\r\n */\r\nfunction moveVectorToPlane(vectorR: Vector3d, vectorV: Vector3d, planeNormal: Vector3d, result?: Vector3d): Vector3d {\r\n // find s such that (vectorR + s * vectorV) DOT planeNormal = 0.\r\n const dotRN = vectorR.dotProduct(planeNormal);\r\n const dotVN = vectorV.dotProduct(planeNormal);\r\n const s = Geometry.safeDivideFraction(dotRN, dotVN, 0.0);\r\n return vectorR.plusScaled(vectorV, -s, result);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"CurveFactory.js","sourceRoot":"","sources":["../../../src/curve/CurveFactory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,6DAA6D;AAE7D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAA0B,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAGtD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,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AC9C,MAAM,CAAC,GAAG,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACzD,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\n// import { Geometry, Angle, AngleSweep } from \"../Geometry\";\r\n\r\nimport { AxisIndex, AxisOrder, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { AngleSweep } from \"../geometry3d/AngleSweep\";\r\nimport { Ellipsoid, GeodesicPathPoint } from \"../geometry3d/Ellipsoid\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3dArrayCarrier } from \"../geometry3d/Point3dArrayCarrier\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolylineOps } from \"../geometry3d/PolylineOps\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Segment1d } from \"../geometry3d/Segment1d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XAndY } from \"../geometry3d/XYZProps\";\r\nimport { SmallSystem } from \"../numerics/SmallSystem\";\r\nimport { IndexedPolyface } from \"../polyface/Polyface\";\r\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\r\nimport { Cone } from \"../solid/Cone\";\r\nimport { RuledSweep } from \"../solid/RuledSweep\";\r\nimport { TorusPipe } from \"../solid/TorusPipe\";\r\nimport { Arc3d, ArcBlendData } from \"./Arc3d\";\r\nimport { CurveChain } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { AnyCurve } from \"./CurveTypes\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineSegment3d } from \"./LineSegment3d\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { Loop } from \"./Loop\";\r\nimport { Path } from \"./Path\";\r\nimport { IntegratedSpiral3d } from \"./spiral/IntegratedSpiral3d\";\r\nimport { IntegratedSpiralTypeName } from \"./spiral/TransitionSpiral3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n// cspell:word CCWXY\r\n\r\n/**\r\n * Interface to carry parallel arrays of planes and sections, and optional geometry assembled from them, as returned by [CurveFactory.createMiteredSweepSections].\r\n * @public\r\n */\r\nexport interface SectionSequenceWithPlanes {\r\n /** the plane of each section */\r\n planes: Plane3dByOriginAndUnitNormal[];\r\n /** section curve projected onto the corresponding plane */\r\n sections: AnyCurve[];\r\n /**\r\n * Optional `RuledSweep` generated from the sections.\r\n * * The `RuledSweep` and sections array refer to the same section objects.\r\n */\r\n ruledSweep?: RuledSweep;\r\n /** Optional mesh generated from the `RuledSweep` generated from the sections. */\r\n mesh?: IndexedPolyface;\r\n}\r\n\r\n/**\r\n * Enumeration of geometric output for [CurveFactory.createMiteredSweepSections].\r\n * @public\r\n */\r\nexport enum MiteredSweepOutputSelect {\r\n /** Output only the parallel arrays of planes and sections. */\r\n Sections = 0,\r\n /** Output planes and sections, as well as the assembled ruled sweep. */\r\n AlsoRuledSweep = 1,\r\n /** Output planes and sections, as well as the assembled ruled sweep and its stroked mesh. */\r\n AlsoMesh = 2,\r\n}\r\n\r\n/**\r\n * Interface bundling options for [CurveFactory.createMiteredSweepSections].\r\n * @public\r\n */\r\nexport interface MiteredSweepOptions {\r\n /** Whether first and last planes are averaged and equated when the centerline is physically closed. Default value is `false`. */\r\n wrapIfPhysicallyClosed?: boolean;\r\n /** Whether to output sections only, or sections plus optional geometry constructed from them. Default value is `MiteredSweepOutputSelect.Sections`. */\r\n outputSelect?: MiteredSweepOutputSelect;\r\n /** How to stroke the ruled sweep if outputting a mesh. If undefined, default stroke options are used. */\r\n strokeOptions?: StrokeOptions;\r\n /** Whether to cap the ruled sweep if outputting a ruled sweep or mesh. Default value is `false`. */\r\n capped?: boolean;\r\n}\r\n\r\n/**\r\n * The `CurveFactory` class contains methods for specialized curve constructions.\r\n * @public\r\n */\r\nexport class CurveFactory {\r\n /** (cautiously) construct and save a line segment between fractional positions. */\r\n private static addPartialSegment(path: Path, allowBackup: boolean, pointA: Point3d | undefined, pointB: Point3d | undefined, fraction0: number, fraction1: number) {\r\n if (allowBackup || (fraction1 > fraction0)) {\r\n if (pointA !== undefined && pointB !== undefined && !Geometry.isAlmostEqualNumber(fraction0, fraction1))\r\n path.tryAddChild(LineSegment3d.create(pointA.interpolate(fraction0, pointB), pointA.interpolate(fraction1, pointB)));\r\n }\r\n }\r\n /**\r\n * Create a circular arc defined by start point, tangent at start point, and end point.\r\n * * The circular arc is swept from start to end toward direction of the `tangentAtStart`.\r\n * * If tangent is parallel to line segment from start to end, return `undefined`.\r\n */\r\n public static createArcPointTangentPoint(start: Point3d, tangentAtStart: Vector3d, end: Point3d): Arc3d | undefined {\r\n const ret = Arc3d.createCircularStartTangentEnd(start, tangentAtStart, end);\r\n if (ret instanceof Arc3d)\r\n return ret;\r\n else\r\n return undefined;\r\n }\r\n /**\r\n * Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.\r\n * * If the radius parameter is a number, that radius is used throughout.\r\n * * If the radius parameter is an array of numbers, `radius[i]` is applied at `point[i]`.\r\n * * Note that since no fillet is constructed at the initial or final point, those entries in `radius[]` are never referenced.\r\n * * A zero radius for any point indicates to leave the as a simple corner.\r\n * @param points point source\r\n * @param radius fillet radius or array of radii indexed to correspond to the points.\r\n * @param allowBackupAlongEdge true to allow edges to be created going \"backwards\" along edges if needed to create the blend.\r\n */\r\n public static createFilletsInLineString(points: LineString3d | IndexedXYZCollection | Point3d[], radius: number | number[], allowBackupAlongEdge: boolean = true): Path | undefined {\r\n if (Array.isArray(points))\r\n return this.createFilletsInLineString(new Point3dArrayCarrier(points), radius, allowBackupAlongEdge);\r\n if (points instanceof LineString3d)\r\n return this.createFilletsInLineString(points.packedPoints, radius, allowBackupAlongEdge);\r\n\r\n const n = points.length;\r\n if (n <= 1)\r\n return undefined;\r\n const pointA = points.getPoint3dAtCheckedPointIndex(0)!;\r\n const pointB = points.getPoint3dAtCheckedPointIndex(1)!;\r\n // remark: n=2 and n=3 cases should fall out from loop logic\r\n const blendArray: ArcBlendData[] = [];\r\n // build one-sided blends at each end . .\r\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointA.clone() });\r\n\r\n for (let i = 1; i + 1 < n; i++) {\r\n const pointC = points.getPoint3dAtCheckedPointIndex(i + 1)!;\r\n let thisRadius = 0;\r\n if (Array.isArray(radius)) {\r\n if (i < radius.length)\r\n thisRadius = radius[i];\r\n } else if (Number.isFinite(radius))\r\n thisRadius = radius;\r\n\r\n if (thisRadius !== 0.0)\r\n blendArray.push(Arc3d.createFilletArc(pointA, pointB, pointC, thisRadius));\r\n else\r\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });\r\n pointA.setFromPoint3d(pointB);\r\n pointB.setFromPoint3d(pointC);\r\n }\r\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });\r\n if (!allowBackupAlongEdge) {\r\n // suppress arcs that have overlap with both neighbors or flood either neighbor ..\r\n for (let i = 1; i + 1 < n; i++) {\r\n const b = blendArray[i];\r\n if (b.fraction10 > 1.0\r\n || b.fraction12 > 1.0\r\n || 1.0 - b.fraction10 < blendArray[i - 1].fraction12\r\n || b.fraction12 > 1.0 - blendArray[i + 1].fraction10) {\r\n b.fraction10 = 0.0;\r\n b.fraction12 = 0.0;\r\n blendArray[i].arc = undefined;\r\n }\r\n }\r\n /* The \"1-b\" logic above prevents this loop from ever doing anything.\r\n // on edge with conflict, suppress the arc with larger fraction\r\n for (let i = 1; i < n; i++) {\r\n const b0 = blendArray[i - 1];\r\n const b1 = blendArray[i];\r\n if (b0.fraction12 > 1 - b1.fraction10) {\r\n const b = b0.fraction12 > b1.fraction12 ? b1 : b0;\r\n b.fraction10 = 0.0;\r\n b.fraction12 = 0.0;\r\n blendArray[i].arc = undefined;\r\n }\r\n } */\r\n }\r\n const path = Path.create();\r\n this.addPartialSegment(path, allowBackupAlongEdge, blendArray[0].point, blendArray[1].point, blendArray[0].fraction12, 1.0 - blendArray[1].fraction10);\r\n // add each path and successor edge ...\r\n for (let i = 1; i + 1 < points.length; i++) {\r\n const b0 = blendArray[i];\r\n const b1 = blendArray[i + 1];\r\n path.tryAddChild(b0.arc);\r\n this.addPartialSegment(path, allowBackupAlongEdge, b0.point, b1.point, b0.fraction12, 1.0 - b1.fraction10);\r\n }\r\n return path;\r\n }\r\n\r\n /** Create a `Loop` with given xy corners and fixed z.\r\n * * The corners always proceed counter clockwise from lower left.\r\n * * If the radius is too large for the outer rectangle size, it is reduced to half of the the smaller x or y size.\r\n */\r\n public static createRectangleXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, filletRadius?: number): Loop {\r\n let radius = Geometry.correctSmallMetricDistance(filletRadius);\r\n const xMin = Math.min(x0, x1);\r\n const xMax = Math.max(x0, x1);\r\n const yMin = Math.min(y0, y1);\r\n const yMax = Math.max(y0, y1);\r\n radius = Math.min(Math.abs(radius), 0.5 * (xMax - xMin), 0.5 * (yMax - yMin));\r\n if (radius === 0.0)\r\n return Loop.createPolygon([Point3d.create(xMin, yMin, z), Point3d.create(xMax, yMin, z), Point3d.create(xMax, yMax, z), Point3d.create(xMin, yMax, z), Point3d.create(xMin, yMin, z)]);\r\n else {\r\n const vectorU = Vector3d.create(radius, 0, 0);\r\n const vectorV = Vector3d.create(0, radius, 0);\r\n const x0A = xMin + radius;\r\n const y0A = yMin + radius;\r\n const x1A = xMax - radius;\r\n const y1A = yMax - radius;\r\n const centers = [Point3d.create(x1A, y1A, z), Point3d.create(x0A, y1A, z), Point3d.create(x0A, y0A, z), Point3d.create(x1A, y0A, z)];\r\n const loop = Loop.create();\r\n for (let i = 0; i < 4; i++) {\r\n const center = centers[i];\r\n const nextCenter = centers[(i + 1) % 4];\r\n const edgeVector = Vector3d.createStartEnd(center, nextCenter);\r\n const arc = Arc3d.create(center, vectorU, vectorV, AngleSweep.createStartEndDegrees(0, 90));\r\n loop.tryAddChild(arc);\r\n const arcEnd = arc.endPoint();\r\n if (!edgeVector.isAlmostZero)\r\n loop.tryAddChild(LineSegment3d.create(arcEnd, arcEnd.plus(edgeVector)));\r\n vectorU.rotate90CCWXY(vectorU);\r\n vectorV.rotate90CCWXY(vectorV);\r\n }\r\n return loop;\r\n }\r\n }\r\n\r\n /**\r\n * If `arcB` is a continuation of `arcA`, extend `arcA` (in place) to include the range of `arcB`\r\n * * This only succeeds if the two arcs are part of identical complete arcs and end of `arcA` matches the beginning of `arcB`.\r\n * @param arcA first arc, modified in place\r\n * @param arcB second arc, unmodified\r\n * @param allowReversed whether to consolidate even when second arc is reversed\r\n * @returns whether `arcA` was modified\r\n */\r\n public static appendToArcInPlace(arcA: Arc3d, arcB: Arc3d, allowReverse: boolean = false): boolean {\r\n if (arcA.center.isAlmostEqual(arcB.center)) {\r\n const sweepSign = Geometry.split3WaySign(arcA.sweep.sweepRadians * arcB.sweep.sweepRadians, -1, 0, 1);\r\n // evaluate derivatives wrt radians (not fraction!), but adjust direction for sweep signs\r\n const endA = arcA.angleToPointAndDerivative(arcA.sweep.fractionToAngle(1.0));\r\n if (arcA.sweep.sweepRadians < 0)\r\n endA.direction.scaleInPlace(-1.0);\r\n const startB = arcB.angleToPointAndDerivative(arcB.sweep.fractionToAngle(0.0));\r\n if (arcB.sweep.sweepRadians < 0)\r\n startB.direction.scaleInPlace(-1.0);\r\n\r\n if (endA.isAlmostEqual(startB)) {\r\n arcA.sweep.setStartEndRadians(arcA.sweep.startRadians, arcA.sweep.startRadians + arcA.sweep.sweepRadians + sweepSign * arcB.sweep.sweepRadians);\r\n return true;\r\n }\r\n // Also ok if negated tangent . ..\r\n if (allowReverse) {\r\n startB.direction.scaleInPlace(-1.0);\r\n if (endA.isAlmostEqual(startB)) {\r\n arcA.sweep.setStartEndRadians(arcA.sweep.startRadians, arcA.sweep.startRadians + arcA.sweep.sweepRadians - sweepSign * arcB.sweep.sweepRadians);\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Return a `Path` containing arcs are on the surface of an ellipsoid and pass through a sequence of points.\r\n * * Each arc passes through the two given endpoints and in the plane containing the true surface normal at given `fractionForIntermediateNormal`\r\n * @param ellipsoid\r\n * @param pathPoints\r\n * @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.\r\n */\r\n public static assembleArcChainOnEllipsoid(ellipsoid: Ellipsoid, pathPoints: GeodesicPathPoint[], fractionForIntermediateNormal: number = 0.5): Path {\r\n const arcPath = Path.create();\r\n for (let i = 0; i + 1 < pathPoints.length; i++) {\r\n const arc = ellipsoid.sectionArcWithIntermediateNormal(\r\n pathPoints[i].toAngles(),\r\n fractionForIntermediateNormal,\r\n pathPoints[i + 1].toAngles());\r\n arcPath.tryAddChild(arc);\r\n }\r\n return arcPath;\r\n }\r\n\r\n private static appendGeometryQueryArray(candidate: GeometryQuery | GeometryQuery[] | undefined, result: GeometryQuery[]) {\r\n if (candidate instanceof GeometryQuery)\r\n result.push(candidate);\r\n else if (Array.isArray(candidate)) {\r\n for (const p of candidate)\r\n this.appendGeometryQueryArray(p, result);\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Create solid primitives for pipe segments (e.g. Cone or TorusPipe) around line and arc primitives.\r\n * @param centerline centerline geometry/\r\n * @param pipeRadius radius of pipe.\r\n */\r\n public static createPipeSegments(centerline: CurvePrimitive | CurveChain, pipeRadius: number): GeometryQuery | GeometryQuery[] | undefined {\r\n if (centerline instanceof LineSegment3d) {\r\n return Cone.createAxisPoints(centerline.startPoint(), centerline.endPoint(), pipeRadius, pipeRadius, false);\r\n } else if (centerline instanceof Arc3d) {\r\n return TorusPipe.createAlongArc(centerline, pipeRadius, false);\r\n } else if (centerline instanceof CurvePrimitive) {\r\n const builder = PolyfaceBuilder.create();\r\n builder.addMiteredPipes(centerline, pipeRadius);\r\n return builder.claimPolyface();\r\n } else if (centerline instanceof CurveChain) {\r\n const result: GeometryQuery[] = [];\r\n for (const p of centerline.children) {\r\n const pipe = this.createPipeSegments(p, pipeRadius);\r\n this.appendGeometryQueryArray(pipe, result);\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * * Create section arcs for mitered pipe.\r\n * * At each end of each pipe, the pipe is cut by the plane that bisects the angle between successive pipe centerlines.\r\n * * The arc definitions are constructed so that lines between corresponding fractional positions on the arcs are\r\n * axial lines on the pipes.\r\n * * This means that each arc definition axes (aka vector0 and vector90) are _not_ perpendicular to each other.\r\n * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis lengths, or a full Arc3d.\r\n * * For semi-axis length input, x corresponds to an ellipse local axis nominally situated parallel to the xy-plane.\r\n * * The center of Arc3d input is translated to the centerline start point to act as initial cross section.\r\n * @param centerline centerline of pipe\r\n * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d\r\n */\r\n public static createMiteredPipeSections(centerline: IndexedXYZCollection, sectionData: number | XAndY | Arc3d): Arc3d[] {\r\n const arcs: Arc3d[] = [];\r\n if (centerline.length < 2)\r\n return [];\r\n\r\n const vector0 = Vector3d.create();\r\n const vector90 = Vector3d.create();\r\n const vectorBC = Vector3d.create();\r\n const currentCenter = Point3d.create();\r\n centerline.vectorIndexIndex(0, 1, vectorBC)!;\r\n centerline.getPoint3dAtUncheckedPointIndex(0, currentCenter);\r\n\r\n let initialSection: Arc3d;\r\n if (sectionData instanceof Arc3d) {\r\n initialSection = sectionData.clone();\r\n initialSection.center.setFrom(currentCenter);\r\n vector0.setFrom(sectionData.vector0);\r\n vector90.setFrom(sectionData.vector90);\r\n } else if (typeof sectionData === \"number\" || Point3d.isXAndY(sectionData)) {\r\n const length0 = (typeof sectionData === \"number\") ? sectionData : sectionData.x;\r\n const length90 = (typeof sectionData === \"number\") ? sectionData : sectionData.y;\r\n const baseFrame = Matrix3d.createRigidHeadsUp(vectorBC, AxisOrder.ZXY);\r\n baseFrame.columnX(vector0).scaleInPlace(length0);\r\n baseFrame.columnY(vector90).scaleInPlace(length90);\r\n initialSection = Arc3d.create(currentCenter, vector0, vector90, AngleSweep.create360());\r\n } else {\r\n return [];\r\n }\r\n arcs.push(initialSection);\r\n\r\n const vectorAB = Vector3d.create();\r\n const bisector = Vector3d.create();\r\n for (let i = 1; i < centerline.length; i++) {\r\n vectorAB.setFromVector3d(vectorBC);\r\n centerline.getPoint3dAtUncheckedPointIndex(i, currentCenter);\r\n if (i + 1 < centerline.length) {\r\n centerline.vectorIndexIndex(i, i + 1, vectorBC)!;\r\n } else {\r\n vectorBC.setFromVector3d(vectorAB);\r\n }\r\n if (vectorAB.normalizeInPlace() && vectorBC.normalizeInPlace()) {\r\n vectorAB.interpolate(0.5, vectorBC, bisector);\r\n // On the end ellipse for this pipe section. ..\r\n // center comes directly from centerline[i]\r\n // vector0 and vector90 are obtained by sweeping the corresponding vectors of the start ellipse to the split plane.\r\n moveVectorToPlane(vector0, vectorAB, bisector, vector0);\r\n moveVectorToPlane(vector90, vectorAB, bisector, vector90);\r\n arcs.push(Arc3d.create(currentCenter, vector0, vector90, AngleSweep.create360()));\r\n }\r\n }\r\n return arcs;\r\n }\r\n\r\n /**\r\n * Sweep the initialSection along each segment of the centerLine until it hits the bisector plane at the next vertex.\r\n * * The caller should place the initialSection on a plane perpendicular to the first edge.\r\n * * This plane is commonly (but not necessarily) through the start point itself.\r\n * * If the geometry is not \"on a perpendicular plane\", the output geometry will still be flattened onto the various planes.\r\n * * In the \"open path\" case (i.e when wrapIfPhysicallyClosed is false or the path does not have matched first and last points)\r\n * the first/last output plane will be at the start/end of the first/last edge and on a perpendicular plane.\r\n * * In the \"closed path\" case, the output plane for the first and last point is the bisector of the start and end planes from the \"open path\" case,\r\n * and the first/last section geometry may be different from `initialSection`.\r\n * * The centerline path does NOT have to be planar, however twisting effects effects will appear in the various bisector planes.\r\n * @param centerline sweep path, e.g., as stroked from a smooth centerline curve\r\n * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the first segment of the centerline.\r\n * @param options options for computation and output\r\n * @return array of sections, starting with `initialSection` projected along the first edge to the first plane.\r\n */\r\n public static createMiteredSweepSections(centerline: IndexedXYZCollection | Point3d[], initialSection: AnyCurve, options: MiteredSweepOptions): SectionSequenceWithPlanes | undefined {\r\n const sectionData: SectionSequenceWithPlanes = { sections: [], planes: [] };\r\n const planes = PolylineOps.createBisectorPlanesForDistinctPoints(centerline, options.wrapIfPhysicallyClosed);\r\n if (planes !== undefined && planes.length > 1) {\r\n // Projection to target plane, constructing sweep direction from two given planes.\r\n // If successful, push the target plane and swept section to the output arrays and return the swept section.\r\n // If unsuccessful, leave the output arrays alone and return the input section.\r\n const doSweepToPlane = function (edgePlane0: Plane3dByOriginAndUnitNormal, edgePlane1: Plane3dByOriginAndUnitNormal,\r\n targetPlane: Plane3dByOriginAndUnitNormal,\r\n section: AnyCurve) {\r\n const sweepVector = Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());\r\n const transform = Transform.createFlattenAlongVectorToPlane(sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef());\r\n if (transform === undefined)\r\n return section;\r\n const section1 = section.cloneTransformed(transform);\r\n if (section1 === undefined)\r\n return section;\r\n sectionData.planes.push(targetPlane);\r\n sectionData.sections.push(section1);\r\n return section1;\r\n };\r\n\r\n let currentSection = doSweepToPlane(planes[0], planes[1], planes[0], initialSection);\r\n for (let i = 1; i < planes.length; i++) {\r\n currentSection = doSweepToPlane(planes[i - 1], planes[i], planes[i], currentSection);\r\n }\r\n\r\n if (options.outputSelect) {\r\n const ruledSweep = RuledSweep.create(sectionData.sections, options.capped ?? false);\r\n if (ruledSweep) {\r\n sectionData.ruledSweep = ruledSweep;\r\n if (MiteredSweepOutputSelect.AlsoMesh === options.outputSelect) {\r\n const builder = PolyfaceBuilder.create(options.strokeOptions);\r\n builder.addRuledSweep(ruledSweep);\r\n sectionData.mesh = builder.claimPolyface();\r\n }\r\n }\r\n }\r\n return sectionData;\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep.\r\n * * The vector from start point to center is in the direction of upVector crossed with tangentA.\r\n * @param start start point.\r\n * @param tangentAtStart vector in tangent direction at the start.\r\n * @param radius signed radius.\r\n * @param upVector optional out-of-plane vector. Defaults to positive Z.\r\n * @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).\r\n */\r\n public static createArcPointTangentRadius(\r\n start: Point3d, tangentAtStart: Vector3d, radius: number, upVector?: Vector3d, sweep?: Angle | AngleSweep,\r\n ): Arc3d | undefined {\r\n return Arc3d.createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep);\r\n }\r\n\r\n /**\r\n * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.\r\n * * First spiral begins at given start point.\r\n * * first tangent aims at shoulder\r\n * * outbound spiral joins line from shoulder to target.\r\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE\r\n * @param startPoint inbound start point.\r\n * @param shoulder point target point for (both) spiral-to-line tangencies\r\n * @return array with the computed spirals, or undefined if failure.\r\n */\r\n public static createLineSpiralSpiralLine(\r\n spiralType: IntegratedSpiralTypeName,\r\n startPoint: Point3d,\r\n shoulderPoint: Point3d,\r\n targetPoint: Point3d,\r\n ): GeometryQuery[] | undefined {\r\n const vectorAB = Vector3d.createStartEnd(startPoint, shoulderPoint);\r\n const vectorBC0 = Vector3d.createStartEnd(shoulderPoint, targetPoint);\r\n const referenceLength = vectorAB.magnitude();\r\n const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);\r\n const lineTurnRadians = vectorAB.angleToXY(vectorBC0);\r\n const spiralTurnRadians = 0.5 * lineTurnRadians.radians;\r\n const radiansBC = radiansAB + lineTurnRadians.radians;\r\n const axesA = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansAB));\r\n const frameA = Transform.createRefs(startPoint.clone(), axesA);\r\n // We know how much it has to turn, and but not the length or end radius.\r\n // make a spiral of referenceLength and scale it back to the junction line\r\n const spiralARefLength = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined,\r\n Angle.createRadians(0), Angle.createRadians(spiralTurnRadians), referenceLength, undefined, frameA);\r\n if (spiralARefLength) {\r\n const midPlanePerpendicularRadians = radiansAB + spiralTurnRadians;\r\n const midPlanePerpendicularVector = Vector3d.createPolar(1.0, Angle.createRadians(midPlanePerpendicularRadians));\r\n const altitudeB = midPlanePerpendicularVector.dotProductStartEnd(startPoint, shoulderPoint);\r\n const altitudeSpiralEnd = midPlanePerpendicularVector.dotProductStartEnd(startPoint, spiralARefLength.endPoint());\r\n const scaleFactor = altitudeB / altitudeSpiralEnd;\r\n const spiralA = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined,\r\n Angle.createRadians(0), Angle.createRadians(spiralTurnRadians), referenceLength * scaleFactor, undefined, frameA)!;\r\n const distanceAB = vectorAB.magnitude();\r\n const vectorBC = Vector3d.createStartEnd(shoulderPoint, targetPoint);\r\n vectorBC.scaleToLength(distanceAB, vectorBC);\r\n const pointC = shoulderPoint.plus(vectorBC);\r\n const axesC = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansBC + Math.PI));\r\n const frameC = Transform.createRefs(pointC, axesC);\r\n const spiralC = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\r\n 0, -spiralA.radius01.x1, Angle.zero(), undefined, spiralA.curveLength(), Segment1d.create(1, 0), frameC)!;\r\n return [spiralA, spiralC];\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.\r\n * * Spiral length is given.\r\n * * tangency points float on both lines.\r\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE\r\n * @param pointA inbound start point.\r\n * @param shoulder point target point for (both) spiral-to-line tangencies\r\n * @param spiralLength for each part of the spiral pair.\r\n * @return array with the computed spirals, or undefined if failure.\r\n */\r\n public static createLineSpiralSpiralLineWithSpiralLength(\r\n spiralType: IntegratedSpiralTypeName,\r\n pointA: Point3d,\r\n pointB: Point3d,\r\n pointC: Point3d,\r\n spiralLength: number,\r\n ): GeometryQuery[] | undefined {\r\n const vectorAB = Vector3d.createStartEnd(pointA, pointB);\r\n const vectorBC = Vector3d.createStartEnd(pointB, pointC);\r\n const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);\r\n const lineTurnAngle = vectorAB.angleToXY(vectorBC);\r\n const spiralTurnRadians = 0.5 * lineTurnAngle.radians;\r\n const bisectorRadians = 0.5 * (Math.PI - lineTurnAngle.radians);\r\n const radiansCB = Math.atan2(-vectorBC.y, -vectorBC.x);\r\n const spiralAB0 = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, Angle.zero(), Angle.createRadians(spiralTurnRadians),\r\n spiralLength, undefined, Transform.createIdentity());\r\n if (spiralAB0) {\r\n const localEndPoint = spiralAB0.fractionToPoint(1);\r\n const distanceAB = pointA.distance(pointB);\r\n const distanceCB = pointC.distance(pointB);\r\n // The spiral eventually has to end on the bisector, at localEndPoint.y height from the inbound line\r\n // distance from shoulder to projection of that point to point E on the inbound line is\r\n const distanceBE = localEndPoint.y / Math.tan(bisectorRadians);\r\n const xFractionAB = Geometry.conditionalDivideFraction(distanceAB - distanceBE - localEndPoint.x, distanceAB);\r\n const xFractionCB = Geometry.conditionalDivideFraction(distanceCB - distanceBE - localEndPoint.x, distanceCB);\r\n if (xFractionAB !== undefined && xFractionCB !== undefined) {\r\n const axesA = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansAB));\r\n const frameAOrigin = pointA.interpolate(xFractionAB, pointB);\r\n const frameA = Transform.createRefs(frameAOrigin, axesA);\r\n const spiralAB = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, Angle.zero(), Angle.createRadians(spiralTurnRadians),\r\n spiralLength, undefined, frameA)!;\r\n const axesB = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansCB));\r\n const frameBOrigin = pointC.interpolate(xFractionCB, pointB);\r\n const frameB = Transform.createRefs(frameBOrigin, axesB);\r\n const spiralBC = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, Angle.zero(), Angle.createRadians(-spiralTurnRadians),\r\n spiralLength, undefined, frameB)!;\r\n return [spiralAB, spiralBC];\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Compute 2 spirals and an arc (all in XY) for a symmetric line-to-line transition.\r\n * Spiral lengths and arc radius are given. (e.g. from design speed standards.)\r\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE\r\n * @param pointA inbound start point.\r\n * @param pointB shoulder (target) point for (both) spiral-to-line tangencies\r\n * @param lengthA inbound spiral length\r\n * @param lengthB outbound spiral length\r\n * @return array with the computed spirals, or undefined if failure.\r\n */\r\n public static createLineSpiralArcSpiralLine(\r\n spiralType: IntegratedSpiralTypeName,\r\n pointA: Point3d,\r\n pointB: Point3d,\r\n pointC: Point3d,\r\n lengthA: number,\r\n lengthB: number,\r\n arcRadius: number,\r\n ): GeometryQuery[] | undefined {\r\n const vectorAB = Vector3d.createStartEnd(pointA, pointB); vectorAB.z = 0;\r\n const vectorCB = Vector3d.createStartEnd(pointC, pointB); vectorCB.z = 0;\r\n const unitAB = vectorAB.normalize();\r\n const unitCB = vectorCB.normalize();\r\n if (unitAB === undefined || unitCB === undefined)\r\n return undefined;\r\n const unitPerpAB = unitAB.unitPerpendicularXY();\r\n const unitPerpCB = unitCB.unitPerpendicularXY();\r\n const thetaABC = vectorAB.angleToXY(vectorCB);\r\n const sideA = Geometry.split3WaySign(thetaABC.radians, 1, -1, -1);\r\n const sideB = - sideA;\r\n const radiusA = sideA * Math.abs(arcRadius);\r\n const radiusB = sideB * Math.abs(arcRadius);\r\n const spiralA = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\r\n 0, radiusA, Angle.zero(), undefined, lengthA, undefined, Transform.createIdentity())!;\r\n const spiralB = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\r\n 0, radiusB, Angle.zero(), undefined, lengthB, undefined, Transform.createIdentity())!;\r\n const spiralEndA = spiralA.fractionToPointAndUnitTangent(1.0);\r\n const spiralEndB = spiralB.fractionToPointAndUnitTangent(1.0);\r\n // From the end of spiral, step away to arc center (and this is in local coordinates of each spiral)\r\n const sA = spiralEndA.origin.x - radiusA * spiralEndA.direction.y;\r\n const tA = spiralEndA.origin.y + radiusA * spiralEndA.direction.x;\r\n\r\n const sB = spiralEndB.origin.x - radiusB * spiralEndB.direction.y;\r\n const tB = spiralEndB.origin.y + radiusB * spiralEndB.direction.x;\r\n\r\n // Those local coordinates are rotated to unitAB and unitBC ...\r\n const vectorA = Vector3d.createAdd2Scaled(unitAB, sA, unitPerpAB, tA);\r\n const vectorB = Vector3d.createAdd2Scaled(unitCB, sB, unitPerpCB, tB);\r\n const uv = Vector2d.create();\r\n if (SmallSystem.linearSystem2d(\r\n unitAB.x, -unitCB.x,\r\n unitAB.y, -unitCB.y,\r\n vectorB.x - vectorA.x, vectorB.y - vectorA.y, uv)) {\r\n const tangencyAB = pointB.plusScaled(unitAB, uv.x);\r\n const tangencyCB = pointB.plusScaled(unitCB, uv.y);\r\n const frameA = Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB, Vector3d.unitZ());\r\n const frameB = Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB, Vector3d.unitZ());\r\n spiralA.tryTransformInPlace(frameA);\r\n spiralB.tryTransformInPlace(frameB);\r\n const rayA1 = spiralA.fractionToPointAndUnitTangent(1.0);\r\n const rayB0 = spiralB.fractionToPointAndUnitTangent(1.0);\r\n rayB0.direction.scaleInPlace(-1.0);\r\n const sweep = rayA1.direction.angleToXY(rayB0.direction);\r\n if (radiusA < 0)\r\n sweep.setRadians(- sweep.radians);\r\n const arc = CurveFactory.createArcPointTangentRadius(rayA1.origin, rayA1.direction, radiusA, undefined, sweep)!;\r\n return [spiralA, arc, spiralB];\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return the intersection point of 3 planes.\r\n * @param planeA\r\n * @param planeB\r\n * @param planeC\r\n */\r\n public static planePlaneIntersectionRay(\r\n planeA: PlaneAltitudeEvaluator, planeB: PlaneAltitudeEvaluator): Ray3d | undefined {\r\n const altitudeA = planeA.altitudeXYZ(0, 0, 0);\r\n const altitudeB = planeB.altitudeXYZ(0, 0, 0);\r\n const normalAx = planeA.normalX();\r\n const normalAy = planeA.normalY();\r\n const normalAz = planeA.normalZ();\r\n const normalBx = planeB.normalX();\r\n const normalBy = planeB.normalY();\r\n const normalBz = planeB.normalZ();\r\n const normalCx = Geometry.crossProductXYXY(normalAy, normalAz, normalBy, normalBz);\r\n const normalCy = Geometry.crossProductXYXY(normalAz, normalAx, normalBz, normalBx);\r\n const normalCz = Geometry.crossProductXYXY(normalAx, normalAy, normalBx, normalBy);\r\n const rayOrigin = SmallSystem.linearSystem3d(\r\n normalAx, normalAy, normalAz,\r\n normalBx, normalBy, normalBz,\r\n normalCx, normalCy, normalCz,\r\n -altitudeA, -altitudeB, 0.0);\r\n if (rayOrigin !== undefined) {\r\n return Ray3d.createXYZUVW(rayOrigin.x, rayOrigin.y, rayOrigin.z, normalCx, normalCy, normalCz);\r\n }\r\n return undefined;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Starting at vectorR, move parallel to vectorV until perpendicular to planeNormal\r\n */\r\nfunction moveVectorToPlane(vectorR: Vector3d, vectorV: Vector3d, planeNormal: Vector3d, result?: Vector3d): Vector3d {\r\n // find s such that (vectorR + s * vectorV) DOT planeNormal = 0.\r\n const dotRN = vectorR.dotProduct(planeNormal);\r\n const dotVN = vectorV.dotProduct(planeNormal);\r\n const s = Geometry.safeDivideFraction(dotRN, dotVN, 0.0);\r\n return vectorR.plusScaled(vectorV, -s, result);\r\n}\r\n"]}
|
|
@@ -13,7 +13,7 @@ import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
|
|
|
13
13
|
import { Range3d } from "../geometry3d/Range";
|
|
14
14
|
import { Ray3d } from "../geometry3d/Ray3d";
|
|
15
15
|
import { Order2Bezier } from "../numerics/BezierPolynomials";
|
|
16
|
-
import { SmallSystem } from "../numerics/
|
|
16
|
+
import { SmallSystem } from "../numerics/SmallSystem";
|
|
17
17
|
import { CurveExtendOptions } from "./CurveExtendMode";
|
|
18
18
|
import { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from "./CurveLocationDetail";
|
|
19
19
|
import { CurvePrimitive } from "./CurvePrimitive";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5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;YAC5E,OAAO,aAAa,CAAC,MAAM,CACzB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,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\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Clipper } from \"../clipping/ClipUtils\";\r\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Order2Bezier } from \"../numerics/BezierPolynomials\";\r\nimport { SmallSystem } from \"../numerics/Polynomials\";\r\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\r\nimport { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from \"./CurveLocationDetail\";\r\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { OffsetOptions } from \"./OffsetOptions\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n\r\n/**\r\n * A LineSegment3d is:\r\n * * A 3d line segment represented by its start and end coordinates\r\n * * startPoint\r\n * * endPoint\r\n * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these\r\n * equivalent forms maps fraction `f` to a point `X(f)`:\r\n * ```\r\n * equation\r\n * X(f) = P_0 + f*(P_1 - P_0)\\newline\r\n * X(f) = (1-f)*P_0 + f*P_1\r\n * ```\r\n * @public\r\n */\r\nexport class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {\r\n /** String name for schema properties */\r\n public readonly curvePrimitiveType = \"lineSegment\";\r\n /** Test if `other` is of class `LineSegment3d` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof LineSegment3d;\r\n }\r\n /** Start point of the segment */\r\n private _point0: Point3d;\r\n /** End point of the segment */\r\n private _point1: Point3d;\r\n /**\r\n * Return REFERENCE to the start point of this segment.\r\n * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.\r\n */\r\n public get point0Ref(): Point3d {\r\n return this._point0;\r\n }\r\n /**\r\n * Return REFERENCE to the end point of this segment.\r\n * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.\r\n */\r\n public get point1Ref(): Point3d {\r\n return this._point1;\r\n }\r\n /** A LineSegment3d extends along its infinite line. */\r\n public override get isExtensibleFractionSpace(): boolean {\r\n return true;\r\n }\r\n /**\r\n * CAPTURE point references as a `LineSegment3d`\r\n * @param point0\r\n * @param point1\r\n */\r\n protected constructor(point0: Point3d, point1: Point3d) {\r\n super();\r\n this._point0 = point0;\r\n this._point1 = point1;\r\n }\r\n /** Set the start and endpoints by capturing input references. */\r\n public setRefs(point0: Point3d, point1: Point3d) {\r\n this._point0 = point0;\r\n this._point1 = point1;\r\n }\r\n /** Set the start and endpoints by cloning the input parameters. */\r\n public set(point0: Point3d, point1: Point3d) {\r\n this._point0 = point0.clone();\r\n this._point1 = point1.clone();\r\n }\r\n /** Copy (clone) data from other */\r\n public setFrom(other: LineSegment3d) {\r\n this._point0.setFrom(other._point0);\r\n this._point1.setFrom(other._point1);\r\n }\r\n /** Return a (clone of) the start point (This is NOT a reference to the stored start point) */\r\n public override startPoint(result?: Point3d): Point3d {\r\n if (result) { result.setFrom(this._point0); return result; }\r\n return this._point0.clone();\r\n }\r\n /** Return a (clone of) the end point (This is NOT a reference to the stored end point) */\r\n public override endPoint(result?: Point3d): Point3d {\r\n if (result) { result.setFrom(this._point1); return result; }\r\n return this._point1.clone();\r\n }\r\n /** Return the point and derivative vector at fractional position along the line segment. */\r\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\r\n result = result ? result : Ray3d.createZero();\r\n result.direction.setStartEnd(this._point0, this._point1);\r\n this._point0.interpolate(fraction, this._point1, result.origin);\r\n return result;\r\n }\r\n /**\r\n * Construct a plane with\r\n * * origin at the fractional position along the line segment\r\n * * x axis is the first derivative, i.e. along the line segment\r\n * * y axis is the second derivative, i.e. 000\r\n */\r\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n result = result ? result : Plane3dByOriginAndVectors.createXYPlane();\r\n result.vectorU.setStartEnd(this._point0, this._point1);\r\n result.vectorV.set(0, 0, 0);\r\n this._point0.interpolate(fraction, this._point1, result.origin);\r\n return result;\r\n }\r\n /** Clone the LineSegment3d */\r\n public clone(): LineSegment3d {\r\n return LineSegment3d.create(this._point0, this._point1);\r\n }\r\n /** Clone and apply transform to the clone. */\r\n public cloneTransformed(transform: Transform): LineSegment3d { // we know tryTransformInPlace succeeds.\r\n const c = this.clone();\r\n c.tryTransformInPlace(transform);\r\n return c;\r\n }\r\n /** Create with start and end points. The point contents are cloned into the LineSegment3d. */\r\n public static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d {\r\n if (result) {\r\n result.set(point0, point1); // and this will clone them !!\r\n return result;\r\n }\r\n return new LineSegment3d(point0.clone(), point1.clone());\r\n }\r\n /** Create with start and end points. The point contents are CAPTURED into the result */\r\n public static createCapture(point0: Point3d, point1: Point3d): LineSegment3d {\r\n return new LineSegment3d(point0, point1);\r\n }\r\n /**\r\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\r\n * @param x0 start point x coordinate.\r\n * @param y0 start point y coordinate.\r\n * @param x1 end point x coordinate.\r\n * @param y1 end point y coordinate.\r\n * @param z z coordinate to use for both points.\r\n * @param result optional existing LineSegment to be reinitialized.\r\n */\r\n public static createXYXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, result?: LineSegment3d) {\r\n if (result) {\r\n result._point0.set(x0, y0, z);\r\n result._point1.set(x1, y1, z);\r\n return result;\r\n }\r\n return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));\r\n }\r\n /**\r\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\r\n * @param x0 start point x coordinate.\r\n * @param y0 start point y coordinate.\r\n * @param x1 end point x coordinate.\r\n * @param y1 end point y coordinate.\r\n * @param z z coordinate to use for both points.\r\n * @param result optional existing LineSegment to be reinitialized.\r\n */\r\n public static createXYZXYZ(\r\n x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, result?: LineSegment3d,\r\n ): LineSegment3d {\r\n if (result) {\r\n result._point0.set(x0, y0, z0);\r\n result._point1.set(x1, y1, z1);\r\n return result;\r\n }\r\n return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));\r\n }\r\n /** Return the point at fractional position along the line segment. */\r\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\r\n return this._point0.interpolate(fraction, this._point1, result);\r\n }\r\n /** Return the length of the segment. */\r\n public override curveLength(): number {\r\n return this._point0.distance(this._point1);\r\n }\r\n /** Return the length of the partial segment between fractions. */\r\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\r\n return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);\r\n }\r\n /** Return the length of the segment. */\r\n public quickLength(): number {\r\n return this.curveLength();\r\n }\r\n /**\r\n * Returns a curve location detail with both xyz and fractional coordinates of the closest point.\r\n * @param spacePoint point in space\r\n * @param extend if false, only return points within the bounded line segment. If true, allow the point to be on\r\n * the unbounded line that contains the bounded segment.\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point\r\n */\r\n public override closestPoint(\r\n spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);\r\n fraction = CurveExtendOptions.correctFraction(extend, fraction);\r\n result = CurveLocationDetail.create(this, result);\r\n result.fraction = fraction;\r\n this._point0.interpolate(fraction, this._point1, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = result.point.distance(spacePoint);\r\n return result;\r\n }\r\n /**\r\n * Compute the closest approach between a pair of line segments.\r\n * * The approach distance is returned in the `a` fields of the details.\r\n * @param segmentA first line segment\r\n * @param extendA how to extend segmentA forward/backward\r\n * @param segmentB second line segment\r\n * @param extendB how to extend segmentB forward/backward\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns pair of details, one per segment, each with `a` field set to the closest approach distance\r\n */\r\n public static closestApproach(\r\n segmentA: LineSegment3d,\r\n extendA: VariantCurveExtendParameter,\r\n segmentB: LineSegment3d,\r\n extendB: VariantCurveExtendParameter,\r\n result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair | undefined {\r\n const unboundedFractions = Vector2d.create();\r\n if (result === undefined)\r\n result = CurveLocationDetailPair.createCapture(CurveLocationDetail.create(), CurveLocationDetail.create());\r\n if (SmallSystem.lineSegment3dClosestApproachUnbounded(segmentA._point0, segmentA._point1, segmentB._point0, segmentB._point1, unboundedFractions)) {\r\n // There is a simple approach between the unbounded segments. Maybe its a really easy case ...\r\n const fractionA = CurveExtendOptions.correctFraction(extendA, unboundedFractions.x);\r\n const fractionB = CurveExtendOptions.correctFraction(extendB, unboundedFractions.y);\r\n // if neither fraction was corrected, just accept !!!\r\n if (fractionA === unboundedFractions.x && fractionB === unboundedFractions.y) {\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, fractionA, result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, fractionB, result.detailB);\r\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\r\n return result;\r\n }\r\n // One or both of the fractions were clamped back to an endpoint.\r\n // Claim: (????!!!????) The only proximity candidates that matter are from clamped point onto the other.\r\n if (fractionA !== unboundedFractions.x && fractionB !== unboundedFractions.y) {\r\n // Fill in (in the result) both individual details with \"projected\" points and distance.\r\n // The \"loser\" will have its contents replaced.\r\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\r\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\r\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\r\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\r\n if (result.detailA.a <= result.detailB.a) {\r\n CurveLocationDetail.createCurveFractionPoint(segmentB, fractionB, clampedPointOnB, result.detailB);\r\n } else {\r\n CurveLocationDetail.createCurveFractionPoint(segmentA, fractionA, clampedPointOnA, result.detailA);\r\n }\r\n } else if (fractionB !== unboundedFractions.y) {\r\n // B (only) was clamped.\r\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\r\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\r\n result.detailB.setCurve(segmentB);\r\n result.detailB.point.setFrom(clampedPointOnB);\r\n result.detailB.fraction = fractionB;\r\n } else {\r\n // fractionA was clamped.\r\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\r\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\r\n result.detailA.setCurve(segmentA);\r\n result.detailA.point.setFrom(clampedPointOnA);\r\n result.detailA.fraction = fractionA;\r\n }\r\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\r\n return result;\r\n }\r\n // (probably? certainly?) parallel (possibly coincident) lines.\r\n // run all 4 endpoint-to-other cases . . . reassemble carefully ...\r\n const resultSet = [\r\n segmentA.closestPoint(segmentB._point0, extendA),\r\n segmentA.closestPoint(segmentB._point1, extendA),\r\n segmentB.closestPoint(segmentA._point0, extendB),\r\n segmentB.closestPoint(segmentA._point1, extendB),\r\n ];\r\n let dMin = resultSet[0].a;\r\n let iMin = 0;\r\n for (let i = 1; i < 4; i++) {\r\n if (resultSet[i].a < dMin) {\r\n iMin = i;\r\n dMin = resultSet[i].a;\r\n }\r\n }\r\n if (iMin === 0) {\r\n resultSet[0].clone(result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 0.0, result.detailB);\r\n result.detailB.a = result.detailA.a;\r\n } else if (iMin === 1) {\r\n resultSet[1].clone(result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 1.0, result.detailB);\r\n result.detailB.a = result.detailA.a;\r\n } else if (iMin === 2) {\r\n resultSet[2].clone(result.detailB);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 0.0, result.detailA);\r\n result.detailA.a = result.detailB.a;\r\n } else {\r\n assert(iMin === 3);\r\n resultSet[3].clone(result.detailB);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 1.0, result.detailA);\r\n result.detailA.a = result.detailB.a;\r\n }\r\n return result;\r\n }\r\n /** Swap the endpoint references. */\r\n public reverseInPlace(): void {\r\n const a = this._point0;\r\n this._point0 = this._point1;\r\n this._point1 = a;\r\n }\r\n /** Transform the two endpoints of this LinSegment. */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n this._point0 = transform.multiplyPoint3d(this._point0, this._point0);\r\n this._point1 = transform.multiplyPoint3d(this._point1, this._point1);\r\n return true;\r\n }\r\n /** Test if both endpoints are in a plane (within tolerance) */\r\n public isInPlane(plane: PlaneAltitudeEvaluator): boolean {\r\n return Geometry.isSmallMetricDistance(plane.altitude(this._point0))\r\n && Geometry.isSmallMetricDistance(plane.altitude(this._point1));\r\n }\r\n /**\r\n * Compute points of simple (transverse) with a plane.\r\n * * Use isInPlane to test if the line segment is completely in the plane.\r\n */\r\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\r\n const h0 = plane.altitude(this._point0);\r\n const h1 = plane.altitude(this._point1);\r\n const fraction = Order2Bezier.solveCoffs(h0, h1);\r\n let numIntersection = 0;\r\n if (fraction !== undefined) {\r\n numIntersection++;\r\n const detail = CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));\r\n detail.intervalRole = CurveIntervalRole.isolated;\r\n result.push(detail);\r\n }\r\n return numIntersection;\r\n }\r\n /**\r\n * Extend a range to include the (optionally transformed) line segment\r\n * @param range range to extend\r\n * @param transform optional transform to apply to the end points\r\n */\r\n public extendRange(range: Range3d, transform?: Transform): void {\r\n if (transform) {\r\n range.extendTransformedPoint(transform, this._point0);\r\n range.extendTransformedPoint(transform, this._point1);\r\n } else {\r\n range.extendPoint(this._point0);\r\n range.extendPoint(this._point1);\r\n }\r\n }\r\n /**\r\n * Construct a line from either of these json forms:\r\n *\r\n * * object with named start and end:\r\n * `{startPoint: pointValue, endPoint: pointValue}`\r\n * * array of two point values:\r\n * `[pointValue, pointValue]`\r\n * The point values are any values accepted by the Point3d method setFromJSON.\r\n * @param json data to parse.\r\n */\r\n public setFromJSON(json?: any) {\r\n if (!json) {\r\n this._point0.set(0, 0, 0);\r\n this._point1.set(1, 0, 0);\r\n return;\r\n } else if (json.startPoint && json.endPoint) { // {startPoint:json point, endPoint:json point}\r\n this._point0.setFromJSON(json.startPoint);\r\n this._point1.setFromJSON(json.endPoint);\r\n } else if (Array.isArray(json)\r\n && json.length > 1) { // [json point, json point]\r\n this._point0.setFromJSON(json[0]);\r\n this._point1.setFromJSON(json[1]);\r\n }\r\n }\r\n /** A simple line segment's fraction and distance are proportional. */\r\n public override getFractionToDistanceScale(): number | undefined {\r\n return this.curveLength();\r\n }\r\n /**\r\n * Place the lineSegment3d start and points in a json object\r\n * @return {*} [[x,y,z],[x,y,z]]\r\n */\r\n public toJSON(): any {\r\n return [this._point0.toJSON(), this._point1.toJSON()];\r\n }\r\n /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */\r\n public static fromJSON(json?: any): LineSegment3d {\r\n const result = new LineSegment3d(Point3d.createZero(), Point3d.create());\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Near equality test with `other`. */\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof LineSegment3d) {\r\n const ls = other;\r\n return this._point0.isAlmostEqual(ls._point0) && this._point1.isAlmostEqual(ls._point1);\r\n }\r\n return false;\r\n }\r\n /** Emit strokes to caller-supplied linestring */\r\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\r\n const numStroke = this.computeStrokeCountForOptions(options);\r\n dest.appendFractionalStrokePoints(this, numStroke, 0.0, 1.0);\r\n }\r\n /** Emit strokes to caller-supplied handler */\r\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\r\n handler.startCurvePrimitive(this);\r\n const numStroke = this.computeStrokeCountForOptions(options);\r\n handler.announceSegmentInterval(this, this._point0, this._point1, numStroke, 0.0, 1.0);\r\n handler.endCurvePrimitive(this);\r\n }\r\n /**\r\n * Return the stroke count required for given options.\r\n * @param options StrokeOptions that determine count\r\n */\r\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\r\n let numStroke = 1;\r\n if (options) {\r\n if (options.maxEdgeLength)\r\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\r\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\r\n }\r\n return numStroke;\r\n }\r\n /** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleLineSegment3d(this);\r\n }\r\n /**\r\n * Find intervals of this curve primitive that are interior to a clipper\r\n * @param clipper clip structure (e.g. clip planes)\r\n * @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`\r\n */\r\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n return clipper.announceClippedSegmentIntervals(\r\n 0.0, 1.0, this._point0, this._point1,\r\n announce ? (fraction0: number, fraction1: number) => announce(fraction0, fraction1, this) : undefined,\r\n );\r\n }\r\n /**\r\n * Return (if possible) a curve primitive which is a portion of this curve.\r\n * @param fractionA [in] start fraction\r\n * @param fractionB [in] end fraction\r\n */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): LineSegment3d {\r\n return LineSegment3d.create(this.fractionToPoint(fractionA), this.fractionToPoint(fractionB));\r\n }\r\n /**\r\n * Returns a (high accuracy) range of the curve between fractional positions\r\n * * Default implementation returns teh range of the curve from clonePartialCurve\r\n */\r\n public override rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\r\n // (This is cheap -- don't bother testing for fraction0===fraction1)\r\n if (!transform) {\r\n const range = Range3d.create();\r\n range.extendInterpolated(this._point0, fraction0, this._point1);\r\n range.extendInterpolated(this._point0, fraction1, this._point1);\r\n return range;\r\n }\r\n const point0 = this.fractionToPoint(fraction0);\r\n const point1 = this.fractionToPoint(fraction1);\r\n if (transform) {\r\n transform.multiplyPoint3d(point0, point0);\r\n transform.multiplyPoint3d(point1, point1);\r\n }\r\n return Range3d.create(point0, point1);\r\n }\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\r\n */\r\n public override constructOffsetXY(\r\n offsetDistanceOrOptions: number | OffsetOptions,\r\n ): CurvePrimitive | CurvePrimitive[] | undefined {\r\n const offsetVec = Vector3d.createStartEnd(this._point0, this._point1);\r\n if (offsetVec.normalizeInPlace()) {\r\n offsetVec.rotate90CCWXY(offsetVec);\r\n const offsetDist = OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);\r\n return LineSegment3d.create(\r\n this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist),\r\n );\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\r\n * projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,+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ACzB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,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\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Clipper } from \"../clipping/ClipUtils\";\r\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Order2Bezier } from \"../numerics/BezierPolynomials\";\r\nimport { SmallSystem } from \"../numerics/SmallSystem\";\r\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\r\nimport { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from \"./CurveLocationDetail\";\r\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { OffsetOptions } from \"./OffsetOptions\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n\r\n/**\r\n * A LineSegment3d is:\r\n * * A 3d line segment represented by its start and end coordinates\r\n * * startPoint\r\n * * endPoint\r\n * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these\r\n * equivalent forms maps fraction `f` to a point `X(f)`:\r\n * ```\r\n * equation\r\n * X(f) = P_0 + f*(P_1 - P_0)\\newline\r\n * X(f) = (1-f)*P_0 + f*P_1\r\n * ```\r\n * @public\r\n */\r\nexport class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {\r\n /** String name for schema properties */\r\n public readonly curvePrimitiveType = \"lineSegment\";\r\n /** Test if `other` is of class `LineSegment3d` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof LineSegment3d;\r\n }\r\n /** Start point of the segment */\r\n private _point0: Point3d;\r\n /** End point of the segment */\r\n private _point1: Point3d;\r\n /**\r\n * Return REFERENCE to the start point of this segment.\r\n * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.\r\n */\r\n public get point0Ref(): Point3d {\r\n return this._point0;\r\n }\r\n /**\r\n * Return REFERENCE to the end point of this segment.\r\n * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.\r\n */\r\n public get point1Ref(): Point3d {\r\n return this._point1;\r\n }\r\n /** A LineSegment3d extends along its infinite line. */\r\n public override get isExtensibleFractionSpace(): boolean {\r\n return true;\r\n }\r\n /**\r\n * CAPTURE point references as a `LineSegment3d`\r\n * @param point0\r\n * @param point1\r\n */\r\n protected constructor(point0: Point3d, point1: Point3d) {\r\n super();\r\n this._point0 = point0;\r\n this._point1 = point1;\r\n }\r\n /** Set the start and endpoints by capturing input references. */\r\n public setRefs(point0: Point3d, point1: Point3d) {\r\n this._point0 = point0;\r\n this._point1 = point1;\r\n }\r\n /** Set the start and endpoints by cloning the input parameters. */\r\n public set(point0: Point3d, point1: Point3d) {\r\n this._point0 = point0.clone();\r\n this._point1 = point1.clone();\r\n }\r\n /** Copy (clone) data from other */\r\n public setFrom(other: LineSegment3d) {\r\n this._point0.setFrom(other._point0);\r\n this._point1.setFrom(other._point1);\r\n }\r\n /** Return a (clone of) the start point (This is NOT a reference to the stored start point) */\r\n public override startPoint(result?: Point3d): Point3d {\r\n if (result) { result.setFrom(this._point0); return result; }\r\n return this._point0.clone();\r\n }\r\n /** Return a (clone of) the end point (This is NOT a reference to the stored end point) */\r\n public override endPoint(result?: Point3d): Point3d {\r\n if (result) { result.setFrom(this._point1); return result; }\r\n return this._point1.clone();\r\n }\r\n /** Return the point and derivative vector at fractional position along the line segment. */\r\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\r\n result = result ? result : Ray3d.createZero();\r\n result.direction.setStartEnd(this._point0, this._point1);\r\n this._point0.interpolate(fraction, this._point1, result.origin);\r\n return result;\r\n }\r\n /**\r\n * Construct a plane with\r\n * * origin at the fractional position along the line segment\r\n * * x axis is the first derivative, i.e. along the line segment\r\n * * y axis is the second derivative, i.e. 000\r\n */\r\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n result = result ? result : Plane3dByOriginAndVectors.createXYPlane();\r\n result.vectorU.setStartEnd(this._point0, this._point1);\r\n result.vectorV.set(0, 0, 0);\r\n this._point0.interpolate(fraction, this._point1, result.origin);\r\n return result;\r\n }\r\n /** Clone the LineSegment3d */\r\n public clone(): LineSegment3d {\r\n return LineSegment3d.create(this._point0, this._point1);\r\n }\r\n /** Clone and apply transform to the clone. */\r\n public cloneTransformed(transform: Transform): LineSegment3d { // we know tryTransformInPlace succeeds.\r\n const c = this.clone();\r\n c.tryTransformInPlace(transform);\r\n return c;\r\n }\r\n /** Create with start and end points. The point contents are cloned into the LineSegment3d. */\r\n public static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d {\r\n if (result) {\r\n result.set(point0, point1); // and this will clone them !!\r\n return result;\r\n }\r\n return new LineSegment3d(point0.clone(), point1.clone());\r\n }\r\n /** Create with start and end points. The point contents are CAPTURED into the result */\r\n public static createCapture(point0: Point3d, point1: Point3d): LineSegment3d {\r\n return new LineSegment3d(point0, point1);\r\n }\r\n /**\r\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\r\n * @param x0 start point x coordinate.\r\n * @param y0 start point y coordinate.\r\n * @param x1 end point x coordinate.\r\n * @param y1 end point y coordinate.\r\n * @param z z coordinate to use for both points.\r\n * @param result optional existing LineSegment to be reinitialized.\r\n */\r\n public static createXYXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, result?: LineSegment3d) {\r\n if (result) {\r\n result._point0.set(x0, y0, z);\r\n result._point1.set(x1, y1, z);\r\n return result;\r\n }\r\n return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));\r\n }\r\n /**\r\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\r\n * @param x0 start point x coordinate.\r\n * @param y0 start point y coordinate.\r\n * @param x1 end point x coordinate.\r\n * @param y1 end point y coordinate.\r\n * @param z z coordinate to use for both points.\r\n * @param result optional existing LineSegment to be reinitialized.\r\n */\r\n public static createXYZXYZ(\r\n x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, result?: LineSegment3d,\r\n ): LineSegment3d {\r\n if (result) {\r\n result._point0.set(x0, y0, z0);\r\n result._point1.set(x1, y1, z1);\r\n return result;\r\n }\r\n return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));\r\n }\r\n /** Return the point at fractional position along the line segment. */\r\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\r\n return this._point0.interpolate(fraction, this._point1, result);\r\n }\r\n /** Return the length of the segment. */\r\n public override curveLength(): number {\r\n return this._point0.distance(this._point1);\r\n }\r\n /** Return the length of the partial segment between fractions. */\r\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\r\n return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);\r\n }\r\n /** Return the length of the segment. */\r\n public quickLength(): number {\r\n return this.curveLength();\r\n }\r\n /**\r\n * Returns a curve location detail with both xyz and fractional coordinates of the closest point.\r\n * @param spacePoint point in space\r\n * @param extend if false, only return points within the bounded line segment. If true, allow the point to be on\r\n * the unbounded line that contains the bounded segment.\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point\r\n */\r\n public override closestPoint(\r\n spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);\r\n fraction = CurveExtendOptions.correctFraction(extend, fraction);\r\n result = CurveLocationDetail.create(this, result);\r\n result.fraction = fraction;\r\n this._point0.interpolate(fraction, this._point1, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = result.point.distance(spacePoint);\r\n return result;\r\n }\r\n /**\r\n * Compute the closest approach between a pair of line segments.\r\n * * The approach distance is returned in the `a` fields of the details.\r\n * @param segmentA first line segment\r\n * @param extendA how to extend segmentA forward/backward\r\n * @param segmentB second line segment\r\n * @param extendB how to extend segmentB forward/backward\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns pair of details, one per segment, each with `a` field set to the closest approach distance\r\n */\r\n public static closestApproach(\r\n segmentA: LineSegment3d,\r\n extendA: VariantCurveExtendParameter,\r\n segmentB: LineSegment3d,\r\n extendB: VariantCurveExtendParameter,\r\n result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair | undefined {\r\n const unboundedFractions = Vector2d.create();\r\n if (result === undefined)\r\n result = CurveLocationDetailPair.createCapture(CurveLocationDetail.create(), CurveLocationDetail.create());\r\n if (SmallSystem.lineSegment3dClosestApproachUnbounded(segmentA._point0, segmentA._point1, segmentB._point0, segmentB._point1, unboundedFractions)) {\r\n // There is a simple approach between the unbounded segments. Maybe its a really easy case ...\r\n const fractionA = CurveExtendOptions.correctFraction(extendA, unboundedFractions.x);\r\n const fractionB = CurveExtendOptions.correctFraction(extendB, unboundedFractions.y);\r\n // if neither fraction was corrected, just accept !!!\r\n if (fractionA === unboundedFractions.x && fractionB === unboundedFractions.y) {\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, fractionA, result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, fractionB, result.detailB);\r\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\r\n return result;\r\n }\r\n // One or both of the fractions were clamped back to an endpoint.\r\n // Claim: (????!!!????) The only proximity candidates that matter are from clamped point onto the other.\r\n if (fractionA !== unboundedFractions.x && fractionB !== unboundedFractions.y) {\r\n // Fill in (in the result) both individual details with \"projected\" points and distance.\r\n // The \"loser\" will have its contents replaced.\r\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\r\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\r\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\r\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\r\n if (result.detailA.a <= result.detailB.a) {\r\n CurveLocationDetail.createCurveFractionPoint(segmentB, fractionB, clampedPointOnB, result.detailB);\r\n } else {\r\n CurveLocationDetail.createCurveFractionPoint(segmentA, fractionA, clampedPointOnA, result.detailA);\r\n }\r\n } else if (fractionB !== unboundedFractions.y) {\r\n // B (only) was clamped.\r\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\r\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\r\n result.detailB.setCurve(segmentB);\r\n result.detailB.point.setFrom(clampedPointOnB);\r\n result.detailB.fraction = fractionB;\r\n } else {\r\n // fractionA was clamped.\r\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\r\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\r\n result.detailA.setCurve(segmentA);\r\n result.detailA.point.setFrom(clampedPointOnA);\r\n result.detailA.fraction = fractionA;\r\n }\r\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\r\n return result;\r\n }\r\n // (probably? certainly?) parallel (possibly coincident) lines.\r\n // run all 4 endpoint-to-other cases . . . reassemble carefully ...\r\n const resultSet = [\r\n segmentA.closestPoint(segmentB._point0, extendA),\r\n segmentA.closestPoint(segmentB._point1, extendA),\r\n segmentB.closestPoint(segmentA._point0, extendB),\r\n segmentB.closestPoint(segmentA._point1, extendB),\r\n ];\r\n let dMin = resultSet[0].a;\r\n let iMin = 0;\r\n for (let i = 1; i < 4; i++) {\r\n if (resultSet[i].a < dMin) {\r\n iMin = i;\r\n dMin = resultSet[i].a;\r\n }\r\n }\r\n if (iMin === 0) {\r\n resultSet[0].clone(result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 0.0, result.detailB);\r\n result.detailB.a = result.detailA.a;\r\n } else if (iMin === 1) {\r\n resultSet[1].clone(result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 1.0, result.detailB);\r\n result.detailB.a = result.detailA.a;\r\n } else if (iMin === 2) {\r\n resultSet[2].clone(result.detailB);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 0.0, result.detailA);\r\n result.detailA.a = result.detailB.a;\r\n } else {\r\n assert(iMin === 3);\r\n resultSet[3].clone(result.detailB);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 1.0, result.detailA);\r\n result.detailA.a = result.detailB.a;\r\n }\r\n return result;\r\n }\r\n /** Swap the endpoint references. */\r\n public reverseInPlace(): void {\r\n const a = this._point0;\r\n this._point0 = this._point1;\r\n this._point1 = a;\r\n }\r\n /** Transform the two endpoints of this LinSegment. */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n this._point0 = transform.multiplyPoint3d(this._point0, this._point0);\r\n this._point1 = transform.multiplyPoint3d(this._point1, this._point1);\r\n return true;\r\n }\r\n /** Test if both endpoints are in a plane (within tolerance) */\r\n public isInPlane(plane: PlaneAltitudeEvaluator): boolean {\r\n return Geometry.isSmallMetricDistance(plane.altitude(this._point0))\r\n && Geometry.isSmallMetricDistance(plane.altitude(this._point1));\r\n }\r\n /**\r\n * Compute points of simple (transverse) with a plane.\r\n * * Use isInPlane to test if the line segment is completely in the plane.\r\n */\r\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\r\n const h0 = plane.altitude(this._point0);\r\n const h1 = plane.altitude(this._point1);\r\n const fraction = Order2Bezier.solveCoffs(h0, h1);\r\n let numIntersection = 0;\r\n if (fraction !== undefined) {\r\n numIntersection++;\r\n const detail = CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));\r\n detail.intervalRole = CurveIntervalRole.isolated;\r\n result.push(detail);\r\n }\r\n return numIntersection;\r\n }\r\n /**\r\n * Extend a range to include the (optionally transformed) line segment\r\n * @param range range to extend\r\n * @param transform optional transform to apply to the end points\r\n */\r\n public extendRange(range: Range3d, transform?: Transform): void {\r\n if (transform) {\r\n range.extendTransformedPoint(transform, this._point0);\r\n range.extendTransformedPoint(transform, this._point1);\r\n } else {\r\n range.extendPoint(this._point0);\r\n range.extendPoint(this._point1);\r\n }\r\n }\r\n /**\r\n * Construct a line from either of these json forms:\r\n *\r\n * * object with named start and end:\r\n * `{startPoint: pointValue, endPoint: pointValue}`\r\n * * array of two point values:\r\n * `[pointValue, pointValue]`\r\n * The point values are any values accepted by the Point3d method setFromJSON.\r\n * @param json data to parse.\r\n */\r\n public setFromJSON(json?: any) {\r\n if (!json) {\r\n this._point0.set(0, 0, 0);\r\n this._point1.set(1, 0, 0);\r\n return;\r\n } else if (json.startPoint && json.endPoint) { // {startPoint:json point, endPoint:json point}\r\n this._point0.setFromJSON(json.startPoint);\r\n this._point1.setFromJSON(json.endPoint);\r\n } else if (Array.isArray(json)\r\n && json.length > 1) { // [json point, json point]\r\n this._point0.setFromJSON(json[0]);\r\n this._point1.setFromJSON(json[1]);\r\n }\r\n }\r\n /** A simple line segment's fraction and distance are proportional. */\r\n public override getFractionToDistanceScale(): number | undefined {\r\n return this.curveLength();\r\n }\r\n /**\r\n * Place the lineSegment3d start and points in a json object\r\n * @return {*} [[x,y,z],[x,y,z]]\r\n */\r\n public toJSON(): any {\r\n return [this._point0.toJSON(), this._point1.toJSON()];\r\n }\r\n /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */\r\n public static fromJSON(json?: any): LineSegment3d {\r\n const result = new LineSegment3d(Point3d.createZero(), Point3d.create());\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Near equality test with `other`. */\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof LineSegment3d) {\r\n const ls = other;\r\n return this._point0.isAlmostEqual(ls._point0) && this._point1.isAlmostEqual(ls._point1);\r\n }\r\n return false;\r\n }\r\n /** Emit strokes to caller-supplied linestring */\r\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\r\n const numStroke = this.computeStrokeCountForOptions(options);\r\n dest.appendFractionalStrokePoints(this, numStroke, 0.0, 1.0);\r\n }\r\n /** Emit strokes to caller-supplied handler */\r\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\r\n handler.startCurvePrimitive(this);\r\n const numStroke = this.computeStrokeCountForOptions(options);\r\n handler.announceSegmentInterval(this, this._point0, this._point1, numStroke, 0.0, 1.0);\r\n handler.endCurvePrimitive(this);\r\n }\r\n /**\r\n * Return the stroke count required for given options.\r\n * @param options StrokeOptions that determine count\r\n */\r\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\r\n let numStroke = 1;\r\n if (options) {\r\n if (options.maxEdgeLength)\r\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\r\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\r\n }\r\n return numStroke;\r\n }\r\n /** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleLineSegment3d(this);\r\n }\r\n /**\r\n * Find intervals of this curve primitive that are interior to a clipper\r\n * @param clipper clip structure (e.g. clip planes)\r\n * @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`\r\n */\r\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n return clipper.announceClippedSegmentIntervals(\r\n 0.0, 1.0, this._point0, this._point1,\r\n announce ? (fraction0: number, fraction1: number) => announce(fraction0, fraction1, this) : undefined,\r\n );\r\n }\r\n /**\r\n * Return (if possible) a curve primitive which is a portion of this curve.\r\n * @param fractionA [in] start fraction\r\n * @param fractionB [in] end fraction\r\n */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): LineSegment3d {\r\n return LineSegment3d.create(this.fractionToPoint(fractionA), this.fractionToPoint(fractionB));\r\n }\r\n /**\r\n * Returns a (high accuracy) range of the curve between fractional positions\r\n * * Default implementation returns teh range of the curve from clonePartialCurve\r\n */\r\n public override rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\r\n // (This is cheap -- don't bother testing for fraction0===fraction1)\r\n if (!transform) {\r\n const range = Range3d.create();\r\n range.extendInterpolated(this._point0, fraction0, this._point1);\r\n range.extendInterpolated(this._point0, fraction1, this._point1);\r\n return range;\r\n }\r\n const point0 = this.fractionToPoint(fraction0);\r\n const point1 = this.fractionToPoint(fraction1);\r\n if (transform) {\r\n transform.multiplyPoint3d(point0, point0);\r\n transform.multiplyPoint3d(point1, point1);\r\n }\r\n return Range3d.create(point0, point1);\r\n }\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\r\n */\r\n public override constructOffsetXY(\r\n offsetDistanceOrOptions: number | OffsetOptions,\r\n ): CurvePrimitive | CurvePrimitive[] | undefined {\r\n const offsetVec = Vector3d.createStartEnd(this._point0, this._point1);\r\n if (offsetVec.normalizeInPlace()) {\r\n offsetVec.rotate90CCWXY(offsetVec);\r\n const offsetDist = OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);\r\n return LineSegment3d.create(\r\n this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist),\r\n );\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\r\n * projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveCurveCloseApproachXY.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CurveCurveCloseApproachXY.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"CurveCurveCloseApproachXY.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CurveCurveCloseApproachXY.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAA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C,MAAM,EAAE,eAAe,GAAG,GAAG;CAgBpE"}
|
|
@@ -13,7 +13,8 @@ import { GrowableFloat64Array } from "../../geometry3d/GrowableFloat64Array";
|
|
|
13
13
|
import { Point3d } from "../../geometry3d/Point3dVector3d";
|
|
14
14
|
import { Range3d } from "../../geometry3d/Range";
|
|
15
15
|
import { CurveCurveCloseApproachXYRRtoRRD, CurvePointCloseApproachXYRtoRD, Newton1dUnbounded, Newton2dUnboundedWithDerivative, } from "../../numerics/Newton";
|
|
16
|
-
import { AnalyticRoots
|
|
16
|
+
import { AnalyticRoots } from "../../numerics/Polynomials";
|
|
17
|
+
import { SmallSystem } from "../../numerics/SmallSystem";
|
|
17
18
|
import { Arc3d } from "../Arc3d";
|
|
18
19
|
import { CurveChainWithDistanceIndex } from "../CurveChainWithDistanceIndex";
|
|
19
20
|
import { CurveCollection } from "../CurveCollection";
|
|
@@ -354,7 +355,7 @@ export class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
|
|
|
354
355
|
*/
|
|
355
356
|
getPointCurveClosestApproachXYNewton(curveP, pointQ) {
|
|
356
357
|
if (!(curveP instanceof Arc3d) && !(curveP instanceof LineSegment3d)) {
|
|
357
|
-
assert(
|
|
358
|
+
assert(false, "getPointCurveClosestApproachXYNewton only supports Arc3d and LineSegment");
|
|
358
359
|
return undefined;
|
|
359
360
|
}
|
|
360
361
|
const seeds = [0.2, 0.4, 0.6, 0.8]; // HEURISTIC: arcs have up to 4 perpendiculars; lines have only 1
|
|
@@ -629,7 +630,7 @@ export class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
|
|
|
629
630
|
if (!this._geometryB || !(this._geometryB instanceof CurveChainWithDistanceIndex))
|
|
630
631
|
return;
|
|
631
632
|
if (geomA instanceof CurveChainWithDistanceIndex) {
|
|
632
|
-
assert(
|
|
633
|
+
assert(false, "call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
633
634
|
return;
|
|
634
635
|
}
|
|
635
636
|
const index0 = this._results.length;
|