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

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
@@ -41,10 +41,10 @@ import { IndexedPolyfaceSubsetVisitor } from "./IndexedPolyfaceVisitor";
41
41
  import { IndexedPolyface } from "./Polyface";
42
42
  import { PolyfaceQuery } from "./PolyfaceQuery";
43
43
  /**
44
- * A FacetSector
45
- * * initially holds coordinate data for a place where xyz and sectionDerivative are known
46
- * * normal is computed as a deferred step using an edge to adjacent place on ruled surface
47
- * * indices are set up even later.
44
+ * A FacetSector.
45
+ * * Initially holds coordinate data for a place where xyz and sectionDerivative are known.
46
+ * * Normal is computed as a deferred step using an edge to adjacent place on ruled surface.
47
+ * * Indices are set up even later.
48
48
  */
49
49
  class FacetSector {
50
50
  constructor(needNormal = false, needUV = false, needSectionDerivative = false) {
@@ -63,8 +63,9 @@ class FacetSector {
63
63
  this.sectionDerivative = Vector3d.create();
64
64
  }
65
65
  }
66
- /** copy contents (not pointers) from source
67
- * * ASSUME all fields defined in this are defined int the source (undefined check only needed on this)
66
+ /**
67
+ * Copy contents (not pointers) from `other`.
68
+ * * ASSUME all fields defined in the instance are defined in `other`.
68
69
  */
69
70
  copyContentsFrom(other) {
70
71
  this.xyz.setFromPoint3d(other.xyz);
@@ -78,10 +79,11 @@ class FacetSector {
78
79
  if (this.sectionDerivative)
79
80
  this.sectionDerivative.setFrom(other.sectionDerivative);
80
81
  }
81
- /** access xyz, derivative from given arrays.
82
- * * ASSUME corresponding defined conditions
82
+ /**
83
+ * Access xyz, derivative from given arrays.
84
+ * * ASSUME corresponding defined conditions.
83
85
  * * xyz and derivative are set.
84
- * * index fields for updated data are cleared to -1.
86
+ * * Index fields for updated data are cleared to -1.
85
87
  */
86
88
  loadIndexedPointAndDerivativeCoordinatesFromPackedArrays(i, packedXYZ, packedDerivatives, fractions, v) {
87
89
  packedXYZ.getPoint3dAtCheckedPointIndex(i, this.xyz);
@@ -103,16 +105,14 @@ class FacetSector {
103
105
  uvw.z = 0.0;
104
106
  }
105
107
  /**
106
- * given two sectors with xyz and sectionDerivative (u derivative)
107
- * use the edge from A to B as v direction in-surface derivative.
108
- * compute cross products (and normalize)
109
- * @param sectorA "lower" sector
110
- * @param sectorB "upper" sector
111
- *
108
+ * Given two sectors with xyz and sectionDerivative (u derivative), use the edge from A to B as v direction
109
+ * in-surface derivative. Compute cross products (and normalize).
110
+ * @param sectorA "lower" sector.
111
+ * @param sectorB "upper" sector.
112
112
  */
113
113
  static computeNormalsAlongRuleLine(sectorA, sectorB) {
114
- // We expect that if sectionDerivative is defined so is normal.
115
- // (If not, the cross product calls will generate normals that are never used .. not good, garbage collector will clean up.)
114
+ // We expect that if a sector's sectionDerivative is defined, then so is its normal. If a normal is undefined, the
115
+ // crossProduct returns an object that goes unused---not good, but the garbage collector will clean it up.
116
116
  if (sectorA.sectionDerivative && sectorB.sectionDerivative) {
117
117
  const vectorAB = FacetSector._edgeVector;
118
118
  Vector3d.createStartEnd(sectorA.xyz, sectorB.xyz, vectorAB);
@@ -127,12 +127,10 @@ class FacetSector {
127
127
  }
128
128
  FacetSector._edgeVector = Vector3d.create();
129
129
  /**
130
- *
131
130
  * * Simple construction for strongly typed GeometryQuery objects:
132
131
  *
133
132
  * * Create a builder with `builder = PolyfaceBuilder.create()`
134
133
  * * Add GeometryQuery objects:
135
- *
136
134
  * * `builder.addGeometryQuery(g: GeometryQuery)`
137
135
  * * `builder.addCone(cone: Cone)`
138
136
  * * `builder.addTorusPipe(surface: TorusPipe)`
@@ -143,7 +141,7 @@ FacetSector._edgeVector = Vector3d.create();
143
141
  * * `builder.addSphere(sphere: Sphere)`
144
142
  * * `builder.addBox(box: Box)`
145
143
  * * `builder.addIndexedPolyface(polyface)`
146
- * * Extract with `builder.claimPolyface(true)`
144
+ * * Extract with `builder.claimPolyface(true)`
147
145
  *
148
146
  * * Simple construction for ephemeral constructive data:
149
147
  *
@@ -159,9 +157,10 @@ FacetSector._edgeVector = Vector3d.create();
159
157
  * * `builder.addTrianglesInUncheckedConvexPolygon(linestring, toggle)`
160
158
  * * `builder.addUVGridBody(surface,numU, numV, createFanInCaps)`
161
159
  * * `builder.addGraph(Graph, acceptFaceFunction)`
162
- * * Extract with `builder.claimPolyface(true)`
160
+ * * Extract with `builder.claimPolyface(true)`
161
+ *
162
+ * * Low-level detail construction -- direct use of indices:
163
163
  *
164
- * * Low-level detail construction -- direct use of indices
165
164
  * * Create a builder with `builder = PolyfaceBuilder.create()`
166
165
  * * Add GeometryQuery objects
167
166
  * * `builder.addPoint(point)`
@@ -169,17 +168,21 @@ FacetSector._edgeVector = Vector3d.create();
169
168
  * * `builder.addPointXYZ(x,y,z)`
170
169
  * * `builder.addTriangleFacet(points)`
171
170
  * * `builder.addQuadFacet(points)`
172
- * @public
171
+ * @public
173
172
  */
174
173
  export class PolyfaceBuilder extends NullGeometryHandler {
175
- /** return (pointer to) the `StrokeOptions` in use by the builder. */
176
- get options() { return this._options; }
174
+ /** Return (pointer to) the `StrokeOptions` in use by the builder. */
175
+ get options() {
176
+ return this._options;
177
+ }
177
178
  /** Ask if this builder is reversing vertex order as loops are received. */
178
- get reversedFlag() { return this._reversed; }
179
+ get reversedFlag() {
180
+ return this._reversed;
181
+ }
179
182
  /**
180
183
  * Extract the polyface.
181
- * @param compress whether to cluster vertices (default true)
182
- * @param tolerance compression tolerance (default Geometry.smallMetricDistance)
184
+ * @param compress whether to cluster vertices (default `true`).
185
+ * @param tolerance compression tolerance (default `Geometry.smallMetricDistance`).
183
186
  */
184
187
  claimPolyface(compress = true, tolerance = Geometry.smallMetricDistance) {
185
188
  if (compress)
@@ -187,7 +190,9 @@ export class PolyfaceBuilder extends NullGeometryHandler {
187
190
  return this._polyface;
188
191
  }
189
192
  /** Toggle (reverse) the flag controlling orientation flips for newly added facets. */
190
- toggleReversedFacetFlag() { this._reversed = !this._reversed; }
193
+ toggleReversedFacetFlag() {
194
+ this._reversed = !this._reversed;
195
+ }
191
196
  constructor(options) {
192
197
  super();
193
198
  this._options = options ? options : StrokeOptions.createForFacets();
@@ -195,25 +200,27 @@ export class PolyfaceBuilder extends NullGeometryHandler {
195
200
  this._reversed = false;
196
201
  }
197
202
  /**
198
- * Create a builder with given StrokeOptions
199
- * @param options StrokeOptions (captured)
203
+ * Create a builder with given StrokeOptions.
204
+ * @param options StrokeOptions (captured).
200
205
  */
201
206
  static create(options) {
202
207
  return new PolyfaceBuilder(options);
203
208
  }
204
- /** add facets for a transformed unit box. */
209
+ /** Add facets for a transformed unit box. */
205
210
  addTransformedUnitBox(transform) {
206
211
  this.addTransformedRangeMesh(transform, Range3d.createXYZXYZ(0, 0, 0, 1, 1, 1));
207
212
  }
208
- /** Add facets for a transformed range box.
213
+ /**
214
+ * Add facets for a transformed range box.
209
215
  * * For best results, the transformed range corners should define a nonzero volume or area.
210
- * @param transform applied to the range points before adding to the polyface
211
- * @param range sides become 6 quad polyface facets
212
- * @param faceSelector for each face in the order of BoxTopology.cornerIndexCCW, faceSelector[i]===false skips that facet.
216
+ * @param transform applied to the range points before adding to the polyface.
217
+ * @param range sides become 6 quad polyface facets.
218
+ * @param faceSelector for each face in the order of `BoxTopology.cornerIndexCCW`, `faceSelector[i] === false` skips
219
+ * that facet.
213
220
  */
214
221
  addTransformedRangeMesh(transform, range, faceSelector) {
215
222
  const pointIndex0 = this._polyface.data.pointCount;
216
- // these will have sequential indices starting at pointIndex0 . . .
223
+ // these will have sequential indices starting at pointIndex0
217
224
  const points = range.corners();
218
225
  for (const p of points)
219
226
  this._polyface.addPoint(transform.multiplyPoint3d(p));
@@ -235,9 +242,11 @@ export class PolyfaceBuilder extends NullGeometryHandler {
235
242
  faceCounter++;
236
243
  }
237
244
  }
238
- /** Add triangles from points[0] to each far edge.
239
- * @param ls linestring with point coordinates
240
- * @param toggle if true, wrap the triangle creation in toggleReversedFacetFlag.
245
+ /**
246
+ * Add triangles from `conePoint` to each far edge.
247
+ * @param conePoint the common vertex of all triangles.
248
+ * @param ls linestring with point coordinates.
249
+ * @param toggle if `true`, wrap the triangle creation in toggleReversedFacetFlag.
241
250
  */
242
251
  addTriangleFan(conePoint, ls, toggle) {
243
252
  const n = ls.numPoints();
@@ -256,12 +265,11 @@ export class PolyfaceBuilder extends NullGeometryHandler {
256
265
  this.toggleReversedFacetFlag();
257
266
  }
258
267
  }
259
- /** Add triangles from points[0] to each far edge
260
- * * Assume the polygon is convex.
261
- * * i.e. simple triangulation from point0
262
- * * i.e. simple cross products give a good normal.
263
- * @param ls linestring with point coordinates
264
- * @param reverse if true, wrap the triangle creation in toggleReversedFacetFlag.
268
+ /**
269
+ * Add triangles from the first point of the linestring to the subsequent edges of the linestring.
270
+ * * No checks are made for polygon convexity or edge collinearity, conditions which would ensure positive area triangles.
271
+ * @param ls linestring with point coordinates.
272
+ * @param reverse if `true`, wrap the triangle creation in toggleReversedFacetFlag.
265
273
  */
266
274
  addTrianglesInUncheckedConvexPolygon(ls, toggle) {
267
275
  const n = ls.numPoints();
@@ -306,36 +314,36 @@ export class PolyfaceBuilder extends NullGeometryHandler {
306
314
  this.toggleReversedFacetFlag();
307
315
  }
308
316
  }
309
- /**
310
- * Announce point coordinates.
311
- */
317
+ /** Add a point to the polyface. */
312
318
  addPoint(xyz) {
313
319
  return this._polyface.addPoint(xyz);
314
320
  }
315
321
  /**
316
- * Announce point coordinates.
322
+ * Add a point to the polyface.
317
323
  * @deprecated in 3.x. Use addPoint instead.
318
324
  */
319
325
  findOrAddPoint(xyz) {
320
326
  return this.addPoint(xyz);
321
327
  }
322
- /**
323
- * Announce uv parameter coordinates.
324
- */
328
+ /** Add a uv parameter to the polyface. */
325
329
  addParamXY(x, y) {
326
330
  return this._polyface.addParamUV(x, y);
327
331
  }
328
332
  /**
329
- * Announce uv parameter coordinates.
333
+ * Add a uv parameter to the polyface.
330
334
  * @deprecated in 3.x. Use addParamXY instead.
331
335
  */
332
336
  findOrAddParamXY(x, y) {
333
337
  return this.addParamXY(x, y);
334
338
  }
335
339
  /**
336
- * 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.
337
- * @returns Returns the point index in the Polyface.
338
- * @param index Index of the point in the linestring.
340
+ * Add a point to the polyface. The implementation is free to either create a new point or return the index of a
341
+ * prior point with the same coordinates.
342
+ * @param ls the linestring.
343
+ * @param index index of the point in the linestring.
344
+ * @param transform (optional) transform to be applied.
345
+ * @param priorIndex (optional) index of a prior point to check for possible duplicate value.
346
+ * @returns the point index in the polyface.
339
347
  */
340
348
  findOrAddPointInLineString(ls, index, transform, priorIndex) {
341
349
  const q = ls.pointAt(index, PolyfaceBuilder._workPointFindOrAddA);
@@ -347,9 +355,13 @@ export class PolyfaceBuilder extends NullGeometryHandler {
347
355
  return undefined;
348
356
  }
349
357
  /**
350
- * 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.
351
- * @returns Returns the point index in the Polyface.
352
- * @param index Index of the point in the linestring.
358
+ * Add a point to the polyface. The implementation is free to either create a new point or return the index of a
359
+ * prior point with the same coordinates.
360
+ * @param xyz the array of points.
361
+ * @param index index of the point in the array.
362
+ * @param transform (optional) transform to be applied.
363
+ * @param priorIndex (optional) index of a prior point to check for possible duplicate value.
364
+ * @returns the point index in the polyface.
353
365
  */
354
366
  findOrAddPointInGrowableXYZArray(xyz, index, transform, priorIndex) {
355
367
  const q = xyz.getPoint3dAtCheckedPointIndex(index, PolyfaceBuilder._workPointFindOrAddA);
@@ -361,9 +373,13 @@ export class PolyfaceBuilder extends NullGeometryHandler {
361
373
  return undefined;
362
374
  }
363
375
  /**
364
- * 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.
365
- * @returns Returns the point index in the Polyface.
366
- * @param index Index of the point in the linestring.
376
+ * Add a normal to the polyface. The implementation is free to either create a new normal or return the index of a
377
+ * prior normal with the same coordinates.
378
+ * @param xyz the array of normals.
379
+ * @param index index of the normal in the array.
380
+ * @param transform (optional) transform to be applied.
381
+ * @param priorIndex (optional) index of a prior point to check for possible duplicate value.
382
+ * @returns the normal index in the polyface.
367
383
  */
368
384
  findOrAddNormalInGrowableXYZArray(xyz, index, transform, priorIndex) {
369
385
  const q = xyz.getVector3dAtCheckedVectorIndex(index, PolyfaceBuilder._workVectorFindOrAdd);
@@ -375,40 +391,49 @@ export class PolyfaceBuilder extends NullGeometryHandler {
375
391
  return undefined;
376
392
  }
377
393
  /**
378
- * Announce uv parameter coordinates.
379
- * @returns Returns the uv parameter index in the Polyface.
380
- * @param index Index of the param in the linestring.
394
+ * Add a uv parameter to the polyface.
395
+ * @param data the array of uv data.
396
+ * @param index index of the param in the array.
397
+ * @returns the uv parameter index in the polyface.
381
398
  */
382
399
  addParamInGrowableXYArray(data, index) {
383
400
  if (!data)
384
401
  return undefined;
385
402
  const q = data.getPoint2dAtCheckedPointIndex(index, PolyfaceBuilder._workUVFindOrAdd);
386
- if (q) {
403
+ if (q)
387
404
  return this._polyface.addParam(q);
388
- }
389
405
  return undefined;
390
406
  }
391
407
  /**
392
- * Announce uv parameter coordinates.
408
+ * Add a uv parameter to the polyface.
393
409
  * @deprecated in 3.x. Use addParamInGrowableXYArray instead.
394
410
  */
395
411
  findOrAddParamInGrowableXYArray(data, index) {
396
412
  return this.addParamInGrowableXYArray(data, index);
397
413
  }
398
414
  /**
399
- * 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.
400
- * @returns Returns the point index in the Polyface.
401
- * @param index Index of the point in the linestring.
415
+ * Add a uv parameter to the polyface, taking `u` from `ls.fractions` and `v` from input. The implementation is
416
+ * free to either create a new param or return the index of a prior param with the same coordinates.
417
+ * @param ls the linestring.
418
+ * @param index index of the point in the linestring.
419
+ * @param v the v parameter.
420
+ * @param priorIndexA (optional) an index of a prior param to check for possible duplicate value.
421
+ * @param priorIndexB (optional) another index of a prior param to check for possible duplicate value.
422
+ * @returns the uv parameter index in the polyface.
402
423
  */
403
424
  findOrAddParamInLineString(ls, index, v, priorIndexA, priorIndexB) {
404
- const u = (ls.fractions && index < ls.fractions.length) ? ls.fractions.atUncheckedIndex(index) : index / ls.points.length;
425
+ const u = (ls.fractions && index < ls.fractions.length) ?
426
+ ls.fractions.atUncheckedIndex(index) : index / ls.points.length;
405
427
  return this._polyface.addParamUV(u, v, priorIndexA, priorIndexB);
406
428
  }
407
429
  /**
408
- * Announce normal coordinates found at index in the surfaceNormal array stored on the linestring
409
- * @returns Returns the point index in the Polyface.
410
- * @param index Index of the point in the linestring.
411
- * @param priorIndex possible prior normal index to reuse
430
+ * Add a normal to the polyface.
431
+ * @param ls the linestring.
432
+ * @param index Index of the normal in the linestring's surface normal array.
433
+ * @param transform (optional) transform to be applied.
434
+ * @param priorIndexA (optional) an index of a prior normal to check for possible duplicate value.
435
+ * @param priorIndexB (optional) another index of a prior normal to check for possible duplicate value.
436
+ * @returns the normal index in the polyface.
412
437
  */
413
438
  findOrAddNormalInLineString(ls, index, transform, priorIndexA, priorIndexB) {
414
439
  const linestringNormals = ls.packedSurfaceNormals;
@@ -422,14 +447,12 @@ export class PolyfaceBuilder extends NullGeometryHandler {
422
447
  }
423
448
  return undefined;
424
449
  }
425
- /**
426
- * Announce point coordinates.
427
- */
450
+ /** Add a point to the polyface. */
428
451
  addPointXYZ(x, y, z) {
429
452
  return this._polyface.addPointXYZ(x, y, z);
430
453
  }
431
454
  /**
432
- * Announce point coordinates.
455
+ * Add a point to the polyface.
433
456
  * @deprecated in 3.x. Use addPointXYZ instead.
434
457
  */
435
458
  findOrAddPointXYZ(x, y, z) {
@@ -451,18 +474,22 @@ export class PolyfaceBuilder extends NullGeometryHandler {
451
474
  normal = normal ? normal : Vector3d.create();
452
475
  return normal;
453
476
  }
454
- // ###: Consider case where normals will be reversed and point through the other end of the facet
477
+ // ### TODO: Consider case where normals will be reversed and point through the other end of the facet.
455
478
  /**
456
479
  * Add a quad to the polyface given its points in order around the edges.
457
- * @param points array of at least three vertices
458
- * @param params optional array of at least four uv parameters (if undefined, params are calculated without reference data)
459
- * @param normals optional array of at least four vectors (if undefined, the quad is assumed to be planar and its normal is calculated)
460
- * @param colors optional array of at least four colors
480
+ * @param points array of at least four vertices.
481
+ * @param params (optional) array of at least four uv parameters (if `undefined`, params are calculated without
482
+ * reference data).
483
+ * @param normals (optional) array of at least four vectors (if `undefined`, the quad is assumed to be planar and its
484
+ * normal is calculated).
485
+ * @param colors (optional) array of at least four colors.
461
486
  */
462
487
  addQuadFacet(points, params, normals, colors) {
463
488
  if (points instanceof GrowableXYZArray)
464
489
  points = points.getPoint3dArray();
465
- // If params and/or normals are needed, calculate them first
490
+ if (points.length < 4)
491
+ return;
492
+ // if params and/or normals are needed, calculate them first
466
493
  const needParams = this.options.needParams;
467
494
  const needNormals = this.options.needNormals;
468
495
  const needColors = this.options.needColors;
@@ -512,7 +539,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
512
539
  }
513
540
  }
514
541
  if (this._options.shouldTriangulate) {
515
- // Add as two triangles, with a diagonal along the shortest distance
542
+ // add as two triangles, with a diagonal along the shortest distance
516
543
  const vectorAC = points[0].vectorTo(points[2]);
517
544
  const vectorBD = points[1].vectorTo(points[3]);
518
545
  // Note: We pass along any values for normals or params that we calculated
@@ -527,7 +554,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
527
554
  return;
528
555
  }
529
556
  let idx0, idx1, idx2, idx3;
530
- // Add params if needed
557
+ // add params if needed
531
558
  if (needParams) {
532
559
  idx0 = this._polyface.addParam(param0);
533
560
  idx1 = this._polyface.addParam(param1);
@@ -535,7 +562,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
535
562
  idx3 = this._polyface.addParam(param3);
536
563
  this.addIndexedQuadParamIndexes(idx0, idx1, idx3, idx2);
537
564
  }
538
- // Add normals if needed
565
+ // add normals if needed
539
566
  if (needNormals) {
540
567
  idx0 = this._polyface.addNormal(normal0);
541
568
  idx1 = this._polyface.addNormal(normal1);
@@ -543,7 +570,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
543
570
  idx3 = this._polyface.addNormal(normal3);
544
571
  this.addIndexedQuadNormalIndexes(idx0, idx1, idx3, idx2);
545
572
  }
546
- // Add colors if needed
573
+ // add colors if needed
547
574
  if (needColors) {
548
575
  idx0 = this._polyface.addColor(color0);
549
576
  idx1 = this._polyface.addColor(color1);
@@ -551,18 +578,19 @@ export class PolyfaceBuilder extends NullGeometryHandler {
551
578
  idx3 = this._polyface.addColor(color3);
552
579
  this.addIndexedQuadColorIndexes(idx0, idx1, idx3, idx2);
553
580
  }
554
- // Add point and point indexes last (terminates the facet)
581
+ // add point and point indexes last (terminates the facet)
555
582
  idx0 = this.addPoint(points[0]);
556
583
  idx1 = this.addPoint(points[1]);
557
584
  idx2 = this.addPoint(points[2]);
558
585
  idx3 = this.addPoint(points[3]);
559
586
  this.addIndexedQuadPointIndexes(idx0, idx1, idx3, idx2);
560
587
  }
561
- /** Announce a single quad facet's point indexes.
588
+ /**
589
+ * Add a single quad facet from existing points to the polyface.
562
590
  * * The actual quad may be reversed or triangulated based on builder setup.
563
- * * indexA0 and indexA1 are in the forward order at the "A" end of the quad
564
- * * indexB0 and indexB1 are in the forward order at the "B" end of the quad.
565
- * * This means ccw/cw ordered vertices v[i] should be passed into this function as i=[0,1,3,2]
591
+ * * `indexA0` and `indexA1` are in the forward order at the "A" end of the quad
592
+ * * `indexB0` and `indexB1` are in the forward order at the "B" end of the quad.
593
+ * * This means ccw/cw ordered vertices v[i] should be passed into this function as i=[0,1,3,2].
566
594
  */
567
595
  addIndexedQuadPointIndexes(indexA0, indexA1, indexB0, indexB1, terminate = true) {
568
596
  if (this._reversed) {
@@ -625,13 +653,14 @@ export class PolyfaceBuilder extends NullGeometryHandler {
625
653
  this._polyface.addColorIndex(indexB0);
626
654
  }
627
655
  }
628
- // ### TODO: Consider case where normals will be reversed and point through the other end of the facet
656
+ // ### TODO: Consider case where normals will be reversed and point through the other end of the facet.
629
657
  /**
630
658
  * Add a triangle to the polyface given its points in order around the edges.
631
- * @param points array of at least three vertices
632
- * @param params optional array of at least three uv parameters (if undefined, params are calculated without reference data)
633
- * @param normals optional array of at least three vectors (if undefined, the normal is calculated)
634
- * @param colors optional array of at least three colors
659
+ * @param points array of at least three vertices.
660
+ * @param params (optional) array of at least three uv parameters (if `undefined`, params are calculated without
661
+ * reference data).
662
+ * @param normals (optional) array of at least three vectors (if `undefined`, the normal is calculated).
663
+ * @param colors (optional) array of at least three colors.
635
664
  */
636
665
  addTriangleFacet(points, params, normals, colors) {
637
666
  if (points.length < 3)
@@ -650,14 +679,14 @@ export class PolyfaceBuilder extends NullGeometryHandler {
650
679
  point1 = points[1];
651
680
  point2 = points[2];
652
681
  }
653
- // Add params if needed
682
+ // add params if needed
654
683
  if (this._options.needParams) {
655
- if (params && params.length >= 3) { // Params were given
684
+ if (params && params.length >= 3) { // params were given
656
685
  idx0 = this._polyface.addParam(params[0]);
657
686
  idx1 = this._polyface.addParam(params[1]);
658
687
  idx2 = this._polyface.addParam(params[2]);
659
688
  }
660
- else { // Compute params
689
+ else { // compute params
661
690
  const paramTransform = this.getUVTransformForTriangleFacet(point0, point1, point2);
662
691
  idx0 = this._polyface.addParam(Point2d.createFrom(paramTransform ? paramTransform.multiplyPoint3d(point0) : undefined));
663
692
  idx1 = this._polyface.addParam(Point2d.createFrom(paramTransform ? paramTransform.multiplyPoint3d(point1) : undefined));
@@ -665,14 +694,14 @@ export class PolyfaceBuilder extends NullGeometryHandler {
665
694
  }
666
695
  this.addIndexedTriangleParamIndexes(idx0, idx1, idx2);
667
696
  }
668
- // Add normals if needed
697
+ // add normals if needed
669
698
  if (this._options.needNormals) {
670
- if (normals !== undefined && normals.length > 2) { // Normals were given
699
+ if (normals !== undefined && normals.length > 2) { // normals were given
671
700
  idx0 = this._polyface.addNormal(normals[0]);
672
701
  idx1 = this._polyface.addNormal(normals[1]);
673
702
  idx2 = this._polyface.addNormal(normals[2]);
674
703
  }
675
- else { // Compute normals
704
+ else { // compute normals
676
705
  const normal = this.getNormalForTriangularFacet(point0, point1, point2);
677
706
  idx0 = this._polyface.addNormal(normal);
678
707
  idx1 = this._polyface.addNormal(normal);
@@ -680,7 +709,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
680
709
  }
681
710
  this.addIndexedTriangleNormalIndexes(idx0, idx1, idx2);
682
711
  }
683
- // Add colors if needed and provided
712
+ // add colors if needed and provided
684
713
  if (this._options.needColors) {
685
714
  if (colors !== undefined && colors.length > 2) {
686
715
  idx0 = this._polyface.addColor(colors[0]);
@@ -689,15 +718,15 @@ export class PolyfaceBuilder extends NullGeometryHandler {
689
718
  this.addIndexedTriangleColorIndexes(idx0, idx1, idx2);
690
719
  }
691
720
  }
692
- // Add point and point indexes last (terminates the facet)
721
+ // add point and point indexes last (terminates the facet)
693
722
  idx0 = this.addPoint(point0);
694
723
  idx1 = this.addPoint(point1);
695
724
  idx2 = this.addPoint(point2);
696
725
  this.addIndexedTrianglePointIndexes(idx0, idx1, idx2);
697
726
  }
698
- /** Announce a single triangle facet's point indexes.
699
- *
700
- * * The actual quad may be reversed or triangulated based on builder setup.
727
+ /**
728
+ * Add a single triangular facet from existing points to the polyface.
729
+ * * The added triangle may be reversed based on builder setup.
701
730
  */
702
731
  addIndexedTrianglePointIndexes(indexA, indexB, indexC, terminateFacet = true) {
703
732
  if (!this._reversed) {
@@ -764,7 +793,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
764
793
  if (sectorA0.xyz.isAlmostEqual(sectorA1.xyz)
765
794
  || sectorA1.xyz.isAlmostEqual(sectorA2.xyz)
766
795
  || sectorA2.xyz.isAlmostEqual(sectorA0.xyz)) {
767
- // trivially degenerate triangle !!! skip !!!
796
+ // trivially degenerate triangle; skip!!!
768
797
  }
769
798
  else {
770
799
  if (this._options.needNormals)
@@ -776,7 +805,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
776
805
  }
777
806
  addSectorQuadA01B01(sectorA0, sectorA1, sectorB0, sectorB1) {
778
807
  if (sectorA0.xyz.isAlmostEqual(sectorA1.xyz) && sectorB0.xyz.isAlmostEqual(sectorB1.xyz)) {
779
- // ignore null quad !!
808
+ // ignore null quad
780
809
  }
781
810
  else if (this._options.shouldTriangulate) {
782
811
  this.addSectorTriangle(sectorA0, sectorA1, sectorB1);
@@ -790,10 +819,9 @@ export class PolyfaceBuilder extends NullGeometryHandler {
790
819
  this.addIndexedQuadPointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorB0.xyzIndex, sectorB1.xyzIndex, true);
791
820
  }
792
821
  }
793
- /** Add facets between lineStrings with matched point counts.
794
- * * surface normals are computed from (a) curve tangents in the linestrings and (b)rule line between linestrings.
795
- * * Facets are announced to addIndexedQuad.
796
- * * addIndexedQuad is free to apply reversal or triangulation options.
822
+ /**
823
+ * Add facets between lineStrings with matched point counts.
824
+ * * Surface normals are computed from (a) curve tangents in the linestrings and (b) rule line between linestrings.
797
825
  */
798
826
  addBetweenLineStringsWithRuleEdgeNormals(lineStringA, vA, lineStringB, vB, addClosure = false) {
799
827
  const pointA = lineStringA.packedPoints;
@@ -827,7 +855,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
827
855
  FacetSector.computeNormalsAlongRuleLine(sectorA1, sectorB1);
828
856
  this.setSectorIndices(sectorA1);
829
857
  this.setSectorIndices(sectorB1);
830
- // create the facet ...
858
+ // create the facet
831
859
  this.addSectorQuadA01B01(sectorA0, sectorA1, sectorB0, sectorB1);
832
860
  sectorA0.copyContentsFrom(sectorA1);
833
861
  sectorB0.copyContentsFrom(sectorB1);
@@ -835,10 +863,9 @@ export class PolyfaceBuilder extends NullGeometryHandler {
835
863
  if (addClosure)
836
864
  this.addSectorQuadA01B01(sectorA0, sectorA00, sectorB0, sectorB00);
837
865
  }
838
- /** Add facets between lineStrings with matched point counts.
839
- * * point indices pre-stored
840
- * * normal indices pre-stored
841
- * * uv indices pre-stored
866
+ /**
867
+ * Add facets between lineStrings with matched point counts.
868
+ * * Indices of points, normals, and uv parameters are pre-stored in the linestrings.
842
869
  */
843
870
  addBetweenLineStringsWithStoredIndices(lineStringA, lineStringB) {
844
871
  const pointA = lineStringA.pointIndices;
@@ -874,7 +901,8 @@ export class PolyfaceBuilder extends NullGeometryHandler {
874
901
  }
875
902
  }
876
903
  else {
877
- if (pointA.atUncheckedIndex(i - 1) !== pointA.atUncheckedIndex(i) || pointB.atUncheckedIndex(i - 1) !== pointB.atUncheckedIndex(i)) {
904
+ if (pointA.atUncheckedIndex(i - 1) !== pointA.atUncheckedIndex(i) ||
905
+ pointB.atUncheckedIndex(i - 1) !== pointB.atUncheckedIndex(i)) {
878
906
  this.addIndexedQuadPointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i), false);
879
907
  if (normalA && normalB)
880
908
  this.addIndexedQuadNormalIndexes(normalA.atUncheckedIndex(i - 1), normalA.atUncheckedIndex(i), normalB.atUncheckedIndex(i - 1), normalB.atUncheckedIndex(i));
@@ -885,8 +913,8 @@ export class PolyfaceBuilder extends NullGeometryHandler {
885
913
  this._polyface.terminateFacet();
886
914
  }
887
915
  }
888
- /** Add facets between lineStrings with matched point counts.
889
- *
916
+ /**
917
+ * Add facets between lineStrings with matched point counts.
890
918
  * * Facets are announced to addIndexedQuad.
891
919
  * * addIndexedQuad is free to apply reversal or triangulation options.
892
920
  */
@@ -912,7 +940,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
912
940
  }
913
941
  else {
914
942
  const children = curves.children;
915
- // just send the children individually -- final s will fix things??
943
+ // just send the children individually; final compress will fix things??
916
944
  if (children)
917
945
  for (const c of children) {
918
946
  this.addBetweenTransformedLineStrings(c, transformA, transformB);
@@ -944,11 +972,9 @@ export class PolyfaceBuilder extends NullGeometryHandler {
944
972
  }
945
973
  }
946
974
  }
947
- /**
948
- * Add facets from a Cone
949
- */
975
+ /** Add facets from a Cone. */
950
976
  addCone(cone) {
951
- // ensure identical stroke counts at each end . . .
977
+ // ensure identical stroke counts at each end
952
978
  let strokeCount = 16;
953
979
  if (this._options)
954
980
  strokeCount = this._options.applyTolerancesToArc(cone.getMaxRadius());
@@ -973,9 +999,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
973
999
  }
974
1000
  }
975
1001
  }
976
- /**
977
- * Add facets for a TorusPipe.
978
- */
1002
+ /** Add facets for a TorusPipe. */
979
1003
  addTorusPipe(surface, phiStrokeCount, thetaStrokeCount) {
980
1004
  const thetaFraction = surface.getThetaFraction();
981
1005
  let numU = Geometry.clamp(Geometry.resolveNumber(phiStrokeCount, 8), 4, 64);
@@ -1019,11 +1043,11 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1019
1043
  }
1020
1044
  /**
1021
1045
  * Add point data (no params, normals) for linestrings.
1022
- * * This recurses through curve chains (loops and paths)
1023
- * * linestrings are swept
1046
+ * * This recurses through curve chains (loops and paths).
1047
+ * * LineStrings are swept.
1024
1048
  * * All other curve types are ignored.
1025
- * @param vector sweep vector
1026
- * @param contour contour which contains only linestrings
1049
+ * @param contour contour which contains only linestrings.
1050
+ * @param vector sweep vector.
1027
1051
  */
1028
1052
  addLinearSweepLineStringsXYZOnly(contour, vector) {
1029
1053
  if (contour instanceof LineString3d) {
@@ -1039,22 +1063,18 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1039
1063
  pointB = pointA.plus(vector, pointB);
1040
1064
  indexA1 = this.addPoint(pointA);
1041
1065
  indexB1 = this.addPoint(pointB);
1042
- if (i > 0) {
1066
+ if (i > 0)
1043
1067
  this.addIndexedQuadPointIndexes(indexA0, indexA1, indexB0, indexB1);
1044
- }
1045
1068
  indexA0 = indexA1;
1046
1069
  indexB0 = indexB1;
1047
1070
  }
1048
1071
  }
1049
1072
  else if (contour instanceof CurveChain) {
1050
- for (const ls of contour.children) {
1073
+ for (const ls of contour.children)
1051
1074
  this.addLinearSweepLineStringsXYZOnly(ls, vector);
1052
- }
1053
1075
  }
1054
1076
  }
1055
- /**
1056
- * Construct facets for a rotational sweep.
1057
- */
1077
+ /** Construct facets for a rotational sweep. */
1058
1078
  addRotationalSweep(surface) {
1059
1079
  const contour = surface.getCurves();
1060
1080
  const section0 = StrokeCountSection.createForParityRegionOrChain(contour, this._options);
@@ -1077,22 +1097,21 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1077
1097
  const capContour = surface.getSweepContourRef();
1078
1098
  capContour.purgeFacets();
1079
1099
  capContour.emitFacets(this, true, undefined);
1080
- // final loop pass left transformA at end ..
1100
+ // final loop pass left transformA at end
1081
1101
  capContour.emitFacets(this, false, surface.getFractionalRotationTransform(1.0));
1082
1102
  }
1083
1103
  }
1084
- /**
1085
- * Construct facets for any planar region
1086
- */
1104
+ /** Construct facets for any planar region. */
1087
1105
  addTriangulatedRegion(region) {
1088
1106
  const contour = SweepContour.createForLinearSweep(region);
1089
1107
  if (contour)
1090
1108
  contour.emitFacets(this, this.reversedFlag, undefined);
1091
1109
  }
1092
1110
  /**
1111
+ * Apply stroke counts to curve primitives.
1093
1112
  * * Recursively visit all children of data.
1094
- * * At each primitive, invoke the computeStrokeCountForOptions method, with options from the builder.
1095
- * @param data
1113
+ * * At each primitive, invoke `computeStrokeCountForOptions` method with options from the builder.
1114
+ * @deprecated in 4.x. This method does nothing and is unneeded.
1096
1115
  */
1097
1116
  applyStrokeCountsToCurvePrimitives(data) {
1098
1117
  const options = this._options;
@@ -1102,9 +1121,9 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1102
1121
  else if (data instanceof CurveCollection) {
1103
1122
  const children = data.children;
1104
1123
  if (children)
1105
- for (const child of children) {
1124
+ for (const child of children)
1125
+ // eslint-disable-next-line deprecation/deprecation
1106
1126
  this.applyStrokeCountsToCurvePrimitives(child);
1107
- }
1108
1127
  }
1109
1128
  }
1110
1129
  addBetweenStrokeSetsWithRuledNormals(stroke0, stroke1, numVEdge) {
@@ -1124,22 +1143,20 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1124
1143
  }
1125
1144
  createIndicesInLineString(ls, vParam, transform) {
1126
1145
  const n = ls.numPoints();
1127
- {
1128
- const pointIndices = ls.ensureEmptyPointIndices();
1129
- const index0 = this.findOrAddPointInLineString(ls, 0, transform);
1130
- pointIndices.push(index0);
1131
- if (n > 1) {
1132
- let indexA = index0;
1133
- let indexB;
1134
- for (let i = 1; i + 1 < n; i++) {
1135
- indexB = this.findOrAddPointInLineString(ls, i, transform, indexA);
1136
- pointIndices.push(indexB);
1137
- indexA = indexB;
1138
- }
1139
- // assume last point can only repeat back to zero ...
1140
- indexB = this.findOrAddPointInLineString(ls, n - 1, transform, index0);
1146
+ const pointIndices = ls.ensureEmptyPointIndices();
1147
+ const index0 = this.findOrAddPointInLineString(ls, 0, transform);
1148
+ pointIndices.push(index0);
1149
+ if (n > 1) {
1150
+ let indexA = index0;
1151
+ let indexB;
1152
+ for (let i = 1; i + 1 < n; i++) {
1153
+ indexB = this.findOrAddPointInLineString(ls, i, transform, indexA);
1141
1154
  pointIndices.push(indexB);
1155
+ indexA = indexB;
1142
1156
  }
1157
+ // assume last point can only repeat back to zero
1158
+ indexB = this.findOrAddPointInLineString(ls, n - 1, transform, index0);
1159
+ pointIndices.push(indexB);
1143
1160
  }
1144
1161
  if (this._options.needNormals && ls.packedSurfaceNormals !== undefined) {
1145
1162
  const normalIndices = ls.ensureEmptyNormalIndices();
@@ -1153,7 +1170,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1153
1170
  normalIndices.push(normalIndexB);
1154
1171
  normalIndexA = normalIndexB;
1155
1172
  }
1156
- // assume last point can only repeat back to zero ...
1173
+ // assume last point can only repeat back to zero
1157
1174
  normalIndexB = this.findOrAddNormalInLineString(ls, n - 1, transform, normalIndex0, normalIndexA);
1158
1175
  normalIndices.push(normalIndexB);
1159
1176
  }
@@ -1170,7 +1187,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1170
1187
  uvIndices.push(uvIndexB);
1171
1188
  uvIndexA = uvIndexB;
1172
1189
  }
1173
- // assume last point can only repeat back to zero ...
1190
+ // assume last point can only repeat back to zero
1174
1191
  uvIndexB = this.findOrAddParamInLineString(ls, n - 1, vParam, uvIndexA, uvIndex0);
1175
1192
  uvIndices.push(uvIndexB);
1176
1193
  }
@@ -1197,12 +1214,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1197
1214
  }
1198
1215
  }
1199
1216
  }
1200
- /**
1201
- *
1202
- * Add facets from
1203
- * * The swept contour
1204
- * * each cap.
1205
- */
1217
+ /** Add facets from the linear sweep. */
1206
1218
  addLinearSweep(surface) {
1207
1219
  const contour = surface.getCurvesRef();
1208
1220
  const section0 = StrokeCountSection.createForParityRegionOrChain(contour, this._options);
@@ -1219,17 +1231,14 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1219
1231
  contourA.emitFacets(this, false, sweepTransform);
1220
1232
  }
1221
1233
  }
1222
- /**
1223
- * Add facets from a ruled sweep.
1224
- */
1234
+ /** Add facets from a ruled sweep. */
1225
1235
  addRuledSweep(surface) {
1226
1236
  const contours = surface.sweepContoursRef();
1227
1237
  let stroke0;
1228
1238
  let stroke1;
1229
1239
  const sectionMaps = [];
1230
- for (const contour of contours) {
1240
+ for (const contour of contours)
1231
1241
  sectionMaps.push(StrokeCountSection.createForParityRegionOrChain(contour.curves, this._options));
1232
- }
1233
1242
  if (StrokeCountSection.enforceStrokeCountCompatibility(sectionMaps)) {
1234
1243
  StrokeCountSection.enforceCompatibleDistanceSums(sectionMaps);
1235
1244
  for (let i = 0; i < contours.length; i++) {
@@ -1255,9 +1264,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1255
1264
  }
1256
1265
  return true;
1257
1266
  }
1258
- /**
1259
- * Add facets from a Sphere
1260
- */
1267
+ /** Add facets from a sphere. */
1261
1268
  addSphere(sphere, strokeCount) {
1262
1269
  let numStrokeTheta = strokeCount ? strokeCount : this.options.applyTolerancesToArc(sphere.maxAxisRadius());
1263
1270
  if (Geometry.isOdd(numStrokeTheta))
@@ -1277,21 +1284,19 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1277
1284
  this.endFace();
1278
1285
  }
1279
1286
  }
1280
- /**
1281
- * Add facets from a Box
1282
- */
1287
+ /** Add facets from a box. */
1283
1288
  addBox(box) {
1284
1289
  const corners = box.getCorners();
1285
1290
  const xLength = Geometry.maxXY(box.getBaseX(), box.getBaseX());
1286
1291
  const yLength = Geometry.maxXY(box.getBaseY(), box.getTopY());
1287
1292
  let zLength = 0.0;
1288
- for (let i = 0; i < 4; i++) {
1293
+ for (let i = 0; i < 4; i++)
1289
1294
  zLength = Geometry.maxXY(zLength, corners[i].distance(corners[i + 4]));
1290
- }
1291
1295
  const numX = this._options.applyMaxEdgeLength(1, xLength);
1292
1296
  const numY = this._options.applyMaxEdgeLength(1, yLength);
1293
1297
  const numZ = this._options.applyMaxEdgeLength(1, zLength);
1294
- // 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 ...
1298
+ // wrap the 4 out-of-plane faces as a single parameter space with "distance"
1299
+ // advancing in x, then y, then negative x, then negative y
1295
1300
  const uParamRange = Segment1d.create(0, xLength);
1296
1301
  const vParamRange = Segment1d.create(0, zLength);
1297
1302
  this.addUVGridBody(BilinearPatch.create(corners[0], corners[1], corners[4], corners[5]), numX, numZ, uParamRange, vParamRange);
@@ -1301,7 +1306,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1301
1306
  this.addUVGridBody(BilinearPatch.create(corners[3], corners[2], corners[7], corners[6]), numX, numZ, uParamRange, vParamRange);
1302
1307
  uParamRange.shift(xLength);
1303
1308
  this.addUVGridBody(BilinearPatch.create(corners[2], corners[0], corners[6], corners[4]), numY, numZ, uParamRange, vParamRange);
1304
- // finally end that wraparound face !!
1309
+ // finally end that wraparound face
1305
1310
  this.endFace();
1306
1311
  if (box.capped) {
1307
1312
  uParamRange.set(0.0, xLength);
@@ -1314,15 +1319,15 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1314
1319
  this.endFace();
1315
1320
  }
1316
1321
  }
1317
- /** Add a polygon to the evolving facets.
1318
- *
1319
- * * Add points to the polyface
1320
- * * indices are added (in reverse order if indicated by the builder state)
1321
- * @param points array of points. This may contain extra points not to be used in the polygon
1322
+ /**
1323
+ * Add a polygon to the evolving facets.
1324
+ * * Add points to the polyface.
1325
+ * * Indices are added (in reverse order if indicated by the builder state).
1326
+ * @param points array of points. This may contain extra points not to be used in the polygon.
1322
1327
  * @param numPointsToUse number of points to use.
1323
1328
  */
1324
1329
  addPolygon(points, numPointsToUse) {
1325
- // don't use trailing points that match start point.
1330
+ // don't use trailing points that match start point
1326
1331
  if (numPointsToUse === undefined)
1327
1332
  numPointsToUse = points.length;
1328
1333
  while (numPointsToUse > 1 && points[numPointsToUse - 1].isAlmostEqual(points[0]))
@@ -1342,23 +1347,23 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1342
1347
  }
1343
1348
  this._polyface.terminateFacet();
1344
1349
  }
1345
- /** Add a polygon to the evolving facets.
1346
- *
1350
+ /**
1351
+ * Add a polygon to the evolving facets.
1347
1352
  * * Add points to the polyface
1348
- * * indices are added (in reverse order if indicated by the builder state)
1353
+ * * Indices are added (in reverse order if indicated by the builder state).
1349
1354
  * * Arrays with 2 or fewer points are ignored.
1350
1355
  * @param points array of points. Trailing closure points are ignored.
1351
1356
  */
1352
1357
  addPolygonGrowableXYZArray(points) {
1353
- // don't use trailing points that match start point.
1358
+ // don't use trailing points that match start point
1354
1359
  let numPointsToUse = points.length;
1355
1360
  while (numPointsToUse > 2 && Geometry.isSmallMetricDistance(points.distanceIndexIndex(0, numPointsToUse - 1)))
1356
1361
  numPointsToUse--;
1357
1362
  // strip trailing duplicates
1358
1363
  while (numPointsToUse > 2 && Geometry.isSmallMetricDistance(points.distanceIndexIndex(numPointsToUse - 2, numPointsToUse - 1)))
1359
1364
  numPointsToUse--;
1360
- // ignore triangles for which the height is less than smallMetricDistance times length
1361
- // sum of edge lengths is twice the perimeter. If it is flat that's twice the largest base dimension.
1365
+ // ignore triangles for which the height is less than smallMetricDistance times length.
1366
+ // sum of edge lengths is twice the perimeter. If it is flat that's twice the largest base dimension.
1362
1367
  // cross product magnitude is twice the area.
1363
1368
  if (numPointsToUse === 3) {
1364
1369
  const cross = points.crossProductIndexIndexIndex(0, 1, 2);
@@ -1384,19 +1389,20 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1384
1389
  this._polyface.terminateFacet();
1385
1390
  }
1386
1391
  }
1387
- /** Add a polygon to the evolving facets.
1388
- * * add points to the polyface
1389
- * * compute each point index as the point is added
1390
- * * all data arrays are parallel to the point array
1391
- * * point indices are added in reverse order if indicated by the builder state
1392
- * @param points array of vertices in order around the facet
1393
- * @param normals optional array of normals, one per vertex
1394
- * @param params optional array of uv-parameters, one per vertex
1395
- * @param colors optional array of colors, one per vertex
1396
- * @param edgeVisible optional array of flags, one per vertex, true iff edge starting at corresponding vertex is visible
1392
+ /**
1393
+ * Add a polygon to the evolving facets.
1394
+ * * Add points to the polyface.
1395
+ * * Compute each point index as the point is added.
1396
+ * * All data arrays are parallel to the point array.
1397
+ * * Point indices are added in reverse order if indicated by the builder state.
1398
+ * @param points array of vertices in order around the facet.
1399
+ * @param normals (optional) array of normals, one per vertex.
1400
+ * @param params (optional) array of uv-parameters, one per vertex.
1401
+ * @param colors (optional) array of colors, one per vertex.
1402
+ * @param edgeVisible (optional) array of flags, one per vertex, true iff edge starting at corresponding vertex is visible.
1397
1403
  */
1398
1404
  addFacetFromGrowableArrays(points, normals, params, colors, edgeVisible) {
1399
- // don't use trailing points that match start point.
1405
+ // don't use trailing points that match start point
1400
1406
  let numPointsToUse = points.length;
1401
1407
  while (numPointsToUse > 1 && Geometry.isSmallMetricDistance(points.distanceIndexIndex(0, numPointsToUse - 1)))
1402
1408
  numPointsToUse--;
@@ -1447,13 +1453,14 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1447
1453
  }
1448
1454
  this._polyface.terminateFacet();
1449
1455
  }
1450
- /** Add the current visitor facet to the evolving polyface.
1451
- * * indices are added (in reverse order if indicated by the builder state)
1456
+ /**
1457
+ * Add the current visitor facet to the evolving polyface.
1458
+ * * Indices are added (in reverse order if indicated by the builder state).
1452
1459
  */
1453
1460
  addFacetFromVisitor(visitor) {
1454
1461
  this.addFacetFromGrowableArrays(visitor.point, visitor.normal, visitor.param, visitor.color, visitor.edgeVisible);
1455
1462
  }
1456
- /** Add all visitor facets to the evolving polyface (in reverse order if indicated by the builder state) */
1463
+ /** Add all visitor facets to the evolving polyface (in reverse order if indicated by the builder state). */
1457
1464
  addFacetsFromVisitor(visitor) {
1458
1465
  visitor.reset();
1459
1466
  for (; visitor.moveToNextFacet();)
@@ -1462,8 +1469,8 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1462
1469
  /**
1463
1470
  * Add the subset of visitor data indexed by the indices.
1464
1471
  * * Ideally, the subset represents a sub-facet of the visited facet.
1465
- * @param visitor data for the currently visited facet
1466
- * @param indices local indices into the visitor data arrays
1472
+ * @param visitor data for the currently visited facet.
1473
+ * @param indices local indices into the visitor data arrays.
1467
1474
  * @returns whether the data was added successfully. Encountering an invalid index returns false.
1468
1475
  */
1469
1476
  addFacetFromIndexedVisitor(visitor, indices) {
@@ -1491,49 +1498,71 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1491
1498
  this.addFacetFromGrowableArrays(xyz, normal, param, color, visible);
1492
1499
  return true;
1493
1500
  }
1494
- /** Add a polyface, with optional reverse and transform. */
1501
+ /** Add a polyface with optional reverse and transform. */
1495
1502
  addIndexedPolyface(source, reversed = false, transform) {
1496
1503
  this._polyface.addIndexedPolyface(source, reversed, transform);
1497
1504
  }
1498
1505
  /**
1499
1506
  * Produce a new FacetFaceData for all terminated facets since construction of the previous face.
1500
- * Each facet number/index is mapped to the FacetFaceData through the faceToFaceData array.
1501
- * Returns true if successful, and false otherwise.
1507
+ * * Each facet number/index is mapped to the FacetFaceData through the faceToFaceData array.
1508
+ * @returns true if successful, and false otherwise.
1502
1509
  */
1503
1510
  endFace() {
1504
1511
  return this._polyface.setNewFaceData();
1505
1512
  }
1506
- /** Double dispatch handler for Cone */
1507
- handleCone(g) { return this.addCone(g); }
1508
- /** Double dispatch handler for TorusPipe */
1509
- handleTorusPipe(g) { return this.addTorusPipe(g); }
1510
- /** Double dispatch handler for Sphere */
1511
- handleSphere(g) { return this.addSphere(g); }
1512
- /** Double dispatch handler for Box */
1513
- handleBox(g) { return this.addBox(g); }
1514
- /** Double dispatch handler for LinearSweep */
1515
- handleLinearSweep(g) { return this.addLinearSweep(g); }
1516
- /** Double dispatch handler for RotationalSweep */
1517
- handleRotationalSweep(g) { return this.addRotationalSweep(g); }
1518
- /** Double dispatch handler for RuledSweep */
1519
- handleRuledSweep(g) { return this.addRuledSweep(g); }
1520
- /** Double dispatch handler for Loop */
1521
- handleLoop(g) { return this.addTriangulatedRegion(g); }
1522
- /** Double dispatch handler for ParityRegion */
1523
- handleParityRegion(g) { return this.addTriangulatedRegion(g); }
1524
- /** Double dispatch handler for UnionRegion */
1525
- handleUnionRegion(g) { return this.addTriangulatedRegion(g); }
1526
- /** add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
1527
- addGeometryQuery(g) { g.dispatchToGeometryHandler(this); }
1513
+ /** Double dispatch handler for Cone. */
1514
+ handleCone(g) {
1515
+ return this.addCone(g);
1516
+ }
1517
+ /** Double dispatch handler for TorusPipe. */
1518
+ handleTorusPipe(g) {
1519
+ return this.addTorusPipe(g);
1520
+ }
1521
+ /** Double dispatch handler for Sphere. */
1522
+ handleSphere(g) {
1523
+ return this.addSphere(g);
1524
+ }
1525
+ /** Double dispatch handler for Box. */
1526
+ handleBox(g) {
1527
+ return this.addBox(g);
1528
+ }
1529
+ /** Double dispatch handler for LinearSweep. */
1530
+ handleLinearSweep(g) {
1531
+ return this.addLinearSweep(g);
1532
+ }
1533
+ /** Double dispatch handler for RotationalSweep. */
1534
+ handleRotationalSweep(g) {
1535
+ return this.addRotationalSweep(g);
1536
+ }
1537
+ /** Double dispatch handler for RuledSweep. */
1538
+ handleRuledSweep(g) {
1539
+ return this.addRuledSweep(g);
1540
+ }
1541
+ /** Double dispatch handler for Loop. */
1542
+ handleLoop(g) {
1543
+ return this.addTriangulatedRegion(g);
1544
+ }
1545
+ /** Double dispatch handler for ParityRegion. */
1546
+ handleParityRegion(g) {
1547
+ return this.addTriangulatedRegion(g);
1548
+ }
1549
+ /** Double dispatch handler for UnionRegion. */
1550
+ handleUnionRegion(g) {
1551
+ return this.addTriangulatedRegion(g);
1552
+ }
1553
+ /** Add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
1554
+ addGeometryQuery(g) {
1555
+ g.dispatchToGeometryHandler(this);
1556
+ }
1528
1557
  /**
1529
1558
  * Add a graph to the builder.
1530
- * * Visit one node per face
1531
- * * If `acceptFaceFunction(node)` returns true, pass face coordinates to the builder
1559
+ * * Visit one node per face.
1560
+ * * If `acceptFaceFunction(node)` returns true, pass face coordinates to the builder.
1532
1561
  * * Accepted face edge visibility is determined by `isEdgeVisibleFunction`.
1533
1562
  * * Rely on the builder's compress step to find common vertex coordinates.
1534
- * @param graph faces to add as facets
1535
- * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces
1536
- * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges
1563
+ * @param graph faces to add as facets.
1564
+ * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces.
1565
+ * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges.
1537
1566
  * @internal
1538
1567
  */
1539
1568
  addGraph(graph, acceptFaceFunction = (node) => HalfEdge.testNodeMaskNotExterior(node), isEdgeVisibleFunction = (node) => HalfEdge.testMateMaskExterior(node)) {
@@ -1564,12 +1593,12 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1564
1593
  });
1565
1594
  }
1566
1595
  /**
1567
- *
1568
- * * For each node in `faces`
1569
- * * add all of its vertices to the polyface
1570
- * * add point indices to form a new facet.
1571
- * * (Note: no normal or param indices are added)
1572
- * * terminate the facet
1596
+ * Add a graph's faces to the builder.
1597
+ * * For each node in `faces`:
1598
+ * * Add all of its vertices to the polyface.
1599
+ * * Add point indices to form a new facet.
1600
+ * * (note: no normal or param indices are added)
1601
+ * * Terminate the facet.
1573
1602
  * @internal
1574
1603
  */
1575
1604
  addGraphFaces(faces) {
@@ -1587,9 +1616,10 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1587
1616
  /**
1588
1617
  * Create a polyface containing the faces of a HalfEdgeGraph, with test functions to filter faces and hide edges.
1589
1618
  * * This is a static wrapper of [[addGraph]].
1590
- * @param graph faces to add as facets
1591
- * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces
1592
- * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges
1619
+ * @param graph faces to add as facets.
1620
+ * @param options (optional) options for the polyface.
1621
+ * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces.
1622
+ * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges.
1593
1623
  * @internal
1594
1624
  */
1595
1625
  static graphToPolyface(graph, options, acceptFaceFunction = (node) => HalfEdge.testNodeMaskNotExterior(node), isEdgeVisibleFunction = (node) => HalfEdge.testMateMaskExterior(node)) {
@@ -1598,7 +1628,8 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1598
1628
  builder.endFace();
1599
1629
  return builder.claimPolyface();
1600
1630
  }
1601
- /** Create a polyface containing the faces of a HalfEdgeGraph that are specified by the HalfEdge array.
1631
+ /**
1632
+ * Create a polyface containing the faces of a HalfEdgeGraph that are specified by the HalfEdge array.
1602
1633
  * @internal
1603
1634
  */
1604
1635
  static graphFacesToPolyface(faces) {
@@ -1607,7 +1638,8 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1607
1638
  builder.endFace();
1608
1639
  return builder.claimPolyface();
1609
1640
  }
1610
- /** Create a polyface containing triangles in a (space) polygon.
1641
+ /**
1642
+ * Create a polyface containing triangles in a (space) polygon.
1611
1643
  * * The polyface contains only coordinate data (no params or normals).
1612
1644
  */
1613
1645
  static polygonToTriangulatedPolyface(points, localToWorld) {
@@ -1628,13 +1660,13 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1628
1660
  return undefined;
1629
1661
  }
1630
1662
  /**
1631
- * Given arrays of coordinates for multiple facets.
1632
- * * pointArray[i] is an array of 3 or 4 points
1633
- * * paramArray[i] is an array of matching number of params
1663
+ * Add facets to the builder given arrays of coordinates for multiple facets.
1664
+ * * pointArray[i] is an array of 3 or 4 points.
1665
+ * * paramArray[i] is an array of matching number of params.
1634
1666
  * * normalArray[i] is an array of matching number of normals.
1635
- * @param pointArray array of arrays of point coordinates
1636
- * @param paramArray array of arrays of uv parameters
1637
- * @param normalArray array of arrays of normals
1667
+ * @param pointArray array of arrays of point coordinates.
1668
+ * @param paramArray (optional) array of arrays of uv parameters.
1669
+ * @param normalArray (optional) array of arrays of normals.
1638
1670
  * @param endFace if true, call this.endFace after adding all the facets.
1639
1671
  */
1640
1672
  addCoordinateFacets(pointArray, paramArray, normalArray, endFace = false) {
@@ -1650,15 +1682,16 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1650
1682
  this.endFace();
1651
1683
  }
1652
1684
  /**
1685
+ * Add facets from the parametric surface.
1653
1686
  * * Evaluate `(numU + 1) * (numV + 1)` grid points (in 0..1 in both u and v) on a surface.
1654
1687
  * * Add the facets for `numU * numV` quads.
1655
1688
  * * uv params are the 0..1 fractions.
1656
- * * normals are cross products of u and v direction partial derivatives.
1657
- * @param surface
1658
- * @param numU number of intervals (edges) in the u direction. (Number of points is `numU + 1`)
1659
- * @param numV number of intervals (edges) in the v direction. (Number of points is `numV + 1`)
1660
- * @param uMap optional mapping from u fraction to parameter space (such as texture)
1661
- * @param vMap optional mapping from v fraction to parameter space (such as texture)
1689
+ * * Normals are cross products of u and v direction partial derivatives.
1690
+ * @param surface UV surface to evaluate.
1691
+ * @param numU number of intervals (edges) in the u direction (number of points is `numU + 1`).
1692
+ * @param numV number of intervals (edges) in the v direction (number of points is `numV + 1`).
1693
+ * @param uMap optional mapping from u fraction to parameter space (such as texture).
1694
+ * @param vMap optional mapping from v fraction to parameter space (such as texture).
1662
1695
  */
1663
1696
  addUVGridBody(surface, numU, numV, uMap, vMap) {
1664
1697
  let xyzIndex0 = new GrowableFloat64Array(numU);
@@ -1687,7 +1720,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1687
1720
  const dv = 1.0 / numV;
1688
1721
  const plane = Plane3dByOriginAndVectors.createXYPlane();
1689
1722
  for (let v = 0; v <= numV; v++) {
1690
- // evaluate new points ....
1723
+ // evaluate new points
1691
1724
  xyzIndex1.clear();
1692
1725
  if (needNormals)
1693
1726
  normalIndex1.clear();
@@ -1737,23 +1770,26 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1737
1770
  indexSwap = xyzIndex1;
1738
1771
  xyzIndex1 = xyzIndex0;
1739
1772
  xyzIndex0 = indexSwap;
1740
- if (needParams) {
1773
+ if (needParams)
1741
1774
  indexSwap = paramIndex1;
1742
- paramIndex1 = paramIndex0;
1743
- paramIndex0 = indexSwap;
1744
- }
1745
- if (needNormals) {
1775
+ paramIndex1 = paramIndex0;
1776
+ paramIndex0 = indexSwap;
1777
+ if (needNormals)
1746
1778
  indexSwap = normalIndex1;
1747
- normalIndex1 = normalIndex0;
1748
- normalIndex0 = indexSwap;
1749
- }
1779
+ normalIndex1 = normalIndex0;
1780
+ normalIndex0 = indexSwap;
1750
1781
  }
1751
1782
  xyzIndex0.clear();
1752
1783
  xyzIndex1.clear();
1753
1784
  }
1754
1785
  /**
1755
- * Triangulate the points as viewed in xy.
1756
- * @param points
1786
+ * Create a polyface from a triangulation of the points.
1787
+ * * The triangulation is computed as seen in the top view: z-coordinates are ignored.
1788
+ * @param points an array of points.
1789
+ * @param options (optional) stroke options. Currently only two options are supported. If `options.needNormals` is
1790
+ * true, all facets are assigned the single normal 001. If `options.needParams` is true, all facet vertices are
1791
+ * assigned uv-parameters equal to their xy-coordinates. These options are rarely useful.
1792
+ * @returns triangulated polyface or `undefined` if triangulation was not possible.
1757
1793
  */
1758
1794
  static pointsToTriangulatedPolyface(points, options) {
1759
1795
  const graph = Triangulator.createTriangulatedGraphFromPoints(points);
@@ -1761,21 +1797,20 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1761
1797
  return PolyfaceBuilder.graphToPolyface(graph, options);
1762
1798
  return undefined;
1763
1799
  }
1764
- /** Create (and add to the builder) triangles that bridge the gap between two linestrings.
1765
- * * Each triangle will have 1 vertex on one of the linestrings and 2 on the other
1800
+ /**
1801
+ * Add triangular facets between two linestrings.
1802
+ * * Each triangle will have 1 vertex on one of the linestrings and 2 on the other.
1766
1803
  * * Choice of triangles is heuristic, hence does not have a unique solution.
1767
- * * Logic to choice among the various possible triangle orders prefers
1768
- * * Make near-coplanar facets
1769
- * * make facets with good aspect ratio.
1804
+ * * Logic for choosing among the various possible triangles prefers:
1805
+ * * Make near-coplanar facets.
1806
+ * * Make facets with good aspect ratio.
1770
1807
  * * This is exercised with a limited number of lookahead points, i.e. greedy to make first-available decision.
1771
1808
  * @param pointsA points of first linestring.
1772
1809
  * @param pointsB points of second linestring.
1773
1810
  */
1774
1811
  addGreedyTriangulationBetweenLineStrings(pointsA, pointsB) {
1775
1812
  const context = GreedyTriangulationBetweenLineStrings.createContext();
1776
- context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => {
1777
- this.addTriangleFacet(triangle.points);
1778
- });
1813
+ context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => { this.addTriangleFacet(triangle.points); });
1779
1814
  }
1780
1815
  addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12) {
1781
1816
  const sections = CurveFactory.createMiteredPipeSections(centerline, sectionData);
@@ -1800,13 +1835,14 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1800
1835
  }
1801
1836
  }
1802
1837
  /**
1803
- * * Create (and add to the builder) quad facets for a mitered pipe that follows a centerline curve.
1804
- * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis lengths, or a full Arc3d.
1838
+ * Add quad facets along a mitered pipe that follows a centerline curve.
1839
+ * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis
1840
+ * lengths, or a full Arc3d:
1805
1841
  * * For semi-axis length input, x corresponds to an ellipse local axis nominally situated parallel to the xy-plane.
1806
- * * The center of Arc3d input is translated to the centerline start point to act as initial cross section.
1842
+ * * For Arc3d input, the center is translated to the centerline start point to act as initial cross section.
1807
1843
  * @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions.
1808
- * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d
1809
- * @param numFacetAround how many equal parameter-space chords around each section
1844
+ * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d.
1845
+ * @param numFacetAround how many equal parameter-space chords around each section.
1810
1846
  */
1811
1847
  addMiteredPipes(centerline, sectionData, numFacetAround = 12) {
1812
1848
  if (Array.isArray(centerline)) {
@@ -1827,7 +1863,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1827
1863
  this.addMiteredPipesFromPoints(linestring.packedPoints, sectionData, numFacetAround);
1828
1864
  }
1829
1865
  }
1830
- /** Return the polyface index array indices corresponding to the given edge, or undefined if error. */
1866
+ /** Return the polyface index array indices corresponding to the given edge, or `undefined` if error. */
1831
1867
  getEdgeIndices(edge) {
1832
1868
  let indexA = -1;
1833
1869
  let indexB = -1;
@@ -1839,8 +1875,10 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1839
1875
  }
1840
1876
  return (indexA < 0 || indexB < 0) ? undefined : { edgeIndexA: indexA, edgeIndexB: indexB };
1841
1877
  }
1842
- /** Create a side face between base and swept facets along a base boundary edge.
1843
- * * 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).
1878
+ /**
1879
+ * Create a side face between base and swept facets along a base boundary edge.
1880
+ * * Assumes numBaseFacets base facets were added to this builder, immediately followed by the same number of swept
1881
+ * facets with opposite orientation (first index not preserved).
1844
1882
  */
1845
1883
  addSweptFace(baseBoundaryEdge, numBaseFacets) {
1846
1884
  const edge = this.getEdgeIndices(baseBoundaryEdge);
@@ -1859,7 +1897,12 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1859
1897
  const edgeIndexOffsetInFaceLoopB = edge.edgeIndexB - baseFacetIndexStart;
1860
1898
  const sweptEdgeIndexOffsetInFaceLoopA = (numBaseFacetEdges - 1) - edgeIndexOffsetInFaceLoopA;
1861
1899
  const sweptEdgeIndexOffsetInFaceLoopB = (numBaseFacetEdges - 1) - edgeIndexOffsetInFaceLoopB;
1862
- const indices = [edge.edgeIndexB, edge.edgeIndexA, sweptFacetIndexStart + sweptEdgeIndexOffsetInFaceLoopA, sweptFacetIndexStart + sweptEdgeIndexOffsetInFaceLoopB];
1900
+ const indices = [
1901
+ edge.edgeIndexB,
1902
+ edge.edgeIndexA,
1903
+ sweptFacetIndexStart + sweptEdgeIndexOffsetInFaceLoopA,
1904
+ sweptFacetIndexStart + sweptEdgeIndexOffsetInFaceLoopB,
1905
+ ];
1863
1906
  const vertices = [];
1864
1907
  let colors; // try to re-use colors; missing normals and params will be computed if needed
1865
1908
  if (undefined !== this.options.needColors && undefined !== this._polyface.data.color && undefined !== this._polyface.data.colorIndex)
@@ -1880,11 +1923,13 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1880
1923
  return true;
1881
1924
  }
1882
1925
  /**
1883
- * 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.
1884
- * @param source the surface mesh to sweep
1885
- * @param sweepVector the direction and length to sweep the surface mesh
1886
- * @param triangulateSides whether to triangulate side facets, or leave as quads
1887
- * @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.
1926
+ * Add facets from the source polyface, from its translation along the vector, and from its swept boundary edges,
1927
+ * to form a polyface that encloses a volume.
1928
+ * @param source the surface mesh to sweep.
1929
+ * @param sweepVector the direction and length to sweep the surface mesh.
1930
+ * @param triangulateSides whether to triangulate side facets, or leave as quads.
1931
+ * @returns whether the added facets comprise a simple sweep. If false, the resulting mesh may have self-intersections,
1932
+ * be non-manifold, have inconsistently oriented facets, etc.
1888
1933
  */
1889
1934
  addSweptIndexedPolyface(source, sweepVector, triangulateSides = false) {
1890
1935
  let isSimpleSweep = true;