@itwin/core-geometry 5.14.0-dev.2 → 5.14.0-dev.20

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 (230) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/lib/cjs/bspline/AkimaCurve3d.d.ts +18 -13
  3. package/lib/cjs/bspline/AkimaCurve3d.d.ts.map +1 -1
  4. package/lib/cjs/bspline/AkimaCurve3d.js +19 -16
  5. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.d.ts +2 -1
  7. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurve.js +3 -2
  9. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  10. package/lib/cjs/bspline/InterpolationCurve3d.d.ts +5 -1
  11. package/lib/cjs/bspline/InterpolationCurve3d.d.ts.map +1 -1
  12. package/lib/cjs/bspline/InterpolationCurve3d.js +11 -11
  13. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  14. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  15. package/lib/cjs/clipping/ClipUtils.js +0 -2
  16. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  17. package/lib/cjs/curve/CoordinateXYZ.d.ts +2 -2
  18. package/lib/cjs/curve/CoordinateXYZ.d.ts.map +1 -1
  19. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  20. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +5 -5
  21. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  22. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +9 -23
  23. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  24. package/lib/cjs/curve/CurveCollection.d.ts +20 -4
  25. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  26. package/lib/cjs/curve/CurveCollection.js +39 -2
  27. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  28. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  29. package/lib/cjs/curve/CurveFactory.js +4 -5
  30. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  31. package/lib/cjs/curve/CurveOps.d.ts.map +1 -1
  32. package/lib/cjs/curve/CurveOps.js.map +1 -1
  33. package/lib/cjs/curve/CurvePrimitive.d.ts +10 -3
  34. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  35. package/lib/cjs/curve/CurvePrimitive.js +1 -1
  36. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  37. package/lib/cjs/curve/CurveProcessor.d.ts +7 -7
  38. package/lib/cjs/curve/CurveProcessor.d.ts.map +1 -1
  39. package/lib/cjs/curve/CurveProcessor.js +19 -3
  40. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  41. package/lib/cjs/curve/GeometryQuery.d.ts +49 -4
  42. package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
  43. package/lib/cjs/curve/GeometryQuery.js +52 -0
  44. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  45. package/lib/cjs/curve/LineSegment3d.d.ts +1 -1
  46. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  47. package/lib/cjs/curve/LineSegment3d.js +1 -1
  48. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  49. package/lib/cjs/curve/Loop.d.ts +18 -2
  50. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  51. package/lib/cjs/curve/Loop.js +26 -1
  52. package/lib/cjs/curve/Loop.js.map +1 -1
  53. package/lib/cjs/curve/ParityRegion.d.ts +7 -2
  54. package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
  55. package/lib/cjs/curve/ParityRegion.js +9 -8
  56. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  57. package/lib/cjs/curve/Path.d.ts +8 -1
  58. package/lib/cjs/curve/Path.d.ts.map +1 -1
  59. package/lib/cjs/curve/Path.js +12 -0
  60. package/lib/cjs/curve/Path.js.map +1 -1
  61. package/lib/cjs/curve/ProxyCurve.d.ts +1 -1
  62. package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
  63. package/lib/cjs/curve/ProxyCurve.js +2 -3
  64. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  65. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +36 -35
  66. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  67. package/lib/cjs/curve/Query/PlanarSubdivision.js +4 -4
  68. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  69. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  70. package/lib/cjs/curve/RegionOps.js +3 -3
  71. package/lib/cjs/curve/RegionOps.js.map +1 -1
  72. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  73. package/lib/cjs/curve/UnionRegion.d.ts +9 -2
  74. package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
  75. package/lib/cjs/curve/UnionRegion.js +12 -0
  76. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  77. package/lib/cjs/curve/internalContexts/CloneCurvesContext.d.ts +1 -0
  78. package/lib/cjs/curve/internalContexts/CloneCurvesContext.d.ts.map +1 -1
  79. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js +3 -1
  80. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.d.ts +1 -6
  82. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.d.ts.map +1 -1
  83. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js +15 -8
  84. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  85. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +5 -2
  86. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  87. package/lib/cjs/curve/spiral/DirectSpiral3d.js +6 -3
  88. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  89. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +5 -2
  90. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  91. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +6 -3
  92. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  93. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +2 -0
  94. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  95. package/lib/cjs/geometry3d/Point3dVector3d.js +4 -0
  96. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  97. package/lib/cjs/geometry3d/Range.d.ts +2 -0
  98. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  99. package/lib/cjs/geometry3d/Range.js +6 -0
  100. package/lib/cjs/geometry3d/Range.js.map +1 -1
  101. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  102. package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
  103. package/lib/cjs/serialization/BGFBReader.js +5 -2
  104. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  105. package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
  106. package/lib/cjs/serialization/BGFBWriter.js +1 -2
  107. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  108. package/lib/cjs/serialization/IModelJsonSchema.d.ts +36 -22
  109. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  110. package/lib/cjs/serialization/IModelJsonSchema.js +16 -17
  111. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  112. package/lib/cjs/topology/Merging.d.ts +4 -2
  113. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  114. package/lib/cjs/topology/Merging.js +23 -20
  115. package/lib/cjs/topology/Merging.js.map +1 -1
  116. package/lib/esm/bspline/AkimaCurve3d.d.ts +18 -13
  117. package/lib/esm/bspline/AkimaCurve3d.d.ts.map +1 -1
  118. package/lib/esm/bspline/AkimaCurve3d.js +19 -16
  119. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  120. package/lib/esm/bspline/BSplineCurve.d.ts +2 -1
  121. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  122. package/lib/esm/bspline/BSplineCurve.js +3 -2
  123. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  124. package/lib/esm/bspline/InterpolationCurve3d.d.ts +5 -1
  125. package/lib/esm/bspline/InterpolationCurve3d.d.ts.map +1 -1
  126. package/lib/esm/bspline/InterpolationCurve3d.js +11 -11
  127. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  128. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  129. package/lib/esm/clipping/ClipUtils.js +0 -2
  130. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  131. package/lib/esm/curve/CoordinateXYZ.d.ts +2 -2
  132. package/lib/esm/curve/CoordinateXYZ.d.ts.map +1 -1
  133. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  134. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +5 -5
  135. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  136. package/lib/esm/curve/CurveChainWithDistanceIndex.js +9 -23
  137. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  138. package/lib/esm/curve/CurveCollection.d.ts +20 -4
  139. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  140. package/lib/esm/curve/CurveCollection.js +39 -2
  141. package/lib/esm/curve/CurveCollection.js.map +1 -1
  142. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  143. package/lib/esm/curve/CurveFactory.js +4 -5
  144. package/lib/esm/curve/CurveFactory.js.map +1 -1
  145. package/lib/esm/curve/CurveOps.d.ts.map +1 -1
  146. package/lib/esm/curve/CurveOps.js.map +1 -1
  147. package/lib/esm/curve/CurvePrimitive.d.ts +10 -3
  148. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  149. package/lib/esm/curve/CurvePrimitive.js +1 -1
  150. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  151. package/lib/esm/curve/CurveProcessor.d.ts +7 -7
  152. package/lib/esm/curve/CurveProcessor.d.ts.map +1 -1
  153. package/lib/esm/curve/CurveProcessor.js +19 -3
  154. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  155. package/lib/esm/curve/GeometryQuery.d.ts +49 -4
  156. package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
  157. package/lib/esm/curve/GeometryQuery.js +52 -0
  158. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  159. package/lib/esm/curve/LineSegment3d.d.ts +1 -1
  160. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  161. package/lib/esm/curve/LineSegment3d.js +1 -1
  162. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  163. package/lib/esm/curve/Loop.d.ts +18 -2
  164. package/lib/esm/curve/Loop.d.ts.map +1 -1
  165. package/lib/esm/curve/Loop.js +26 -1
  166. package/lib/esm/curve/Loop.js.map +1 -1
  167. package/lib/esm/curve/ParityRegion.d.ts +7 -2
  168. package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
  169. package/lib/esm/curve/ParityRegion.js +9 -8
  170. package/lib/esm/curve/ParityRegion.js.map +1 -1
  171. package/lib/esm/curve/Path.d.ts +8 -1
  172. package/lib/esm/curve/Path.d.ts.map +1 -1
  173. package/lib/esm/curve/Path.js +12 -0
  174. package/lib/esm/curve/Path.js.map +1 -1
  175. package/lib/esm/curve/ProxyCurve.d.ts +1 -1
  176. package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
  177. package/lib/esm/curve/ProxyCurve.js +2 -3
  178. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  179. package/lib/esm/curve/Query/PlanarSubdivision.d.ts +36 -35
  180. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  181. package/lib/esm/curve/Query/PlanarSubdivision.js +4 -4
  182. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  183. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  184. package/lib/esm/curve/RegionOps.js +3 -3
  185. package/lib/esm/curve/RegionOps.js.map +1 -1
  186. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  187. package/lib/esm/curve/UnionRegion.d.ts +9 -2
  188. package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
  189. package/lib/esm/curve/UnionRegion.js +12 -0
  190. package/lib/esm/curve/UnionRegion.js.map +1 -1
  191. package/lib/esm/curve/internalContexts/CloneCurvesContext.d.ts +1 -0
  192. package/lib/esm/curve/internalContexts/CloneCurvesContext.d.ts.map +1 -1
  193. package/lib/esm/curve/internalContexts/CloneCurvesContext.js +3 -1
  194. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  195. package/lib/esm/curve/internalContexts/TransformInPlaceContext.d.ts +1 -6
  196. package/lib/esm/curve/internalContexts/TransformInPlaceContext.d.ts.map +1 -1
  197. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js +15 -8
  198. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  199. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +5 -2
  200. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  201. package/lib/esm/curve/spiral/DirectSpiral3d.js +6 -3
  202. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  203. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +5 -2
  204. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  205. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +6 -3
  206. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  207. package/lib/esm/geometry3d/Point3dVector3d.d.ts +2 -0
  208. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  209. package/lib/esm/geometry3d/Point3dVector3d.js +4 -0
  210. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  211. package/lib/esm/geometry3d/Range.d.ts +2 -0
  212. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  213. package/lib/esm/geometry3d/Range.js +6 -0
  214. package/lib/esm/geometry3d/Range.js.map +1 -1
  215. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  216. package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
  217. package/lib/esm/serialization/BGFBReader.js +5 -2
  218. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  219. package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
  220. package/lib/esm/serialization/BGFBWriter.js +1 -2
  221. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  222. package/lib/esm/serialization/IModelJsonSchema.d.ts +36 -22
  223. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  224. package/lib/esm/serialization/IModelJsonSchema.js +16 -17
  225. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  226. package/lib/esm/topology/Merging.d.ts +4 -2
  227. package/lib/esm/topology/Merging.d.ts.map +1 -1
  228. package/lib/esm/topology/Merging.js +23 -20
  229. package/lib/esm/topology/Merging.js.map +1 -1
  230. package/package.json +3 -3
@@ -39,6 +39,20 @@ export type GeometryQueryCategory = "polyface" | "curvePrimitive" | "curveCollec
39
39
  * @public
40
40
  */
41
41
  export type AnyGeometryQuery = Polyface | CurvePrimitive | CurveCollection | SolidPrimitive | CoordinateXYZ | PointString3d | BSpline2dNd;
42
+ /**
43
+ * Options bundle for [[GeometryQuery.computeScaledTolerance]] and [[GeometryQuery.scaleToleranceForGeometry]].
44
+ * @public
45
+ */
46
+ export interface ScaledToleranceOptions {
47
+ /** Optional transform to apply to geometry before computing its size. */
48
+ transform?: Transform;
49
+ /** Relative tolerance by which to scale the computed geometry size. Default is [[Geometry.smallMetricDistance]]. */
50
+ relativeTolerance?: number;
51
+ /** Smallest tolerance to return. Default is [[Geometry.smallMetricDistanceSquared]]. */
52
+ minimumTolerance?: number;
53
+ /** Whether to ignore z-coordinates when computing the geometry size. */
54
+ xyOnly?: boolean;
55
+ }
42
56
  /**
43
57
  * Queries to be supported by Curve, Surface, and Solid objects.
44
58
  * * `GeometryQuery` is an abstract base class with (abstract) methods for querying curve, solid primitive, mesh,
@@ -54,16 +68,20 @@ export declare abstract class GeometryQuery {
54
68
  abstract extendRange(rangeToExtend: Range3d, transform?: Transform): void;
55
69
  /**
56
70
  * Attempt to transform in place.
57
- * * LineSegment3d, Arc3d, LineString3d, BsplineCurve3d always succeed.
58
- * * Some geometry types may fail if scaling is non-uniform.
71
+ * * Curve types always succeed.
72
+ * * Other geometry types may fail if the transform is not invertible.
73
+ * * Subclasses are free to ignore certain effects of the transform in lieu of failing.
59
74
  */
60
75
  abstract tryTransformInPlace(transform: Transform): boolean;
61
76
  /** Try to move the geometry by dx,dy,dz. */
62
77
  tryTranslateInPlace(dx: number, dy?: number, dz?: number): boolean;
63
- /** Return a transformed clone. */
78
+ /**
79
+ * Return a transformed clone.
80
+ * @see [[tryTransformInPlace]] for discussion of transform success.
81
+ */
64
82
  abstract cloneTransformed(transform: Transform): GeometryQuery | undefined;
65
83
  /** Return a clone */
66
- abstract clone(): GeometryQuery | undefined;
84
+ abstract clone(): GeometryQuery;
67
85
  /**
68
86
  * Return GeometryQuery children for recursive queries.
69
87
  * * leaf classes do not need to implement.
@@ -95,5 +113,32 @@ export declare abstract class GeometryQuery {
95
113
  * @param handler handler to be called by the particular geometry class
96
114
  */
97
115
  abstract dispatchToGeometryHandler(handler: GeometryHandler): any;
116
+ /**
117
+ * Compute a distance tolerance appropriate for comparing the coordinates of `geom`.
118
+ * * The formula is `absTol = minTol + relTol * geomSize`, where `geomSize` is the largest absolute coordinate of
119
+ * the geometry range.
120
+ * * Scaling tolerances by geometry size helps account for the decreased floating point resolution between large
121
+ * coordinates. While using such scaled tolerances can enable more tolerance-sensitive constructions to succeed on
122
+ * far-flung geometries, on extremely small geometries at extremely large coordinate magnitudes, geometric
123
+ * constructions are generally more accurate when applied to the geometry temporarily translated to the origin.
124
+ * @param geom geometry to measure
125
+ * @param options bundle of options
126
+ * @returns the computed absolute tolerance
127
+ * @see [[scaleToleranceForGeometry]]
128
+ */
129
+ static computeScaledTolerance(geom: GeometryQuery | GeometryQuery[], options?: ScaledToleranceOptions): number;
130
+ /**
131
+ * Scale the given distance tolerance as appropriate for comparing the coordinates of `geom`.
132
+ * * Scaling tolerances by geometry size helps account for the decreased floating point resolution between large
133
+ * coordinates. While using such scaled tolerances can enable more tolerance-sensitive constructions to succeed on
134
+ * far-flung geometries, on extremely small geometries at extremely large coordinate magnitudes, geometric
135
+ * constructions are generally more accurate when applied to the geometry temporarily translated to the origin.
136
+ * @param geom geometry to measure
137
+ * @param distanceTolerance positive input distance tolerance to examine
138
+ * @param options bundle of options (`minimumTolerance` and `relativeTolerance` are ignored)
139
+ * @return a distance tolerance >= `distanceTolerance`
140
+ * @see [[computeScaledTolerance]]
141
+ */
142
+ static scaleToleranceForGeometry(geom: GeometryQuery | GeometryQuery[], distanceTolerance: number, options?: ScaledToleranceOptions): number;
98
143
  }
99
144
  //# sourceMappingURL=GeometryQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeometryQuery.d.ts","sourceRoot":"","sources":["../../../src/curve/GeometryQuery.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC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,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM;CAkBpJ"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GeometryQuery = void 0;
4
+ const Geometry_1 = require("../Geometry");
4
5
  const Range_1 = require("../geometry3d/Range");
5
6
  const Transform_1 = require("../geometry3d/Transform");
6
7
  /**
@@ -70,6 +71,57 @@ class GeometryQuery {
70
71
  return true;
71
72
  return false;
72
73
  }
74
+ /**
75
+ * Compute a distance tolerance appropriate for comparing the coordinates of `geom`.
76
+ * * The formula is `absTol = minTol + relTol * geomSize`, where `geomSize` is the largest absolute coordinate of
77
+ * the geometry range.
78
+ * * Scaling tolerances by geometry size helps account for the decreased floating point resolution between large
79
+ * coordinates. While using such scaled tolerances can enable more tolerance-sensitive constructions to succeed on
80
+ * far-flung geometries, on extremely small geometries at extremely large coordinate magnitudes, geometric
81
+ * constructions are generally more accurate when applied to the geometry temporarily translated to the origin.
82
+ * @param geom geometry to measure
83
+ * @param options bundle of options
84
+ * @returns the computed absolute tolerance
85
+ * @see [[scaleToleranceForGeometry]]
86
+ */
87
+ static computeScaledTolerance(geom, options) {
88
+ const relTol = Math.abs(options?.relativeTolerance ?? Geometry_1.Geometry.smallMetricDistance);
89
+ const minTol = Math.abs(options?.minimumTolerance ?? Geometry_1.Geometry.smallMetricDistanceSquared);
90
+ const geomRange = Range_1.Range3d.createNull();
91
+ (Array.isArray(geom) ? geom : [geom]).forEach((g) => g.extendRange(geomRange, options?.transform));
92
+ const geomSize = geomRange.isNull ? 0 : options?.xyOnly ? geomRange.maxAbsXY() : geomRange.maxAbs();
93
+ return minTol + relTol * geomSize;
94
+ }
95
+ /**
96
+ * Scale the given distance tolerance as appropriate for comparing the coordinates of `geom`.
97
+ * * Scaling tolerances by geometry size helps account for the decreased floating point resolution between large
98
+ * coordinates. While using such scaled tolerances can enable more tolerance-sensitive constructions to succeed on
99
+ * far-flung geometries, on extremely small geometries at extremely large coordinate magnitudes, geometric
100
+ * constructions are generally more accurate when applied to the geometry temporarily translated to the origin.
101
+ * @param geom geometry to measure
102
+ * @param distanceTolerance positive input distance tolerance to examine
103
+ * @param options bundle of options (`minimumTolerance` and `relativeTolerance` are ignored)
104
+ * @return a distance tolerance >= `distanceTolerance`
105
+ * @see [[computeScaledTolerance]]
106
+ */
107
+ static scaleToleranceForGeometry(geom, distanceTolerance, options) {
108
+ if (distanceTolerance > 0) {
109
+ const geomRange = Range_1.Range3d.createNull();
110
+ (Array.isArray(geom) ? geom : [geom]).forEach((g) => g.extendRange(geomRange, options?.transform));
111
+ if (!geomRange.isNull) {
112
+ const geomSize = options?.xyOnly ? geomRange.maxAbsXY() : geomRange.maxAbs();
113
+ if (geomSize > 0) {
114
+ // HEURISTIC: truncate the fractional part of a coordinate's base-10 significand to maxDigits digits.
115
+ // Adding the tolerance to this number should change the significand; otherwise, it's too small.
116
+ const maxDigits = 10; // comfortably far from IEEE double's 15 guaranteed fractional digits
117
+ const requiredDigitsForTol = Math.floor(Math.log10(geomSize / distanceTolerance));
118
+ if (requiredDigitsForTol > maxDigits)
119
+ distanceTolerance *= Math.pow(10, requiredDigitsForTol - maxDigits);
120
+ }
121
+ }
122
+ }
123
+ return distanceTolerance;
124
+ }
73
125
  }
74
126
  exports.GeometryQuery = GeometryQuery;
75
127
  //# sourceMappingURL=GeometryQuery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeometryQuery.js","sourceRoot":"","sources":["../../../src/curve/GeometryQuery.ts"],"names":[],"mappings":";;;AASA,+CAA8C;AAC9C,uDAAoD;AAsCpD;;;;;GAKG;AACH,MAAsB,aAAa;IAGjC,yDAAyD;IAClD,KAAK,CAAC,SAAqB,EAAE,MAAgB;QAClD,IAAI,MAAM;YACR,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,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;IACI,MAAM,CAAC,cAAc,CAAC,CAA4B,EAAE,CAA4B;QACrF,IAAI,CAAC,YAAY,aAAa,IAAI,CAAC,YAAY,aAAa;YAC1D,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,CAAC,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,SAAS,CAAC;YACxC,OAAO,IAAI,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;CAWF;AArFD,sCAqFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { BSpline2dNd } from \"../bspline/BSplineSurface\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Polyface } from \"../polyface/Polyface\";\r\nimport { SolidPrimitive } from \"../solid/SolidPrimitive\";\r\nimport { CoordinateXYZ } from \"./CoordinateXYZ\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { PointString3d } from \"./PointString3d\";\r\n\r\n/**\r\n * Describes the category of a [[GeometryQuery]], enabling type-switching like:\r\n * ```ts\r\n * function processGeometryQuery(q: GeometryQuery): void {\r\n * if (\"solid\" === q.geometryCategory)\r\n * alert(\"Solid type = \" + q.solidPrimitiveType); // compiler knows q is an instance of SolidPrimitive\r\n * // ...etc...\r\n * ```\r\n *\r\n * Each string maps to a particular subclass of [[GeometryQuery]]:\r\n * - \"polyface\" => [[Polyface]]\r\n * - \"curvePrimitive\" => [[CurvePrimitive]]\r\n * - \"curveCollection\" => [[CurveCollection]]\r\n * - \"solid\" => [[SolidPrimitive]]\r\n * - \"point\" => [[CoordinateXYZ]]\r\n * - \"pointCollection\" => [[PointString3d]]\r\n * - \"bsurf\" => [[BSpline2dNd]] (which is an intermediate class shared by [[BSplineSurface3d]] and [[BSplineSurface3dH]])\r\n *\r\n * @see [[AnyGeometryQuery]]\r\n * @public\r\n */\r\nexport type GeometryQueryCategory = \"polyface\" | \"curvePrimitive\" | \"curveCollection\" | \"solid\" | \"point\" | \"pointCollection\" | \"bsurf\";\r\n\r\n/**\r\n * Union type for subclasses of [[GeometryQuery]]. Specific subclasses can be discriminated at compile- or run-time\r\n * using [[GeometryQuery.geometryCategory]].\r\n * @public\r\n */\r\nexport type AnyGeometryQuery = Polyface | CurvePrimitive | CurveCollection | SolidPrimitive | CoordinateXYZ | PointString3d | BSpline2dNd;\r\n\r\n/**\r\n * Queries to be supported by Curve, Surface, and Solid objects.\r\n * * `GeometryQuery` is an abstract base class with (abstract) methods for querying curve, solid primitive, mesh,\r\n * and bspline surfaces.\r\n * @public\r\n */\r\nexport abstract class GeometryQuery {\r\n /** Type discriminator. */\r\n public abstract readonly geometryCategory: GeometryQueryCategory;\r\n /** Return the range of the entire GeometryQuery tree. */\r\n public range(transform?: Transform, result?: Range3d): Range3d {\r\n if (result)\r\n result.setNull();\r\n const range = result ? result : Range3d.createNull();\r\n this.extendRange(range, transform);\r\n return range;\r\n }\r\n /** Extend `rangeToExtend` by the range of this geometry multiplied by the `transform`. */\r\n public abstract extendRange(rangeToExtend: Range3d, transform?: Transform): void;\r\n /**\r\n * Attempt to transform in place.\r\n * * LineSegment3d, Arc3d, LineString3d, BsplineCurve3d always succeed.\r\n * * Some geometry types may fail if scaling is non-uniform.\r\n */\r\n public abstract tryTransformInPlace(transform: Transform): boolean;\r\n /** Try to move the geometry by dx,dy,dz. */\r\n public tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean {\r\n return this.tryTransformInPlace(Transform.createTranslationXYZ(dx, dy, dz));\r\n }\r\n /** Return a transformed clone. */\r\n public abstract cloneTransformed(transform: Transform): GeometryQuery | undefined;\r\n /** Return a clone */\r\n public abstract clone(): GeometryQuery | undefined;\r\n /**\r\n * Return GeometryQuery children for recursive queries.\r\n * * leaf classes do not need to implement.\r\n */\r\n public get children(): GeometryQuery[] | undefined {\r\n return undefined;\r\n }\r\n /** Test `if (other instanceof this.Type)`. REQUIRED IN ALL CONCRETE CLASSES. */\r\n public abstract isSameGeometryClass(other: GeometryQuery): boolean;\r\n /**\r\n * Test for exact structure and nearly identical geometry.\r\n * * Leaf classes must implement.\r\n * * Base class implementation recurses through children.\r\n * * Base implementation is complete for classes with children and no properties.\r\n * * Classes with both children and properties must implement for properties, call super for children.\r\n */\r\n public isAlmostEqual(other: GeometryQuery): boolean {\r\n if (this.isSameGeometryClass(other)) {\r\n const childrenA = this.children;\r\n const childrenB = other.children;\r\n if (childrenA && childrenB) {\r\n if (childrenA.length !== childrenB.length)\r\n return false;\r\n for (let i = 0; i < childrenA.length; i++) {\r\n if (!childrenA[i].isAlmostEqual(childrenB[i]))\r\n return false;\r\n }\r\n return true;\r\n } else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children so these null pointer cases are never reached.\r\n return false; // plainly different\r\n } else {\r\n return true; // both children null; call it equal\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Apply instance method [[isAlmostEqual]] if both are defined.\r\n * * Both undefined returns true.\r\n * * Single defined returns false.\r\n */\r\n public static areAlmostEqual(a: GeometryQuery | undefined, b: GeometryQuery | undefined): boolean {\r\n if (a instanceof GeometryQuery && b instanceof GeometryQuery)\r\n return a.isAlmostEqual(b);\r\n if ((a === undefined) && (b === undefined))\r\n return true;\r\n return false;\r\n }\r\n /**\r\n * Double Dispatch call pattern.\r\n * * User code implements a `GeometryHandler` with specialized methods to handle `LineSegment3d`, `Arc3d`, etc as\r\n * relevant to its use case.\r\n * * Each such `GeometryQuery` class implements this method as a one-line method containing the appropriate call\r\n * such as `handler.handleLineSegment3d())`\r\n * * This allows each type-specific method to be called without a switch or `instanceof` test.\r\n * @param handler handler to be called by the particular geometry class\r\n */\r\n public abstract dispatchToGeometryHandler(handler: GeometryHandler): any;\r\n}\r\n"]}
1
+ {"version":3,"file":"GeometryQuery.js","sourceRoot":"","sources":["../../../src/curve/GeometryQuery.ts"],"names":[],"mappings":";;;AAQA,0CAAuC;AAEvC,+CAA8C;AAC9C,uDAAoD;AAqDpD;;;;;GAKG;AACH,MAAsB,aAAa;IAGjC,yDAAyD;IAClD,KAAK,CAAC,SAAqB,EAAE,MAAgB;QAClD,IAAI,MAAM;YACR,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,eAAO,CAAC,UAAU,EAAE,CAAC;QACrD,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IAUD,4CAA4C;IACrC,mBAAmB,CAAC,EAAU,EAAE,KAAa,GAAG,EAAE,KAAa,GAAG;QACvE,OAAO,IAAI,CAAC,mBAAmB,CAAC,qBAAS,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAQD;;;OAGG;IACH,IAAW,QAAQ;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IAGD;;;;;;OAMG;IACI,aAAa,CAAC,KAAoB;QACvC,IAAI,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;YACpC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;YAChC,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC;YACjC,IAAI,SAAS,IAAI,SAAS,EAAE,CAAC;gBAC3B,IAAI,SAAS,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;oBACvC,OAAO,KAAK,CAAC;gBACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EA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I,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,oBAAoB,GAAG,SAAS,CAAC,CAAC;gBACxE,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF;AA9ID,sCA8IC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { BSpline2dNd } from \"../bspline/BSplineSurface\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Polyface } from \"../polyface/Polyface\";\r\nimport { SolidPrimitive } from \"../solid/SolidPrimitive\";\r\nimport { CoordinateXYZ } from \"./CoordinateXYZ\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { PointString3d } from \"./PointString3d\";\r\n\r\n/**\r\n * Describes the category of a [[GeometryQuery]], enabling type-switching like:\r\n * ```ts\r\n * function processGeometryQuery(q: GeometryQuery): void {\r\n * if (\"solid\" === q.geometryCategory)\r\n * alert(\"Solid type = \" + q.solidPrimitiveType); // compiler knows q is an instance of SolidPrimitive\r\n * // ...etc...\r\n * ```\r\n *\r\n * Each string maps to a particular subclass of [[GeometryQuery]]:\r\n * - \"polyface\" => [[Polyface]]\r\n * - \"curvePrimitive\" => [[CurvePrimitive]]\r\n * - \"curveCollection\" => [[CurveCollection]]\r\n * - \"solid\" => [[SolidPrimitive]]\r\n * - \"point\" => [[CoordinateXYZ]]\r\n * - \"pointCollection\" => [[PointString3d]]\r\n * - \"bsurf\" => [[BSpline2dNd]] (which is an intermediate class shared by [[BSplineSurface3d]] and [[BSplineSurface3dH]])\r\n *\r\n * @see [[AnyGeometryQuery]]\r\n * @public\r\n */\r\nexport type GeometryQueryCategory = \"polyface\" | \"curvePrimitive\" | \"curveCollection\" | \"solid\" | \"point\" | \"pointCollection\" | \"bsurf\";\r\n\r\n/**\r\n * Union type for subclasses of [[GeometryQuery]]. Specific subclasses can be discriminated at compile- or run-time\r\n * using [[GeometryQuery.geometryCategory]].\r\n * @public\r\n */\r\nexport type AnyGeometryQuery = Polyface | CurvePrimitive | CurveCollection | SolidPrimitive | CoordinateXYZ | PointString3d | BSpline2dNd;\r\n\r\n/**\r\n * Options bundle for [[GeometryQuery.computeScaledTolerance]] and [[GeometryQuery.scaleToleranceForGeometry]].\r\n * @public\r\n */\r\nexport interface ScaledToleranceOptions {\r\n /** Optional transform to apply to geometry before computing its size. */\r\n transform?: Transform;\r\n /** Relative tolerance by which to scale the computed geometry size. Default is [[Geometry.smallMetricDistance]]. */\r\n relativeTolerance?: number;\r\n /** Smallest tolerance to return. Default is [[Geometry.smallMetricDistanceSquared]]. */\r\n minimumTolerance?: number;\r\n /** Whether to ignore z-coordinates when computing the geometry size. */\r\n xyOnly?: boolean;\r\n}\r\n\r\n/**\r\n * Queries to be supported by Curve, Surface, and Solid objects.\r\n * * `GeometryQuery` is an abstract base class with (abstract) methods for querying curve, solid primitive, mesh,\r\n * and bspline surfaces.\r\n * @public\r\n */\r\nexport abstract class GeometryQuery {\r\n /** Type discriminator. */\r\n public abstract readonly geometryCategory: GeometryQueryCategory;\r\n /** Return the range of the entire GeometryQuery tree. */\r\n public range(transform?: Transform, result?: Range3d): Range3d {\r\n if (result)\r\n result.setNull();\r\n const range = result ? result : Range3d.createNull();\r\n this.extendRange(range, transform);\r\n return range;\r\n }\r\n /** Extend `rangeToExtend` by the range of this geometry multiplied by the `transform`. */\r\n public abstract extendRange(rangeToExtend: Range3d, transform?: Transform): void;\r\n /**\r\n * Attempt to transform in place.\r\n * * Curve types always succeed.\r\n * * Other geometry types may fail if the transform is not invertible.\r\n * * Subclasses are free to ignore certain effects of the transform in lieu of failing.\r\n */\r\n public abstract tryTransformInPlace(transform: Transform): boolean;\r\n /** Try to move the geometry by dx,dy,dz. */\r\n public tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean {\r\n return this.tryTransformInPlace(Transform.createTranslationXYZ(dx, dy, dz));\r\n }\r\n /**\r\n * Return a transformed clone.\r\n * @see [[tryTransformInPlace]] for discussion of transform success.\r\n */\r\n public abstract cloneTransformed(transform: Transform): GeometryQuery | undefined;\r\n /** Return a clone */\r\n public abstract clone(): GeometryQuery;\r\n /**\r\n * Return GeometryQuery children for recursive queries.\r\n * * leaf classes do not need to implement.\r\n */\r\n public get children(): GeometryQuery[] | undefined {\r\n return undefined;\r\n }\r\n /** Test `if (other instanceof this.Type)`. REQUIRED IN ALL CONCRETE CLASSES. */\r\n public abstract isSameGeometryClass(other: GeometryQuery): boolean;\r\n /**\r\n * Test for exact structure and nearly identical geometry.\r\n * * Leaf classes must implement.\r\n * * Base class implementation recurses through children.\r\n * * Base implementation is complete for classes with children and no properties.\r\n * * Classes with both children and properties must implement for properties, call super for children.\r\n */\r\n public isAlmostEqual(other: GeometryQuery): boolean {\r\n if (this.isSameGeometryClass(other)) {\r\n const childrenA = this.children;\r\n const childrenB = other.children;\r\n if (childrenA && childrenB) {\r\n if (childrenA.length !== childrenB.length)\r\n return false;\r\n for (let i = 0; i < childrenA.length; i++) {\r\n if (!childrenA[i].isAlmostEqual(childrenB[i]))\r\n return false;\r\n }\r\n return true;\r\n } else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children so these null pointer cases are never reached.\r\n return false; // plainly different\r\n } else {\r\n return true; // both children null; call it equal\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Apply instance method [[isAlmostEqual]] if both are defined.\r\n * * Both undefined returns true.\r\n * * Single defined returns false.\r\n */\r\n public static areAlmostEqual(a: GeometryQuery | undefined, b: GeometryQuery | undefined): boolean {\r\n if (a instanceof GeometryQuery && b instanceof GeometryQuery)\r\n return a.isAlmostEqual(b);\r\n if ((a === undefined) && (b === undefined))\r\n return true;\r\n return false;\r\n }\r\n /**\r\n * Double Dispatch call pattern.\r\n * * User code implements a `GeometryHandler` with specialized methods to handle `LineSegment3d`, `Arc3d`, etc as\r\n * relevant to its use case.\r\n * * Each such `GeometryQuery` class implements this method as a one-line method containing the appropriate call\r\n * such as `handler.handleLineSegment3d())`\r\n * * This allows each type-specific method to be called without a switch or `instanceof` test.\r\n * @param handler handler to be called by the particular geometry class\r\n */\r\n public abstract dispatchToGeometryHandler(handler: GeometryHandler): any;\r\n\r\n /**\r\n * Compute a distance tolerance appropriate for comparing the coordinates of `geom`.\r\n * * The formula is `absTol = minTol + relTol * geomSize`, where `geomSize` is the largest absolute coordinate of\r\n * the geometry range.\r\n * * Scaling tolerances by geometry size helps account for the decreased floating point resolution between large\r\n * coordinates. While using such scaled tolerances can enable more tolerance-sensitive constructions to succeed on\r\n * far-flung geometries, on extremely small geometries at extremely large coordinate magnitudes, geometric\r\n * constructions are generally more accurate when applied to the geometry temporarily translated to the origin.\r\n * @param geom geometry to measure\r\n * @param options bundle of options\r\n * @returns the computed absolute tolerance\r\n * @see [[scaleToleranceForGeometry]]\r\n */\r\n public static computeScaledTolerance(geom: GeometryQuery | GeometryQuery[], options?: ScaledToleranceOptions): number {\r\n const relTol = Math.abs(options?.relativeTolerance ?? Geometry.smallMetricDistance);\r\n const minTol = Math.abs(options?.minimumTolerance ?? Geometry.smallMetricDistanceSquared);\r\n const geomRange = Range3d.createNull();\r\n (Array.isArray(geom) ? geom : [geom]).forEach((g: GeometryQuery) => g.extendRange(geomRange, options?.transform));\r\n const geomSize = geomRange.isNull ? 0 : options?.xyOnly ? geomRange.maxAbsXY() : geomRange.maxAbs();\r\n return minTol + relTol * geomSize;\r\n }\r\n\r\n /**\r\n * Scale the given distance tolerance as appropriate for comparing the coordinates of `geom`.\r\n * * Scaling tolerances by geometry size helps account for the decreased floating point resolution between large\r\n * coordinates. While using such scaled tolerances can enable more tolerance-sensitive constructions to succeed on\r\n * far-flung geometries, on extremely small geometries at extremely large coordinate magnitudes, geometric\r\n * constructions are generally more accurate when applied to the geometry temporarily translated to the origin.\r\n * @param geom geometry to measure\r\n * @param distanceTolerance positive input distance tolerance to examine\r\n * @param options bundle of options (`minimumTolerance` and `relativeTolerance` are ignored)\r\n * @return a distance tolerance >= `distanceTolerance`\r\n * @see [[computeScaledTolerance]]\r\n */\r\n public static scaleToleranceForGeometry(geom: GeometryQuery | GeometryQuery[], distanceTolerance: number, options?: ScaledToleranceOptions): number {\r\n if (distanceTolerance > 0) {\r\n const geomRange = Range3d.createNull();\r\n (Array.isArray(geom) ? geom : [geom]).forEach((g: GeometryQuery) => g.extendRange(geomRange, options?.transform));\r\n if (!geomRange.isNull) {\r\n const geomSize = options?.xyOnly ? geomRange.maxAbsXY() : geomRange.maxAbs();\r\n if (geomSize > 0) {\r\n // HEURISTIC: truncate the fractional part of a coordinate's base-10 significand to maxDigits digits.\r\n // Adding the tolerance to this number should change the significand; otherwise, it's too small.\r\n const maxDigits = 10; // comfortably far from IEEE double's 15 guaranteed fractional digits\r\n const requiredDigitsForTol = Math.floor(Math.log10(geomSize / distanceTolerance));\r\n if (requiredDigitsForTol > maxDigits)\r\n distanceTolerance *= Math.pow(10, requiredDigitsForTol - maxDigits);\r\n }\r\n }\r\n }\r\n return distanceTolerance;\r\n }\r\n}\r\n"]}
@@ -137,7 +137,7 @@ export declare class LineSegment3d extends CurvePrimitive implements BeJSONFunct
137
137
  static closestApproach(segmentA: LineSegment3d, extendA: VariantCurveExtendParameter, segmentB: LineSegment3d, extendB: VariantCurveExtendParameter, result?: CurveLocationDetailPair): CurveLocationDetailPair | undefined;
138
138
  /** Swap the endpoint references. */
139
139
  reverseInPlace(): void;
140
- /** Transform the two endpoints of this LinSegment. */
140
+ /** Transform the two endpoints of this line segment. */
141
141
  tryTransformInPlace(transform: Transform): boolean;
142
142
  /** Test if both endpoints are in a plane (within tolerance) */
143
143
  isInPlane(plane: Pl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Ac,EAAE,GAAG,SAAS;IAWhD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;CAGvG"}
@@ -331,7 +331,7 @@ class LineSegment3d extends CurvePrimitive_1.CurvePrimitive {
331
331
  this._point0 = this._point1;
332
332
  this._point1 = a;
333
333
  }
334
- /** Transform the two endpoints of this LinSegment. */
334
+ /** Transform the two endpoints of this line segment. */
335
335
  tryTransformInPlace(transform) {
336
336
  this._point0 = transform.multiplyPoint3d(this._point0, this._point0);
337
337
  this._point1 = transform.multiplyPoint3d(this._point1, this._point1);
@@ -1 +1 @@
1
- {"version":3,"file":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAA6C;AAE7C,0CAAgF;AAEhF,uFAAoF;AACpF,mEAAyD;AACzD,mEAAkE;AAClE,+CAAuD;AACvD,+CAA4C;AAE5C,qEAA6D;AAC7D,yDAAsD;AACtD,uDAAoF;AACpF,+DAAwG;AACxG,qDAAsF;AAEtF,4FAAyF;AAEzF,mDAAgD;AAGhD;;;;;;;;;;;;GAYG;AACH,MAAa,aAAc,SAAQ,+BAAc;IAC/C,wCAAwC;IACxB,kBAAkB,GAAG,aAAa,CAAC;IACnD,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,aAAa,CAAC;IACxC,CAAC;IACD,iCAAiC;IACzB,OAAO,CAAU;IACzB,+BAA+B;IACvB,OAAO,CAAU;IACzB;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,6DAA6D;IAC7D,IAAW,MAAM;QACf,OAAO,CAAC,I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;QACf,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,SAAS,EAAE,CAAC;YACd,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC1C,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,eAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IACD;;;OAGG;IACa,iBAAiB,CAC/B,uBAA+C;QAE/C,MAAM,SAAS,GAAG,0BAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,SAAS,CAAC,gBAAgB,EAAE,EAAE,CAAC;YACjC,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;YACnC,MAAM,UAAU,GAAG,6BAAa,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;YAC5E,OAAO,aAAa,CAAC,MAAM,CACzB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,qDAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AAjeD,sCAieC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Clipper } from \"../clipping/ClipUtils\";\r\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Order2Bezier } from \"../numerics/BezierPolynomials\";\r\nimport { SmallSystem } from \"../numerics/SmallSystem\";\r\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\r\nimport { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from \"./CurveLocationDetail\";\r\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { OffsetOptions } from \"./OffsetOptions\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * A LineSegment3d is:\r\n * * A 3d line segment represented by its start and end coordinates\r\n * * startPoint\r\n * * endPoint\r\n * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these\r\n * equivalent forms maps fraction `f` to a point `X(f)`:\r\n * ```equation\r\n * X(f) = P_0 + f*(P_1 - P_0)\\newline\r\n * X(f) = (1-f)*P_0 + f*P_1\r\n * ```\r\n * @public\r\n */\r\nexport class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {\r\n /** String name for schema properties */\r\n public readonly curvePrimitiveType = \"lineSegment\";\r\n /** Test if `other` is of class `LineSegment3d` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof LineSegment3d;\r\n }\r\n /** Start point of the segment */\r\n private _point0: Point3d;\r\n /** End point of the segment */\r\n private _point1: Point3d;\r\n /**\r\n * Return REFERENCE to the start point of this segment.\r\n * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.\r\n */\r\n public get point0Ref(): Point3d {\r\n return this._point0;\r\n }\r\n /**\r\n * Return REFERENCE to the end point of this segment.\r\n * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.\r\n */\r\n public get point1Ref(): Point3d {\r\n return this._point1;\r\n }\r\n /** Return a copy of the start and end points in an array. */\r\n public get points(): Point3d[] {\r\n return [this._point0.clone(), this._point1.clone()];\r\n }\r\n /** A LineSegment3d extends along its infinite line. */\r\n public override get isExtensibleFractionSpace(): boolean {\r\n return true;\r\n }\r\n /**\r\n * CAPTURE point references as a `LineSegment3d`\r\n * @param point0\r\n * @param point1\r\n */\r\n protected constructor(point0: Point3d, point1: Point3d) {\r\n super();\r\n this._point0 = point0;\r\n this._point1 = point1;\r\n }\r\n /** Set the start and endpoints by capturing input references. */\r\n public setRefs(point0: Point3d, point1: Point3d) {\r\n this._point0 = point0;\r\n this._point1 = point1;\r\n }\r\n /** Set the start and endpoints by cloning the input parameters. */\r\n public set(point0: Point3d, point1: Point3d) {\r\n this._point0 = point0.clone();\r\n this._point1 = point1.clone();\r\n }\r\n /** Copy (clone) data from other */\r\n public setFrom(other: LineSegment3d) {\r\n this._point0.setFrom(other._point0);\r\n this._point1.setFrom(other._point1);\r\n }\r\n /** Return a (clone of) the start point (This is NOT a reference to the stored start point) */\r\n public override startPoint(result?: Point3d): Point3d {\r\n if (result) { result.setFrom(this._point0); return result; }\r\n return this._point0.clone();\r\n }\r\n /** Return a (clone of) the end point (This is NOT a reference to the stored end point) */\r\n public override endPoint(result?: Point3d): Point3d {\r\n if (result) { result.setFrom(this._point1); return result; }\r\n return this._point1.clone();\r\n }\r\n /**\r\n * Whether the start and end points are defined and within tolerance.\r\n * * Always `false` for `LineSegment3d`.\r\n */\r\n public override isPhysicallyClosedCurve(_tolerance: number = Geometry.smallMetricDistance, _xyOnly: boolean = false): boolean {\r\n return false;\r\n }\r\n /** Return the point and derivative vector at fractional position along the line segment. */\r\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\r\n result = result ? result : Ray3d.createZero();\r\n result.direction.setStartEnd(this._point0, this._point1);\r\n this._point0.interpolate(fraction, this._point1, result.origin);\r\n return result;\r\n }\r\n /**\r\n * Construct a plane with\r\n * * origin at the fractional position along the line segment\r\n * * x axis is the first derivative, i.e. along the line segment\r\n * * y axis is the second derivative, i.e. 000\r\n */\r\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n result = result ? result : Plane3dByOriginAndVectors.createXYPlane();\r\n result.vectorU.setStartEnd(this._point0, this._point1);\r\n result.vectorV.set(0, 0, 0);\r\n this._point0.interpolate(fraction, this._point1, result.origin);\r\n return result;\r\n }\r\n /** Clone the LineSegment3d */\r\n public clone(): LineSegment3d {\r\n return LineSegment3d.create(this._point0, this._point1);\r\n }\r\n /** Clone and apply transform to the clone. */\r\n public cloneTransformed(transform: Transform): LineSegment3d { // we know tryTransformInPlace succeeds.\r\n const c = this.clone();\r\n c.tryTransformInPlace(transform);\r\n return c;\r\n }\r\n /** Create with start and end points. The point contents are cloned into the LineSegment3d. */\r\n public static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d {\r\n if (result) {\r\n result.set(point0, point1); // and this will clone them !!\r\n return result;\r\n }\r\n return new LineSegment3d(point0.clone(), point1.clone());\r\n }\r\n /** Create with start and end points. The point contents are CAPTURED into the result */\r\n public static createCapture(point0: Point3d, point1: Point3d): LineSegment3d {\r\n return new LineSegment3d(point0, point1);\r\n }\r\n /**\r\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\r\n * @param x0 start point x coordinate.\r\n * @param y0 start point y coordinate.\r\n * @param x1 end point x coordinate.\r\n * @param y1 end point y coordinate.\r\n * @param z z coordinate to use for both points.\r\n * @param result optional existing LineSegment to be reinitialized.\r\n */\r\n public static createXYXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, result?: LineSegment3d) {\r\n if (result) {\r\n result._point0.set(x0, y0, z);\r\n result._point1.set(x1, y1, z);\r\n return result;\r\n }\r\n return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));\r\n }\r\n /**\r\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\r\n * @param x0 start point x coordinate.\r\n * @param y0 start point y coordinate.\r\n * @param x1 end point x coordinate.\r\n * @param y1 end point y coordinate.\r\n * @param z z coordinate to use for both points.\r\n * @param result optional existing LineSegment to be reinitialized.\r\n */\r\n public static createXYZXYZ(\r\n x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, result?: LineSegment3d,\r\n ): LineSegment3d {\r\n if (result) {\r\n result._point0.set(x0, y0, z0);\r\n result._point1.set(x1, y1, z1);\r\n return result;\r\n }\r\n return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));\r\n }\r\n /** Return the point at fractional position along the line segment. */\r\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\r\n return this._point0.interpolate(fraction, this._point1, result);\r\n }\r\n /** Return the length of the segment. */\r\n public override curveLength(): number {\r\n return this._point0.distance(this._point1);\r\n }\r\n /** Return the length of the partial segment between fractions. */\r\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\r\n return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);\r\n }\r\n /** Return the length of the segment. */\r\n public quickLength(): number {\r\n return this.curveLength();\r\n }\r\n /**\r\n * Returns a curve location detail with both xyz and fractional coordinates of the closest point.\r\n * @param spacePoint point in space\r\n * @param extend if false (default), only return points within the bounded line segment. If true, allow the point to be on\r\n * the unbounded line that contains the bounded segment.\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point\r\n */\r\n public override closestPoint(\r\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);\r\n fraction = CurveExtendOptions.correctFraction(extend, fraction);\r\n result = CurveLocationDetail.create(this, result);\r\n result.fraction = fraction;\r\n this._point0.interpolate(fraction, this._point1, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = result.point.distance(spacePoint);\r\n return result;\r\n }\r\n /**\r\n * Compute the closest approach between a pair of line segments.\r\n * * The approach distance is returned in the `a` fields of the details.\r\n * @param segmentA first line segment\r\n * @param extendA how to extend segmentA forward/backward\r\n * @param segmentB second line segment\r\n * @param extendB how to extend segmentB forward/backward\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns pair of details, one per segment, each with `a` field set to the closest approach distance\r\n */\r\n public static closestApproach(\r\n segmentA: LineSegment3d,\r\n extendA: VariantCurveExtendParameter,\r\n segmentB: LineSegment3d,\r\n extendB: VariantCurveExtendParameter,\r\n result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair | undefined {\r\n const unboundedFractions = Vector2d.create();\r\n if (result === undefined)\r\n result = CurveLocationDetailPair.createCapture(CurveLocationDetail.create(), CurveLocationDetail.create());\r\n if (SmallSystem.lineSegment3dClosestApproachUnbounded(segmentA._point0, segmentA._point1, segmentB._point0, segmentB._point1, unboundedFractions)) {\r\n // There is a simple approach between the unbounded segments. Maybe its a really easy case ...\r\n const fractionA = CurveExtendOptions.correctFraction(extendA, unboundedFractions.x);\r\n const fractionB = CurveExtendOptions.correctFraction(extendB, unboundedFractions.y);\r\n // if neither fraction was corrected, just accept !!!\r\n if (fractionA === unboundedFractions.x && fractionB === unboundedFractions.y) {\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, fractionA, result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, fractionB, result.detailB);\r\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\r\n return result;\r\n }\r\n // One or both of the fractions were clamped back to an endpoint.\r\n // Claim: (????!!!????) The only proximity candidates that matter are from clamped point onto the other.\r\n if (fractionA !== unboundedFractions.x && fractionB !== unboundedFractions.y) {\r\n // Fill in (in the result) both individual details with \"projected\" points and distance.\r\n // The \"loser\" will have its contents replaced.\r\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\r\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\r\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\r\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\r\n if (result.detailA.a <= result.detailB.a) {\r\n CurveLocationDetail.createCurveFractionPoint(segmentB, fractionB, clampedPointOnB, result.detailB);\r\n } else {\r\n CurveLocationDetail.createCurveFractionPoint(segmentA, fractionA, clampedPointOnA, result.detailA);\r\n }\r\n } else if (fractionB !== unboundedFractions.y) {\r\n // B (only) was clamped.\r\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\r\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\r\n result.detailB.setCurve(segmentB);\r\n result.detailB.point.setFrom(clampedPointOnB);\r\n result.detailB.fraction = fractionB;\r\n } else {\r\n // fractionA was clamped.\r\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\r\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\r\n result.detailA.setCurve(segmentA);\r\n result.detailA.point.setFrom(clampedPointOnA);\r\n result.detailA.fraction = fractionA;\r\n }\r\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\r\n return result;\r\n }\r\n // (probably? certainly?) parallel (possibly coincident) lines.\r\n // run all 4 endpoint-to-other cases . . . reassemble carefully ...\r\n const resultSet = [\r\n segmentA.closestPoint(segmentB._point0, extendA),\r\n segmentA.closestPoint(segmentB._point1, extendA),\r\n segmentB.closestPoint(segmentA._point0, extendB),\r\n segmentB.closestPoint(segmentA._point1, extendB),\r\n ];\r\n let dMin = resultSet[0].a;\r\n let iMin = 0;\r\n for (let i = 1; i < 4; i++) {\r\n if (resultSet[i].a < dMin) {\r\n iMin = i;\r\n dMin = resultSet[i].a;\r\n }\r\n }\r\n if (iMin === 0) {\r\n resultSet[0].clone(result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 0.0, result.detailB);\r\n result.detailB.a = result.detailA.a;\r\n } else if (iMin === 1) {\r\n resultSet[1].clone(result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 1.0, result.detailB);\r\n result.detailB.a = result.detailA.a;\r\n } else if (iMin === 2) {\r\n resultSet[2].clone(result.detailB);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 0.0, result.detailA);\r\n result.detailA.a = result.detailB.a;\r\n } else {\r\n assert(iMin === 3);\r\n resultSet[3].clone(result.detailB);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 1.0, result.detailA);\r\n result.detailA.a = result.detailB.a;\r\n }\r\n return result;\r\n }\r\n /** Swap the endpoint references. */\r\n public reverseInPlace(): void {\r\n const a = this._point0;\r\n this._point0 = this._point1;\r\n this._point1 = a;\r\n }\r\n /** Transform the two endpoints of this LinSegment. */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n this._point0 = transform.multiplyPoint3d(this._point0, this._point0);\r\n this._point1 = transform.multiplyPoint3d(this._point1, this._point1);\r\n return true;\r\n }\r\n /** Test if both endpoints are in a plane (within tolerance) */\r\n public isInPlane(plane: PlaneAltitudeEvaluator): boolean {\r\n return Geometry.isSmallMetricDistance(plane.altitude(this._point0))\r\n && Geometry.isSmallMetricDistance(plane.altitude(this._point1));\r\n }\r\n /**\r\n * Compute points of simple (transverse) with a plane.\r\n * * Use isInPlane to test if the line segment is completely in the plane.\r\n */\r\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\r\n const h0 = plane.altitude(this._point0);\r\n const h1 = plane.altitude(this._point1);\r\n const fraction = Order2Bezier.solveCoffs(h0, h1);\r\n let numIntersection = 0;\r\n if (fraction !== undefined) {\r\n numIntersection++;\r\n const detail = CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));\r\n detail.intervalRole = CurveIntervalRole.isolated;\r\n result.push(detail);\r\n }\r\n return numIntersection;\r\n }\r\n /**\r\n * Extend a range to include the (optionally transformed) line segment\r\n * @param range range to extend\r\n * @param transform optional transform to apply to the end points\r\n */\r\n public extendRange(range: Range3d, transform?: Transform): void {\r\n if (transform) {\r\n range.extendTransformedPoint(transform, this._point0);\r\n range.extendTransformedPoint(transform, this._point1);\r\n } else {\r\n range.extendPoint(this._point0);\r\n range.extendPoint(this._point1);\r\n }\r\n }\r\n /**\r\n * Construct a line from either of these json forms:\r\n *\r\n * * object with named start and end:\r\n * `{startPoint: pointValue, endPoint: pointValue}`\r\n * * array of two point values:\r\n * `[pointValue, pointValue]`\r\n * The point values are any values accepted by the Point3d method setFromJSON.\r\n * @param json data to parse.\r\n */\r\n public setFromJSON(json?: any) {\r\n if (!json) {\r\n this._point0.set(0, 0, 0);\r\n this._point1.set(1, 0, 0);\r\n return;\r\n } else if (json.startPoint && json.endPoint) { // {startPoint:json point, endPoint:json point}\r\n this._point0.setFromJSON(json.startPoint);\r\n this._point1.setFromJSON(json.endPoint);\r\n } else if (Array.isArray(json)\r\n && json.length > 1) { // [json point, json point]\r\n this._point0.setFromJSON(json[0]);\r\n this._point1.setFromJSON(json[1]);\r\n }\r\n }\r\n /** A simple line segment's fraction and distance are proportional. */\r\n public override getFractionToDistanceScale(): number | undefined {\r\n return this.curveLength();\r\n }\r\n /**\r\n * Place the lineSegment3d start and points in a json object\r\n * @return {*} [[x,y,z],[x,y,z]]\r\n */\r\n public toJSON(): any {\r\n return [this._point0.toJSON(), this._point1.toJSON()];\r\n }\r\n /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */\r\n public static fromJSON(json?: any): LineSegment3d {\r\n const result = new LineSegment3d(Point3d.createZero(), Point3d.create());\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Near equality test with `other`. */\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof LineSegment3d) {\r\n const ls = other;\r\n return this._point0.isAlmostEqual(ls._point0) && this._point1.isAlmostEqual(ls._point1);\r\n }\r\n return false;\r\n }\r\n /** Emit strokes to caller-supplied linestring */\r\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\r\n const numStroke = this.computeStrokeCountForOptions(options);\r\n dest.appendFractionalStrokePoints(this, numStroke, 0.0, 1.0);\r\n }\r\n /** Emit strokes to caller-supplied handler */\r\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\r\n handler.startCurvePrimitive(this);\r\n const numStroke = this.computeStrokeCountForOptions(options);\r\n handler.announceSegmentInterval(this, this._point0, this._point1, numStroke, 0.0, 1.0);\r\n handler.endCurvePrimitive(this);\r\n }\r\n /**\r\n * Return the stroke count required for given options.\r\n * @param options StrokeOptions that determine count\r\n */\r\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\r\n let numStroke = 1;\r\n if (options) {\r\n if (options.maxEdgeLength)\r\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\r\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\r\n }\r\n return numStroke;\r\n }\r\n /** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleLineSegment3d(this);\r\n }\r\n /**\r\n * Find intervals of this curve primitive that are interior to a clipper\r\n * @param clipper clip structure (e.g. clip planes)\r\n * @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`\r\n */\r\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n return clipper.announceClippedSegmentIntervals(\r\n 0.0, 1.0, this._point0, this._point1,\r\n announce ? (fraction0: number, fraction1: number) => announce(fraction0, fraction1, this) : undefined,\r\n );\r\n }\r\n /**\r\n * Return (if possible) a curve primitive which is a portion of this curve.\r\n * @param fractionA [in] start fraction\r\n * @param fractionB [in] end fraction\r\n */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): LineSegment3d {\r\n return LineSegment3d.create(this.fractionToPoint(fractionA), this.fractionToPoint(fractionB));\r\n }\r\n /**\r\n * Returns a (high accuracy) range of the curve between fractional positions\r\n * * Default implementation returns the range of the curve from clonePartialCurve\r\n */\r\n public override rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\r\n // (This is cheap -- don't bother testing for fraction0===fraction1)\r\n if (!transform) {\r\n const range = Range3d.create();\r\n range.extendInterpolated(this._point0, fraction0, this._point1);\r\n range.extendInterpolated(this._point0, fraction1, this._point1);\r\n return range;\r\n }\r\n const point0 = this.fractionToPoint(fraction0);\r\n const point1 = this.fractionToPoint(fraction1);\r\n if (transform) {\r\n transform.multiplyPoint3d(point0, point0);\r\n transform.multiplyPoint3d(point1, point1);\r\n }\r\n return Range3d.create(point0, point1);\r\n }\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\r\n */\r\n public override constructOffsetXY(\r\n offsetDistanceOrOptions: number | OffsetOptions,\r\n ): CurvePrimitive | CurvePrimitive[] | undefined {\r\n const offsetVec = Vector3d.createStartEnd(this._point0, this._point1);\r\n if (offsetVec.normalizeInPlace()) {\r\n offsetVec.rotate90CCWXY(offsetVec);\r\n const offsetDist = OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);\r\n return LineSegment3d.create(\r\n this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist),\r\n );\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\r\n * projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAA6C;AAE7C,0CAAgF;AAEhF,uFAAoF;AACpF,mEAAyD;AACzD,mEAAkE;AAClE,+CAAuD;AACvD,+CAA4C;AAE5C,qEAA6D;AAC7D,yDAAsD;AACtD,uDAAoF;AACpF,+DAAwG;AACxG,qDAAsF;AAEtF,4FAAyF;AAEzF,mDAAgD;AAGhD;;;;;;;;;;;;GAYG;AACH,MAAa,aAAc,SAAQ,+BAAc;IAC/C,wCAAwC;IACxB,kBAAkB,GAAG,aAAa,CAAC;IACnD,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,aAAa,CAAC;IACxC,CAAC;IACD,iCAAiC;IACzB,OAAO,CAAU;IACzB,+BAA+B;IACvB,OAAO,CAAU;IACzB;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,6DAA6D;IAC7D,IAAW,MAAM;QACf,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO,CAA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,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,SAAS,EAAE,CAAC;YACd,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC1C,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,eAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IACD;;;OAGG;IACa,iBAAiB,CAC/B,uBAA+C;QAE/C,MAAM,SAAS,GAAG,0BAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,SAAS,CAAC,gBAAgB,EAAE,EAAE,CAAC;YACjC,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;YACnC,MAAM,UAAU,GAAG,6BAAa,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;YAC5E,OAAO,aAAa,CAAC,MAAM,CACzB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,qDAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AAjeD,sCAieC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Clipper } from \"../clipping/ClipUtils\";\r\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Order2Bezier } from \"../numerics/BezierPolynomials\";\r\nimport { SmallSystem } from \"../numerics/SmallSystem\";\r\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\r\nimport { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from \"./CurveLocationDetail\";\r\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { OffsetOptions } from \"./OffsetOptions\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * A LineSegment3d is:\r\n * * A 3d line segment represented by its start and end coordinates\r\n * * startPoint\r\n * * endPoint\r\n * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these\r\n * equivalent forms maps fraction `f` to a point `X(f)`:\r\n * ```equation\r\n * X(f) = P_0 + f*(P_1 - P_0)\\newline\r\n * X(f) = (1-f)*P_0 + f*P_1\r\n * ```\r\n * @public\r\n */\r\nexport class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {\r\n /** String name for schema properties */\r\n public readonly curvePrimitiveType = \"lineSegment\";\r\n /** Test if `other` is of class `LineSegment3d` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof LineSegment3d;\r\n }\r\n /** Start point of the segment */\r\n private _point0: Point3d;\r\n /** End point of the segment */\r\n private _point1: Point3d;\r\n /**\r\n * Return REFERENCE to the start point of this segment.\r\n * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.\r\n */\r\n public get point0Ref(): Point3d {\r\n return this._point0;\r\n }\r\n /**\r\n * Return REFERENCE to the end point of this segment.\r\n * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.\r\n */\r\n public get point1Ref(): Point3d {\r\n return this._point1;\r\n }\r\n /** Return a copy of the start and end points in an array. */\r\n public get points(): Point3d[] {\r\n return [this._point0.clone(), this._point1.clone()];\r\n }\r\n /** A LineSegment3d extends along its infinite line. */\r\n public override get isExtensibleFractionSpace(): boolean {\r\n return true;\r\n }\r\n /**\r\n * CAPTURE point references as a `LineSegment3d`\r\n * @param point0\r\n * @param point1\r\n */\r\n protected constructor(point0: Point3d, point1: Point3d) {\r\n super();\r\n this._point0 = point0;\r\n this._point1 = point1;\r\n }\r\n /** Set the start and endpoints by capturing input references. */\r\n public setRefs(point0: Point3d, point1: Point3d) {\r\n this._point0 = point0;\r\n this._point1 = point1;\r\n }\r\n /** Set the start and endpoints by cloning the input parameters. */\r\n public set(point0: Point3d, point1: Point3d) {\r\n this._point0 = point0.clone();\r\n this._point1 = point1.clone();\r\n }\r\n /** Copy (clone) data from other */\r\n public setFrom(other: LineSegment3d) {\r\n this._point0.setFrom(other._point0);\r\n this._point1.setFrom(other._point1);\r\n }\r\n /** Return a (clone of) the start point (This is NOT a reference to the stored start point) */\r\n public override startPoint(result?: Point3d): Point3d {\r\n if (result) { result.setFrom(this._point0); return result; }\r\n return this._point0.clone();\r\n }\r\n /** Return a (clone of) the end point (This is NOT a reference to the stored end point) */\r\n public override endPoint(result?: Point3d): Point3d {\r\n if (result) { result.setFrom(this._point1); return result; }\r\n return this._point1.clone();\r\n }\r\n /**\r\n * Whether the start and end points are defined and within tolerance.\r\n * * Always `false` for `LineSegment3d`.\r\n */\r\n public override isPhysicallyClosedCurve(_tolerance: number = Geometry.smallMetricDistance, _xyOnly: boolean = false): boolean {\r\n return false;\r\n }\r\n /** Return the point and derivative vector at fractional position along the line segment. */\r\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\r\n result = result ? result : Ray3d.createZero();\r\n result.direction.setStartEnd(this._point0, this._point1);\r\n this._point0.interpolate(fraction, this._point1, result.origin);\r\n return result;\r\n }\r\n /**\r\n * Construct a plane with\r\n * * origin at the fractional position along the line segment\r\n * * x axis is the first derivative, i.e. along the line segment\r\n * * y axis is the second derivative, i.e. 000\r\n */\r\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n result = result ? result : Plane3dByOriginAndVectors.createXYPlane();\r\n result.vectorU.setStartEnd(this._point0, this._point1);\r\n result.vectorV.set(0, 0, 0);\r\n this._point0.interpolate(fraction, this._point1, result.origin);\r\n return result;\r\n }\r\n /** Clone the LineSegment3d */\r\n public clone(): LineSegment3d {\r\n return LineSegment3d.create(this._point0, this._point1);\r\n }\r\n /** Clone and apply transform to the clone. */\r\n public cloneTransformed(transform: Transform): LineSegment3d { // we know tryTransformInPlace succeeds.\r\n const c = this.clone();\r\n c.tryTransformInPlace(transform);\r\n return c;\r\n }\r\n /** Create with start and end points. The point contents are cloned into the LineSegment3d. */\r\n public static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d {\r\n if (result) {\r\n result.set(point0, point1); // and this will clone them !!\r\n return result;\r\n }\r\n return new LineSegment3d(point0.clone(), point1.clone());\r\n }\r\n /** Create with start and end points. The point contents are CAPTURED into the result */\r\n public static createCapture(point0: Point3d, point1: Point3d): LineSegment3d {\r\n return new LineSegment3d(point0, point1);\r\n }\r\n /**\r\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\r\n * @param x0 start point x coordinate.\r\n * @param y0 start point y coordinate.\r\n * @param x1 end point x coordinate.\r\n * @param y1 end point y coordinate.\r\n * @param z z coordinate to use for both points.\r\n * @param result optional existing LineSegment to be reinitialized.\r\n */\r\n public static createXYXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, result?: LineSegment3d) {\r\n if (result) {\r\n result._point0.set(x0, y0, z);\r\n result._point1.set(x1, y1, z);\r\n return result;\r\n }\r\n return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));\r\n }\r\n /**\r\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\r\n * @param x0 start point x coordinate.\r\n * @param y0 start point y coordinate.\r\n * @param x1 end point x coordinate.\r\n * @param y1 end point y coordinate.\r\n * @param z z coordinate to use for both points.\r\n * @param result optional existing LineSegment to be reinitialized.\r\n */\r\n public static createXYZXYZ(\r\n x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, result?: LineSegment3d,\r\n ): LineSegment3d {\r\n if (result) {\r\n result._point0.set(x0, y0, z0);\r\n result._point1.set(x1, y1, z1);\r\n return result;\r\n }\r\n return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));\r\n }\r\n /** Return the point at fractional position along the line segment. */\r\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\r\n return this._point0.interpolate(fraction, this._point1, result);\r\n }\r\n /** Return the length of the segment. */\r\n public override curveLength(): number {\r\n return this._point0.distance(this._point1);\r\n }\r\n /** Return the length of the partial segment between fractions. */\r\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\r\n return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);\r\n }\r\n /** Return the length of the segment. */\r\n public quickLength(): number {\r\n return this.curveLength();\r\n }\r\n /**\r\n * Returns a curve location detail with both xyz and fractional coordinates of the closest point.\r\n * @param spacePoint point in space\r\n * @param extend if false (default), only return points within the bounded line segment. If true, allow the point to be on\r\n * the unbounded line that contains the bounded segment.\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point\r\n */\r\n public override closestPoint(\r\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);\r\n fraction = CurveExtendOptions.correctFraction(extend, fraction);\r\n result = CurveLocationDetail.create(this, result);\r\n result.fraction = fraction;\r\n this._point0.interpolate(fraction, this._point1, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = result.point.distance(spacePoint);\r\n return result;\r\n }\r\n /**\r\n * Compute the closest approach between a pair of line segments.\r\n * * The approach distance is returned in the `a` fields of the details.\r\n * @param segmentA first line segment\r\n * @param extendA how to extend segmentA forward/backward\r\n * @param segmentB second line segment\r\n * @param extendB how to extend segmentB forward/backward\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns pair of details, one per segment, each with `a` field set to the closest approach distance\r\n */\r\n public static closestApproach(\r\n segmentA: LineSegment3d,\r\n extendA: VariantCurveExtendParameter,\r\n segmentB: LineSegment3d,\r\n extendB: VariantCurveExtendParameter,\r\n result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair | undefined {\r\n const unboundedFractions = Vector2d.create();\r\n if (result === undefined)\r\n result = CurveLocationDetailPair.createCapture(CurveLocationDetail.create(), CurveLocationDetail.create());\r\n if (SmallSystem.lineSegment3dClosestApproachUnbounded(segmentA._point0, segmentA._point1, segmentB._point0, segmentB._point1, unboundedFractions)) {\r\n // There is a simple approach between the unbounded segments. Maybe its a really easy case ...\r\n const fractionA = CurveExtendOptions.correctFraction(extendA, unboundedFractions.x);\r\n const fractionB = CurveExtendOptions.correctFraction(extendB, unboundedFractions.y);\r\n // if neither fraction was corrected, just accept !!!\r\n if (fractionA === unboundedFractions.x && fractionB === unboundedFractions.y) {\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, fractionA, result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, fractionB, result.detailB);\r\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\r\n return result;\r\n }\r\n // One or both of the fractions were clamped back to an endpoint.\r\n // Claim: (????!!!????) The only proximity candidates that matter are from clamped point onto the other.\r\n if (fractionA !== unboundedFractions.x && fractionB !== unboundedFractions.y) {\r\n // Fill in (in the result) both individual details with \"projected\" points and distance.\r\n // The \"loser\" will have its contents replaced.\r\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\r\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\r\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\r\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\r\n if (result.detailA.a <= result.detailB.a) {\r\n CurveLocationDetail.createCurveFractionPoint(segmentB, fractionB, clampedPointOnB, result.detailB);\r\n } else {\r\n CurveLocationDetail.createCurveFractionPoint(segmentA, fractionA, clampedPointOnA, result.detailA);\r\n }\r\n } else if (fractionB !== unboundedFractions.y) {\r\n // B (only) was clamped.\r\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\r\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\r\n result.detailB.setCurve(segmentB);\r\n result.detailB.point.setFrom(clampedPointOnB);\r\n result.detailB.fraction = fractionB;\r\n } else {\r\n // fractionA was clamped.\r\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\r\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\r\n result.detailA.setCurve(segmentA);\r\n result.detailA.point.setFrom(clampedPointOnA);\r\n result.detailA.fraction = fractionA;\r\n }\r\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\r\n return result;\r\n }\r\n // (probably? certainly?) parallel (possibly coincident) lines.\r\n // run all 4 endpoint-to-other cases . . . reassemble carefully ...\r\n const resultSet = [\r\n segmentA.closestPoint(segmentB._point0, extendA),\r\n segmentA.closestPoint(segmentB._point1, extendA),\r\n segmentB.closestPoint(segmentA._point0, extendB),\r\n segmentB.closestPoint(segmentA._point1, extendB),\r\n ];\r\n let dMin = resultSet[0].a;\r\n let iMin = 0;\r\n for (let i = 1; i < 4; i++) {\r\n if (resultSet[i].a < dMin) {\r\n iMin = i;\r\n dMin = resultSet[i].a;\r\n }\r\n }\r\n if (iMin === 0) {\r\n resultSet[0].clone(result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 0.0, result.detailB);\r\n result.detailB.a = result.detailA.a;\r\n } else if (iMin === 1) {\r\n resultSet[1].clone(result.detailA);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 1.0, result.detailB);\r\n result.detailB.a = result.detailA.a;\r\n } else if (iMin === 2) {\r\n resultSet[2].clone(result.detailB);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 0.0, result.detailA);\r\n result.detailA.a = result.detailB.a;\r\n } else {\r\n assert(iMin === 3);\r\n resultSet[3].clone(result.detailB);\r\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 1.0, result.detailA);\r\n result.detailA.a = result.detailB.a;\r\n }\r\n return result;\r\n }\r\n /** Swap the endpoint references. */\r\n public reverseInPlace(): void {\r\n const a = this._point0;\r\n this._point0 = this._point1;\r\n this._point1 = a;\r\n }\r\n /** Transform the two endpoints of this line segment. */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n this._point0 = transform.multiplyPoint3d(this._point0, this._point0);\r\n this._point1 = transform.multiplyPoint3d(this._point1, this._point1);\r\n return true;\r\n }\r\n /** Test if both endpoints are in a plane (within tolerance) */\r\n public isInPlane(plane: PlaneAltitudeEvaluator): boolean {\r\n return Geometry.isSmallMetricDistance(plane.altitude(this._point0))\r\n && Geometry.isSmallMetricDistance(plane.altitude(this._point1));\r\n }\r\n /**\r\n * Compute points of simple (transverse) with a plane.\r\n * * Use isInPlane to test if the line segment is completely in the plane.\r\n */\r\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\r\n const h0 = plane.altitude(this._point0);\r\n const h1 = plane.altitude(this._point1);\r\n const fraction = Order2Bezier.solveCoffs(h0, h1);\r\n let numIntersection = 0;\r\n if (fraction !== undefined) {\r\n numIntersection++;\r\n const detail = CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));\r\n detail.intervalRole = CurveIntervalRole.isolated;\r\n result.push(detail);\r\n }\r\n return numIntersection;\r\n }\r\n /**\r\n * Extend a range to include the (optionally transformed) line segment\r\n * @param range range to extend\r\n * @param transform optional transform to apply to the end points\r\n */\r\n public extendRange(range: Range3d, transform?: Transform): void {\r\n if (transform) {\r\n range.extendTransformedPoint(transform, this._point0);\r\n range.extendTransformedPoint(transform, this._point1);\r\n } else {\r\n range.extendPoint(this._point0);\r\n range.extendPoint(this._point1);\r\n }\r\n }\r\n /**\r\n * Construct a line from either of these json forms:\r\n *\r\n * * object with named start and end:\r\n * `{startPoint: pointValue, endPoint: pointValue}`\r\n * * array of two point values:\r\n * `[pointValue, pointValue]`\r\n * The point values are any values accepted by the Point3d method setFromJSON.\r\n * @param json data to parse.\r\n */\r\n public setFromJSON(json?: any) {\r\n if (!json) {\r\n this._point0.set(0, 0, 0);\r\n this._point1.set(1, 0, 0);\r\n return;\r\n } else if (json.startPoint && json.endPoint) { // {startPoint:json point, endPoint:json point}\r\n this._point0.setFromJSON(json.startPoint);\r\n this._point1.setFromJSON(json.endPoint);\r\n } else if (Array.isArray(json)\r\n && json.length > 1) { // [json point, json point]\r\n this._point0.setFromJSON(json[0]);\r\n this._point1.setFromJSON(json[1]);\r\n }\r\n }\r\n /** A simple line segment's fraction and distance are proportional. */\r\n public override getFractionToDistanceScale(): number | undefined {\r\n return this.curveLength();\r\n }\r\n /**\r\n * Place the lineSegment3d start and points in a json object\r\n * @return {*} [[x,y,z],[x,y,z]]\r\n */\r\n public toJSON(): any {\r\n return [this._point0.toJSON(), this._point1.toJSON()];\r\n }\r\n /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */\r\n public static fromJSON(json?: any): LineSegment3d {\r\n const result = new LineSegment3d(Point3d.createZero(), Point3d.create());\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Near equality test with `other`. */\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof LineSegment3d) {\r\n const ls = other;\r\n return this._point0.isAlmostEqual(ls._point0) && this._point1.isAlmostEqual(ls._point1);\r\n }\r\n return false;\r\n }\r\n /** Emit strokes to caller-supplied linestring */\r\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\r\n const numStroke = this.computeStrokeCountForOptions(options);\r\n dest.appendFractionalStrokePoints(this, numStroke, 0.0, 1.0);\r\n }\r\n /** Emit strokes to caller-supplied handler */\r\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\r\n handler.startCurvePrimitive(this);\r\n const numStroke = this.computeStrokeCountForOptions(options);\r\n handler.announceSegmentInterval(this, this._point0, this._point1, numStroke, 0.0, 1.0);\r\n handler.endCurvePrimitive(this);\r\n }\r\n /**\r\n * Return the stroke count required for given options.\r\n * @param options StrokeOptions that determine count\r\n */\r\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\r\n let numStroke = 1;\r\n if (options) {\r\n if (options.maxEdgeLength)\r\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\r\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\r\n }\r\n return numStroke;\r\n }\r\n /** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleLineSegment3d(this);\r\n }\r\n /**\r\n * Find intervals of this curve primitive that are interior to a clipper\r\n * @param clipper clip structure (e.g. clip planes)\r\n * @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`\r\n */\r\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n return clipper.announceClippedSegmentIntervals(\r\n 0.0, 1.0, this._point0, this._point1,\r\n announce ? (fraction0: number, fraction1: number) => announce(fraction0, fraction1, this) : undefined,\r\n );\r\n }\r\n /**\r\n * Return (if possible) a curve primitive which is a portion of this curve.\r\n * @param fractionA [in] start fraction\r\n * @param fractionB [in] end fraction\r\n */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): LineSegment3d {\r\n return LineSegment3d.create(this.fractionToPoint(fractionA), this.fractionToPoint(fractionB));\r\n }\r\n /**\r\n * Returns a (high accuracy) range of the curve between fractional positions\r\n * * Default implementation returns the range of the curve from clonePartialCurve\r\n */\r\n public override rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\r\n // (This is cheap -- don't bother testing for fraction0===fraction1)\r\n if (!transform) {\r\n const range = Range3d.create();\r\n range.extendInterpolated(this._point0, fraction0, this._point1);\r\n range.extendInterpolated(this._point0, fraction1, this._point1);\r\n return range;\r\n }\r\n const point0 = this.fractionToPoint(fraction0);\r\n const point1 = this.fractionToPoint(fraction1);\r\n if (transform) {\r\n transform.multiplyPoint3d(point0, point0);\r\n transform.multiplyPoint3d(point1, point1);\r\n }\r\n return Range3d.create(point0, point1);\r\n }\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\r\n */\r\n public override constructOffsetXY(\r\n offsetDistanceOrOptions: number | OffsetOptions,\r\n ): CurvePrimitive | CurvePrimitive[] | undefined {\r\n const offsetVec = Vector3d.createStartEnd(this._point0, this._point1);\r\n if (offsetVec.normalizeInPlace()) {\r\n offsetVec.rotate90CCWXY(offsetVec);\r\n const offsetDist = OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);\r\n return LineSegment3d.create(\r\n this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist),\r\n );\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\r\n * projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
@@ -4,11 +4,12 @@
4
4
  import { GeometryHandler } from "../geometry3d/GeometryHandler";
5
5
  import { IndexedXYZCollection } from "../geometry3d/IndexedXYZCollection";
6
6
  import { Point3d } from "../geometry3d/Point3dVector3d";
7
+ import { Transform } from "../geometry3d/Transform";
7
8
  import { CurveChain } from "./CurveCollection";
8
9
  import { CurvePrimitive } from "./CurvePrimitive";
9
- import { RecursiveCurveProcessor } from "./CurveProcessor";
10
10
  import { GeometryQuery } from "./GeometryQuery";
11
11
  import { StrokeOptions } from "./StrokeOptions";
12
+ import type { RecursiveCurveProcessor } from "./CurveProcessor";
12
13
  /**
13
14
  * A `Loop` is a curve chain that is the boundary of a closed (planar) loop.
14
15
  * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
@@ -17,10 +18,17 @@ import { StrokeOptions } from "./StrokeOptions";
17
18
  export declare class Loop extends CurveChain {
18
19
  /** String name for schema properties */
19
20
  readonly curveCollectionType = "loop";
20
- /** Tag value that can be set to true for user code to mark inner and outer loops. */
21
+ /**
22
+ * Flag for inner loop status (default value is `false`).
23
+ * * Typical usage is to set to `true` on hole `Loop`s in a `ParityRegion` to distinguish them from the outer `Loop`.
24
+ * * This property is only set by the user, and does not affect region processing.
25
+ * * This property is propagated through [[clone]] and JSON/FlatBuffer de/serialization.
26
+ * * For best de/serialization results, avoid setting to `false` on multiple `Loop`s of a `ParityRegion`.
27
+ */
21
28
  isInner: boolean;
22
29
  /** Test if `other` is a `Loop` */
23
30
  isSameGeometryClass(other: GeometryQuery): boolean;
31
+ /** Construct an empty loop. */
24
32
  constructor();
25
33
  /**
26
34
  * Create a loop from a variable length list of [[CurvePrimitive]]s.
@@ -49,8 +57,16 @@ export declare class Loop extends CurveChain {
49
57
  announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent?: number): void;
50
58
  /** Create a new `Loop` with no children */
51
59
  cloneEmptyPeer(): Loop;
60
+ /** Return a deep copy. */
61
+ clone(): Loop;
62
+ /** Create a deep copy of transformed curves. */
63
+ cloneTransformed(transform: Transform): Loop;
64
+ /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */
65
+ cloneWithExpandedLineStrings(): Loop;
52
66
  /** Second step of double dispatch: call `handler.handleLoop(this)` */
53
67
  dispatchToGeometryHandler(handler: GeometryHandler): any;
68
+ /** Test for near equality */
69
+ isAlmostEqual(other: GeometryQuery): boolean;
54
70
  }
55
71
  /**
56
72
  * Structure carrying a pair of loops with curve geometry.
@@ -1 +1 @@
1
- {"version":3,"file":"Loop.d.ts","sourceRoot":"","sources":["../../../src/curve/Loop.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,wCAAwC;IACxC,SAAgB,mBAAmB,UAAU;IAC7C,qFAAqF;IACrE,OAAO,EAAE,O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EAAmE;IACnE,OAAO,EAAE,IAAI,EAAE,CAAC;IAChB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC9B"}
@@ -16,12 +16,19 @@ const LineString3d_1 = require("./LineString3d");
16
16
  class Loop extends CurveCollection_1.CurveChain {
17
17
  /** String name for schema properties */
18
18
  curveCollectionType = "loop";
19
- /** Tag value that can be set to true for user code to mark inner and outer loops. */
19
+ /**
20
+ * Flag for inner loop status (default value is `false`).
21
+ * * Typical usage is to set to `true` on hole `Loop`s in a `ParityRegion` to distinguish them from the outer `Loop`.
22
+ * * This property is only set by the user, and does not affect region processing.
23
+ * * This property is propagated through [[clone]] and JSON/FlatBuffer de/serialization.
24
+ * * For best de/serialization results, avoid setting to `false` on multiple `Loop`s of a `ParityRegion`.
25
+ */
20
26
  isInner = false;
21
27
  /** Test if `other` is a `Loop` */
22
28
  isSameGeometryClass(other) {
23
29
  return other instanceof Loop;
24
30
  }
31
+ /** Construct an empty loop. */
25
32
  constructor() {
26
33
  super();
27
34
  }
@@ -91,10 +98,28 @@ class Loop extends CurveCollection_1.CurveChain {
91
98
  emptyClone.isInner = this.isInner;
92
99
  return emptyClone;
93
100
  }
101
+ /** Return a deep copy. */
102
+ clone() {
103
+ return super.clone();
104
+ }
105
+ /** Create a deep copy of transformed curves. */
106
+ cloneTransformed(transform) {
107
+ return super.cloneTransformed(transform);
108
+ }
109
+ /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */
110
+ cloneWithExpandedLineStrings() {
111
+ return super.cloneWithExpandedLineStrings();
112
+ }
94
113
  /** Second step of double dispatch: call `handler.handleLoop(this)` */
95
114
  dispatchToGeometryHandler(handler) {
96
115
  return handler.handleLoop(this);
97
116
  }
117
+ /** Test for near equality */
118
+ isAlmostEqual(other) {
119
+ if (!super.isAlmostEqual(other))
120
+ return false;
121
+ return this.isInner === other.isInner;
122
+ }
98
123
  }
99
124
  exports.Loop = Loop;
100
125
  /**