@itwin/core-geometry 4.8.0-dev.9 → 4.9.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (468) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/lib/cjs/Constant.d.ts +4 -3
  3. package/lib/cjs/Constant.d.ts.map +1 -1
  4. package/lib/cjs/Constant.js +4 -3
  5. package/lib/cjs/Constant.js.map +1 -1
  6. package/lib/cjs/Geometry.js.map +1 -1
  7. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  8. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  11. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  12. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  13. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  14. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  15. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  16. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  17. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  18. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  19. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  20. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  21. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  22. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  23. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  24. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  25. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  26. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  27. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  28. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  29. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  30. package/lib/cjs/core-geometry.js.map +1 -1
  31. package/lib/cjs/curve/Arc3d.js.map +1 -1
  32. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  33. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  34. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  35. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  36. package/lib/cjs/curve/CurveCurve.d.ts +0 -1
  37. package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
  38. package/lib/cjs/curve/CurveCurve.js +0 -1
  39. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  40. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  41. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  42. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  43. package/lib/cjs/curve/CurveOps.js.map +1 -1
  44. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  45. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  46. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  47. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  48. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  49. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  50. package/lib/cjs/curve/LineString3d.js.map +1 -1
  51. package/lib/cjs/curve/Loop.js.map +1 -1
  52. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  53. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  54. package/lib/cjs/curve/Path.js.map +1 -1
  55. package/lib/cjs/curve/PointString3d.js.map +1 -1
  56. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  57. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  58. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  59. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  60. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  61. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  62. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  63. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  64. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  65. package/lib/cjs/curve/RegionOps.js.map +1 -1
  66. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  67. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  68. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  69. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  70. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  71. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  72. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  73. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  74. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  75. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  76. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -4
  77. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  78. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  84. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  85. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  86. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  87. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  88. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  89. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  90. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  91. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  92. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  93. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  94. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  95. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  96. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  97. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  98. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  99. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  100. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  101. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  102. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  103. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  104. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  105. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  106. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  107. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  108. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  109. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  110. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  111. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  112. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  113. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  114. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  115. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  116. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  117. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  118. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  119. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  120. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  121. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  122. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  123. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  124. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  125. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  126. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  127. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  128. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  129. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  130. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  131. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  132. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  133. package/lib/cjs/geometry3d/Range.js.map +1 -1
  134. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  135. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  136. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  137. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  138. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  139. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  140. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  141. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  142. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  143. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  144. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  145. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  146. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  147. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  148. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  149. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  150. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  151. package/lib/cjs/numerics/Complex.js.map +1 -1
  152. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  153. package/lib/cjs/numerics/Newton.js.map +1 -1
  154. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  155. package/lib/cjs/numerics/PolarData.js.map +1 -1
  156. package/lib/cjs/numerics/Polynomials.d.ts +5 -4
  157. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  158. package/lib/cjs/numerics/Polynomials.js +5 -4
  159. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  160. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  161. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  162. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  163. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  164. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  165. package/lib/cjs/polyface/AuxData.js.map +1 -1
  166. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  167. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  168. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  169. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  170. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  171. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  172. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  173. package/lib/cjs/polyface/Polyface.js.map +1 -1
  174. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +219 -200
  175. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  176. package/lib/cjs/polyface/PolyfaceBuilder.js +349 -304
  177. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  178. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  179. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  180. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  181. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  182. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  183. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  184. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  185. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  186. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  187. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  188. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  189. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  190. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  191. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  192. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  193. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  194. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  195. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  196. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  197. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  198. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  199. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  200. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  201. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  202. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  203. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  204. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  205. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  206. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  207. package/lib/cjs/solid/Box.js.map +1 -1
  208. package/lib/cjs/solid/Cone.js.map +1 -1
  209. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  210. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  211. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  212. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  213. package/lib/cjs/solid/Sphere.js.map +1 -1
  214. package/lib/cjs/solid/SweepContour.js.map +1 -1
  215. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  216. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  217. package/lib/cjs/topology/Graph.js.map +1 -1
  218. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  219. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  220. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  221. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  222. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  223. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  224. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  225. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  226. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  227. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  228. package/lib/cjs/topology/MaskManager.js.map +1 -1
  229. package/lib/cjs/topology/Merging.js.map +1 -1
  230. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  231. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  232. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  233. package/lib/cjs/topology/Triangulation.js.map +1 -1
  234. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  235. package/lib/esm/Constant.d.ts +4 -3
  236. package/lib/esm/Constant.d.ts.map +1 -1
  237. package/lib/esm/Constant.js +4 -3
  238. package/lib/esm/Constant.js.map +1 -1
  239. package/lib/esm/Geometry.js.map +1 -1
  240. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  241. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  242. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  243. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  244. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  245. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  246. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  247. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  248. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  249. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  250. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  251. package/lib/esm/bspline/KnotVector.js.map +1 -1
  252. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  253. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  254. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  255. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  256. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  257. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  258. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  259. package/lib/esm/clipping/ClipVector.js.map +1 -1
  260. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  261. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  262. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  263. package/lib/esm/core-geometry.js.map +1 -1
  264. package/lib/esm/curve/Arc3d.js.map +1 -1
  265. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  266. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  267. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  268. package/lib/esm/curve/CurveCollection.js.map +1 -1
  269. package/lib/esm/curve/CurveCurve.d.ts +0 -1
  270. package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
  271. package/lib/esm/curve/CurveCurve.js +0 -1
  272. package/lib/esm/curve/CurveCurve.js.map +1 -1
  273. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  274. package/lib/esm/curve/CurveFactory.js.map +1 -1
  275. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  276. package/lib/esm/curve/CurveOps.js.map +1 -1
  277. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  278. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  279. package/lib/esm/curve/CurveTypes.js.map +1 -1
  280. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  281. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  282. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  283. package/lib/esm/curve/LineString3d.js.map +1 -1
  284. package/lib/esm/curve/Loop.js.map +1 -1
  285. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  286. package/lib/esm/curve/ParityRegion.js.map +1 -1
  287. package/lib/esm/curve/Path.js.map +1 -1
  288. package/lib/esm/curve/PointString3d.js.map +1 -1
  289. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  290. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  291. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  292. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  293. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  294. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  295. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  296. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  297. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  298. package/lib/esm/curve/RegionOps.js.map +1 -1
  299. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  300. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  301. package/lib/esm/curve/UnionRegion.js.map +1 -1
  302. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  303. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  304. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  305. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  306. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  307. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  308. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  309. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -4
  310. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  311. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  312. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  313. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  314. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  315. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  316. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  317. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  318. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  319. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  320. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  321. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  322. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  323. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  324. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  325. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  326. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  327. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  328. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  329. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  330. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  331. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  332. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  333. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  334. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  335. package/lib/esm/geometry3d/Angle.js.map +1 -1
  336. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  337. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  338. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  339. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  340. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  341. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  342. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  343. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  344. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  345. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  346. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  347. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  348. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  349. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  350. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  351. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  352. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  353. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  354. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  355. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  356. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  357. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  358. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  359. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  360. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  361. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  362. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  363. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  364. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  365. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  366. package/lib/esm/geometry3d/Range.js.map +1 -1
  367. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  368. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  369. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  370. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  371. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  372. package/lib/esm/geometry3d/Transform.js.map +1 -1
  373. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  374. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  375. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  376. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  377. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  378. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  379. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  380. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  381. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  382. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  383. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  384. package/lib/esm/numerics/Complex.js.map +1 -1
  385. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  386. package/lib/esm/numerics/Newton.js.map +1 -1
  387. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  388. package/lib/esm/numerics/PolarData.js.map +1 -1
  389. package/lib/esm/numerics/Polynomials.d.ts +5 -4
  390. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  391. package/lib/esm/numerics/Polynomials.js +5 -4
  392. package/lib/esm/numerics/Polynomials.js.map +1 -1
  393. package/lib/esm/numerics/Quadrature.js.map +1 -1
  394. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  395. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  396. package/lib/esm/numerics/UnionFind.js.map +1 -1
  397. package/lib/esm/numerics/UsageSums.js.map +1 -1
  398. package/lib/esm/polyface/AuxData.js.map +1 -1
  399. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  400. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  401. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  402. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  403. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  404. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  405. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  406. package/lib/esm/polyface/Polyface.js.map +1 -1
  407. package/lib/esm/polyface/PolyfaceBuilder.d.ts +219 -200
  408. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  409. package/lib/esm/polyface/PolyfaceBuilder.js +349 -304
  410. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  411. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  412. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  413. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  414. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  415. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  416. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  417. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  418. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  419. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  420. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  421. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  422. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  423. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  424. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  425. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  426. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  427. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  428. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  429. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  430. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  431. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  432. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  433. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  434. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  435. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  436. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  437. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  438. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  439. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  440. package/lib/esm/solid/Box.js.map +1 -1
  441. package/lib/esm/solid/Cone.js.map +1 -1
  442. package/lib/esm/solid/LinearSweep.js.map +1 -1
  443. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  444. package/lib/esm/solid/RuledSweep.js.map +1 -1
  445. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  446. package/lib/esm/solid/Sphere.js.map +1 -1
  447. package/lib/esm/solid/SweepContour.js.map +1 -1
  448. package/lib/esm/solid/TorusPipe.js.map +1 -1
  449. package/lib/esm/topology/ChainMerge.js.map +1 -1
  450. package/lib/esm/topology/Graph.js.map +1 -1
  451. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  452. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  453. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  454. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  455. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  456. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  457. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  458. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  459. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  460. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  461. package/lib/esm/topology/MaskManager.js.map +1 -1
  462. package/lib/esm/topology/Merging.js.map +1 -1
  463. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  464. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  465. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  466. package/lib/esm/topology/Triangulation.js.map +1 -1
  467. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  468. package/package.json +3 -3
@@ -44,10 +44,10 @@ const IndexedPolyfaceVisitor_1 = require("./IndexedPolyfaceVisitor");
44
44
  const Polyface_1 = require("./Polyface");
45
45
  const PolyfaceQuery_1 = require("./PolyfaceQuery");
46
46
  /**
47
- * A FacetSector
48
- * * initially holds coordinate data for a place where xyz and sectionDerivative are known
49
- * * normal is computed as a deferred step using an edge to adjacent place on ruled surface
50
- * * indices are set up even later.
47
+ * A FacetSector.
48
+ * * Initially holds coordinate data for a place where xyz and sectionDerivative are known.
49
+ * * Normal is computed as a deferred step using an edge to adjacent place on ruled surface.
50
+ * * Indices are set up even later.
51
51
  */
52
52
  class FacetSector {
53
53
  constructor(needNormal = false, needUV = false, needSectionDerivative = false) {
@@ -66,8 +66,9 @@ class FacetSector {
66
66
  this.sectionDerivative = Point3dVector3d_1.Vector3d.create();
67
67
  }
68
68
  }
69
- /** copy contents (not pointers) from source
70
- * * ASSUME all fields defined in this are defined int the source (undefined check only needed on this)
69
+ /**
70
+ * Copy contents (not pointers) from `other`.
71
+ * * ASSUME all fields defined in the instance are defined in `other`.
71
72
  */
72
73
  copyContentsFrom(other) {
73
74
  this.xyz.setFromPoint3d(other.xyz);
@@ -81,10 +82,11 @@ class FacetSector {
81
82
  if (this.sectionDerivative)
82
83
  this.sectionDerivative.setFrom(other.sectionDerivative);
83
84
  }
84
- /** access xyz, derivative from given arrays.
85
- * * ASSUME corresponding defined conditions
85
+ /**
86
+ * Access xyz, derivative from given arrays.
87
+ * * ASSUME corresponding defined conditions.
86
88
  * * xyz and derivative are set.
87
- * * index fields for updated data are cleared to -1.
89
+ * * Index fields for updated data are cleared to -1.
88
90
  */
89
91
  loadIndexedPointAndDerivativeCoordinatesFromPackedArrays(i, packedXYZ, packedDerivatives, fractions, v) {
90
92
  packedXYZ.getPoint3dAtCheckedPointIndex(i, this.xyz);
@@ -106,16 +108,14 @@ class FacetSector {
106
108
  uvw.z = 0.0;
107
109
  }
108
110
  /**
109
- * given two sectors with xyz and sectionDerivative (u derivative)
110
- * use the edge from A to B as v direction in-surface derivative.
111
- * compute cross products (and normalize)
112
- * @param sectorA "lower" sector
113
- * @param sectorB "upper" sector
114
- *
111
+ * Given two sectors with xyz and sectionDerivative (u derivative), use the edge from A to B as v direction
112
+ * in-surface derivative. Compute cross products (and normalize).
113
+ * @param sectorA "lower" sector.
114
+ * @param sectorB "upper" sector.
115
115
  */
116
116
  static computeNormalsAlongRuleLine(sectorA, sectorB) {
117
- // We expect that if sectionDerivative is defined so is normal.
118
- // (If not, the cross product calls will generate normals that are never used .. not good, garbage collector will clean up.)
117
+ // We expect that if a sector's sectionDerivative is defined, then so is its normal. If a normal is undefined, the
118
+ // crossProduct returns an object that goes unused---not good, but the garbage collector will clean it up.
119
119
  if (sectorA.sectionDerivative && sectorB.sectionDerivative) {
120
120
  const vectorAB = FacetSector._edgeVector;
121
121
  Point3dVector3d_1.Vector3d.createStartEnd(sectorA.xyz, sectorB.xyz, vectorAB);
@@ -130,12 +130,10 @@ class FacetSector {
130
130
  }
131
131
  FacetSector._edgeVector = Point3dVector3d_1.Vector3d.create();
132
132
  /**
133
- *
134
133
  * * Simple construction for strongly typed GeometryQuery objects:
135
134
  *
136
135
  * * Create a builder with `builder = PolyfaceBuilder.create()`
137
136
  * * Add GeometryQuery objects:
138
- *
139
137
  * * `builder.addGeometryQuery(g: GeometryQuery)`
140
138
  * * `builder.addCone(cone: Cone)`
141
139
  * * `builder.addTorusPipe(surface: TorusPipe)`
@@ -146,7 +144,7 @@ FacetSector._edgeVector = Point3dVector3d_1.Vector3d.create();
146
144
  * * `builder.addSphere(sphere: Sphere)`
147
145
  * * `builder.addBox(box: Box)`
148
146
  * * `builder.addIndexedPolyface(polyface)`
149
- * * Extract with `builder.claimPolyface(true)`
147
+ * * Extract with `builder.claimPolyface(true)`
150
148
  *
151
149
  * * Simple construction for ephemeral constructive data:
152
150
  *
@@ -162,9 +160,10 @@ FacetSector._edgeVector = Point3dVector3d_1.Vector3d.create();
162
160
  * * `builder.addTrianglesInUncheckedConvexPolygon(linestring, toggle)`
163
161
  * * `builder.addUVGridBody(surface,numU, numV, createFanInCaps)`
164
162
  * * `builder.addGraph(Graph, acceptFaceFunction)`
165
- * * Extract with `builder.claimPolyface(true)`
163
+ * * Extract with `builder.claimPolyface(true)`
164
+ *
165
+ * * Low-level detail construction -- direct use of indices:
166
166
  *
167
- * * Low-level detail construction -- direct use of indices
168
167
  * * Create a builder with `builder = PolyfaceBuilder.create()`
169
168
  * * Add GeometryQuery objects
170
169
  * * `builder.addPoint(point)`
@@ -172,17 +171,21 @@ FacetSector._edgeVector = Point3dVector3d_1.Vector3d.create();
172
171
  * * `builder.addPointXYZ(x,y,z)`
173
172
  * * `builder.addTriangleFacet(points)`
174
173
  * * `builder.addQuadFacet(points)`
175
- * @public
174
+ * @public
176
175
  */
177
176
  class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
178
- /** return (pointer to) the `StrokeOptions` in use by the builder. */
179
- get options() { return this._options; }
177
+ /** Return (pointer to) the `StrokeOptions` in use by the builder. */
178
+ get options() {
179
+ return this._options;
180
+ }
180
181
  /** Ask if this builder is reversing vertex order as loops are received. */
181
- get reversedFlag() { return this._reversed; }
182
+ get reversedFlag() {
183
+ return this._reversed;
184
+ }
182
185
  /**
183
186
  * Extract the polyface.
184
- * @param compress whether to cluster vertices (default true)
185
- * @param tolerance compression tolerance (default Geometry.smallMetricDistance)
187
+ * @param compress whether to cluster vertices (default `true`).
188
+ * @param tolerance compression tolerance (default `Geometry.smallMetricDistance`).
186
189
  */
187
190
  claimPolyface(compress = true, tolerance = Geometry_1.Geometry.smallMetricDistance) {
188
191
  if (compress)
@@ -190,7 +193,9 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
190
193
  return this._polyface;
191
194
  }
192
195
  /** Toggle (reverse) the flag controlling orientation flips for newly added facets. */
193
- toggleReversedFacetFlag() { this._reversed = !this._reversed; }
196
+ toggleReversedFacetFlag() {
197
+ this._reversed = !this._reversed;
198
+ }
194
199
  constructor(options) {
195
200
  super();
196
201
  this._options = options ? options : StrokeOptions_1.StrokeOptions.createForFacets();
@@ -198,25 +203,27 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
198
203
  this._reversed = false;
199
204
  }
200
205
  /**
201
- * Create a builder with given StrokeOptions
202
- * @param options StrokeOptions (captured)
206
+ * Create a builder with given StrokeOptions.
207
+ * @param options StrokeOptions (captured).
203
208
  */
204
209
  static create(options) {
205
210
  return new PolyfaceBuilder(options);
206
211
  }
207
- /** add facets for a transformed unit box. */
212
+ /** Add facets for a transformed unit box. */
208
213
  addTransformedUnitBox(transform) {
209
214
  this.addTransformedRangeMesh(transform, Range_1.Range3d.createXYZXYZ(0, 0, 0, 1, 1, 1));
210
215
  }
211
- /** Add facets for a transformed range box.
216
+ /**
217
+ * Add facets for a transformed range box.
212
218
  * * For best results, the transformed range corners should define a nonzero volume or area.
213
- * @param transform applied to the range points before adding to the polyface
214
- * @param range sides become 6 quad polyface facets
215
- * @param faceSelector for each face in the order of BoxTopology.cornerIndexCCW, faceSelector[i]===false skips that facet.
219
+ * @param transform applied to the range points before adding to the polyface.
220
+ * @param range sides become 6 quad polyface facets.
221
+ * @param faceSelector for each face in the order of `BoxTopology.cornerIndexCCW`, `faceSelector[i] === false` skips
222
+ * that facet.
216
223
  */
217
224
  addTransformedRangeMesh(transform, range, faceSelector) {
218
225
  const pointIndex0 = this._polyface.data.pointCount;
219
- // these will have sequential indices starting at pointIndex0 . . .
226
+ // these will have sequential indices starting at pointIndex0
220
227
  const points = range.corners();
221
228
  for (const p of points)
222
229
  this._polyface.addPoint(transform.multiplyPoint3d(p));
@@ -238,9 +245,11 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
238
245
  faceCounter++;
239
246
  }
240
247
  }
241
- /** Add triangles from points[0] to each far edge.
242
- * @param ls linestring with point coordinates
243
- * @param toggle if true, wrap the triangle creation in toggleReversedFacetFlag.
248
+ /**
249
+ * Add triangles from `conePoint` to each far edge.
250
+ * @param conePoint the common vertex of all triangles.
251
+ * @param ls linestring with point coordinates.
252
+ * @param toggle if `true`, wrap the triangle creation in toggleReversedFacetFlag.
244
253
  */
245
254
  addTriangleFan(conePoint, ls, toggle) {
246
255
  const n = ls.numPoints();
@@ -259,12 +268,11 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
259
268
  this.toggleReversedFacetFlag();
260
269
  }
261
270
  }
262
- /** Add triangles from points[0] to each far edge
263
- * * Assume the polygon is convex.
264
- * * i.e. simple triangulation from point0
265
- * * i.e. simple cross products give a good normal.
266
- * @param ls linestring with point coordinates
267
- * @param reverse if true, wrap the triangle creation in toggleReversedFacetFlag.
271
+ /**
272
+ * Add triangles from the first point of the linestring to the subsequent edges of the linestring.
273
+ * * No checks are made for polygon convexity or edge collinearity, conditions which would ensure positive area triangles.
274
+ * @param ls linestring with point coordinates.
275
+ * @param reverse if `true`, wrap the triangle creation in toggleReversedFacetFlag.
268
276
  */
269
277
  addTrianglesInUncheckedConvexPolygon(ls, toggle) {
270
278
  const n = ls.numPoints();
@@ -309,36 +317,36 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
309
317
  this.toggleReversedFacetFlag();
310
318
  }
311
319
  }
312
- /**
313
- * Announce point coordinates.
314
- */
320
+ /** Add a point to the polyface. */
315
321
  addPoint(xyz) {
316
322
  return this._polyface.addPoint(xyz);
317
323
  }
318
324
  /**
319
- * Announce point coordinates.
325
+ * Add a point to the polyface.
320
326
  * @deprecated in 3.x. Use addPoint instead.
321
327
  */
322
328
  findOrAddPoint(xyz) {
323
329
  return this.addPoint(xyz);
324
330
  }
325
- /**
326
- * Announce uv parameter coordinates.
327
- */
331
+ /** Add a uv parameter to the polyface. */
328
332
  addParamXY(x, y) {
329
333
  return this._polyface.addParamUV(x, y);
330
334
  }
331
335
  /**
332
- * Announce uv parameter coordinates.
336
+ * Add a uv parameter to the polyface.
333
337
  * @deprecated in 3.x. Use addParamXY instead.
334
338
  */
335
339
  findOrAddParamXY(x, y) {
336
340
  return this.addParamXY(x, y);
337
341
  }
338
342
  /**
339
- * Announce point coordinates. The implementation is free to either create a new point or (if known) return index of a prior point with the same coordinates.
340
- * @returns Returns the point index in the Polyface.
341
- * @param index Index of the point in the linestring.
343
+ * Add a point to the polyface. The implementation is free to either create a new point or return the index of a
344
+ * prior point with the same coordinates.
345
+ * @param ls the linestring.
346
+ * @param index index of the point in the linestring.
347
+ * @param transform (optional) transform to be applied.
348
+ * @param priorIndex (optional) index of a prior point to check for possible duplicate value.
349
+ * @returns the point index in the polyface.
342
350
  */
343
351
  findOrAddPointInLineString(ls, index, transform, priorIndex) {
344
352
  const q = ls.pointAt(index, PolyfaceBuilder._workPointFindOrAddA);
@@ -350,9 +358,13 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
350
358
  return undefined;
351
359
  }
352
360
  /**
353
- * Announce point coordinates. The implementation is free to either create a new point or (if known) return index of a prior point with the same coordinates.
354
- * @returns Returns the point index in the Polyface.
355
- * @param index Index of the point in the linestring.
361
+ * Add a point to the polyface. The implementation is free to either create a new point or return the index of a
362
+ * prior point with the same coordinates.
363
+ * @param xyz the array of points.
364
+ * @param index index of the point in the array.
365
+ * @param transform (optional) transform to be applied.
366
+ * @param priorIndex (optional) index of a prior point to check for possible duplicate value.
367
+ * @returns the point index in the polyface.
356
368
  */
357
369
  findOrAddPointInGrowableXYZArray(xyz, index, transform, priorIndex) {
358
370
  const q = xyz.getPoint3dAtCheckedPointIndex(index, PolyfaceBuilder._workPointFindOrAddA);
@@ -364,9 +376,13 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
364
376
  return undefined;
365
377
  }
366
378
  /**
367
- * Announce point coordinates. The implementation is free to either create a new point or (if known) return index of a prior point with the same coordinates.
368
- * @returns Returns the point index in the Polyface.
369
- * @param index Index of the point in the linestring.
379
+ * Add a normal to the polyface. The implementation is free to either create a new normal or return the index of a
380
+ * prior normal with the same coordinates.
381
+ * @param xyz the array of normals.
382
+ * @param index index of the normal in the array.
383
+ * @param transform (optional) transform to be applied.
384
+ * @param priorIndex (optional) index of a prior point to check for possible duplicate value.
385
+ * @returns the normal index in the polyface.
370
386
  */
371
387
  findOrAddNormalInGrowableXYZArray(xyz, index, transform, priorIndex) {
372
388
  const q = xyz.getVector3dAtCheckedVectorIndex(index, PolyfaceBuilder._workVectorFindOrAdd);
@@ -378,40 +394,49 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
378
394
  return undefined;
379
395
  }
380
396
  /**
381
- * Announce uv parameter coordinates.
382
- * @returns Returns the uv parameter index in the Polyface.
383
- * @param index Index of the param in the linestring.
397
+ * Add a uv parameter to the polyface.
398
+ * @param data the array of uv data.
399
+ * @param index index of the param in the array.
400
+ * @returns the uv parameter index in the polyface.
384
401
  */
385
402
  addParamInGrowableXYArray(data, index) {
386
403
  if (!data)
387
404
  return undefined;
388
405
  const q = data.getPoint2dAtCheckedPointIndex(index, PolyfaceBuilder._workUVFindOrAdd);
389
- if (q) {
406
+ if (q)
390
407
  return this._polyface.addParam(q);
391
- }
392
408
  return undefined;
393
409
  }
394
410
  /**
395
- * Announce uv parameter coordinates.
411
+ * Add a uv parameter to the polyface.
396
412
  * @deprecated in 3.x. Use addParamInGrowableXYArray instead.
397
413
  */
398
414
  findOrAddParamInGrowableXYArray(data, index) {
399
415
  return this.addParamInGrowableXYArray(data, index);
400
416
  }
401
417
  /**
402
- * Announce param coordinates, taking u from ls.fractions and v from parameter. The implementation is free to either create a new param or (if known) return index of a prior point with the same coordinates.
403
- * @returns Returns the point index in the Polyface.
404
- * @param index Index of the point in the linestring.
418
+ * Add a uv parameter to the polyface, taking `u` from `ls.fractions` and `v` from input. The implementation is
419
+ * free to either create a new param or return the index of a prior param with the same coordinates.
420
+ * @param ls the linestring.
421
+ * @param index index of the point in the linestring.
422
+ * @param v the v parameter.
423
+ * @param priorIndexA (optional) an index of a prior param to check for possible duplicate value.
424
+ * @param priorIndexB (optional) another index of a prior param to check for possible duplicate value.
425
+ * @returns the uv parameter index in the polyface.
405
426
  */
406
427
  findOrAddParamInLineString(ls, index, v, priorIndexA, priorIndexB) {
407
- const u = (ls.fractions && index < ls.fractions.length) ? ls.fractions.atUncheckedIndex(index) : index / ls.points.length;
428
+ const u = (ls.fractions && index < ls.fractions.length) ?
429
+ ls.fractions.atUncheckedIndex(index) : index / ls.points.length;
408
430
  return this._polyface.addParamUV(u, v, priorIndexA, priorIndexB);
409
431
  }
410
432
  /**
411
- * Announce normal coordinates found at index in the surfaceNormal array stored on the linestring
412
- * @returns Returns the point index in the Polyface.
413
- * @param index Index of the point in the linestring.
414
- * @param priorIndex possible prior normal index to reuse
433
+ * Add a normal to the polyface.
434
+ * @param ls the linestring.
435
+ * @param index Index of the normal in the linestring's surface normal array.
436
+ * @param transform (optional) transform to be applied.
437
+ * @param priorIndexA (optional) an index of a prior normal to check for possible duplicate value.
438
+ * @param priorIndexB (optional) another index of a prior normal to check for possible duplicate value.
439
+ * @returns the normal index in the polyface.
415
440
  */
416
441
  findOrAddNormalInLineString(ls, index, transform, priorIndexA, priorIndexB) {
417
442
  const linestringNormals = ls.packedSurfaceNormals;
@@ -425,14 +450,12 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
425
450
  }
426
451
  return undefined;
427
452
  }
428
- /**
429
- * Announce point coordinates.
430
- */
453
+ /** Add a point to the polyface. */
431
454
  addPointXYZ(x, y, z) {
432
455
  return this._polyface.addPointXYZ(x, y, z);
433
456
  }
434
457
  /**
435
- * Announce point coordinates.
458
+ * Add a point to the polyface.
436
459
  * @deprecated in 3.x. Use addPointXYZ instead.
437
460
  */
438
461
  findOrAddPointXYZ(x, y, z) {
@@ -454,18 +477,22 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
454
477
  normal = normal ? normal : Point3dVector3d_1.Vector3d.create();
455
478
  return normal;
456
479
  }
457
- // ###: Consider case where normals will be reversed and point through the other end of the facet
480
+ // ### TODO: Consider case where normals will be reversed and point through the other end of the facet.
458
481
  /**
459
482
  * Add a quad to the polyface given its points in order around the edges.
460
- * @param points array of at least three vertices
461
- * @param params optional array of at least four uv parameters (if undefined, params are calculated without reference data)
462
- * @param normals optional array of at least four vectors (if undefined, the quad is assumed to be planar and its normal is calculated)
463
- * @param colors optional array of at least four colors
483
+ * @param points array of at least four vertices.
484
+ * @param params (optional) array of at least four uv parameters (if `undefined`, params are calculated without
485
+ * reference data).
486
+ * @param normals (optional) array of at least four vectors (if `undefined`, the quad is assumed to be planar and its
487
+ * normal is calculated).
488
+ * @param colors (optional) array of at least four colors.
464
489
  */
465
490
  addQuadFacet(points, params, normals, colors) {
466
491
  if (points instanceof GrowableXYZArray_1.GrowableXYZArray)
467
492
  points = points.getPoint3dArray();
468
- // If params and/or normals are needed, calculate them first
493
+ if (points.length < 4)
494
+ return;
495
+ // if params and/or normals are needed, calculate them first
469
496
  const needParams = this.options.needParams;
470
497
  const needNormals = this.options.needNormals;
471
498
  const needColors = this.options.needColors;
@@ -515,7 +542,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
515
542
  }
516
543
  }
517
544
  if (this._options.shouldTriangulate) {
518
- // Add as two triangles, with a diagonal along the shortest distance
545
+ // add as two triangles, with a diagonal along the shortest distance
519
546
  const vectorAC = points[0].vectorTo(points[2]);
520
547
  const vectorBD = points[1].vectorTo(points[3]);
521
548
  // Note: We pass along any values for normals or params that we calculated
@@ -530,7 +557,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
530
557
  return;
531
558
  }
532
559
  let idx0, idx1, idx2, idx3;
533
- // Add params if needed
560
+ // add params if needed
534
561
  if (needParams) {
535
562
  idx0 = this._polyface.addParam(param0);
536
563
  idx1 = this._polyface.addParam(param1);
@@ -538,7 +565,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
538
565
  idx3 = this._polyface.addParam(param3);
539
566
  this.addIndexedQuadParamIndexes(idx0, idx1, idx3, idx2);
540
567
  }
541
- // Add normals if needed
568
+ // add normals if needed
542
569
  if (needNormals) {
543
570
  idx0 = this._polyface.addNormal(normal0);
544
571
  idx1 = this._polyface.addNormal(normal1);
@@ -546,7 +573,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
546
573
  idx3 = this._polyface.addNormal(normal3);
547
574
  this.addIndexedQuadNormalIndexes(idx0, idx1, idx3, idx2);
548
575
  }
549
- // Add colors if needed
576
+ // add colors if needed
550
577
  if (needColors) {
551
578
  idx0 = this._polyface.addColor(color0);
552
579
  idx1 = this._polyface.addColor(color1);
@@ -554,18 +581,19 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
554
581
  idx3 = this._polyface.addColor(color3);
555
582
  this.addIndexedQuadColorIndexes(idx0, idx1, idx3, idx2);
556
583
  }
557
- // Add point and point indexes last (terminates the facet)
584
+ // add point and point indexes last (terminates the facet)
558
585
  idx0 = this.addPoint(points[0]);
559
586
  idx1 = this.addPoint(points[1]);
560
587
  idx2 = this.addPoint(points[2]);
561
588
  idx3 = this.addPoint(points[3]);
562
589
  this.addIndexedQuadPointIndexes(idx0, idx1, idx3, idx2);
563
590
  }
564
- /** Announce a single quad facet's point indexes.
591
+ /**
592
+ * Add a single quad facet from existing points to the polyface.
565
593
  * * The actual quad may be reversed or triangulated based on builder setup.
566
- * * indexA0 and indexA1 are in the forward order at the "A" end of the quad
567
- * * indexB0 and indexB1 are in the forward order at the "B" end of the quad.
568
- * * This means ccw/cw ordered vertices v[i] should be passed into this function as i=[0,1,3,2]
594
+ * * `indexA0` and `indexA1` are in the forward order at the "A" end of the quad
595
+ * * `indexB0` and `indexB1` are in the forward order at the "B" end of the quad.
596
+ * * This means ccw/cw ordered vertices v[i] should be passed into this function as i=[0,1,3,2].
569
597
  */
570
598
  addIndexedQuadPointIndexes(indexA0, indexA1, indexB0, indexB1, terminate = true) {
571
599
  if (this._reversed) {
@@ -628,13 +656,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
628
656
  this._polyface.addColorIndex(indexB0);
629
657
  }
630
658
  }
631
- // ### TODO: Consider case where normals will be reversed and point through the other end of the facet
659
+ // ### TODO: Consider case where normals will be reversed and point through the other end of the facet.
632
660
  /**
633
661
  * Add a triangle to the polyface given its points in order around the edges.
634
- * @param points array of at least three vertices
635
- * @param params optional array of at least three uv parameters (if undefined, params are calculated without reference data)
636
- * @param normals optional array of at least three vectors (if undefined, the normal is calculated)
637
- * @param colors optional array of at least three colors
662
+ * @param points array of at least three vertices.
663
+ * @param params (optional) array of at least three uv parameters (if `undefined`, params are calculated without
664
+ * reference data).
665
+ * @param normals (optional) array of at least three vectors (if `undefined`, the normal is calculated).
666
+ * @param colors (optional) array of at least three colors.
638
667
  */
639
668
  addTriangleFacet(points, params, normals, colors) {
640
669
  if (points.length < 3)
@@ -653,14 +682,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
653
682
  point1 = points[1];
654
683
  point2 = points[2];
655
684
  }
656
- // Add params if needed
685
+ // add params if needed
657
686
  if (this._options.needParams) {
658
- if (params && params.length >= 3) { // Params were given
687
+ if (params && params.length >= 3) { // params were given
659
688
  idx0 = this._polyface.addParam(params[0]);
660
689
  idx1 = this._polyface.addParam(params[1]);
661
690
  idx2 = this._polyface.addParam(params[2]);
662
691
  }
663
- else { // Compute params
692
+ else { // compute params
664
693
  const paramTransform = this.getUVTransformForTriangleFacet(point0, point1, point2);
665
694
  idx0 = this._polyface.addParam(Point2dVector2d_1.Point2d.createFrom(paramTransform ? paramTransform.multiplyPoint3d(point0) : undefined));
666
695
  idx1 = this._polyface.addParam(Point2dVector2d_1.Point2d.createFrom(paramTransform ? paramTransform.multiplyPoint3d(point1) : undefined));
@@ -668,14 +697,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
668
697
  }
669
698
  this.addIndexedTriangleParamIndexes(idx0, idx1, idx2);
670
699
  }
671
- // Add normals if needed
700
+ // add normals if needed
672
701
  if (this._options.needNormals) {
673
- if (normals !== undefined && normals.length > 2) { // Normals were given
702
+ if (normals !== undefined && normals.length > 2) { // normals were given
674
703
  idx0 = this._polyface.addNormal(normals[0]);
675
704
  idx1 = this._polyface.addNormal(normals[1]);
676
705
  idx2 = this._polyface.addNormal(normals[2]);
677
706
  }
678
- else { // Compute normals
707
+ else { // compute normals
679
708
  const normal = this.getNormalForTriangularFacet(point0, point1, point2);
680
709
  idx0 = this._polyface.addNormal(normal);
681
710
  idx1 = this._polyface.addNormal(normal);
@@ -683,7 +712,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
683
712
  }
684
713
  this.addIndexedTriangleNormalIndexes(idx0, idx1, idx2);
685
714
  }
686
- // Add colors if needed and provided
715
+ // add colors if needed and provided
687
716
  if (this._options.needColors) {
688
717
  if (colors !== undefined && colors.length > 2) {
689
718
  idx0 = this._polyface.addColor(colors[0]);
@@ -692,15 +721,15 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
692
721
  this.addIndexedTriangleColorIndexes(idx0, idx1, idx2);
693
722
  }
694
723
  }
695
- // Add point and point indexes last (terminates the facet)
724
+ // add point and point indexes last (terminates the facet)
696
725
  idx0 = this.addPoint(point0);
697
726
  idx1 = this.addPoint(point1);
698
727
  idx2 = this.addPoint(point2);
699
728
  this.addIndexedTrianglePointIndexes(idx0, idx1, idx2);
700
729
  }
701
- /** Announce a single triangle facet's point indexes.
702
- *
703
- * * The actual quad may be reversed or triangulated based on builder setup.
730
+ /**
731
+ * Add a single triangular facet from existing points to the polyface.
732
+ * * The added triangle may be reversed based on builder setup.
704
733
  */
705
734
  addIndexedTrianglePointIndexes(indexA, indexB, indexC, terminateFacet = true) {
706
735
  if (!this._reversed) {
@@ -767,7 +796,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
767
796
  if (sectorA0.xyz.isAlmostEqual(sectorA1.xyz)
768
797
  || sectorA1.xyz.isAlmostEqual(sectorA2.xyz)
769
798
  || sectorA2.xyz.isAlmostEqual(sectorA0.xyz)) {
770
- // trivially degenerate triangle !!! skip !!!
799
+ // trivially degenerate triangle; skip!!!
771
800
  }
772
801
  else {
773
802
  if (this._options.needNormals)
@@ -779,7 +808,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
779
808
  }
780
809
  addSectorQuadA01B01(sectorA0, sectorA1, sectorB0, sectorB1) {
781
810
  if (sectorA0.xyz.isAlmostEqual(sectorA1.xyz) && sectorB0.xyz.isAlmostEqual(sectorB1.xyz)) {
782
- // ignore null quad !!
811
+ // ignore null quad
783
812
  }
784
813
  else if (this._options.shouldTriangulate) {
785
814
  this.addSectorTriangle(sectorA0, sectorA1, sectorB1);
@@ -793,10 +822,9 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
793
822
  this.addIndexedQuadPointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorB0.xyzIndex, sectorB1.xyzIndex, true);
794
823
  }
795
824
  }
796
- /** Add facets between lineStrings with matched point counts.
797
- * * surface normals are computed from (a) curve tangents in the linestrings and (b)rule line between linestrings.
798
- * * Facets are announced to addIndexedQuad.
799
- * * addIndexedQuad is free to apply reversal or triangulation options.
825
+ /**
826
+ * Add facets between lineStrings with matched point counts.
827
+ * * Surface normals are computed from (a) curve tangents in the linestrings and (b) rule line between linestrings.
800
828
  */
801
829
  addBetweenLineStringsWithRuleEdgeNormals(lineStringA, vA, lineStringB, vB, addClosure = false) {
802
830
  const pointA = lineStringA.packedPoints;
@@ -830,7 +858,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
830
858
  FacetSector.computeNormalsAlongRuleLine(sectorA1, sectorB1);
831
859
  this.setSectorIndices(sectorA1);
832
860
  this.setSectorIndices(sectorB1);
833
- // create the facet ...
861
+ // create the facet
834
862
  this.addSectorQuadA01B01(sectorA0, sectorA1, sectorB0, sectorB1);
835
863
  sectorA0.copyContentsFrom(sectorA1);
836
864
  sectorB0.copyContentsFrom(sectorB1);
@@ -838,10 +866,9 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
838
866
  if (addClosure)
839
867
  this.addSectorQuadA01B01(sectorA0, sectorA00, sectorB0, sectorB00);
840
868
  }
841
- /** Add facets between lineStrings with matched point counts.
842
- * * point indices pre-stored
843
- * * normal indices pre-stored
844
- * * uv indices pre-stored
869
+ /**
870
+ * Add facets between lineStrings with matched point counts.
871
+ * * Indices of points, normals, and uv parameters are pre-stored in the linestrings.
845
872
  */
846
873
  addBetweenLineStringsWithStoredIndices(lineStringA, lineStringB) {
847
874
  const pointA = lineStringA.pointIndices;
@@ -877,7 +904,8 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
877
904
  }
878
905
  }
879
906
  else {
880
- if (pointA.atUncheckedIndex(i - 1) !== pointA.atUncheckedIndex(i) || pointB.atUncheckedIndex(i - 1) !== pointB.atUncheckedIndex(i)) {
907
+ if (pointA.atUncheckedIndex(i - 1) !== pointA.atUncheckedIndex(i) ||
908
+ pointB.atUncheckedIndex(i - 1) !== pointB.atUncheckedIndex(i)) {
881
909
  this.addIndexedQuadPointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i), false);
882
910
  if (normalA && normalB)
883
911
  this.addIndexedQuadNormalIndexes(normalA.atUncheckedIndex(i - 1), normalA.atUncheckedIndex(i), normalB.atUncheckedIndex(i - 1), normalB.atUncheckedIndex(i));
@@ -888,8 +916,8 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
888
916
  this._polyface.terminateFacet();
889
917
  }
890
918
  }
891
- /** Add facets between lineStrings with matched point counts.
892
- *
919
+ /**
920
+ * Add facets between lineStrings with matched point counts.
893
921
  * * Facets are announced to addIndexedQuad.
894
922
  * * addIndexedQuad is free to apply reversal or triangulation options.
895
923
  */
@@ -915,7 +943,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
915
943
  }
916
944
  else {
917
945
  const children = curves.children;
918
- // just send the children individually -- final s will fix things??
946
+ // just send the children individually; final compress will fix things??
919
947
  if (children)
920
948
  for (const c of children) {
921
949
  this.addBetweenTransformedLineStrings(c, transformA, transformB);
@@ -947,11 +975,9 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
947
975
  }
948
976
  }
949
977
  }
950
- /**
951
- * Add facets from a Cone
952
- */
978
+ /** Add facets from a Cone. */
953
979
  addCone(cone) {
954
- // ensure identical stroke counts at each end . . .
980
+ // ensure identical stroke counts at each end
955
981
  let strokeCount = 16;
956
982
  if (this._options)
957
983
  strokeCount = this._options.applyTolerancesToArc(cone.getMaxRadius());
@@ -976,9 +1002,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
976
1002
  }
977
1003
  }
978
1004
  }
979
- /**
980
- * Add facets for a TorusPipe.
981
- */
1005
+ /** Add facets for a TorusPipe. */
982
1006
  addTorusPipe(surface, phiStrokeCount, thetaStrokeCount) {
983
1007
  const thetaFraction = surface.getThetaFraction();
984
1008
  let numU = Geometry_1.Geometry.clamp(Geometry_1.Geometry.resolveNumber(phiStrokeCount, 8), 4, 64);
@@ -1022,11 +1046,11 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1022
1046
  }
1023
1047
  /**
1024
1048
  * Add point data (no params, normals) for linestrings.
1025
- * * This recurses through curve chains (loops and paths)
1026
- * * linestrings are swept
1049
+ * * This recurses through curve chains (loops and paths).
1050
+ * * LineStrings are swept.
1027
1051
  * * All other curve types are ignored.
1028
- * @param vector sweep vector
1029
- * @param contour contour which contains only linestrings
1052
+ * @param contour contour which contains only linestrings.
1053
+ * @param vector sweep vector.
1030
1054
  */
1031
1055
  addLinearSweepLineStringsXYZOnly(contour, vector) {
1032
1056
  if (contour instanceof LineString3d_1.LineString3d) {
@@ -1042,22 +1066,18 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1042
1066
  pointB = pointA.plus(vector, pointB);
1043
1067
  indexA1 = this.addPoint(pointA);
1044
1068
  indexB1 = this.addPoint(pointB);
1045
- if (i > 0) {
1069
+ if (i > 0)
1046
1070
  this.addIndexedQuadPointIndexes(indexA0, indexA1, indexB0, indexB1);
1047
- }
1048
1071
  indexA0 = indexA1;
1049
1072
  indexB0 = indexB1;
1050
1073
  }
1051
1074
  }
1052
1075
  else if (contour instanceof CurveCollection_1.CurveChain) {
1053
- for (const ls of contour.children) {
1076
+ for (const ls of contour.children)
1054
1077
  this.addLinearSweepLineStringsXYZOnly(ls, vector);
1055
- }
1056
1078
  }
1057
1079
  }
1058
- /**
1059
- * Construct facets for a rotational sweep.
1060
- */
1080
+ /** Construct facets for a rotational sweep. */
1061
1081
  addRotationalSweep(surface) {
1062
1082
  const contour = surface.getCurves();
1063
1083
  const section0 = StrokeCountChain_1.StrokeCountSection.createForParityRegionOrChain(contour, this._options);
@@ -1080,22 +1100,21 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1080
1100
  const capContour = surface.getSweepContourRef();
1081
1101
  capContour.purgeFacets();
1082
1102
  capContour.emitFacets(this, true, undefined);
1083
- // final loop pass left transformA at end ..
1103
+ // final loop pass left transformA at end
1084
1104
  capContour.emitFacets(this, false, surface.getFractionalRotationTransform(1.0));
1085
1105
  }
1086
1106
  }
1087
- /**
1088
- * Construct facets for any planar region
1089
- */
1107
+ /** Construct facets for any planar region. */
1090
1108
  addTriangulatedRegion(region) {
1091
1109
  const contour = SweepContour_1.SweepContour.createForLinearSweep(region);
1092
1110
  if (contour)
1093
1111
  contour.emitFacets(this, this.reversedFlag, undefined);
1094
1112
  }
1095
1113
  /**
1114
+ * Apply stroke counts to curve primitives.
1096
1115
  * * Recursively visit all children of data.
1097
- * * At each primitive, invoke the computeStrokeCountForOptions method, with options from the builder.
1098
- * @param data
1116
+ * * At each primitive, invoke `computeStrokeCountForOptions` method with options from the builder.
1117
+ * @deprecated in 4.x. This method does nothing and is unneeded.
1099
1118
  */
1100
1119
  applyStrokeCountsToCurvePrimitives(data) {
1101
1120
  const options = this._options;
@@ -1105,9 +1124,9 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1105
1124
  else if (data instanceof CurveCollection_1.CurveCollection) {
1106
1125
  const children = data.children;
1107
1126
  if (children)
1108
- for (const child of children) {
1127
+ for (const child of children)
1128
+ // eslint-disable-next-line deprecation/deprecation
1109
1129
  this.applyStrokeCountsToCurvePrimitives(child);
1110
- }
1111
1130
  }
1112
1131
  }
1113
1132
  addBetweenStrokeSetsWithRuledNormals(stroke0, stroke1, numVEdge) {
@@ -1127,22 +1146,20 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1127
1146
  }
1128
1147
  createIndicesInLineString(ls, vParam, transform) {
1129
1148
  const n = ls.numPoints();
1130
- {
1131
- const pointIndices = ls.ensureEmptyPointIndices();
1132
- const index0 = this.findOrAddPointInLineString(ls, 0, transform);
1133
- pointIndices.push(index0);
1134
- if (n > 1) {
1135
- let indexA = index0;
1136
- let indexB;
1137
- for (let i = 1; i + 1 < n; i++) {
1138
- indexB = this.findOrAddPointInLineString(ls, i, transform, indexA);
1139
- pointIndices.push(indexB);
1140
- indexA = indexB;
1141
- }
1142
- // assume last point can only repeat back to zero ...
1143
- indexB = this.findOrAddPointInLineString(ls, n - 1, transform, index0);
1149
+ const pointIndices = ls.ensureEmptyPointIndices();
1150
+ const index0 = this.findOrAddPointInLineString(ls, 0, transform);
1151
+ pointIndices.push(index0);
1152
+ if (n > 1) {
1153
+ let indexA = index0;
1154
+ let indexB;
1155
+ for (let i = 1; i + 1 < n; i++) {
1156
+ indexB = this.findOrAddPointInLineString(ls, i, transform, indexA);
1144
1157
  pointIndices.push(indexB);
1158
+ indexA = indexB;
1145
1159
  }
1160
+ // assume last point can only repeat back to zero
1161
+ indexB = this.findOrAddPointInLineString(ls, n - 1, transform, index0);
1162
+ pointIndices.push(indexB);
1146
1163
  }
1147
1164
  if (this._options.needNormals && ls.packedSurfaceNormals !== undefined) {
1148
1165
  const normalIndices = ls.ensureEmptyNormalIndices();
@@ -1156,7 +1173,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1156
1173
  normalIndices.push(normalIndexB);
1157
1174
  normalIndexA = normalIndexB;
1158
1175
  }
1159
- // assume last point can only repeat back to zero ...
1176
+ // assume last point can only repeat back to zero
1160
1177
  normalIndexB = this.findOrAddNormalInLineString(ls, n - 1, transform, normalIndex0, normalIndexA);
1161
1178
  normalIndices.push(normalIndexB);
1162
1179
  }
@@ -1173,7 +1190,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1173
1190
  uvIndices.push(uvIndexB);
1174
1191
  uvIndexA = uvIndexB;
1175
1192
  }
1176
- // assume last point can only repeat back to zero ...
1193
+ // assume last point can only repeat back to zero
1177
1194
  uvIndexB = this.findOrAddParamInLineString(ls, n - 1, vParam, uvIndexA, uvIndex0);
1178
1195
  uvIndices.push(uvIndexB);
1179
1196
  }
@@ -1200,12 +1217,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1200
1217
  }
1201
1218
  }
1202
1219
  }
1203
- /**
1204
- *
1205
- * Add facets from
1206
- * * The swept contour
1207
- * * each cap.
1208
- */
1220
+ /** Add facets from the linear sweep. */
1209
1221
  addLinearSweep(surface) {
1210
1222
  const contour = surface.getCurvesRef();
1211
1223
  const section0 = StrokeCountChain_1.StrokeCountSection.createForParityRegionOrChain(contour, this._options);
@@ -1222,17 +1234,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1222
1234
  contourA.emitFacets(this, false, sweepTransform);
1223
1235
  }
1224
1236
  }
1225
- /**
1226
- * Add facets from a ruled sweep.
1227
- */
1237
+ /** Add facets from a ruled sweep. */
1228
1238
  addRuledSweep(surface) {
1229
1239
  const contours = surface.sweepContoursRef();
1230
1240
  let stroke0;
1231
1241
  let stroke1;
1232
1242
  const sectionMaps = [];
1233
- for (const contour of contours) {
1243
+ for (const contour of contours)
1234
1244
  sectionMaps.push(StrokeCountChain_1.StrokeCountSection.createForParityRegionOrChain(contour.curves, this._options));
1235
- }
1236
1245
  if (StrokeCountChain_1.StrokeCountSection.enforceStrokeCountCompatibility(sectionMaps)) {
1237
1246
  StrokeCountChain_1.StrokeCountSection.enforceCompatibleDistanceSums(sectionMaps);
1238
1247
  for (let i = 0; i < contours.length; i++) {
@@ -1258,9 +1267,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1258
1267
  }
1259
1268
  return true;
1260
1269
  }
1261
- /**
1262
- * Add facets from a Sphere
1263
- */
1270
+ /** Add facets from a sphere. */
1264
1271
  addSphere(sphere, strokeCount) {
1265
1272
  let numStrokeTheta = strokeCount ? strokeCount : this.options.applyTolerancesToArc(sphere.maxAxisRadius());
1266
1273
  if (Geometry_1.Geometry.isOdd(numStrokeTheta))
@@ -1280,21 +1287,19 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1280
1287
  this.endFace();
1281
1288
  }
1282
1289
  }
1283
- /**
1284
- * Add facets from a Box
1285
- */
1290
+ /** Add facets from a box. */
1286
1291
  addBox(box) {
1287
1292
  const corners = box.getCorners();
1288
1293
  const xLength = Geometry_1.Geometry.maxXY(box.getBaseX(), box.getBaseX());
1289
1294
  const yLength = Geometry_1.Geometry.maxXY(box.getBaseY(), box.getTopY());
1290
1295
  let zLength = 0.0;
1291
- for (let i = 0; i < 4; i++) {
1296
+ for (let i = 0; i < 4; i++)
1292
1297
  zLength = Geometry_1.Geometry.maxXY(zLength, corners[i].distance(corners[i + 4]));
1293
- }
1294
1298
  const numX = this._options.applyMaxEdgeLength(1, xLength);
1295
1299
  const numY = this._options.applyMaxEdgeLength(1, yLength);
1296
1300
  const numZ = this._options.applyMaxEdgeLength(1, zLength);
1297
- // Wrap the 4 out-of-plane faces as a single parameters space with "distance" advancing in x then y then negative x then negative y ...
1301
+ // wrap the 4 out-of-plane faces as a single parameter space with "distance"
1302
+ // advancing in x, then y, then negative x, then negative y
1298
1303
  const uParamRange = Segment1d_1.Segment1d.create(0, xLength);
1299
1304
  const vParamRange = Segment1d_1.Segment1d.create(0, zLength);
1300
1305
  this.addUVGridBody(BilinearPatch_1.BilinearPatch.create(corners[0], corners[1], corners[4], corners[5]), numX, numZ, uParamRange, vParamRange);
@@ -1304,7 +1309,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1304
1309
  this.addUVGridBody(BilinearPatch_1.BilinearPatch.create(corners[3], corners[2], corners[7], corners[6]), numX, numZ, uParamRange, vParamRange);
1305
1310
  uParamRange.shift(xLength);
1306
1311
  this.addUVGridBody(BilinearPatch_1.BilinearPatch.create(corners[2], corners[0], corners[6], corners[4]), numY, numZ, uParamRange, vParamRange);
1307
- // finally end that wraparound face !!
1312
+ // finally end that wraparound face
1308
1313
  this.endFace();
1309
1314
  if (box.capped) {
1310
1315
  uParamRange.set(0.0, xLength);
@@ -1317,15 +1322,15 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1317
1322
  this.endFace();
1318
1323
  }
1319
1324
  }
1320
- /** Add a polygon to the evolving facets.
1321
- *
1322
- * * Add points to the polyface
1323
- * * indices are added (in reverse order if indicated by the builder state)
1324
- * @param points array of points. This may contain extra points not to be used in the polygon
1325
+ /**
1326
+ * Add a polygon to the evolving facets.
1327
+ * * Add points to the polyface.
1328
+ * * Indices are added (in reverse order if indicated by the builder state).
1329
+ * @param points array of points. This may contain extra points not to be used in the polygon.
1325
1330
  * @param numPointsToUse number of points to use.
1326
1331
  */
1327
1332
  addPolygon(points, numPointsToUse) {
1328
- // don't use trailing points that match start point.
1333
+ // don't use trailing points that match start point
1329
1334
  if (numPointsToUse === undefined)
1330
1335
  numPointsToUse = points.length;
1331
1336
  while (numPointsToUse > 1 && points[numPointsToUse - 1].isAlmostEqual(points[0]))
@@ -1345,23 +1350,23 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1345
1350
  }
1346
1351
  this._polyface.terminateFacet();
1347
1352
  }
1348
- /** Add a polygon to the evolving facets.
1349
- *
1353
+ /**
1354
+ * Add a polygon to the evolving facets.
1350
1355
  * * Add points to the polyface
1351
- * * indices are added (in reverse order if indicated by the builder state)
1356
+ * * Indices are added (in reverse order if indicated by the builder state).
1352
1357
  * * Arrays with 2 or fewer points are ignored.
1353
1358
  * @param points array of points. Trailing closure points are ignored.
1354
1359
  */
1355
1360
  addPolygonGrowableXYZArray(points) {
1356
- // don't use trailing points that match start point.
1361
+ // don't use trailing points that match start point
1357
1362
  let numPointsToUse = points.length;
1358
1363
  while (numPointsToUse > 2 && Geometry_1.Geometry.isSmallMetricDistance(points.distanceIndexIndex(0, numPointsToUse - 1)))
1359
1364
  numPointsToUse--;
1360
1365
  // strip trailing duplicates
1361
1366
  while (numPointsToUse > 2 && Geometry_1.Geometry.isSmallMetricDistance(points.distanceIndexIndex(numPointsToUse - 2, numPointsToUse - 1)))
1362
1367
  numPointsToUse--;
1363
- // ignore triangles for which the height is less than smallMetricDistance times length
1364
- // sum of edge lengths is twice the perimeter. If it is flat that's twice the largest base dimension.
1368
+ // ignore triangles for which the height is less than smallMetricDistance times length.
1369
+ // sum of edge lengths is twice the perimeter. If it is flat that's twice the largest base dimension.
1365
1370
  // cross product magnitude is twice the area.
1366
1371
  if (numPointsToUse === 3) {
1367
1372
  const cross = points.crossProductIndexIndexIndex(0, 1, 2);
@@ -1387,19 +1392,20 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1387
1392
  this._polyface.terminateFacet();
1388
1393
  }
1389
1394
  }
1390
- /** Add a polygon to the evolving facets.
1391
- * * add points to the polyface
1392
- * * compute each point index as the point is added
1393
- * * all data arrays are parallel to the point array
1394
- * * point indices are added in reverse order if indicated by the builder state
1395
- * @param points array of vertices in order around the facet
1396
- * @param normals optional array of normals, one per vertex
1397
- * @param params optional array of uv-parameters, one per vertex
1398
- * @param colors optional array of colors, one per vertex
1399
- * @param edgeVisible optional array of flags, one per vertex, true iff edge starting at corresponding vertex is visible
1395
+ /**
1396
+ * Add a polygon to the evolving facets.
1397
+ * * Add points to the polyface.
1398
+ * * Compute each point index as the point is added.
1399
+ * * All data arrays are parallel to the point array.
1400
+ * * Point indices are added in reverse order if indicated by the builder state.
1401
+ * @param points array of vertices in order around the facet.
1402
+ * @param normals (optional) array of normals, one per vertex.
1403
+ * @param params (optional) array of uv-parameters, one per vertex.
1404
+ * @param colors (optional) array of colors, one per vertex.
1405
+ * @param edgeVisible (optional) array of flags, one per vertex, true iff edge starting at corresponding vertex is visible.
1400
1406
  */
1401
1407
  addFacetFromGrowableArrays(points, normals, params, colors, edgeVisible) {
1402
- // don't use trailing points that match start point.
1408
+ // don't use trailing points that match start point
1403
1409
  let numPointsToUse = points.length;
1404
1410
  while (numPointsToUse > 1 && Geometry_1.Geometry.isSmallMetricDistance(points.distanceIndexIndex(0, numPointsToUse - 1)))
1405
1411
  numPointsToUse--;
@@ -1450,13 +1456,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1450
1456
  }
1451
1457
  this._polyface.terminateFacet();
1452
1458
  }
1453
- /** Add the current visitor facet to the evolving polyface.
1454
- * * indices are added (in reverse order if indicated by the builder state)
1459
+ /**
1460
+ * Add the current visitor facet to the evolving polyface.
1461
+ * * Indices are added (in reverse order if indicated by the builder state).
1455
1462
  */
1456
1463
  addFacetFromVisitor(visitor) {
1457
1464
  this.addFacetFromGrowableArrays(visitor.point, visitor.normal, visitor.param, visitor.color, visitor.edgeVisible);
1458
1465
  }
1459
- /** Add all visitor facets to the evolving polyface (in reverse order if indicated by the builder state) */
1466
+ /** Add all visitor facets to the evolving polyface (in reverse order if indicated by the builder state). */
1460
1467
  addFacetsFromVisitor(visitor) {
1461
1468
  visitor.reset();
1462
1469
  for (; visitor.moveToNextFacet();)
@@ -1465,8 +1472,8 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1465
1472
  /**
1466
1473
  * Add the subset of visitor data indexed by the indices.
1467
1474
  * * Ideally, the subset represents a sub-facet of the visited facet.
1468
- * @param visitor data for the currently visited facet
1469
- * @param indices local indices into the visitor data arrays
1475
+ * @param visitor data for the currently visited facet.
1476
+ * @param indices local indices into the visitor data arrays.
1470
1477
  * @returns whether the data was added successfully. Encountering an invalid index returns false.
1471
1478
  */
1472
1479
  addFacetFromIndexedVisitor(visitor, indices) {
@@ -1494,49 +1501,71 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1494
1501
  this.addFacetFromGrowableArrays(xyz, normal, param, color, visible);
1495
1502
  return true;
1496
1503
  }
1497
- /** Add a polyface, with optional reverse and transform. */
1504
+ /** Add a polyface with optional reverse and transform. */
1498
1505
  addIndexedPolyface(source, reversed = false, transform) {
1499
1506
  this._polyface.addIndexedPolyface(source, reversed, transform);
1500
1507
  }
1501
1508
  /**
1502
1509
  * Produce a new FacetFaceData for all terminated facets since construction of the previous face.
1503
- * Each facet number/index is mapped to the FacetFaceData through the faceToFaceData array.
1504
- * Returns true if successful, and false otherwise.
1510
+ * * Each facet number/index is mapped to the FacetFaceData through the faceToFaceData array.
1511
+ * @returns true if successful, and false otherwise.
1505
1512
  */
1506
1513
  endFace() {
1507
1514
  return this._polyface.setNewFaceData();
1508
1515
  }
1509
- /** Double dispatch handler for Cone */
1510
- handleCone(g) { return this.addCone(g); }
1511
- /** Double dispatch handler for TorusPipe */
1512
- handleTorusPipe(g) { return this.addTorusPipe(g); }
1513
- /** Double dispatch handler for Sphere */
1514
- handleSphere(g) { return this.addSphere(g); }
1515
- /** Double dispatch handler for Box */
1516
- handleBox(g) { return this.addBox(g); }
1517
- /** Double dispatch handler for LinearSweep */
1518
- handleLinearSweep(g) { return this.addLinearSweep(g); }
1519
- /** Double dispatch handler for RotationalSweep */
1520
- handleRotationalSweep(g) { return this.addRotationalSweep(g); }
1521
- /** Double dispatch handler for RuledSweep */
1522
- handleRuledSweep(g) { return this.addRuledSweep(g); }
1523
- /** Double dispatch handler for Loop */
1524
- handleLoop(g) { return this.addTriangulatedRegion(g); }
1525
- /** Double dispatch handler for ParityRegion */
1526
- handleParityRegion(g) { return this.addTriangulatedRegion(g); }
1527
- /** Double dispatch handler for UnionRegion */
1528
- handleUnionRegion(g) { return this.addTriangulatedRegion(g); }
1529
- /** add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
1530
- addGeometryQuery(g) { g.dispatchToGeometryHandler(this); }
1516
+ /** Double dispatch handler for Cone. */
1517
+ handleCone(g) {
1518
+ return this.addCone(g);
1519
+ }
1520
+ /** Double dispatch handler for TorusPipe. */
1521
+ handleTorusPipe(g) {
1522
+ return this.addTorusPipe(g);
1523
+ }
1524
+ /** Double dispatch handler for Sphere. */
1525
+ handleSphere(g) {
1526
+ return this.addSphere(g);
1527
+ }
1528
+ /** Double dispatch handler for Box. */
1529
+ handleBox(g) {
1530
+ return this.addBox(g);
1531
+ }
1532
+ /** Double dispatch handler for LinearSweep. */
1533
+ handleLinearSweep(g) {
1534
+ return this.addLinearSweep(g);
1535
+ }
1536
+ /** Double dispatch handler for RotationalSweep. */
1537
+ handleRotationalSweep(g) {
1538
+ return this.addRotationalSweep(g);
1539
+ }
1540
+ /** Double dispatch handler for RuledSweep. */
1541
+ handleRuledSweep(g) {
1542
+ return this.addRuledSweep(g);
1543
+ }
1544
+ /** Double dispatch handler for Loop. */
1545
+ handleLoop(g) {
1546
+ return this.addTriangulatedRegion(g);
1547
+ }
1548
+ /** Double dispatch handler for ParityRegion. */
1549
+ handleParityRegion(g) {
1550
+ return this.addTriangulatedRegion(g);
1551
+ }
1552
+ /** Double dispatch handler for UnionRegion. */
1553
+ handleUnionRegion(g) {
1554
+ return this.addTriangulatedRegion(g);
1555
+ }
1556
+ /** Add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
1557
+ addGeometryQuery(g) {
1558
+ g.dispatchToGeometryHandler(this);
1559
+ }
1531
1560
  /**
1532
1561
  * Add a graph to the builder.
1533
- * * Visit one node per face
1534
- * * If `acceptFaceFunction(node)` returns true, pass face coordinates to the builder
1562
+ * * Visit one node per face.
1563
+ * * If `acceptFaceFunction(node)` returns true, pass face coordinates to the builder.
1535
1564
  * * Accepted face edge visibility is determined by `isEdgeVisibleFunction`.
1536
1565
  * * Rely on the builder's compress step to find common vertex coordinates.
1537
- * @param graph faces to add as facets
1538
- * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces
1539
- * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges
1566
+ * @param graph faces to add as facets.
1567
+ * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces.
1568
+ * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges.
1540
1569
  * @internal
1541
1570
  */
1542
1571
  addGraph(graph, acceptFaceFunction = (node) => Graph_1.HalfEdge.testNodeMaskNotExterior(node), isEdgeVisibleFunction = (node) => Graph_1.HalfEdge.testMateMaskExterior(node)) {
@@ -1567,12 +1596,12 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1567
1596
  });
1568
1597
  }
1569
1598
  /**
1570
- *
1571
- * * For each node in `faces`
1572
- * * add all of its vertices to the polyface
1573
- * * add point indices to form a new facet.
1574
- * * (Note: no normal or param indices are added)
1575
- * * terminate the facet
1599
+ * Add a graph's faces to the builder.
1600
+ * * For each node in `faces`:
1601
+ * * Add all of its vertices to the polyface.
1602
+ * * Add point indices to form a new facet.
1603
+ * * (note: no normal or param indices are added)
1604
+ * * Terminate the facet.
1576
1605
  * @internal
1577
1606
  */
1578
1607
  addGraphFaces(faces) {
@@ -1590,9 +1619,10 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1590
1619
  /**
1591
1620
  * Create a polyface containing the faces of a HalfEdgeGraph, with test functions to filter faces and hide edges.
1592
1621
  * * This is a static wrapper of [[addGraph]].
1593
- * @param graph faces to add as facets
1594
- * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces
1595
- * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges
1622
+ * @param graph faces to add as facets.
1623
+ * @param options (optional) options for the polyface.
1624
+ * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces.
1625
+ * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges.
1596
1626
  * @internal
1597
1627
  */
1598
1628
  static graphToPolyface(graph, options, acceptFaceFunction = (node) => Graph_1.HalfEdge.testNodeMaskNotExterior(node), isEdgeVisibleFunction = (node) => Graph_1.HalfEdge.testMateMaskExterior(node)) {
@@ -1601,7 +1631,8 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1601
1631
  builder.endFace();
1602
1632
  return builder.claimPolyface();
1603
1633
  }
1604
- /** Create a polyface containing the faces of a HalfEdgeGraph that are specified by the HalfEdge array.
1634
+ /**
1635
+ * Create a polyface containing the faces of a HalfEdgeGraph that are specified by the HalfEdge array.
1605
1636
  * @internal
1606
1637
  */
1607
1638
  static graphFacesToPolyface(faces) {
@@ -1610,7 +1641,8 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1610
1641
  builder.endFace();
1611
1642
  return builder.claimPolyface();
1612
1643
  }
1613
- /** Create a polyface containing triangles in a (space) polygon.
1644
+ /**
1645
+ * Create a polyface containing triangles in a (space) polygon.
1614
1646
  * * The polyface contains only coordinate data (no params or normals).
1615
1647
  */
1616
1648
  static polygonToTriangulatedPolyface(points, localToWorld) {
@@ -1631,13 +1663,13 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1631
1663
  return undefined;
1632
1664
  }
1633
1665
  /**
1634
- * Given arrays of coordinates for multiple facets.
1635
- * * pointArray[i] is an array of 3 or 4 points
1636
- * * paramArray[i] is an array of matching number of params
1666
+ * Add facets to the builder given arrays of coordinates for multiple facets.
1667
+ * * pointArray[i] is an array of 3 or 4 points.
1668
+ * * paramArray[i] is an array of matching number of params.
1637
1669
  * * normalArray[i] is an array of matching number of normals.
1638
- * @param pointArray array of arrays of point coordinates
1639
- * @param paramArray array of arrays of uv parameters
1640
- * @param normalArray array of arrays of normals
1670
+ * @param pointArray array of arrays of point coordinates.
1671
+ * @param paramArray (optional) array of arrays of uv parameters.
1672
+ * @param normalArray (optional) array of arrays of normals.
1641
1673
  * @param endFace if true, call this.endFace after adding all the facets.
1642
1674
  */
1643
1675
  addCoordinateFacets(pointArray, paramArray, normalArray, endFace = false) {
@@ -1653,15 +1685,16 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1653
1685
  this.endFace();
1654
1686
  }
1655
1687
  /**
1688
+ * Add facets from the parametric surface.
1656
1689
  * * Evaluate `(numU + 1) * (numV + 1)` grid points (in 0..1 in both u and v) on a surface.
1657
1690
  * * Add the facets for `numU * numV` quads.
1658
1691
  * * uv params are the 0..1 fractions.
1659
- * * normals are cross products of u and v direction partial derivatives.
1660
- * @param surface
1661
- * @param numU number of intervals (edges) in the u direction. (Number of points is `numU + 1`)
1662
- * @param numV number of intervals (edges) in the v direction. (Number of points is `numV + 1`)
1663
- * @param uMap optional mapping from u fraction to parameter space (such as texture)
1664
- * @param vMap optional mapping from v fraction to parameter space (such as texture)
1692
+ * * Normals are cross products of u and v direction partial derivatives.
1693
+ * @param surface UV surface to evaluate.
1694
+ * @param numU number of intervals (edges) in the u direction (number of points is `numU + 1`).
1695
+ * @param numV number of intervals (edges) in the v direction (number of points is `numV + 1`).
1696
+ * @param uMap optional mapping from u fraction to parameter space (such as texture).
1697
+ * @param vMap optional mapping from v fraction to parameter space (such as texture).
1665
1698
  */
1666
1699
  addUVGridBody(surface, numU, numV, uMap, vMap) {
1667
1700
  let xyzIndex0 = new GrowableFloat64Array_1.GrowableFloat64Array(numU);
@@ -1690,7 +1723,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1690
1723
  const dv = 1.0 / numV;
1691
1724
  const plane = Plane3dByOriginAndVectors_1.Plane3dByOriginAndVectors.createXYPlane();
1692
1725
  for (let v = 0; v <= numV; v++) {
1693
- // evaluate new points ....
1726
+ // evaluate new points
1694
1727
  xyzIndex1.clear();
1695
1728
  if (needNormals)
1696
1729
  normalIndex1.clear();
@@ -1740,23 +1773,26 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1740
1773
  indexSwap = xyzIndex1;
1741
1774
  xyzIndex1 = xyzIndex0;
1742
1775
  xyzIndex0 = indexSwap;
1743
- if (needParams) {
1776
+ if (needParams)
1744
1777
  indexSwap = paramIndex1;
1745
- paramIndex1 = paramIndex0;
1746
- paramIndex0 = indexSwap;
1747
- }
1748
- if (needNormals) {
1778
+ paramIndex1 = paramIndex0;
1779
+ paramIndex0 = indexSwap;
1780
+ if (needNormals)
1749
1781
  indexSwap = normalIndex1;
1750
- normalIndex1 = normalIndex0;
1751
- normalIndex0 = indexSwap;
1752
- }
1782
+ normalIndex1 = normalIndex0;
1783
+ normalIndex0 = indexSwap;
1753
1784
  }
1754
1785
  xyzIndex0.clear();
1755
1786
  xyzIndex1.clear();
1756
1787
  }
1757
1788
  /**
1758
- * Triangulate the points as viewed in xy.
1759
- * @param points
1789
+ * Create a polyface from a triangulation of the points.
1790
+ * * The triangulation is computed as seen in the top view: z-coordinates are ignored.
1791
+ * @param points an array of points.
1792
+ * @param options (optional) stroke options. Currently only two options are supported. If `options.needNormals` is
1793
+ * true, all facets are assigned the single normal 001. If `options.needParams` is true, all facet vertices are
1794
+ * assigned uv-parameters equal to their xy-coordinates. These options are rarely useful.
1795
+ * @returns triangulated polyface or `undefined` if triangulation was not possible.
1760
1796
  */
1761
1797
  static pointsToTriangulatedPolyface(points, options) {
1762
1798
  const graph = Triangulation_1.Triangulator.createTriangulatedGraphFromPoints(points);
@@ -1764,21 +1800,20 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1764
1800
  return PolyfaceBuilder.graphToPolyface(graph, options);
1765
1801
  return undefined;
1766
1802
  }
1767
- /** Create (and add to the builder) triangles that bridge the gap between two linestrings.
1768
- * * Each triangle will have 1 vertex on one of the linestrings and 2 on the other
1803
+ /**
1804
+ * Add triangular facets between two linestrings.
1805
+ * * Each triangle will have 1 vertex on one of the linestrings and 2 on the other.
1769
1806
  * * Choice of triangles is heuristic, hence does not have a unique solution.
1770
- * * Logic to choice among the various possible triangle orders prefers
1771
- * * Make near-coplanar facets
1772
- * * make facets with good aspect ratio.
1807
+ * * Logic for choosing among the various possible triangles prefers:
1808
+ * * Make near-coplanar facets.
1809
+ * * Make facets with good aspect ratio.
1773
1810
  * * This is exercised with a limited number of lookahead points, i.e. greedy to make first-available decision.
1774
1811
  * @param pointsA points of first linestring.
1775
1812
  * @param pointsB points of second linestring.
1776
1813
  */
1777
1814
  addGreedyTriangulationBetweenLineStrings(pointsA, pointsB) {
1778
1815
  const context = GreedyTriangulationBetweenLineStrings_1.GreedyTriangulationBetweenLineStrings.createContext();
1779
- context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => {
1780
- this.addTriangleFacet(triangle.points);
1781
- });
1816
+ context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => { this.addTriangleFacet(triangle.points); });
1782
1817
  }
1783
1818
  addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12) {
1784
1819
  const sections = CurveFactory_1.CurveFactory.createMiteredPipeSections(centerline, sectionData);
@@ -1803,13 +1838,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1803
1838
  }
1804
1839
  }
1805
1840
  /**
1806
- * * Create (and add to the builder) quad facets for a mitered pipe that follows a centerline curve.
1807
- * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis lengths, or a full Arc3d.
1841
+ * Add quad facets along a mitered pipe that follows a centerline curve.
1842
+ * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis
1843
+ * lengths, or a full Arc3d:
1808
1844
  * * For semi-axis length input, x corresponds to an ellipse local axis nominally situated parallel to the xy-plane.
1809
- * * The center of Arc3d input is translated to the centerline start point to act as initial cross section.
1845
+ * * For Arc3d input, the center is translated to the centerline start point to act as initial cross section.
1810
1846
  * @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions.
1811
- * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d
1812
- * @param numFacetAround how many equal parameter-space chords around each section
1847
+ * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d.
1848
+ * @param numFacetAround how many equal parameter-space chords around each section.
1813
1849
  */
1814
1850
  addMiteredPipes(centerline, sectionData, numFacetAround = 12) {
1815
1851
  if (Array.isArray(centerline)) {
@@ -1830,7 +1866,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1830
1866
  this.addMiteredPipesFromPoints(linestring.packedPoints, sectionData, numFacetAround);
1831
1867
  }
1832
1868
  }
1833
- /** Return the polyface index array indices corresponding to the given edge, or undefined if error. */
1869
+ /** Return the polyface index array indices corresponding to the given edge, or `undefined` if error. */
1834
1870
  getEdgeIndices(edge) {
1835
1871
  let indexA = -1;
1836
1872
  let indexB = -1;
@@ -1842,8 +1878,10 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1842
1878
  }
1843
1879
  return (indexA < 0 || indexB < 0) ? undefined : { edgeIndexA: indexA, edgeIndexB: indexB };
1844
1880
  }
1845
- /** Create a side face between base and swept facets along a base boundary edge.
1846
- * * Assumes numBaseFacets base facets were added to this builder, immediately followed by the same number of swept facets with opposite orientation (first index not preserved).
1881
+ /**
1882
+ * Create a side face between base and swept facets along a base boundary edge.
1883
+ * * Assumes numBaseFacets base facets were added to this builder, immediately followed by the same number of swept
1884
+ * facets with opposite orientation (first index not preserved).
1847
1885
  */
1848
1886
  addSweptFace(baseBoundaryEdge, numBaseFacets) {
1849
1887
  const edge = this.getEdgeIndices(baseBoundaryEdge);
@@ -1862,7 +1900,12 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1862
1900
  const edgeIndexOffsetInFaceLoopB = edge.edgeIndexB - baseFacetIndexStart;
1863
1901
  const sweptEdgeIndexOffsetInFaceLoopA = (numBaseFacetEdges - 1) - edgeIndexOffsetInFaceLoopA;
1864
1902
  const sweptEdgeIndexOffsetInFaceLoopB = (numBaseFacetEdges - 1) - edgeIndexOffsetInFaceLoopB;
1865
- const indices = [edge.edgeIndexB, edge.edgeIndexA, sweptFacetIndexStart + sweptEdgeIndexOffsetInFaceLoopA, sweptFacetIndexStart + sweptEdgeIndexOffsetInFaceLoopB];
1903
+ const indices = [
1904
+ edge.edgeIndexB,
1905
+ edge.edgeIndexA,
1906
+ sweptFacetIndexStart + sweptEdgeIndexOffsetInFaceLoopA,
1907
+ sweptFacetIndexStart + sweptEdgeIndexOffsetInFaceLoopB,
1908
+ ];
1866
1909
  const vertices = [];
1867
1910
  let colors; // try to re-use colors; missing normals and params will be computed if needed
1868
1911
  if (undefined !== this.options.needColors && undefined !== this._polyface.data.color && undefined !== this._polyface.data.colorIndex)
@@ -1883,11 +1926,13 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1883
1926
  return true;
1884
1927
  }
1885
1928
  /**
1886
- * Add facets from the source polyface, from its translation along the vector, and from its swept boundary edges, to form a polyface that encloses a volume.
1887
- * @param source the surface mesh to sweep
1888
- * @param sweepVector the direction and length to sweep the surface mesh
1889
- * @param triangulateSides whether to triangulate side facets, or leave as quads
1890
- * @returns whether the added facets comprise a simple sweep. If false, the resulting mesh may have self-intersections, be non-manifold, have inconsistently oriented facets, etc.
1929
+ * Add facets from the source polyface, from its translation along the vector, and from its swept boundary edges,
1930
+ * to form a polyface that encloses a volume.
1931
+ * @param source the surface mesh to sweep.
1932
+ * @param sweepVector the direction and length to sweep the surface mesh.
1933
+ * @param triangulateSides whether to triangulate side facets, or leave as quads.
1934
+ * @returns whether the added facets comprise a simple sweep. If false, the resulting mesh may have self-intersections,
1935
+ * be non-manifold, have inconsistently oriented facets, etc.
1891
1936
  */
1892
1937
  addSweptIndexedPolyface(source, sweepVector, triangulateSides = false) {
1893
1938
  let isSimpleSweep = true;