@itwin/core-geometry 5.8.0-dev.9 → 5.9.0-dev.1

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.
Files changed (576) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Constant.js.map +1 -1
  3. package/lib/cjs/Geometry.d.ts +24 -14
  4. package/lib/cjs/Geometry.d.ts.map +1 -1
  5. package/lib/cjs/Geometry.js +34 -14
  6. package/lib/cjs/Geometry.js.map +1 -1
  7. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  8. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  11. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  12. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  13. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  14. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  15. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  16. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  17. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  18. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  19. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  20. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  21. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  22. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  23. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  24. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  25. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  26. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  27. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  28. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  29. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  30. package/lib/cjs/core-geometry.d.ts +1 -0
  31. package/lib/cjs/core-geometry.d.ts.map +1 -1
  32. package/lib/cjs/core-geometry.js +1 -0
  33. package/lib/cjs/core-geometry.js.map +1 -1
  34. package/lib/cjs/curve/Arc3d.d.ts +4 -0
  35. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  36. package/lib/cjs/curve/Arc3d.js +14 -0
  37. package/lib/cjs/curve/Arc3d.js.map +1 -1
  38. package/lib/cjs/curve/ConstrainedCurve2d.d.ts +149 -0
  39. package/lib/cjs/curve/ConstrainedCurve2d.d.ts.map +1 -0
  40. package/lib/cjs/curve/ConstrainedCurve2d.js +317 -0
  41. package/lib/cjs/curve/ConstrainedCurve2d.js.map +1 -0
  42. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  43. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  44. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  45. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  46. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  47. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  48. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  49. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  50. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  51. package/lib/cjs/curve/CurveOps.js.map +1 -1
  52. package/lib/cjs/curve/CurvePrimitive.d.ts +2 -2
  53. package/lib/cjs/curve/CurvePrimitive.js +2 -2
  54. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  55. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  56. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  57. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  58. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  59. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  60. package/lib/cjs/curve/LineString3d.js.map +1 -1
  61. package/lib/cjs/curve/Loop.js.map +1 -1
  62. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  63. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  64. package/lib/cjs/curve/Path.js.map +1 -1
  65. package/lib/cjs/curve/PointString3d.js.map +1 -1
  66. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  67. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  68. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  69. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  70. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  71. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  72. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  73. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  74. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  75. package/lib/cjs/curve/RegionOps.js.map +1 -1
  76. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  77. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  78. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  84. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  85. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  86. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  87. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  88. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  89. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  90. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  91. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  92. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  93. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  94. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  95. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  96. package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.d.ts +26 -0
  97. package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.d.ts.map +1 -0
  98. package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.js +78 -0
  99. package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.js.map +1 -0
  100. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  101. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  102. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  103. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  104. package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts +152 -0
  105. package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts.map +1 -0
  106. package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js +843 -0
  107. package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -0
  108. package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.d.ts +97 -0
  109. package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.d.ts.map +1 -0
  110. package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.js +300 -0
  111. package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -0
  112. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts +105 -0
  113. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts.map +1 -0
  114. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.js +141 -0
  115. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -0
  116. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts +27 -0
  117. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts.map +1 -0
  118. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js +152 -0
  119. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -0
  120. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts +81 -0
  121. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts.map +1 -0
  122. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.js +170 -0
  123. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -0
  124. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts +96 -0
  125. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts.map +1 -0
  126. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.js +187 -0
  127. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -0
  128. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts +91 -0
  129. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts.map +1 -0
  130. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js +197 -0
  131. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -0
  132. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts +129 -0
  133. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts.map +1 -0
  134. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.js +208 -0
  135. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -0
  136. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts +87 -0
  137. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts.map +1 -0
  138. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.js +193 -0
  139. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.js.map +1 -0
  140. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  141. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  142. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  143. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  144. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  145. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  146. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  147. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  148. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  149. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  150. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  151. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  152. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  153. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  154. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  155. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  156. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  157. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  158. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  159. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  160. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  161. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  162. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  163. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  164. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  165. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  166. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  167. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  168. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  169. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  170. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  171. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  172. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  173. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  174. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  175. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  176. package/lib/cjs/geometry3d/Point2dVector2d.d.ts +7 -0
  177. package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
  178. package/lib/cjs/geometry3d/Point2dVector2d.js +9 -0
  179. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  180. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  181. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  182. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  183. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  184. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  185. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  186. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  187. package/lib/cjs/geometry3d/Range.js.map +1 -1
  188. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  189. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  190. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  191. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  192. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  193. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  194. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  195. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  196. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  197. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  198. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  199. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  200. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  201. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  202. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  203. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  204. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  205. package/lib/cjs/numerics/Complex.js.map +1 -1
  206. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  207. package/lib/cjs/numerics/Newton.js.map +1 -1
  208. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  209. package/lib/cjs/numerics/PolarData.js.map +1 -1
  210. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  211. package/lib/cjs/numerics/Polynomials.js +8 -6
  212. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  213. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  214. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  215. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  216. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  217. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  218. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  219. package/lib/cjs/polyface/AuxData.js.map +1 -1
  220. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  221. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  222. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  223. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  224. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  225. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  226. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  227. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  228. package/lib/cjs/polyface/Polyface.js.map +1 -1
  229. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  230. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  231. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  232. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  233. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  234. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  235. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  236. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  237. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  238. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  239. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  240. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  241. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  242. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  243. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  244. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  245. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  246. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  247. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  248. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  249. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  250. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  251. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  252. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  253. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  254. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  255. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  256. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  257. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  258. package/lib/cjs/solid/Box.js.map +1 -1
  259. package/lib/cjs/solid/Cone.js.map +1 -1
  260. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  261. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  262. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  263. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  264. package/lib/cjs/solid/Sphere.js.map +1 -1
  265. package/lib/cjs/solid/SweepContour.js.map +1 -1
  266. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  267. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  268. package/lib/cjs/topology/Graph.js.map +1 -1
  269. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  270. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  271. package/lib/cjs/topology/HalfEdgeGraphSpineContext.d.ts.map +1 -1
  272. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +3 -1
  273. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  274. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  275. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  276. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  277. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  278. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  279. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  280. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  281. package/lib/cjs/topology/MaskManager.js.map +1 -1
  282. package/lib/cjs/topology/Merging.js.map +1 -1
  283. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  284. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  285. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  286. package/lib/cjs/topology/Triangulation.js.map +1 -1
  287. package/lib/cjs/topology/Voronoi.js.map +1 -1
  288. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  289. package/lib/esm/Constant.js.map +1 -1
  290. package/lib/esm/Geometry.d.ts +24 -14
  291. package/lib/esm/Geometry.d.ts.map +1 -1
  292. package/lib/esm/Geometry.js +34 -14
  293. package/lib/esm/Geometry.js.map +1 -1
  294. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  295. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  296. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  297. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  298. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  299. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  300. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  301. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  302. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  303. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  304. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  305. package/lib/esm/bspline/KnotVector.js.map +1 -1
  306. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  307. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  308. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  309. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  310. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  311. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  312. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  313. package/lib/esm/clipping/ClipVector.js.map +1 -1
  314. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  315. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  316. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  317. package/lib/esm/core-geometry.d.ts +1 -0
  318. package/lib/esm/core-geometry.d.ts.map +1 -1
  319. package/lib/esm/core-geometry.js +1 -0
  320. package/lib/esm/core-geometry.js.map +1 -1
  321. package/lib/esm/curve/Arc3d.d.ts +4 -0
  322. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  323. package/lib/esm/curve/Arc3d.js +14 -0
  324. package/lib/esm/curve/Arc3d.js.map +1 -1
  325. package/lib/esm/curve/ConstrainedCurve2d.d.ts +149 -0
  326. package/lib/esm/curve/ConstrainedCurve2d.d.ts.map +1 -0
  327. package/lib/esm/curve/ConstrainedCurve2d.js +313 -0
  328. package/lib/esm/curve/ConstrainedCurve2d.js.map +1 -0
  329. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  330. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  331. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  332. package/lib/esm/curve/CurveCollection.js.map +1 -1
  333. package/lib/esm/curve/CurveCurve.js.map +1 -1
  334. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  335. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  336. package/lib/esm/curve/CurveFactory.js.map +1 -1
  337. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  338. package/lib/esm/curve/CurveOps.js.map +1 -1
  339. package/lib/esm/curve/CurvePrimitive.d.ts +2 -2
  340. package/lib/esm/curve/CurvePrimitive.js +2 -2
  341. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  342. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  343. package/lib/esm/curve/CurveTypes.js.map +1 -1
  344. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  345. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  346. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  347. package/lib/esm/curve/LineString3d.js.map +1 -1
  348. package/lib/esm/curve/Loop.js.map +1 -1
  349. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  350. package/lib/esm/curve/ParityRegion.js.map +1 -1
  351. package/lib/esm/curve/Path.js.map +1 -1
  352. package/lib/esm/curve/PointString3d.js.map +1 -1
  353. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  354. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  355. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  356. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  357. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  358. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  359. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  360. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  361. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  362. package/lib/esm/curve/RegionOps.js.map +1 -1
  363. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  364. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  365. package/lib/esm/curve/UnionRegion.js.map +1 -1
  366. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  367. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  368. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  369. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  370. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  371. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  372. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  373. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  374. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  375. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  376. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  377. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  378. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  379. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  380. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  381. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  382. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  383. package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.d.ts +26 -0
  384. package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.d.ts.map +1 -0
  385. package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.js +74 -0
  386. package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.js.map +1 -0
  387. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  388. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  389. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  390. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  391. package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts +152 -0
  392. package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts.map +1 -0
  393. package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js +839 -0
  394. package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -0
  395. package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.d.ts +97 -0
  396. package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.d.ts.map +1 -0
  397. package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.js +295 -0
  398. package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -0
  399. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts +105 -0
  400. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts.map +1 -0
  401. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.js +135 -0
  402. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -0
  403. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts +27 -0
  404. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts.map +1 -0
  405. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js +148 -0
  406. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -0
  407. package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts +81 -0
  408. package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts.map +1 -0
  409. package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.js +166 -0
  410. package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -0
  411. package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts +96 -0
  412. package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts.map +1 -0
  413. package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.js +183 -0
  414. package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -0
  415. package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts +91 -0
  416. package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts.map +1 -0
  417. package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js +193 -0
  418. package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -0
  419. package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts +129 -0
  420. package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts.map +1 -0
  421. package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.js +204 -0
  422. package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -0
  423. package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts +87 -0
  424. package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts.map +1 -0
  425. package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.js +189 -0
  426. package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.js.map +1 -0
  427. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  428. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  429. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  430. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  431. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  432. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  433. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  434. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  435. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  436. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  437. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  438. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  439. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  440. package/lib/esm/geometry3d/Angle.js.map +1 -1
  441. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  442. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  443. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  444. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  445. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  446. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  447. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  448. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  449. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  450. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  451. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  452. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  453. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  454. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  455. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  456. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  457. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  458. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  459. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  460. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  461. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  462. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  463. package/lib/esm/geometry3d/Point2dVector2d.d.ts +7 -0
  464. package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
  465. package/lib/esm/geometry3d/Point2dVector2d.js +9 -0
  466. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  467. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  468. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  469. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  470. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  471. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  472. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  473. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  474. package/lib/esm/geometry3d/Range.js.map +1 -1
  475. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  476. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  477. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  478. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  479. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  480. package/lib/esm/geometry3d/Transform.js.map +1 -1
  481. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  482. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  483. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  484. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  485. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  486. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  487. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  488. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  489. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  490. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  491. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  492. package/lib/esm/numerics/Complex.js.map +1 -1
  493. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  494. package/lib/esm/numerics/Newton.js.map +1 -1
  495. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  496. package/lib/esm/numerics/PolarData.js.map +1 -1
  497. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  498. package/lib/esm/numerics/Polynomials.js +8 -6
  499. package/lib/esm/numerics/Polynomials.js.map +1 -1
  500. package/lib/esm/numerics/Quadrature.js.map +1 -1
  501. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  502. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  503. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  504. package/lib/esm/numerics/UnionFind.js.map +1 -1
  505. package/lib/esm/numerics/UsageSums.js.map +1 -1
  506. package/lib/esm/polyface/AuxData.js.map +1 -1
  507. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  508. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  509. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  510. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  511. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  512. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  513. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  514. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  515. package/lib/esm/polyface/Polyface.js.map +1 -1
  516. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  517. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  518. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  519. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  520. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  521. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  522. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  523. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  524. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  525. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  526. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  527. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  528. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  529. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  530. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  531. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  532. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  533. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  534. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  535. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  536. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  537. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  538. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  539. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  540. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  541. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  542. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  543. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  544. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  545. package/lib/esm/solid/Box.js.map +1 -1
  546. package/lib/esm/solid/Cone.js.map +1 -1
  547. package/lib/esm/solid/LinearSweep.js.map +1 -1
  548. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  549. package/lib/esm/solid/RuledSweep.js.map +1 -1
  550. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  551. package/lib/esm/solid/Sphere.js.map +1 -1
  552. package/lib/esm/solid/SweepContour.js.map +1 -1
  553. package/lib/esm/solid/TorusPipe.js.map +1 -1
  554. package/lib/esm/topology/ChainMerge.js.map +1 -1
  555. package/lib/esm/topology/Graph.js.map +1 -1
  556. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  557. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  558. package/lib/esm/topology/HalfEdgeGraphSpineContext.d.ts.map +1 -1
  559. package/lib/esm/topology/HalfEdgeGraphSpineContext.js +3 -1
  560. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  561. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  562. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  563. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  564. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  565. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  566. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  567. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  568. package/lib/esm/topology/MaskManager.js.map +1 -1
  569. package/lib/esm/topology/Merging.js.map +1 -1
  570. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  571. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  572. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  573. package/lib/esm/topology/Triangulation.js.map +1 -1
  574. package/lib/esm/topology/Voronoi.js.map +1 -1
  575. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  576. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConstrainedImplicitCurve2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;EAEE;AAEF,OAAO,EAAE,QAAQ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AAK,CAAC,CAAC;IACvB,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;IACtB,OAAO,MAAM,CAAC;AAChB,CAAC;AACD,uFAAuF;AACvF,SAAS,mBAAmB,CAC1B,OAAqE,EAAE,MAA0C;IAEjH,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC;YACpC,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module CartesianGeometry\n*/\n\nimport { Geometry } from \"../../../Geometry\";\nimport { Matrix3d } from \"../../../geometry3d/Matrix3d\";\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\nimport { Vector3d } from \"../../../geometry3d/Point3dVector3d\";\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\nimport { Degree2PowerPolynomial } from \"../../../numerics/Polynomials\";\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\nimport { ImplicitCurve2d, ImplicitGeometryMarkup, Point2dImplicitCurve2d } from \"./ImplicitCurve2d\";\nimport { UnboundedCircle2dByCenterAndRadius } from \"./UnboundedCircle2d\";\nimport { UnboundedEllipse2d } from \"./UnboundedEllipse2d\";\nimport { UnboundedHyperbola2d } from \"./UnboundedHyperbola2d\";\nimport { UnboundedLine2dByPointAndNormal } from \"./UnboundedLine2d\";\nimport { UnboundedParabola2d } from \"./UnboundedParabola2d\";\n\n/**\n * Static methods for special case circle and line tangent constructions.\n * @internal\n */\nexport class ConstrainedImplicitCurve2d {\n /**\n * Return all (i.e., up to 4) circles that are tangent to 3 given lines.\n * @param lineA first line\n * @param lineB second line\n * @param lineC third line\n */\n public static circlesTangentLLL(\n lineA: UnboundedLine2dByPointAndNormal,\n lineB: UnboundedLine2dByPointAndNormal,\n lineC: UnboundedLine2dByPointAndNormal,\n ): ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] | undefined {\n /*--------------------------------------------------------------------------------------\n (X-A).normalA = a*r\n (X-B).normalB = b*r\n (X-C).normalC = c*r\n Typical expansion is\n x*mx + y*my - a*r = A.normalA\n Where a,b,c are combinations of {+1,-1}\n Need to consider 4 combinations of signs: (+++) (++-) (+-+) (+--) The other 4 generate negated r as solution.\n ----------------------------------------------------------------------------------------*/\n // make lines with normal vectors and nearby origin\n const origin = lineA.point;\n const lineA1 = lineA.cloneNormalizedFromOrigin(origin);\n const lineB1 = lineB.cloneNormalizedFromOrigin(origin);\n const lineC1 = lineC.cloneNormalizedFromOrigin(origin);\n if (lineA1 === undefined || lineB1 === undefined || lineC1 === undefined)\n return undefined;\n const result = [];\n const a = lineA1.normal.dotProduct(lineA1.point);\n const b = lineB1.normal.dotProduct(lineB1.point);\n const c = lineC1.normal.dotProduct(lineC1.point);\n const signA = 1;\n for (const signB of [-1, 1]) {\n for (const signC of [-1, 1]) {\n const matrix = Matrix3d.createRowValues(\n lineA1.normal.x, lineA1.normal.y, signA,\n lineB1.normal.x, lineB1.normal.y, signB,\n lineC1.normal.x, lineC1.normal.y, signC,\n );\n const rhs = Vector3d.create(a, b, c);\n const xyr = matrix.multiplyInverse(rhs);\n if (xyr !== undefined) {\n const circle = UnboundedCircle2dByCenterAndRadius.createXYRadius(\n origin.x + xyr.x, origin.y + xyr.y, Math.abs(xyr.z),\n );\n const markup = new ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>(circle);\n markup.appendClosePoint(circle.center, lineA, circle.center, circle.radius);\n markup.appendClosePoint(circle.center, lineB, circle.center, circle.radius);\n markup.appendClosePoint(circle.center, lineC, circle.center, circle.radius);\n result.push(markup);\n }\n }\n }\n return result;\n }\n /**\n * Return all (i.e., up to 2) unbounded lines perpendicular to a line and tangent to a circle.\n * @param line the line\n * @param circle the circle\n */\n public static linesPerpLTangentC(\n line: UnboundedLine2dByPointAndNormal, circle: UnboundedCircle2dByCenterAndRadius,\n ): ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>[] | undefined {\n // Project the circle center to the line.\n // The endpoints of the perpendicular line are the circle center and that line point shifted\n // by positive and negative radius in the direction of the line.\n const lineTangent = line.unitVectorAlongLine();\n const unitNormal = line.unitNormal();\n const linePoint = line.closestPoint(circle.center);\n if (linePoint === undefined || lineTangent === undefined || unitNormal === undefined)\n return undefined;\n const unitPerp = unitNormal.rotate90CCWXY()\n const result = [];\n for (const r of signedValues(circle.radius)) {\n const pointA = linePoint.plusScaled(lineTangent, r);\n const pointB = circle.center.plusScaled(lineTangent, r);\n const lineC = UnboundedLine2dByPointAndNormal.createPointNormal(pointA, unitPerp);\n const taggedLine = new ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>(lineC);\n taggedLine.data.push(new Point2dImplicitCurve2d(pointA, line)); // CLONE\n taggedLine.data.push(new Point2dImplicitCurve2d(pointB, circle)); // CLONE\n result.push(taggedLine);\n }\n return result;\n }\n /**\n * Return all (i.e., 4) variants of the line perpendicular to 2 circles (line between centers, with ends at crossing\n * points on respective circles).\n * @param circleA first circle\n * @param circleB second circle\n */\n public static linesPerpCPerpC(\n circleA: UnboundedCircle2dByCenterAndRadius, circleB: UnboundedCircle2dByCenterAndRadius,\n ): ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>[] | undefined {\n // There infinite line containing the circle centers is the only line perp to both circles.\n // The endpoints for the 4 line segments are the centers shifted by the respective radii along the infinite line.\n const centerToCenter = Vector2d.createStartEnd(circleA.center, circleB.center);\n const unitCenterToCenter = centerToCenter.normalize();\n if (unitCenterToCenter === undefined)\n return undefined;\n const unitNormal = unitCenterToCenter.rotate90CCWXY();\n const result = [];\n for (const rA of signedValues(circleA.radius)) {\n for (const rB of signedValues(circleB.radius)) {\n const pointA = circleA.center.plusScaled(unitCenterToCenter, rA);\n const pointB = circleB.center.plusScaled(unitCenterToCenter, rB);\n const lineC = UnboundedLine2dByPointAndNormal.createPointNormal(pointA, unitNormal);\n const taggedLine = new ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>(lineC);\n taggedLine.data.push(new Point2dImplicitCurve2d(pointA, circleA)); // CLONE\n taggedLine.data.push(new Point2dImplicitCurve2d(pointB, circleB)); // CLONE\n result.push(taggedLine);\n }\n }\n return result;\n }\n /**\n * Return all (i.e., up to 2) unbounded lines perpendicular to a line and a circle.\n * @param line the line\n * @param circle the circle\n */\n public static linesPerpLPerpC(\n line: UnboundedLine2dByPointAndNormal, circle: UnboundedCircle2dByCenterAndRadius,\n ): ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>[] | undefined {\n // The infinite line through the circle center and in the direction of the line normal is the containing line.\n // Make segments from its intersection with the line to the near and far intersections with the circle.\n // (these are the centers shifted by radius along the line)\n const lineTangent = line.unitVectorAlongLine();\n const unitNormal = line.unitNormal();\n const linePoint = line.closestPoint(circle.center);\n if (linePoint === undefined || lineTangent === undefined || unitNormal === undefined)\n return undefined;\n const unitPerp = unitNormal.rotate90CCWXY()\n const result = [];\n for (const r of signedValues(circle.radius)) {\n const pointA = linePoint.clone()\n const pointB = circle.center.plusScaled(unitNormal, r);\n const lineC = UnboundedLine2dByPointAndNormal.createPointNormal(pointA, unitPerp);\n const taggedLine = new ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>(lineC);\n taggedLine.data.push(new Point2dImplicitCurve2d(pointA, line)); // CLONE!\n taggedLine.data.push(new Point2dImplicitCurve2d(pointB, circle)); // CLONE!\n result.push(taggedLine);\n }\n return result;\n }\n /**\n * Return all (i.e., up to 4) unbounded lines perpendicular to a circle and tangent to a circle.\n * Note that multiple colinear lines are returned tagged with diametrically opposing points of circleA.\n * @param circleA first circle (for perpendicular constraint)\n * @param circleB second circle (for tangent constraint)\n */\n public static linesPerpCTangentC(\n circleA: UnboundedCircle2dByCenterAndRadius, circleB: UnboundedCircle2dByCenterAndRadius\n ): ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>[] | undefined {\n // The solution lines are through the perp circle center and tangent to the tangent circle.\n // Hence this is the two infinite lines \"through first circle center, tangent to second circle\",\n // Bounded line segments go from the tangent circle points to the near and far intersections with the perp circle.\n const centerToCenter = Vector2d.createStartEnd(circleA.center, circleB.center);\n const centerToCenterDistance = centerToCenter.magnitude();\n const unitCenterToCenter = centerToCenter.normalize();\n if (unitCenterToCenter === undefined)\n return undefined;\n const centerToCenterNormal = unitCenterToCenter.rotate90CCWXY();\n const sine = Geometry.safeDivideFraction(circleB.radius, centerToCenterDistance, 0.0);\n if (sine > 1.0)\n return undefined;\n const absoluteCosine = Math.sqrt(1.0 - sine * sine);\n const result = [];\n for (const rA of signedValues(circleA.radius)) {\n for (const rB of signedValues(circleB.radius)) {\n const cosine = rB > 0 ? absoluteCosine : -absoluteCosine;\n const lineNormal = Vector2d.createAdd2Scaled(unitCenterToCenter, -sine, centerToCenterNormal, cosine);\n const lineDirection = Vector2d.createAdd2Scaled(unitCenterToCenter, cosine, centerToCenterNormal, sine);\n const pointA = circleA.center.plusScaled(lineDirection, rA);\n const pointB = circleB.center.plusScaled(lineNormal, Math.abs(rB));\n const lineC = UnboundedLine2dByPointAndNormal.createPointNormal(pointA, lineNormal);\n const taggedLine = new ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>(lineC);\n taggedLine.data.push(new Point2dImplicitCurve2d(pointA, circleA)); // CLONE\n taggedLine.data.push(new Point2dImplicitCurve2d(pointB, circleB)); // CLONE\n result.push(taggedLine);\n }\n }\n return result;\n }\n /**\n * Return all (i.e., up to 4) unbounded lines tangent to 2 circles.\n * * There are 4 lines if there is neither intersection nor containment between the circles\n * * There are 2 lines if the circles intersect\n * * THere are no lines if the one circle is entirely inside the other.\n * @param circleA first circle\n * @param circleB second circle\n */\n public static linesTangentCC(\n circleA: UnboundedCircle2dByCenterAndRadius, circleB: UnboundedCircle2dByCenterAndRadius\n ): ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>[] | undefined {\n // draw a line tangent to both circles. This may have both circles on the same side,\n // or one circle on each side.\n // draw radii from both centers to the tangencies. (These are parallel to each other)\n // the (sum or difference of the radii) and the (distance between centers) are side and hypotenuse of\n // // a right triangle, with the tangent-to-tangent segment as the other side.\n // The lengths give sine and cosine of angles in the triangle, and those give vectors\n // from center to tangency points.\n const distanceAB = circleA.center.distance(circleB.center);\n if (distanceAB + Math.abs(circleB.radius) <= Math.abs(circleA.radius))\n return undefined;\n if (distanceAB + Math.abs(circleA.radius) <= Math.abs(circleB.radius))\n return undefined;\n const unitAB = Vector2d.createStartEnd(circleA.center, circleB.center);\n if (!unitAB.normalize(unitAB))\n return undefined;\n const result = [];\n if (unitAB !== undefined) {\n const radiusA = circleA.radius;\n const radiusB = circleB.radius;\n for (const signQ of [-1, 1]) {\n const q = radiusB + signQ * radiusA;\n const sine = q / distanceAB;\n if (Math.abs(sine) < 1.0) {\n const cosine = Math.sqrt(1.0 - sine * sine);\n for (const sign of [-1, 1]) {\n let pointA, pointB;\n if (signQ < 0) {\n pointA = circleA.center.addForwardLeft(radiusA * -sine, radiusA * sign * cosine, unitAB);\n pointB = circleB.center.addForwardLeft(radiusB * -sine, radiusB * sign * cosine, unitAB);\n } else {\n pointA = circleA.center.addForwardLeft(radiusA * sine, radiusA * sign * cosine, unitAB);\n pointB = circleB.center.addForwardLeft(-radiusB * sine, -radiusB * sign * cosine, unitAB);\n }\n const lineA = UnboundedLine2dByPointAndNormal.createPointPoint(pointA, pointB);\n if (lineA === undefined)\n return undefined;\n const taggedLine = new ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>(lineA);\n taggedLine.data.push(new Point2dImplicitCurve2d(pointA, circleA)); // CLONE\n taggedLine.data.push(new Point2dImplicitCurve2d(pointB, circleB)); // CLONE\n result.push(taggedLine);\n }\n }\n }\n }\n return result;\n }\n /**\n * Return all (i.e., up to 8) circles tangent to two lines and a circle.\n * * There are 8 circles if the circle contains the intersection of the lines.\n * * There are 2 circles if the circle is completely contained in one quadrant bounded by the two lines.\n * * There are 2 circles if the circle intersects one ray outward from the intersection.\n * * There are 4 circles if the circle intersects two of the outward rays.\n */\n public static circlesTangentLLC(\n lineA: UnboundedLine2dByPointAndNormal,\n lineB: UnboundedLine2dByPointAndNormal,\n circle: UnboundedCircle2dByCenterAndRadius,\n ): ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] | undefined {\n /*--------------------------------------------------------------------------------------\n Put origin at circle center.\n A,B are line points.\n M,N are line normals.\n (X).(X) = (a +- r)^2 = 0\n (X-A).M = +-r\n (X-B).N = +-r\n Need to consider 4 combinations of signs: (+++) (++-) (-++) (-+-) The other 4 are negations.\n Write the linear part as\n [M N]^ * X = [M.A N.B]^ + r Ei\n where Ei is one of E0=[1 1]^ or E1=[1 -1]^\n Multiply by inverse of matrix X = F + r G\n The quadratic part is\n (F + rG).(F + rG) = (a +- r)^2\n (F + rG).(F + rG) = a^2 +- 2ar + r^2\n F.F + 2r G.F + r^2 G.G = a^2 +- 2ar + r^2\n r^2 (1-G.G) + 2(+-a - G.F)r + a^2-F.F = 0.\n Solve with positive, negative branch. Each generates 2 solutions to go back through Ei.\n ----------------------------------------------------------------------------------------*/\n // lines with unit vector and point coordinates from circle center\n const lineA1 = lineA.cloneNormalizedFromOrigin(circle.center);\n const lineB1 = lineB.cloneNormalizedFromOrigin(circle.center);\n if (lineA1 === undefined || lineB1 === undefined)\n return undefined;\n // perpendicular distance from each line to center of circle\n const dotMA = lineA1.normal.dotProduct(lineA1.point);\n const dotMB = lineB1.normal.dotProduct(lineB1.point);\n\n const a = circle.radius;\n const vectorF = Vector2d.create(); // vector from circle center to intersection of the lines\n if (lineA1.normal.isParallelTo(lineB1.normal)\n || !SmallSystem.linearSystem2d(\n lineA1.normal.x, lineA1.normal.y,\n lineB1.normal.x, lineB1.normal.y,\n dotMA, dotMB, vectorF)) {\n // SPECIAL CASE: PARALLEL LINES\n // Lines are parallel\n // Make a midline. Half of line separation is the tangent circle radius.\n const midLinePoint = lineA1.point.interpolate(0.5, lineB1.point);\n const lineDirection = lineA1.normal.rotate90CCWXY();\n const a1 = lineA1.functionValue(midLinePoint);\n // vector from centerC to midline point midline point is vectorCP + s * lineDirectionA\n const coffSine2 = lineDirection.dotProduct(lineDirection);\n const coffSine = 2.0 * lineDirection.dotProduct(midLinePoint);\n const coffConstant = Geometry.hypotenuseSquaredXY(midLinePoint.x, midLinePoint.y);\n const targetRadius = [];\n // special case zero radius\n if (!Geometry.isSmallMetricDistance(circle.radius)) {\n targetRadius.push(circle.radius + a1);\n targetRadius.push(circle.radius - a1);\n } else {\n // circle is just a point -- the quadratic solver only has to happen once\n targetRadius.push(circle.radius + a1);\n // But if the center is ON one of the lines, construct by projecting to the other.\n // REMARK: In C++ code this pointOnLine test was done with messy\n // tolerance relative to the various line points' distance to origin.\n // Here we trust metric distance condition.\n let center;\n if (Geometry.isSmallMetricDistance(dotMA)) // tangency is on lineA; move towards line B\n center = circle.center.plusScaled(lineA1.normal, dotMB > 0.0 ? -a1 : a1);\n else if (Geometry.isSmallMetricDistance(dotMB)) // tangency is on lineB; move towards line A\n center = circle.center.plusScaled(lineB1.normal, dotMA > 0.0 ? a1 : -a1);\n if (center !== undefined) {\n const newCircle = UnboundedCircle2dByCenterAndRadius.createPointRadius(center, a1);\n const markup = new ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>(newCircle);\n markup.closePointsOfGeometry(newCircle.center, newCircle.center, newCircle.radius, [lineA, lineB, circle]);\n return [markup];\n }\n }\n const resultA = [];\n for (const radius of targetRadius) {\n const roots = Degree2PowerPolynomial.solveQuadratic(coffSine2, coffSine, coffConstant - radius * radius);\n if (roots) {\n for (const alpha of roots) {\n const center = circle.center.plus2Scaled(midLinePoint, 1.0, lineDirection, alpha);\n const newCircle = UnboundedCircle2dByCenterAndRadius.createPointRadius(center, a1);\n const markup = new ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>(newCircle);\n markup.closePointsOfGeometry(newCircle.center, newCircle.center, newCircle.radius, [lineA, lineB, circle]);\n resultA.push(markup);\n }\n }\n }\n return resultA;\n }\n const result = [];\n for (const sign1 of [-1, 1]) {\n const vectorG = Vector2d.create();\n if (SmallSystem.linearSystem2d(\n lineA1.normal.x, lineA1.normal.y,\n lineB1.normal.x, lineB1.normal.y, 1.0, sign1, vectorG)) {\n for (const sign2 of [-1, 1]) {\n const coffA = 1.0 - vectorG.dotProduct(vectorG);\n const coffB = 2.0 * (sign2 * a - vectorG.dotProduct(vectorF));\n const coffC = a * a - vectorF.dotProduct(vectorF);\n const roots = Degree2PowerPolynomial.solveQuadratic(coffA, coffB, coffC);\n if (roots !== undefined) {\n for (const r of roots) {\n const center = circle.center.plus2Scaled(vectorF, 1.0, vectorG, r);\n const newCircle = UnboundedCircle2dByCenterAndRadius.createPointRadius(center, r);\n if (!isThisCirclePresent(result, newCircle)) {\n const markup = new ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>(newCircle);\n markup.appendClosePoint(newCircle.center, lineA, newCircle.center, newCircle.radius);\n markup.appendClosePoint(newCircle.center, lineB, newCircle.center, newCircle.radius);\n markup.appendClosePoint(newCircle.center, circle, newCircle.center, newCircle.radius);\n result.push(markup);\n }\n }\n }\n }\n }\n }\n return result;\n }\n /**\n * Return all (i.e., up to 4) circles tangent to 2 circles and a line.\n * @param circleA first circle\n * @param circleB second circle\n * @param line the line\n */\n public static circlesTangentCCL(\n circleA: UnboundedCircle2dByCenterAndRadius,\n circleB: UnboundedCircle2dByCenterAndRadius,\n line: UnboundedLine2dByPointAndNormal,\n ): ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] | undefined {\n /*--------------------------------------------------------------------------------------\n (x-xA)^2 + (y-y0)^2 - (r + r0)^2 = 0\n (x-xB)^2 + (y-y1)^2 - (r + r1)^2 = 0\n y = r NOTE: Cannot arbitrarily change sign of r as is done in 3-circle case.\n -------------------------------------------\n x^2 -2 xA x + xA^2 -2 y0 y + y0^2 - 2 r0 y - r0^2 = 0\n x^2 -2 xB x + xB^2 -2 y1 y + y1^2 - 2 r1 y - r1^2 = 0\n -------------------------------------------\n x^2 -2 xA x + -2 (y0 + r0) y + a0= 0 a0 = xA^2 + y0^2 - r0^2\n x^2 -2 xB x + -2 (y1 + r1) y + a1= 0 a1 = xB^2 + y1^2 - r1^2\n -------------------------------------------\n (A0) x^2 + b0 x + c0 y + a0= 0 b0 = -2x0 c0 = -2 (y0 + r0)\n (A1) x^2 + b1 x + c1 y + a1= 0 b1 = -2x1 c1 = -2 (y1 + r1)\n -------------------------------------------\n c1 x^2 c1 c0 y + c1 a0= 0\n c0 x^2 + c0 b1 x + c0 c1 y + c0 a1= 0\n ---------------------------------------\n Subtract first from second.\n (c0 - c1) x^2 + (c0 b1 - c1 b0) x + (c0 a1 - c1 a0) = 0.\n Solve for two x values. Substitute in with largest c0, c1.\n ---------------------------------------\n Repeat with signed combinations of the circle radii.\n ----------------------------------------------------------------------------------------*/\n const lineUnitNormal = line.normal.normalize();\n if (lineUnitNormal === undefined)\n return undefined;\n const lineUnitAlong = lineUnitNormal.rotate90CCWXY();\n const circleGlobalOffsets = [\n Vector2d.createStartEnd(line.point, circleA.center),\n Vector2d.createStartEnd(line.point, circleB.center),\n ];\n const circleLocalOffset = [];\n for (const i of [0, 1]) {\n circleLocalOffset.push(\n Vector2d.create(\n circleGlobalOffsets[i].dotProduct(lineUnitAlong),\n circleGlobalOffsets[i].dotProduct(lineUnitNormal),\n ));\n }\n const coffA = [0, 0];\n const coffB = [0, 0];\n const coffC = [0, 0];\n const circleRadius = [0, 0];\n const result = [];\n const radiiFromA = signedValues(circleA.radius, circleA.radius);\n const radiiFromB = signedValues(circleB.radius, circleB.radius);\n for (const radiusA of radiiFromA) {\n circleRadius[0] = radiusA;\n for (const radiusB of radiiFromB) {\n circleRadius[1] = radiusB;\n for (const i of [0, 1]) {\n const r = circleRadius[i];\n coffA[i] = circleLocalOffset[i].magnitudeSquared() - r * r;\n coffB[i] = -2.0 * circleLocalOffset[i].x;\n coffC[i] = -2.0 * (circleLocalOffset[i].y + r);\n }\n const k = Math.abs(circleRadius[0]) > Math.abs(circleRadius[1])\n ? 0 : 1;\n const qa = coffC[0] - coffC[1];\n const qb = coffC[0] * coffB[1] - coffC[1] * coffB[0];\n const qc = coffC[0] * coffA[1] - coffC[1] * coffA[0];\n const xRoot = Degree2PowerPolynomial.solveQuadratic(qa, qb, qc);\n if (xRoot !== undefined) {\n for (const x of xRoot) {\n const y = Geometry.conditionalDivideCoordinate(x * x + coffB[k] * x + coffA[k], -coffC[k]);\n if (y !== undefined) {\n const r = Math.abs(y);\n const center = line.point.plus2Scaled(lineUnitAlong, x, lineUnitNormal, y);\n const newCircle = UnboundedCircle2dByCenterAndRadius.createPointRadius(center, r);\n if (!isThisCirclePresent(result, newCircle)) {\n const markup = new ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>(newCircle);\n markup.appendClosePoint(newCircle.center, circleA, newCircle.center, r);\n markup.appendClosePoint(newCircle.center, circleB, newCircle.center, r);\n markup.appendClosePoint(newCircle.center, line, newCircle.center, r);\n result.push(markup);\n }\n }\n }\n }\n }\n }\n return result;\n }\n /**\n * Special case CCC tangent construction when inputs are colinear.\n * @param circleA first input circle\n * @param circleB second input circle\n * @param circleC third input circle\n * @param rA signed radius for circleA\n * @param rB signed radius for circleB\n * @param rC signed radius for circleC\n * @param result pre-initialized array to which tangent circle markup will be added.\n */\n private static solveColinearCCCTangents(\n circleA: UnboundedCircle2dByCenterAndRadius,\n circleB: UnboundedCircle2dByCenterAndRadius,\n circleC: UnboundedCircle2dByCenterAndRadius,\n rA: number,\n rB: number,\n rC: number,\n result: ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[],\n ): void {\n const vectorAB = Vector2d.createStartEnd(circleA.center, circleB.center);\n const vectorAC = Vector2d.createStartEnd(circleA.center, circleC.center);\n const xB = vectorAB.magnitude();\n let xC = vectorAC.magnitude();\n if (vectorAB.dotProduct(vectorAC) < 0)\n xC = -xC;\n const unitAB = vectorAB.normalize();\n if (unitAB === undefined)\n return; // there are circle-in-circle cases with common centers\n const unitPerp = unitAB.rotate90CCWXY();\n /*\n Measuring from center A in rotated system:\n x^2 + y^2 = (r+rA)^2\n (x-xB)^2 + y^2 = (r+rB)^2\n (x-xC)^2 + y^2 = (r+rC)^2\n -------------------------\n x^2 + y^2 = (r+rA)^2\n -2xB x + xB^2 = (r+rB)^2 - (r+rA)^2\n -2xC x + xC^2 = (r+rC)^2 - (r+rA)^2\n -------------------------\n x^2 + y^2 = (r+rA)^2\n -2xB x = 2 (rB-rA) r + rB^2 - rA^2 - xB^2\n -2x2 x = 2 (rC-rA) r + rC^2 - rA^2 - xC^2\n -------------------------\n Solve\n -2xB x - 2 (rB-rA) r = rB^2 - rA^2 - xB^2\n -2xC x - 2 (rC-rA) r = rC^2 - rA^2 - xC^2\n */\n const ax = -2.0 * xB;\n const ar = -2.0 * (rB - rA);\n const a = rB * rB - rA * rA - xB * xB;\n const bx = -2.0 * xC;\n const br = -2.0 * (rC - rA);\n const b = rC * rC - rA * rA - xC * xC;\n const sRelTol = 1.0e-14;\n const origin = Point2d.create(circleA.center.x, circleA.center.y);\n const solutionVector = Vector2d.create();\n if (SmallSystem.linearSystem2d(ax, ar, bx, br, a, b, solutionVector)) {\n const x = solutionVector.x;\n const r = solutionVector.y;\n let dd = (r + rA) * (r + rA) - x * x;\n const tol = sRelTol * x * x;\n if (Math.abs(dd) < tol)\n dd = 0.0;\n if (dd >= 0.0) {\n const y = Math.sqrt(dd);\n const xy0 = origin.plus2Scaled(unitAB, x, unitPerp, y);\n const xy1 = origin.plus2Scaled(unitAB, x, unitPerp, -y);\n for (const newCenter of [xy0, xy1]) {\n const newCircle = UnboundedCircle2dByCenterAndRadius.createPointRadius(newCenter, r);\n if (!isThisCirclePresent(result, newCircle)) {\n const markup = new ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>(newCircle);\n markup.appendClosePoint(newCircle.center, circleA, newCircle.center, r);\n markup.appendClosePoint(newCircle.center, circleB, newCircle.center, r);\n markup.appendClosePoint(newCircle.center, circleC, newCircle.center, r);\n result.push(markup);\n }\n }\n }\n }\n }\n /**\n * Return all (i.e., up to 8) circles tangent to 3 circles.\n * @param circles the three input circles\n */\n private static circlesTangentCCCThisOrder(\n circles: UnboundedCircle2dByCenterAndRadius[],\n ): ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] | undefined {\n // Call the circle centers and radii\n // (ax, ay, ar)\n // (bx, by, br)\n // (cx, cy, cr)\n // For a tangent circle with center (x,y) and radius r,\n // (x-ax)^2 + (y-ay)^2 = (r+ar)^2\n // (x-bx)^2 + (y-by)^2 = (r+br)^2\n // (x-cx)^2 + (y-cy)^2 = (r+cr)^2\n // This has squares of all the unknowns x,y,r\n // BUT !!! all coefficients of squares are 1.\n // Subtract the first from the second and third equations.\n // All the squares go away in the shifted equations.\n // What's left is 2 linear equations with x,y,r as unknowns.\n // Move the r and constant parts to the right side.\n // Solve for x and y as a linear function of r.\n // Substitute those linear forms back into the x and y of the first equation.\n // A quadratic in r is left!\n // Solve it for r, and then the linear forms give x and y.\n // Do the whole process with every combination of signed br and cr.\n // (No need to treat negated ar because negating all of them is redundant)\n const result: ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] = [];\n const vector01 = Vector2d.createStartEnd(circles[0].center, circles[1].center);\n const vector02 = Vector2d.createStartEnd(circles[0].center, circles[2].center);\n const dot12 = vector01.dotProduct(vector02);\n const determinant = vector01.crossProduct(vector02);\n const determinantTol = 1.0e-8;\n const oneOverDeterminant = Geometry.conditionalDivideFraction(1.0, determinant);\n // messy tolerance test ported. Why not just a parallel test on the vectors?\n // maybe having 1/determinant is worth it?\n if (oneOverDeterminant === undefined\n || Math.abs(determinant) <= determinantTol * Math.abs(dot12)\n || oneOverDeterminant === undefined) {\n const signedR0 = circles[0].radius;\n for (const signedR1 of signedValues(circles[1].radius)) {\n for (const signedR2 of signedValues(circles[2].radius)) {\n this.solveColinearCCCTangents(\n circles[0], circles[1], circles[2],\n signedR0, signedR1, signedR2,\n result,\n );\n }\n }\n return result.length > 0 ? result : undefined;\n }\n const r0 = circles[0].radius;\n const inverseMatrix = Matrix3d.createRowValues(\n vector02.y * oneOverDeterminant, -vector01.y * oneOverDeterminant, 0.0,\n -vector02.x * oneOverDeterminant, vector01.x * oneOverDeterminant, 0.0,\n 0.0, 0.0, 1.0,\n );\n for (const r1 of signedValues(circles[1].radius)) {\n for (const r2 of signedValues(circles[2].radius)) {\n const vectorA = Vector3d.create(\n -0.5 * (Geometry.square(r1) - Geometry.square(vector01.x) - Geometry.square(vector01.y) - Geometry.square(r0)),\n -0.5 * (Geometry.square(r2) - Geometry.square(vector02.x) - Geometry.square(vector02.y) - Geometry.square(r0)),\n 0.0,\n );\n const vectorB = Vector3d.create(-(r1 - r0), -(r2 - r0), 0.0);\n const vectorA1 = inverseMatrix.multiplyVector(vectorA);\n const vectorB1 = inverseMatrix.multiplyVector(vectorB);\n const qa = vectorB1.magnitudeSquared() - 1.0;\n const qb = 2 * (vectorA1.dotProduct(vectorB1) - r0);\n const qc = vectorA1.magnitudeSquared() - Geometry.square(r0);\n const roots = Degree2PowerPolynomial.solveQuadratic(qa, qb, qc);\n if (roots !== undefined) {\n if (roots.length === 2\n && Geometry.isSmallMetricDistance(Math.abs(roots[0]) - Math.abs(roots[1])))\n roots.pop();\n for (const newRadius of roots) {\n const newCenter = circles[0].center.plus2Scaled(vectorA1, 1.0, vectorB1, newRadius);\n const newCircle = UnboundedCircle2dByCenterAndRadius.createPointRadius(newCenter, newRadius);\n if (!isThisCirclePresent(result, newCircle)) {\n const markup = new ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>(newCircle);\n markup.appendClosePoint(newCircle.center, circles[0], newCircle.center, newRadius);\n markup.appendClosePoint(newCircle.center, circles[1], newCircle.center, newRadius);\n markup.appendClosePoint(newCircle.center, circles[2], newCircle.center, newRadius);\n result.push(markup);\n }\n }\n }\n }\n }\n return result;\n }\n /**\n * Return all (i.e., up to 8) circles tangent to 3 circles.\n * @param circleA first circle\n * @param circleB second circle\n * @param circleC third circle\n */\n public static circlesTangentCCC(\n circleA: UnboundedCircle2dByCenterAndRadius,\n circleB: UnboundedCircle2dByCenterAndRadius,\n circleC: UnboundedCircle2dByCenterAndRadius,\n ): ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] | undefined {\n const circlesInOrder = [circleA, circleB, circleC];\n return this.circlesTangentCCCThisOrder(circlesInOrder);\n }\n /**\n * Return an unbounded line with the midpoint between pointA and pointB as its reference point\n * and the unit vector from pointA towards pointB as its normal.\n * @param pointA first point\n * @param pointB second point\n * @returns unbounded line, or undefined if pointA and pointB are coincident.\n */\n public static bisector(pointA: XAndY, pointB: XAndY): UnboundedLine2dByPointAndNormal | undefined {\n const vectorAB = Vector2d.createStartEnd(pointA, pointB);\n const midPoint = Point2d.createInterpolated(pointA, 0.5, pointB);\n const unitAB = vectorAB.normalize();\n if (unitAB === undefined)\n return undefined;\n return UnboundedLine2dByPointAndNormal.createPointNormal(midPoint, unitAB);\n }\n /**\n * Compute circles of specified radius tangent to each of the lines\n * * There are normally 4 circles\n * * The undefined case occurs when the lines are parallel.\n * @param lineA first line\n * @param lineB second line\n * @param radius radius of tangent circles\n * @returns array of circles with annotated tangencies. returns undefined if lines are parallel.\n */\n public static circlesTangentLLR(\n lineA: UnboundedLine2dByPointAndNormal,\n lineB: UnboundedLine2dByPointAndNormal,\n radius: number,\n ): ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] | undefined {\n // Construct lines offset by (positive and negative) radii.\n // For each of the 4 combinations of offset lines, the intersection of offsets is the\n // center of the tangent circle.\n if (Geometry.isSmallMetricDistance(radius))\n return undefined;\n const offsetA0 = lineA.cloneShifted(radius);\n const offsetA1 = lineA.cloneShifted(-radius);\n const offsetB0 = lineB.cloneShifted(radius);\n const offsetB1 = lineB.cloneShifted(-radius);\n if (offsetA0 === undefined || offsetA1 === undefined || offsetB0 === undefined || offsetB1 === undefined)\n return undefined;\n const offsetsA = [offsetA0, offsetA1];\n const offsetsB = [offsetB0, offsetB1];\n const result = [];\n for (const offsetA of offsetsA) {\n for (const offsetB of offsetsB) {\n const p = offsetA.intersectUnboundedLine2dByPointAndNormalWithOffsets(offsetB);\n if (p !== undefined) {\n const newCircle = UnboundedCircle2dByCenterAndRadius.createPointRadius(p, radius);\n if (!isThisCirclePresent(result, newCircle)) {\n const markup = new ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>(newCircle);\n markup.appendClosePoint(newCircle.center, lineA, newCircle.center, newCircle.radius);\n markup.appendClosePoint(newCircle.center, lineB, newCircle.center, newCircle.radius);\n result.push(markup);\n }\n }\n }\n }\n return result.length > 0 ? result : undefined;\n }\n /**\n * Compute circles of specified radius tangent to both a line and an arc\n * * There can be 0 to 8 circles\n * * The undefined case occurs when the smallest distance from circle to line exceeds radius.\n * @param circleA the circle\n * @param lineB the line\n * @param radius radius of tangent circles\n * @returns array of circles with annotated tangencies\n */\n public static circlesTangentCLR(\n circleA: UnboundedCircle2dByCenterAndRadius, lineB: UnboundedLine2dByPointAndNormal, radius: number,\n ): ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] | undefined {\n // From circleA, construct circles offset by positive and negative radii.\n // From lineB, construct lines offset by positive and negative radii.\n // Each combination of [offsetCircle, offsetLine] can have 2 intersections.\n // Each such intersection is the center of a tangent circle.\n if (Geometry.isSmallMetricDistance(radius))\n return undefined;\n const offsetsA = [\n UnboundedCircle2dByCenterAndRadius.createPointRadius(circleA.center, circleA.radius + radius),\n UnboundedCircle2dByCenterAndRadius.createPointRadius(circleA.center, circleA.radius - radius),\n ];\n const offsetB0 = lineB.cloneShifted(radius);\n const offsetB1 = lineB.cloneShifted(-radius);\n if (offsetB0 === undefined || offsetB1 === undefined)\n return undefined;\n const offsetsB = [offsetB0, offsetB1];\n const result = [];\n for (const offsetA of offsetsA) {\n for (const offsetB of offsetsB) {\n const points = offsetA.intersectLine(offsetB);\n for (const p of points) {\n const newCircle = UnboundedCircle2dByCenterAndRadius.createPointRadius(p, radius);\n if (!isThisCirclePresent(result, newCircle)) {\n const markup = new ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>(newCircle);\n markup.appendClosePoint(newCircle.center, circleA, newCircle.center, newCircle.radius);\n markup.appendClosePoint(newCircle.center, lineB, newCircle.center, newCircle.radius);\n result.push(markup);\n }\n }\n }\n }\n return result.length > 0 ? result : undefined;\n }\n /**\n * Compute circles of specified radius tangent to both circles\n * * There can be 0 to 8 circles\n * * The undefined case is when the smallest distance between the circles exceeds the requested radius.\n * @param circleA the first circle\n * @param circleB the second circle\n * @param radius radius of tangent circles\n * @returns array of circles with annotated tangencies\n */\n public static circlesTangentCCR(\n circleA: UnboundedCircle2dByCenterAndRadius, circleB: UnboundedCircle2dByCenterAndRadius, radius: number,\n ): ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] | undefined {\n // From circleA, construct circles offset by positive and negative radii.\n // From circleB, construct circles offset by positive and negative radii.\n // Each combination of [offsetA, offsetsB] can have 2 intersections.\n // Each such intersection is the center of a tangent circle.\n if (Geometry.isSmallMetricDistance(radius))\n return undefined;\n const offsetsA = [\n UnboundedCircle2dByCenterAndRadius.createPointRadius(circleA.center, circleA.radius + radius),\n UnboundedCircle2dByCenterAndRadius.createPointRadius(circleA.center, circleA.radius - radius),\n ];\n const offsetsB = [\n UnboundedCircle2dByCenterAndRadius.createPointRadius(circleB.center, circleB.radius + radius),\n UnboundedCircle2dByCenterAndRadius.createPointRadius(circleB.center, circleB.radius - radius),\n ];\n const result = [];\n for (const offsetA of offsetsA) {\n for (const offsetB of offsetsB) {\n const points = offsetA.intersectCircle(offsetB);\n for (const p of points) {\n const newCircle = UnboundedCircle2dByCenterAndRadius.createPointRadius(p, radius);\n if (!isThisCirclePresent(result, newCircle)) {\n const markup = new ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>(newCircle);\n markup.appendClosePoint(newCircle.center, circleA, newCircle.center, newCircle.radius);\n markup.appendClosePoint(newCircle.center, circleB, newCircle.center, newCircle.radius);\n result.push(markup);\n }\n }\n }\n }\n return result.length > 0 ? result : undefined;\n }\n /**\n * Construct basis vectors for hyperbola or ellipse whose points are equidistant from tangencies with\n * circleA and circleB.\n * * If the curve is a hyperbola, the equation is\n * X = center + vectorU * sec(theta) + vectorV * tan(theta)\n * * If the curve is an ellipse, the equation is\n * X = center + vectorU * cos(theta) + vectorV * sin(theta)\n * @param circleA first circle\n * @param circleB second circle\n */\n public static medialCurveCircleCircle(\n circleA: UnboundedCircle2dByCenterAndRadius, circleB: UnboundedCircle2dByCenterAndRadius,\n ): ImplicitCurve2d | undefined {\n const d = circleA.center.distance(circleB.center);\n const origin = circleA.center.interpolate(0.5, circleB.center);\n const h = circleA.radius + circleB.radius;\n const discriminant = d * d - h * h;\n const hy = Math.sqrt(Math.abs(discriminant));\n const xAxis = Vector2d.createStartEnd(origin, circleB.center).normalize();\n if (xAxis === undefined)\n return undefined;\n const yAxis = xAxis.rotate90CCWXY();\n const ax = 0.5 * h;\n const ay = 0.5 * hy;\n const vectorU = xAxis.scale(ax);\n const vectorV = yAxis.scale(ay);\n if (discriminant > 0.0) {\n return UnboundedHyperbola2d.createCenterAndAxisVectors(origin, vectorU, vectorV);\n } else if (discriminant < 0.0) {\n return UnboundedEllipse2d.createCenterAndAxisVectors(origin, vectorU, vectorV);\n }\n return undefined;\n }\n /**\n * Construct parabolas whose points are equidistant from tangencies with\n * circleA and circleB.\n * * Note that if th e circle has non-zero radius there are two parabolas based on\n * tangencies on near or far side of the circle.\n * @param line the line\n * @param circle the circle\n */\n public static medialCurveLineCircle(\n line: UnboundedLine2dByPointAndNormal, circle: UnboundedCircle2dByCenterAndRadius,\n ): ImplicitCurve2d[] | undefined {\n const linePoint = line.closestPoint(circle.center);\n if (linePoint === undefined)\n return undefined;\n const lineA = line.cloneNormalizedWithOrigin(linePoint);\n if (lineA === undefined)\n return undefined;\n const b = linePoint.distance(circle.center);\n const side = lineA.functionValue(circle.center) > 0 ? 1 : -1;\n const signedB = b * side;\n const signedRadii = [];\n if (Geometry.isSameCoordinate(circle.radius, -circle.radius))\n signedRadii.push(0);\n else {\n signedRadii.push(circle.radius);\n signedRadii.push(-circle.radius);\n }\n const result = [];\n for (const r of signedRadii) {\n const vertexDistance = (signedB - r) * 0.5;\n const vertex = lineA.point.plusScaled(lineA.normal, vertexDistance);\n const c = 2 * (signedB + r);\n const oneOverC = Geometry.conditionalDivideCoordinate(1, c);\n if (oneOverC !== undefined) {\n const vectorV = lineA.normal.clone().scale(oneOverC);\n const vectorU = lineA.normal.unitPerpendicularXY();\n const parabola = UnboundedParabola2d.createCenterAndAxisVectors(vertex, vectorU, vectorV);\n result.push(parabola);\n }\n }\n return result;\n }\n}\n/**\n * If distance is near zero metric, return an array containing only value.\n * If not near zero, return an array with both value and its negative (in that order).\n * @param distance the distance\n * @param value the value\n */\nfunction signedValues(distance: number, value?: number): number[] {\n if (value === undefined)\n value = distance;\n const values = [value];\n if (!Geometry.isSmallMetricDistance(distance))\n values.push(-value);\n return values;\n}\n/** Search an array of circles to see if a particular new circle is already present. */\nfunction isThisCirclePresent(\n circles: ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[], circle: UnboundedCircle2dByCenterAndRadius,\n): boolean {\n for (const c of circles) {\n if (circle.isSameCircle(c.curve, true))\n return true;\n }\n return false;\n}\n"]}
@@ -0,0 +1,97 @@
1
+ import { Point2d } from "../../../geometry3d/Point2dVector2d";
2
+ import { ImplicitCurve2d, ImplicitGeometryMarkup } from "./ImplicitCurve2d";
3
+ import { UnboundedCircle2dByCenterAndRadius } from "./UnboundedCircle2d";
4
+ import { UnboundedLine2dByPointAndNormal } from "./UnboundedLine2d";
5
+ /**
6
+ * Itemization of constraints for line and circle construction.
7
+ * Not all combinations are solvable!
8
+ * @internal
9
+ */
10
+ export declare enum ConstraintType {
11
+ throughPoint = 0,
12
+ radius = 1,
13
+ perpendicularTo = 2,
14
+ tangentTo = 3,
15
+ curveLength = 4
16
+ }
17
+ /**
18
+ * Represents a single construction constraint used by `ConstraintSet`.
19
+ * @internal
20
+ */
21
+ export declare class ConstraintConstruction {
22
+ constraintType: ConstraintType;
23
+ curve?: ImplicitCurve2d;
24
+ point?: Point2d;
25
+ radius?: number;
26
+ private constructor();
27
+ /** Create a constraint requiring the constructed geometry to pass through a point. */
28
+ static createThroughPoint(point: Point2d): ConstraintConstruction;
29
+ /** Create a tangency constraint to a curve. */
30
+ static createTangentTo(curve: ImplicitCurve2d): ConstraintConstruction;
31
+ /** Create a perpendicularity constraint to a curve. */
32
+ static createPerpendicularTo(curve: ImplicitCurve2d): ConstraintConstruction;
33
+ /** Create a fixed-radius constraint. */
34
+ static createRadius(radius: number): ConstraintConstruction;
35
+ /**
36
+ * Return a clone of this constraint.
37
+ * * point or curve referenced by this constraint are cloned.
38
+ */
39
+ clone(): ConstraintConstruction;
40
+ }
41
+ /**
42
+ * Collection of construction constraints for line and circle construction.
43
+ * @internal
44
+ */
45
+ export declare class ConstraintSet {
46
+ private _constraints;
47
+ private constructor();
48
+ /** Create an empty constraint set. */
49
+ static create(): ConstraintSet;
50
+ /** Clone this constraint set. */
51
+ clone(): ConstraintSet;
52
+ /**
53
+ * Add a new constraint to the array.
54
+ * @param constraint the constraint to add.
55
+ * @returns true if the constraint was accepted.
56
+ */
57
+ addConstraint(constraint: ConstraintConstruction): boolean;
58
+ /** Count constraints of a specific type. */
59
+ countConstraintType(t: ConstraintType): number;
60
+ /** Replace zero-radius circle tangency constraints with through-point constraints. */
61
+ convertZeroRadiusCirclesToThroughPoint(): void;
62
+ /** Replace through-point constraints with tangency to zero-radius circles. */
63
+ convertThroughPointToZeroRadiusCircles(): void;
64
+ /** Normalize all lines for the `tangentTo` constraint. */
65
+ normalizeLines(): void;
66
+ /**
67
+ * Return
68
+ * * 1 if the constraint curve is UnboundedLine2dByPointAndNormal
69
+ * * 2 if the constraint curve is UnboundedCircle2dByCenterAndRadius
70
+ * * 0 otherwise
71
+ * @param c the constraint.
72
+ */
73
+ private static tangentGeometryLineCircleType;
74
+ /**
75
+ * Sort the given constraints with
76
+ * * Primary sort is on constraint type
77
+ * * For equal constraint type, apply ordering from tangentGeometryType function.
78
+ */
79
+ static sortByConstraintTypeAndGeometryType(constraints: ConstraintConstruction[]): void;
80
+ /**
81
+ * Given an array of constraint requests (e.g. tangent to circle, tangent to line, etc),
82
+ * construct all circles that satisfy the conditions.
83
+ * * Circles are defined by 3 conditions, so there is null output for inputs with other than 3 constraints.
84
+ * * Returns undefined if no solver is available for the requested constraints.
85
+ * @returns Array of circles with markup about how or where the constraints are satisfied.
86
+ */
87
+ constructConstrainedCircles(): ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] | undefined;
88
+ /**
89
+ * Given an array of constraint requests (e.g. tangent to circle, tangent to line, etc),
90
+ * construct all lines that satisfy the conditions.
91
+ * * Lines are defined by 2 conditions, so there is null output for inputs with other than 2 constraints.
92
+ * * Returns undefined if no solver is available for the requested constraints.
93
+ * @returns Array of lines with markup about how or where the constraints are satisfied.
94
+ */
95
+ constructConstrainedLines(): ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>[] | undefined;
96
+ }
97
+ //# sourceMappingURL=ConstraintSet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConstraintSet.d.ts","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/ConstraintSet.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAq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;;;;;;OAMG;IACI,2BAA2B,IAAI,sBAAsB,CAAC,kCAAkC,CAAC,EAAE,GAAG,SAAS;IAgD9G;;;;;;OAMG;IACI,yBAAyB,IAAI,sBAAsB,CAAC,+BAA+B,CAAC,EAAE,GAAG,SAAS;CAwC1G"}
@@ -0,0 +1,295 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module CartesianGeometry
7
+ */
8
+ import { Geometry } from "../../../Geometry";
9
+ import { ConstrainedImplicitCurve2d } from "./ConstrainedImplicitCurve2d";
10
+ import { UnboundedCircle2dByCenterAndRadius } from "./UnboundedCircle2d";
11
+ import { UnboundedLine2dByPointAndNormal } from "./UnboundedLine2d";
12
+ /**
13
+ * Itemization of constraints for line and circle construction.
14
+ * Not all combinations are solvable!
15
+ * @internal
16
+ */
17
+ export var ConstraintType;
18
+ (function (ConstraintType) {
19
+ ConstraintType[ConstraintType["throughPoint"] = 0] = "throughPoint";
20
+ ConstraintType[ConstraintType["radius"] = 1] = "radius";
21
+ ConstraintType[ConstraintType["perpendicularTo"] = 2] = "perpendicularTo";
22
+ ConstraintType[ConstraintType["tangentTo"] = 3] = "tangentTo";
23
+ ConstraintType[ConstraintType["curveLength"] = 4] = "curveLength";
24
+ })(ConstraintType || (ConstraintType = {}));
25
+ /**
26
+ * Represents a single construction constraint used by `ConstraintSet`.
27
+ * @internal
28
+ */
29
+ export class ConstraintConstruction {
30
+ constraintType;
31
+ curve;
32
+ point;
33
+ radius;
34
+ constructor(constraintType) {
35
+ this.constraintType = constraintType;
36
+ }
37
+ /** Create a constraint requiring the constructed geometry to pass through a point. */
38
+ static createThroughPoint(point) {
39
+ const c = new ConstraintConstruction(ConstraintType.throughPoint);
40
+ c.point = point.clone();
41
+ return c;
42
+ }
43
+ /** Create a tangency constraint to a curve. */
44
+ static createTangentTo(curve) {
45
+ const c = new ConstraintConstruction(ConstraintType.tangentTo);
46
+ c.curve = curve.clone();
47
+ return c;
48
+ }
49
+ /** Create a perpendicularity constraint to a curve. */
50
+ static createPerpendicularTo(curve) {
51
+ const c = new ConstraintConstruction(ConstraintType.perpendicularTo);
52
+ c.curve = curve.clone();
53
+ return c;
54
+ }
55
+ /** Create a fixed-radius constraint. */
56
+ static createRadius(radius) {
57
+ const c = new ConstraintConstruction(ConstraintType.radius);
58
+ c.radius = radius;
59
+ return c;
60
+ }
61
+ /**
62
+ * Return a clone of this constraint.
63
+ * * point or curve referenced by this constraint are cloned.
64
+ */
65
+ clone() {
66
+ const c = new ConstraintConstruction(this.constraintType);
67
+ if (this.curve !== undefined)
68
+ c.curve = this.curve.clone();
69
+ if (this.point !== undefined)
70
+ c.point = this.point.clone();
71
+ if (this.radius !== undefined)
72
+ c.radius = this.radius;
73
+ return c;
74
+ }
75
+ }
76
+ /**
77
+ * Collection of construction constraints for line and circle construction.
78
+ * @internal
79
+ */
80
+ export class ConstraintSet {
81
+ _constraints;
82
+ constructor() {
83
+ this._constraints = [];
84
+ }
85
+ /** Create an empty constraint set. */
86
+ static create() {
87
+ return new ConstraintSet();
88
+ }
89
+ /** Clone this constraint set. */
90
+ clone() {
91
+ const theClone = ConstraintSet.create();
92
+ for (const c of this._constraints) {
93
+ theClone._constraints.push(c.clone());
94
+ }
95
+ return theClone;
96
+ }
97
+ /**
98
+ * Add a new constraint to the array.
99
+ * @param constraint the constraint to add.
100
+ * @returns true if the constraint was accepted.
101
+ */
102
+ addConstraint(constraint) {
103
+ this._constraints.push(constraint);
104
+ return true;
105
+ }
106
+ /** Count constraints of a specific type. */
107
+ countConstraintType(t) {
108
+ let n = 0;
109
+ for (const c of this._constraints) {
110
+ if (c.constraintType === t)
111
+ n++;
112
+ }
113
+ return n;
114
+ }
115
+ /** Replace zero-radius circle tangency constraints with through-point constraints. */
116
+ convertZeroRadiusCirclesToThroughPoint() {
117
+ for (let i = 0; i < this._constraints.length; i++) {
118
+ const c = this._constraints[i];
119
+ if (c.constraintType === ConstraintType.tangentTo
120
+ && c.curve !== undefined
121
+ && c.curve instanceof UnboundedCircle2dByCenterAndRadius
122
+ && Geometry.isSmallMetricDistance(c.curve.radius)) {
123
+ const c1 = ConstraintConstruction.createThroughPoint(c.curve.center);
124
+ this._constraints[i] = c1;
125
+ }
126
+ }
127
+ }
128
+ /** Replace through-point constraints with tangency to zero-radius circles. */
129
+ convertThroughPointToZeroRadiusCircles() {
130
+ for (let i = 0; i < this._constraints.length; i++) {
131
+ const c = this._constraints[i];
132
+ if (c.constraintType === ConstraintType.throughPoint && c.point !== undefined) {
133
+ const c1 = ConstraintConstruction.createTangentTo(UnboundedCircle2dByCenterAndRadius.createPointRadius(c.point, 0.0));
134
+ this._constraints[i] = c1;
135
+ }
136
+ }
137
+ }
138
+ /** Normalize all lines for the `tangentTo` constraint. */
139
+ normalizeLines() {
140
+ for (let i = 0; i < this._constraints.length; i++) {
141
+ const c = this._constraints[i];
142
+ if (c.constraintType === ConstraintType.tangentTo && c.curve instanceof UnboundedLine2dByPointAndNormal) {
143
+ const newLine = c.curve.cloneNormalizedFromOrigin();
144
+ if (newLine !== undefined) {
145
+ const c1 = ConstraintConstruction.createTangentTo(newLine);
146
+ this._constraints[i] = c1;
147
+ }
148
+ }
149
+ }
150
+ }
151
+ /**
152
+ * Return
153
+ * * 1 if the constraint curve is UnboundedLine2dByPointAndNormal
154
+ * * 2 if the constraint curve is UnboundedCircle2dByCenterAndRadius
155
+ * * 0 otherwise
156
+ * @param c the constraint.
157
+ */
158
+ static tangentGeometryLineCircleType(c) {
159
+ if (c.curve instanceof UnboundedCircle2dByCenterAndRadius)
160
+ return 2;
161
+ if (c.curve instanceof UnboundedLine2dByPointAndNormal)
162
+ return 1;
163
+ return 0;
164
+ }
165
+ /**
166
+ * Sort the given constraints with
167
+ * * Primary sort is on constraint type
168
+ * * For equal constraint type, apply ordering from tangentGeometryType function.
169
+ */
170
+ static sortByConstraintTypeAndGeometryType(constraints) {
171
+ constraints.sort((a, b) => {
172
+ if (a.constraintType === b.constraintType) {
173
+ const ga = this.tangentGeometryLineCircleType(a);
174
+ const gb = this.tangentGeometryLineCircleType(b);
175
+ if (ga === gb)
176
+ return 0;
177
+ return ga < gb ? -1 : 1;
178
+ }
179
+ return (a.constraintType < b.constraintType) ? -1 : 1;
180
+ });
181
+ }
182
+ /**
183
+ * Given an array of constraint requests (e.g. tangent to circle, tangent to line, etc),
184
+ * construct all circles that satisfy the conditions.
185
+ * * Circles are defined by 3 conditions, so there is null output for inputs with other than 3 constraints.
186
+ * * Returns undefined if no solver is available for the requested constraints.
187
+ * @returns Array of circles with markup about how or where the constraints are satisfied.
188
+ */
189
+ constructConstrainedCircles() {
190
+ if (this._constraints.length !== 3)
191
+ return undefined;
192
+ const constraints = this.clone();
193
+ constraints.convertThroughPointToZeroRadiusCircles();
194
+ constraints.normalizeLines();
195
+ ConstraintSet.sortByConstraintTypeAndGeometryType(constraints._constraints);
196
+ // note that pass-through points are now tangentTo circles with zero radius
197
+ const numTangent = constraints.countConstraintType(ConstraintType.tangentTo);
198
+ const numRadius = constraints.countConstraintType(ConstraintType.radius);
199
+ const c0 = constraints._constraints[0];
200
+ const c1 = constraints._constraints[1];
201
+ const c2 = constraints._constraints[2];
202
+ if (numTangent === 3) {
203
+ // radius comes first, then line(s), then circle(s); once a circle is encountered, the rest must be circles
204
+ if (c0.curve instanceof UnboundedLine2dByPointAndNormal) {
205
+ if (c1.curve instanceof UnboundedLine2dByPointAndNormal) {
206
+ if (c2.curve instanceof UnboundedLine2dByPointAndNormal) {
207
+ return ConstrainedImplicitCurve2d.circlesTangentLLL(c0.curve, c1.curve, c2.curve);
208
+ }
209
+ else if (c2.curve instanceof UnboundedCircle2dByCenterAndRadius) {
210
+ return ConstrainedImplicitCurve2d.circlesTangentLLC(c0.curve, c1.curve, c2.curve);
211
+ }
212
+ }
213
+ else if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {
214
+ if (c2.curve instanceof UnboundedCircle2dByCenterAndRadius) {
215
+ return ConstrainedImplicitCurve2d.circlesTangentCCL(c1.curve, c2.curve, c0.curve);
216
+ }
217
+ }
218
+ }
219
+ else if (c0.curve instanceof UnboundedCircle2dByCenterAndRadius) {
220
+ if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius
221
+ && c2.curve instanceof UnboundedCircle2dByCenterAndRadius) {
222
+ return ConstrainedImplicitCurve2d.circlesTangentCCC(c0.curve, c1.curve, c2.curve);
223
+ }
224
+ }
225
+ }
226
+ else if (numRadius === 1 && numTangent === 2 && c0.radius !== undefined) {
227
+ if (c1.curve instanceof UnboundedLine2dByPointAndNormal) {
228
+ if (c2.curve instanceof UnboundedLine2dByPointAndNormal) {
229
+ return ConstrainedImplicitCurve2d.circlesTangentLLR(c1.curve, c2.curve, c0.radius);
230
+ }
231
+ else if (c2.curve instanceof UnboundedCircle2dByCenterAndRadius) {
232
+ return ConstrainedImplicitCurve2d.circlesTangentCLR(c2.curve, c1.curve, c0.radius);
233
+ }
234
+ }
235
+ else if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {
236
+ if (c2.curve instanceof UnboundedCircle2dByCenterAndRadius) {
237
+ return ConstrainedImplicitCurve2d.circlesTangentCCR(c1.curve, c2.curve, c0.radius);
238
+ }
239
+ }
240
+ }
241
+ return undefined;
242
+ }
243
+ /**
244
+ * Given an array of constraint requests (e.g. tangent to circle, tangent to line, etc),
245
+ * construct all lines that satisfy the conditions.
246
+ * * Lines are defined by 2 conditions, so there is null output for inputs with other than 2 constraints.
247
+ * * Returns undefined if no solver is available for the requested constraints.
248
+ * @returns Array of lines with markup about how or where the constraints are satisfied.
249
+ */
250
+ constructConstrainedLines() {
251
+ if (this._constraints.length !== 2)
252
+ return undefined;
253
+ const constraints = this.clone();
254
+ constraints.convertThroughPointToZeroRadiusCircles();
255
+ constraints.normalizeLines();
256
+ ConstraintSet.sortByConstraintTypeAndGeometryType(constraints._constraints);
257
+ // note that pass-through points are now tangentTo circles with zero radius
258
+ const numTangent = constraints.countConstraintType(ConstraintType.tangentTo);
259
+ const numPerp = constraints.countConstraintType(ConstraintType.perpendicularTo);
260
+ const c0 = constraints._constraints[0];
261
+ const c1 = constraints._constraints[1];
262
+ if (numTangent === 2) {
263
+ if (c0.curve instanceof UnboundedCircle2dByCenterAndRadius) {
264
+ if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {
265
+ return ConstrainedImplicitCurve2d.linesTangentCC(c1.curve, c0.curve);
266
+ }
267
+ }
268
+ }
269
+ else if (numPerp === 2) {
270
+ if (c0.curve instanceof UnboundedCircle2dByCenterAndRadius) {
271
+ if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {
272
+ return ConstrainedImplicitCurve2d.linesPerpCPerpC(c0.curve, c1.curve);
273
+ }
274
+ }
275
+ else if (c0.curve instanceof UnboundedLine2dByPointAndNormal) {
276
+ if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {
277
+ return ConstrainedImplicitCurve2d.linesPerpLPerpC(c0.curve, c1.curve);
278
+ }
279
+ }
280
+ }
281
+ else if (numPerp === 1 && numTangent === 1) {
282
+ // the tangent comes second and must be a circle
283
+ if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {
284
+ if (c0.curve instanceof UnboundedCircle2dByCenterAndRadius) {
285
+ return ConstrainedImplicitCurve2d.linesPerpCTangentC(c0.curve, c1.curve);
286
+ }
287
+ else if (c0.curve instanceof UnboundedLine2dByPointAndNormal) {
288
+ return ConstrainedImplicitCurve2d.linesPerpLTangentC(c0.curve, c1.curve);
289
+ }
290
+ }
291
+ }
292
+ return undefined;
293
+ }
294
+ }
295
+ //# sourceMappingURL=ConstraintSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConstraintSet.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/ConstraintSet.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,O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,EAAE,CAAC,KAAK,YAAY,+BAA+B,EAAE,CAAC;oBAC/D,OAAO,0BAA0B,CAAC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;gBAC3E,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { Geometry } from \"../../../Geometry\";\nimport { Point2d } from \"../../../geometry3d/Point2dVector2d\";\nimport { ConstrainedImplicitCurve2d } from \"./ConstrainedImplicitCurve2d\";\nimport { ImplicitCurve2d, ImplicitGeometryMarkup } from \"./ImplicitCurve2d\";\nimport { UnboundedCircle2dByCenterAndRadius } from \"./UnboundedCircle2d\";\nimport { UnboundedLine2dByPointAndNormal } from \"./UnboundedLine2d\";\n\n/**\n * Itemization of constraints for line and circle construction.\n * Not all combinations are solvable!\n * @internal\n */\n\nexport enum ConstraintType {\n throughPoint,\n radius,\n perpendicularTo,\n tangentTo,\n curveLength\n}\n\n/**\n * Represents a single construction constraint used by `ConstraintSet`.\n * @internal\n */\nexport class ConstraintConstruction {\n public constraintType: ConstraintType;\n public curve?: ImplicitCurve2d;\n public point?: Point2d;\n public radius?: number;\n private constructor(constraintType: ConstraintType) {\n this.constraintType = constraintType;\n }\n /** Create a constraint requiring the constructed geometry to pass through a point. */\n public static createThroughPoint(point: Point2d): ConstraintConstruction {\n const c = new ConstraintConstruction(ConstraintType.throughPoint);\n c.point = point.clone();\n return c;\n }\n /** Create a tangency constraint to a curve. */\n public static createTangentTo(curve: ImplicitCurve2d): ConstraintConstruction {\n const c = new ConstraintConstruction(ConstraintType.tangentTo);\n c.curve = curve.clone();\n return c;\n }\n /** Create a perpendicularity constraint to a curve. */\n public static createPerpendicularTo(curve: ImplicitCurve2d): ConstraintConstruction {\n const c = new ConstraintConstruction(ConstraintType.perpendicularTo);\n c.curve = curve.clone();\n return c;\n }\n /** Create a fixed-radius constraint. */\n public static createRadius(radius: number): ConstraintConstruction {\n const c = new ConstraintConstruction(ConstraintType.radius);\n c.radius = radius;\n return c;\n }\n /**\n * Return a clone of this constraint.\n * * point or curve referenced by this constraint are cloned.\n */\n public clone(): ConstraintConstruction {\n const c = new ConstraintConstruction(this.constraintType);\n if (this.curve !== undefined)\n c.curve = this.curve.clone();\n if (this.point !== undefined)\n c.point = this.point.clone();\n if (this.radius !== undefined)\n c.radius = this.radius;\n return c;\n }\n}\n\n/**\n * Collection of construction constraints for line and circle construction.\n * @internal\n */\nexport class ConstraintSet {\n private _constraints: ConstraintConstruction[];\n private constructor() {\n this._constraints = [];\n }\n /** Create an empty constraint set. */\n public static create(): ConstraintSet {\n return new ConstraintSet();\n }\n /** Clone this constraint set. */\n public clone(): ConstraintSet {\n const theClone = ConstraintSet.create();\n for (const c of this._constraints) {\n theClone._constraints.push(c.clone());\n }\n return theClone;\n }\n /**\n * Add a new constraint to the array.\n * @param constraint the constraint to add.\n * @returns true if the constraint was accepted.\n */\n public addConstraint(constraint: ConstraintConstruction): boolean {\n this._constraints.push(constraint);\n return true;\n }\n /** Count constraints of a specific type. */\n public countConstraintType(t: ConstraintType): number {\n let n = 0;\n for (const c of this._constraints) {\n if (c.constraintType === t)\n n++;\n }\n return n;\n }\n /** Replace zero-radius circle tangency constraints with through-point constraints. */\n public convertZeroRadiusCirclesToThroughPoint(): void {\n for (let i = 0; i < this._constraints.length; i++) {\n const c = this._constraints[i];\n if (c.constraintType === ConstraintType.tangentTo\n && c.curve !== undefined\n && c.curve instanceof UnboundedCircle2dByCenterAndRadius\n && Geometry.isSmallMetricDistance(c.curve.radius)) {\n const c1 = ConstraintConstruction.createThroughPoint(c.curve.center);\n this._constraints[i] = c1;\n }\n }\n }\n /** Replace through-point constraints with tangency to zero-radius circles. */\n public convertThroughPointToZeroRadiusCircles(): void {\n for (let i = 0; i < this._constraints.length; i++) {\n const c = this._constraints[i];\n if (c.constraintType === ConstraintType.throughPoint && c.point !== undefined) {\n const c1 = ConstraintConstruction.createTangentTo(\n UnboundedCircle2dByCenterAndRadius.createPointRadius(c.point, 0.0)\n );\n this._constraints[i] = c1;\n }\n }\n }\n /** Normalize all lines for the `tangentTo` constraint. */\n public normalizeLines(): void {\n for (let i = 0; i < this._constraints.length; i++) {\n const c = this._constraints[i];\n if (c.constraintType === ConstraintType.tangentTo && c.curve instanceof UnboundedLine2dByPointAndNormal) {\n const newLine = c.curve.cloneNormalizedFromOrigin();\n if (newLine !== undefined) {\n const c1 = ConstraintConstruction.createTangentTo(newLine);\n this._constraints[i] = c1;\n }\n }\n }\n }\n /**\n * Return\n * * 1 if the constraint curve is UnboundedLine2dByPointAndNormal\n * * 2 if the constraint curve is UnboundedCircle2dByCenterAndRadius\n * * 0 otherwise\n * @param c the constraint.\n */\n private static tangentGeometryLineCircleType(c: ConstraintConstruction): number {\n if (c.curve instanceof UnboundedCircle2dByCenterAndRadius)\n return 2;\n if (c.curve instanceof UnboundedLine2dByPointAndNormal)\n return 1;\n return 0;\n }\n /**\n * Sort the given constraints with\n * * Primary sort is on constraint type\n * * For equal constraint type, apply ordering from tangentGeometryType function.\n */\n public static sortByConstraintTypeAndGeometryType(constraints: ConstraintConstruction[]) {\n constraints.sort(\n (a: ConstraintConstruction, b: ConstraintConstruction) => {\n if (a.constraintType === b.constraintType) {\n const ga = this.tangentGeometryLineCircleType(a);\n const gb = this.tangentGeometryLineCircleType(b);\n if (ga === gb)\n return 0;\n return ga < gb ? -1 : 1;\n }\n return (a.constraintType < b.constraintType) ? -1 : 1;\n }\n )\n }\n /**\n * Given an array of constraint requests (e.g. tangent to circle, tangent to line, etc),\n * construct all circles that satisfy the conditions.\n * * Circles are defined by 3 conditions, so there is null output for inputs with other than 3 constraints.\n * * Returns undefined if no solver is available for the requested constraints.\n * @returns Array of circles with markup about how or where the constraints are satisfied.\n */\n public constructConstrainedCircles(): ImplicitGeometryMarkup<UnboundedCircle2dByCenterAndRadius>[] | undefined {\n if (this._constraints.length !== 3)\n return undefined;\n const constraints = this.clone();\n constraints.convertThroughPointToZeroRadiusCircles();\n constraints.normalizeLines();\n ConstraintSet.sortByConstraintTypeAndGeometryType(constraints._constraints);\n // note that pass-through points are now tangentTo circles with zero radius\n const numTangent = constraints.countConstraintType(ConstraintType.tangentTo);\n const numRadius = constraints.countConstraintType(ConstraintType.radius);\n const c0 = constraints._constraints[0];\n const c1 = constraints._constraints[1];\n const c2 = constraints._constraints[2];\n if (numTangent === 3) {\n // radius comes first, then line(s), then circle(s); once a circle is encountered, the rest must be circles\n if (c0.curve instanceof UnboundedLine2dByPointAndNormal) {\n if (c1.curve instanceof UnboundedLine2dByPointAndNormal) {\n if (c2.curve instanceof UnboundedLine2dByPointAndNormal) {\n return ConstrainedImplicitCurve2d.circlesTangentLLL(c0.curve, c1.curve, c2.curve);\n } else if (c2.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n return ConstrainedImplicitCurve2d.circlesTangentLLC(c0.curve, c1.curve, c2.curve);\n }\n } else if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n if (c2.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n return ConstrainedImplicitCurve2d.circlesTangentCCL(c1.curve, c2.curve, c0.curve);\n }\n }\n } else if (c0.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius\n && c2.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n return ConstrainedImplicitCurve2d.circlesTangentCCC(c0.curve, c1.curve, c2.curve);\n }\n }\n } else if (numRadius === 1 && numTangent === 2 && c0.radius !== undefined) {\n if (c1.curve instanceof UnboundedLine2dByPointAndNormal) {\n if (c2.curve instanceof UnboundedLine2dByPointAndNormal) {\n return ConstrainedImplicitCurve2d.circlesTangentLLR(c1.curve, c2.curve, c0.radius);\n } else if (c2.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n return ConstrainedImplicitCurve2d.circlesTangentCLR(c2.curve, c1.curve, c0.radius);\n }\n } else if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n if (c2.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n return ConstrainedImplicitCurve2d.circlesTangentCCR(c1.curve, c2.curve, c0.radius);\n }\n }\n }\n return undefined;\n }\n /**\n * Given an array of constraint requests (e.g. tangent to circle, tangent to line, etc),\n * construct all lines that satisfy the conditions.\n * * Lines are defined by 2 conditions, so there is null output for inputs with other than 2 constraints.\n * * Returns undefined if no solver is available for the requested constraints.\n * @returns Array of lines with markup about how or where the constraints are satisfied.\n */\n public constructConstrainedLines(): ImplicitGeometryMarkup<UnboundedLine2dByPointAndNormal>[] | undefined {\n if (this._constraints.length !== 2)\n return undefined;\n const constraints = this.clone();\n constraints.convertThroughPointToZeroRadiusCircles();\n constraints.normalizeLines();\n ConstraintSet.sortByConstraintTypeAndGeometryType(constraints._constraints);\n // note that pass-through points are now tangentTo circles with zero radius\n const numTangent = constraints.countConstraintType(ConstraintType.tangentTo);\n const numPerp = constraints.countConstraintType(ConstraintType.perpendicularTo);\n const c0 = constraints._constraints[0];\n const c1 = constraints._constraints[1];\n if (numTangent === 2) {\n if (c0.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n return ConstrainedImplicitCurve2d.linesTangentCC(c1.curve, c0.curve);\n }\n }\n } else if (numPerp === 2) {\n if (c0.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n return ConstrainedImplicitCurve2d.linesPerpCPerpC(c0.curve, c1.curve);\n }\n } else if (c0.curve instanceof UnboundedLine2dByPointAndNormal) {\n if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n return ConstrainedImplicitCurve2d.linesPerpLPerpC(c0.curve, c1.curve);\n }\n }\n } else if (numPerp === 1 && numTangent === 1) {\n // the tangent comes second and must be a circle\n if (c1.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n if (c0.curve instanceof UnboundedCircle2dByCenterAndRadius) {\n return ConstrainedImplicitCurve2d.linesPerpCTangentC(c0.curve, c1.curve);\n } else if (c0.curve instanceof UnboundedLine2dByPointAndNormal) {\n return ConstrainedImplicitCurve2d.linesPerpLTangentC(c0.curve, c1.curve);\n }\n }\n }\n return undefined;\n }\n}\n"]}