@itwin/core-geometry 4.5.0-dev.3 → 4.5.0-dev.30

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 (515) hide show
  1. package/CHANGELOG.md +47 -1
  2. package/LICENSE.md +1 -1
  3. package/lib/cjs/Constant.js.map +1 -1
  4. package/lib/cjs/Geometry.d.ts +15 -0
  5. package/lib/cjs/Geometry.d.ts.map +1 -1
  6. package/lib/cjs/Geometry.js +27 -0
  7. package/lib/cjs/Geometry.js.map +1 -1
  8. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  9. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  11. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  12. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  13. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  14. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  15. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  16. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  17. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  18. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  19. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  20. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  21. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  22. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  23. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  24. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  25. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  26. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  27. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  28. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  29. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  30. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  31. package/lib/cjs/core-geometry.js.map +1 -1
  32. package/lib/cjs/curve/Arc3d.js.map +1 -1
  33. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  34. package/lib/cjs/curve/CoordinateXYZ.d.ts +10 -13
  35. package/lib/cjs/curve/CoordinateXYZ.d.ts.map +1 -1
  36. package/lib/cjs/curve/CoordinateXYZ.js +16 -15
  37. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  38. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  39. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  40. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  41. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  42. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  43. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  44. package/lib/cjs/curve/CurveOps.js.map +1 -1
  45. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  46. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  47. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  48. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  49. package/lib/cjs/curve/GeometryQuery.d.ts +17 -17
  50. package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
  51. package/lib/cjs/curve/GeometryQuery.js +16 -15
  52. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  53. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  54. package/lib/cjs/curve/LineString3d.js.map +1 -1
  55. package/lib/cjs/curve/Loop.js.map +1 -1
  56. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  57. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  58. package/lib/cjs/curve/Path.js.map +1 -1
  59. package/lib/cjs/curve/PointString3d.d.ts +17 -13
  60. package/lib/cjs/curve/PointString3d.d.ts.map +1 -1
  61. package/lib/cjs/curve/PointString3d.js +35 -20
  62. package/lib/cjs/curve/PointString3d.js.map +1 -1
  63. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  64. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  65. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  66. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  67. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  68. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  69. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  70. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  71. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  72. package/lib/cjs/curve/RegionOps.js.map +1 -1
  73. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  74. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  75. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  76. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  77. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  78. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  84. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  85. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  86. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  87. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  88. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  89. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  90. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  91. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  92. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  93. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  94. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  95. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  96. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  97. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  98. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  99. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  100. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  101. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +1 -1
  102. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  103. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  104. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +1 -1
  105. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  106. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  107. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  108. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  109. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  110. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  111. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  112. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  113. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  114. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  115. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  116. package/lib/cjs/geometry3d/FrameBuilder.js +3 -0
  117. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  118. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  119. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  120. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  121. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  122. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  123. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +8 -2
  124. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  125. package/lib/cjs/geometry3d/GrowableXYZArray.js +11 -2
  126. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  127. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  128. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  129. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  130. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  131. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  132. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  133. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  134. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  135. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  136. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  137. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  138. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  139. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  140. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  141. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  142. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  143. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  144. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  145. package/lib/cjs/geometry3d/Range.js.map +1 -1
  146. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  147. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  148. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  149. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  150. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  151. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  152. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  153. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  154. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  155. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  156. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  157. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  158. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  159. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  160. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  161. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  162. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  163. package/lib/cjs/numerics/Complex.js.map +1 -1
  164. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  165. package/lib/cjs/numerics/Newton.js.map +1 -1
  166. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  167. package/lib/cjs/numerics/PolarData.js.map +1 -1
  168. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  169. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  170. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  171. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  172. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  173. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  174. package/lib/cjs/polyface/AuxData.js.map +1 -1
  175. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  176. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  177. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  178. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  179. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  180. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  181. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +42 -50
  182. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  183. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +81 -105
  184. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  185. package/lib/cjs/polyface/Polyface.d.ts +166 -120
  186. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  187. package/lib/cjs/polyface/Polyface.js +251 -162
  188. package/lib/cjs/polyface/Polyface.js.map +1 -1
  189. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +18 -10
  190. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  191. package/lib/cjs/polyface/PolyfaceBuilder.js +27 -21
  192. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  193. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  194. package/lib/cjs/polyface/PolyfaceData.d.ts +142 -86
  195. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  196. package/lib/cjs/polyface/PolyfaceData.js +305 -164
  197. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  198. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  199. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  200. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  201. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  202. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  203. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  204. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  205. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  206. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  207. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  208. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  209. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  210. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  211. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  212. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  213. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  214. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  215. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  216. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  217. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  218. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  219. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  220. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  221. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  222. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  223. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  224. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  225. package/lib/cjs/solid/Box.js.map +1 -1
  226. package/lib/cjs/solid/Cone.js.map +1 -1
  227. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  228. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  229. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  230. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  231. package/lib/cjs/solid/Sphere.js.map +1 -1
  232. package/lib/cjs/solid/SweepContour.js.map +1 -1
  233. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  234. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  235. package/lib/cjs/topology/Graph.d.ts +2 -8
  236. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  237. package/lib/cjs/topology/Graph.js +0 -3
  238. package/lib/cjs/topology/Graph.js.map +1 -1
  239. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  240. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  241. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  242. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  243. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  244. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  245. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  246. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  247. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  248. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  249. package/lib/cjs/topology/MaskManager.js.map +1 -1
  250. package/lib/cjs/topology/Merging.js.map +1 -1
  251. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  252. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  253. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  254. package/lib/cjs/topology/Triangulation.d.ts +18 -7
  255. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  256. package/lib/cjs/topology/Triangulation.js +50 -9
  257. package/lib/cjs/topology/Triangulation.js.map +1 -1
  258. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  259. package/lib/esm/Constant.js.map +1 -1
  260. package/lib/esm/Geometry.d.ts +15 -0
  261. package/lib/esm/Geometry.d.ts.map +1 -1
  262. package/lib/esm/Geometry.js +27 -0
  263. package/lib/esm/Geometry.js.map +1 -1
  264. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  265. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  266. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  267. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  268. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  269. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  270. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  271. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  272. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  273. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  274. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  275. package/lib/esm/bspline/KnotVector.js.map +1 -1
  276. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  277. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  278. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  279. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  280. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  281. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  282. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  283. package/lib/esm/clipping/ClipVector.js.map +1 -1
  284. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  285. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  286. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  287. package/lib/esm/core-geometry.js.map +1 -1
  288. package/lib/esm/curve/Arc3d.js.map +1 -1
  289. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  290. package/lib/esm/curve/CoordinateXYZ.d.ts +10 -13
  291. package/lib/esm/curve/CoordinateXYZ.d.ts.map +1 -1
  292. package/lib/esm/curve/CoordinateXYZ.js +16 -15
  293. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  294. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  295. package/lib/esm/curve/CurveCollection.js.map +1 -1
  296. package/lib/esm/curve/CurveCurve.js.map +1 -1
  297. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  298. package/lib/esm/curve/CurveFactory.js.map +1 -1
  299. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  300. package/lib/esm/curve/CurveOps.js.map +1 -1
  301. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  302. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  303. package/lib/esm/curve/CurveTypes.js.map +1 -1
  304. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  305. package/lib/esm/curve/GeometryQuery.d.ts +17 -17
  306. package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
  307. package/lib/esm/curve/GeometryQuery.js +16 -15
  308. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  309. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  310. package/lib/esm/curve/LineString3d.js.map +1 -1
  311. package/lib/esm/curve/Loop.js.map +1 -1
  312. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  313. package/lib/esm/curve/ParityRegion.js.map +1 -1
  314. package/lib/esm/curve/Path.js.map +1 -1
  315. package/lib/esm/curve/PointString3d.d.ts +17 -13
  316. package/lib/esm/curve/PointString3d.d.ts.map +1 -1
  317. package/lib/esm/curve/PointString3d.js +35 -20
  318. package/lib/esm/curve/PointString3d.js.map +1 -1
  319. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  320. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  321. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  322. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  323. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  324. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  325. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  326. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  327. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  328. package/lib/esm/curve/RegionOps.js.map +1 -1
  329. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  330. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  331. package/lib/esm/curve/UnionRegion.js.map +1 -1
  332. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  333. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  334. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  335. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  336. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  337. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  338. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  339. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  340. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  341. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  342. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  343. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  344. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  345. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  346. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  347. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  348. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  349. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  350. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  351. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  352. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  353. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  354. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  355. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  356. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  357. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +1 -1
  358. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  359. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  360. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +1 -1
  361. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  362. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  363. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  364. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  365. package/lib/esm/geometry3d/Angle.js.map +1 -1
  366. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  367. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  368. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  369. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  370. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  371. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  372. package/lib/esm/geometry3d/FrameBuilder.js +3 -0
  373. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  374. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  375. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  376. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  377. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  378. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  379. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +8 -2
  380. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  381. package/lib/esm/geometry3d/GrowableXYZArray.js +11 -2
  382. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  383. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  384. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  385. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  386. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  387. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  388. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  389. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  390. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  391. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  392. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  393. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  394. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  395. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  396. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  397. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  398. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  399. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  400. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  401. package/lib/esm/geometry3d/Range.js.map +1 -1
  402. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  403. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  404. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  405. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  406. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  407. package/lib/esm/geometry3d/Transform.js.map +1 -1
  408. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  409. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  410. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  411. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  412. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  413. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  414. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  415. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  416. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  417. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  418. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  419. package/lib/esm/numerics/Complex.js.map +1 -1
  420. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  421. package/lib/esm/numerics/Newton.js.map +1 -1
  422. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  423. package/lib/esm/numerics/PolarData.js.map +1 -1
  424. package/lib/esm/numerics/Polynomials.js.map +1 -1
  425. package/lib/esm/numerics/Quadrature.js.map +1 -1
  426. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  427. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  428. package/lib/esm/numerics/UnionFind.js.map +1 -1
  429. package/lib/esm/numerics/UsageSums.js.map +1 -1
  430. package/lib/esm/polyface/AuxData.js.map +1 -1
  431. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  432. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  433. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  434. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  435. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  436. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  437. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +42 -50
  438. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  439. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +80 -103
  440. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  441. package/lib/esm/polyface/Polyface.d.ts +166 -120
  442. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  443. package/lib/esm/polyface/Polyface.js +251 -162
  444. package/lib/esm/polyface/Polyface.js.map +1 -1
  445. package/lib/esm/polyface/PolyfaceBuilder.d.ts +18 -10
  446. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  447. package/lib/esm/polyface/PolyfaceBuilder.js +27 -21
  448. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  449. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  450. package/lib/esm/polyface/PolyfaceData.d.ts +142 -86
  451. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  452. package/lib/esm/polyface/PolyfaceData.js +305 -164
  453. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  454. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  455. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  456. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  457. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  458. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  459. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  460. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  461. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  462. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  463. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  464. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  465. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  466. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  467. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  468. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  469. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  470. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  471. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  472. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  473. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  474. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  475. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  476. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  477. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  478. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  479. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  480. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  481. package/lib/esm/solid/Box.js.map +1 -1
  482. package/lib/esm/solid/Cone.js.map +1 -1
  483. package/lib/esm/solid/LinearSweep.js.map +1 -1
  484. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  485. package/lib/esm/solid/RuledSweep.js.map +1 -1
  486. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  487. package/lib/esm/solid/Sphere.js.map +1 -1
  488. package/lib/esm/solid/SweepContour.js.map +1 -1
  489. package/lib/esm/solid/TorusPipe.js.map +1 -1
  490. package/lib/esm/topology/ChainMerge.js.map +1 -1
  491. package/lib/esm/topology/Graph.d.ts +2 -8
  492. package/lib/esm/topology/Graph.d.ts.map +1 -1
  493. package/lib/esm/topology/Graph.js +0 -3
  494. package/lib/esm/topology/Graph.js.map +1 -1
  495. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  496. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  497. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  498. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  499. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  500. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  501. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  502. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  503. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  504. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  505. package/lib/esm/topology/MaskManager.js.map +1 -1
  506. package/lib/esm/topology/Merging.js.map +1 -1
  507. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  508. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  509. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  510. package/lib/esm/topology/Triangulation.d.ts +18 -7
  511. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  512. package/lib/esm/topology/Triangulation.js +50 -9
  513. package/lib/esm/topology/Triangulation.js.map +1 -1
  514. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  515. package/package.json +4 -3
@@ -6,6 +6,7 @@
6
6
  * @module Polyface
7
7
  */
8
8
  /* eslint-disable @typescript-eslint/naming-convention, no-empty */
9
+ // cspell:word internaldocs
9
10
  import { GeometryQuery } from "../curve/GeometryQuery";
10
11
  import { Geometry } from "../Geometry";
11
12
  import { GrowableXYArray } from "../geometry3d/GrowableXYArray";
@@ -21,6 +22,7 @@ import { PolyfaceData } from "./PolyfaceData";
21
22
  * @public
22
23
  */
23
24
  export class Polyface extends GeometryQuery {
25
+ /** Constructor */
24
26
  constructor(data) {
25
27
  super();
26
28
  /** String name for schema properties */
@@ -28,69 +30,102 @@ export class Polyface extends GeometryQuery {
28
30
  this.data = data;
29
31
  }
30
32
  /** Flag indicating if the mesh display must assume both sides are visible. */
31
- get twoSided() { return this.data.twoSided; }
32
- set twoSided(value) { this.data.twoSided = value; }
33
- /** Flag indicating if the mesh closure is unknown (0), open sheet (1), closed (2) */
34
- get expectedClosure() { return this.data.expectedClosure; }
35
- set expectedClosure(value) { this.data.expectedClosure = value; }
33
+ get twoSided() {
34
+ return this.data.twoSided;
35
+ }
36
+ set twoSided(value) {
37
+ this.data.twoSided = value;
38
+ }
39
+ /**
40
+ * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).
41
+ * * A boundary edge of a mesh is defined as an edge with only one connected facet.
42
+ * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).
43
+ */
44
+ get expectedClosure() {
45
+ return this.data.expectedClosure;
46
+ }
47
+ set expectedClosure(value) {
48
+ this.data.expectedClosure = value;
49
+ }
36
50
  /**
37
- * Check validity of indices into a data array.
38
- * * It is valid to have both indices and data undefined.
39
- * * It is NOT valid for just one to be defined.
40
- * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.
41
- * @param indices array of indices.
42
- * @param indexPositionA first index to test
43
- * @param indexPositionB one past final index to test
44
- * @param data data array
45
- * @param dataLength length of data array
46
- */
51
+ * Check validity of indices into a data array.
52
+ * * It is valid to have both indices and data undefined.
53
+ * * It is NOT valid for just one to be defined.
54
+ * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.
55
+ * @param indices array of indices.
56
+ * @param indexPositionA first index to test.
57
+ * @param indexPositionB one past final index to test.
58
+ * @param data data array.
59
+ * @param dataLength length of data array.
60
+ */
47
61
  static areIndicesValid(indices, indexPositionA, indexPositionB, data, dataLength) {
48
62
  if (indices === undefined && data === undefined)
49
63
  return true;
50
- if (!indices || !data)
64
+ if (indices === undefined || data === undefined)
51
65
  return false;
52
66
  if (indexPositionA < 0 || indexPositionA >= indices.length)
53
67
  return false;
54
- if (indexPositionB < indexPositionA || indexPositionB > indices.length)
68
+ if (indexPositionB <= indexPositionA || indexPositionB > indices.length)
55
69
  return false;
56
70
  for (let i = indexPositionA; i < indexPositionB; i++)
57
71
  if (indices[i] < 0 || indices[i] >= dataLength)
58
72
  return false;
59
73
  return true;
60
74
  }
61
- /**
62
- * Returns the number of facets of this polyface. Subclasses should override.
63
- */
75
+ /** Returns the number of facets of this polyface. Subclasses should override. */
64
76
  get facetCount() {
65
77
  return undefined;
66
78
  }
67
79
  }
68
80
  /**
69
- * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point, normal, param, and color indices.
81
+ * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,
82
+ * normal, param, and color indices.
70
83
  * @public
71
84
  */
72
85
  export class IndexedPolyface extends Polyface {
86
+ /**
87
+ * Constructor for a new polyface.
88
+ * @param data PolyfaceData arrays to capture.
89
+ * @param facetStart optional array of facet start indices (e.g. known during clone)
90
+ * @param facetToFacetData optional array of face identifiers (e.g. known during clone)
91
+ */
92
+ constructor(data, facetStart, facetToFaceData) {
93
+ super(data);
94
+ if (facetStart)
95
+ this._facetStart = facetStart.slice(); // deep copy
96
+ else {
97
+ this._facetStart = [];
98
+ this._facetStart.push(0);
99
+ }
100
+ if (facetToFaceData)
101
+ this._facetToFaceData = facetToFaceData.slice(); // deep copy
102
+ else
103
+ this._facetToFaceData = [];
104
+ }
73
105
  /** Test if other is an instance of `IndexedPolyface` */
74
- isSameGeometryClass(other) { return other instanceof IndexedPolyface; }
106
+ isSameGeometryClass(other) {
107
+ return other instanceof IndexedPolyface;
108
+ }
75
109
  /** Tests for equivalence between two IndexedPolyfaces. */
76
110
  isAlmostEqual(other) {
77
111
  if (other instanceof IndexedPolyface) {
78
- return this.data.isAlmostEqual(other.data) && NumberArray.isExactEqual(this._facetStart, other._facetStart) &&
112
+ return this.data.isAlmostEqual(other.data) &&
113
+ NumberArray.isExactEqual(this._facetStart, other._facetStart) &&
79
114
  NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);
80
115
  }
81
116
  return false;
82
117
  }
118
+ /** Returns true if either the point array or the point index array is empty. */
119
+ get isEmpty() {
120
+ return this.data.pointCount === 0 || this.data.pointIndex.length === 0;
121
+ }
83
122
  /**
84
- * Returns true if either the point array or the point index array is empty.
85
- */
86
- get isEmpty() { return this.data.pointCount === 0 || this.data.pointIndex.length === 0; }
87
- /**
88
- * * apply the transform to points
89
- * * apply the (inverse transpose of) the matrix part to normals
90
- * * If determinant is negative, also
123
+ * Transform the mesh.
124
+ * * Apply the transform to points.
125
+ * * Apply the (inverse transpose of the) matrix part to normals.
126
+ * * If determinant of the transform matrix is negative, also
91
127
  * * negate normals
92
128
  * * reverse index order around each facet.
93
- * @param transform
94
129
  */
95
130
  tryTransformInPlace(transform) {
96
131
  if (!this.data.tryTransformInPlace(transform))
@@ -111,52 +146,47 @@ export class IndexedPolyface extends Polyface {
111
146
  const result = new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());
112
147
  return result;
113
148
  }
114
- /** Return a deep clone with transformed points and normals */
149
+ /**
150
+ * Return a deep clone with transformed points and normals.
151
+ * @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.
152
+ */
115
153
  cloneTransformed(transform) {
116
154
  const result = this.clone();
117
155
  result.tryTransformInPlace(transform);
118
156
  return result;
119
157
  }
120
158
  /** Reverse the order of indices around all facets. */
121
- reverseIndices() { this.data.reverseIndices(this._facetStart); }
159
+ reverseIndices() {
160
+ this.data.reverseIndices(this._facetStart);
161
+ }
122
162
  /** Reverse the direction of all normal vectors. */
123
- reverseNormals() { this.data.reverseNormals(); }
124
- /** return face data using a facet index. This is the REFERENCE to the FacetFaceData, not a copy. Returns undefined if none found. */
163
+ reverseNormals() {
164
+ this.data.reverseNormals();
165
+ }
166
+ /**
167
+ * Return face data using a facet index.
168
+ * * Returns `undefined` if none found.
169
+ * * This is the REFERENCE to the FacetFaceData not a copy.
170
+ */
125
171
  tryGetFaceData(i) {
172
+ if (i < 0 || i >= this._facetToFaceData.length)
173
+ return undefined;
126
174
  const faceIndex = this._facetToFaceData[i];
127
- if (faceIndex >= this.data.face.length)
175
+ if (faceIndex < 0 || faceIndex >= this.data.face.length)
128
176
  return undefined;
129
177
  return this.data.face[faceIndex];
130
178
  }
131
179
  /**
132
- * Constructor for a new polyface.
133
- * @param data PolyfaceData arrays to capture.
134
- * @param facetStart optional array of facet start indices (e.g. known during clone)
135
- * @param facetToFacetData optional array of face identifiers (e.g. known during clone)
136
- */
137
- constructor(data, facetStart, facetToFaceData) {
138
- super(data);
139
- if (facetStart)
140
- this._facetStart = facetStart.slice();
141
- else {
142
- this._facetStart = [];
143
- this._facetStart.push(0);
144
- }
145
- if (facetToFaceData)
146
- this._facetToFaceData = facetToFaceData.slice();
147
- else
148
- this._facetToFaceData = [];
149
- }
150
- /**
151
- * * Add facets from source to this polyface.
152
- * * Optionally reverse facet indices as per PolyfaceData.reverseIndicesSingleFacet() with preserveStart = false, and invert source normals.
153
- * * Optionally apply a transform to points and normals.
180
+ * Add facets from `source` to `this` polyface.
181
+ * * Optionally reverse facet indices as per `PolyfaceData.reverseIndicesSingleFacet()` with `preserveStart = false` and
182
+ * invert source normals.
183
+ * * Optionally apply a `transform` to points and normals.
154
184
  * * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.
155
185
  */
156
186
  addIndexedPolyface(source, reversed, transform) {
157
187
  const numSourceFacets = source.facetCount;
158
- // Add point, point index, and edge visibility data
159
- // Note: there is no need to build an intermediate index map since all points are added
188
+ // add point, point index, and edge visibility data
189
+ // note that there is no need to build an intermediate index map since all points are added
160
190
  const startOfNewPoints = this.data.point.length;
161
191
  const xyz = Point3d.create();
162
192
  for (let i = 0; i < source.data.point.length; i++) {
@@ -183,11 +213,11 @@ export class IndexedPolyface extends Polyface {
183
213
  }
184
214
  this.terminateFacet(false);
185
215
  }
186
- // Add param and param index data
216
+ // add param and param index data
187
217
  if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {
188
218
  const startOfNewParams = this.data.param.length;
189
219
  this.data.param.pushFromGrowableXYArray(source.data.param);
190
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match normals
220
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals
191
221
  const i0 = source._facetStart[i];
192
222
  const i1 = source._facetStart[i + 1];
193
223
  if (reversed) {
@@ -200,7 +230,7 @@ export class IndexedPolyface extends Polyface {
200
230
  }
201
231
  }
202
232
  }
203
- // Add normal and normal index data
233
+ // add normal and normal index data
204
234
  if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {
205
235
  const startOfNewNormals = this.data.normal.length;
206
236
  for (let i = 0; i < source.data.normal.length; i++) {
@@ -211,7 +241,7 @@ export class IndexedPolyface extends Polyface {
211
241
  sourceNormal.scaleInPlace(-1.0);
212
242
  this.addNormal(sourceNormal);
213
243
  }
214
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match normals
244
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals
215
245
  const i0 = source._facetStart[i];
216
246
  const i1 = source._facetStart[i + 1];
217
247
  if (reversed) {
@@ -224,12 +254,12 @@ export class IndexedPolyface extends Polyface {
224
254
  }
225
255
  }
226
256
  }
227
- // Add color and color index data
257
+ // add color and color index data
228
258
  if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {
229
259
  const startOfNewColors = this.data.color.length;
230
260
  for (const sourceColor of source.data.color)
231
261
  this.addColor(sourceColor);
232
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match colors
262
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors
233
263
  const i0 = source._facetStart[i];
234
264
  const i1 = source._facetStart[i + 1];
235
265
  if (reversed) {
@@ -242,7 +272,7 @@ export class IndexedPolyface extends Polyface {
242
272
  }
243
273
  }
244
274
  }
245
- // Add face and facetToFace index data
275
+ // add face and facetToFace index data
246
276
  if (source.data.face.length !== 0) {
247
277
  const startOfNewFaceData = this.data.face.length;
248
278
  for (const face of source.data.face) {
@@ -254,25 +284,31 @@ export class IndexedPolyface extends Polyface {
254
284
  }
255
285
  }
256
286
  }
257
- /** Return the total number of param indices in zero-terminated style, which includes
258
- * * all the indices in the packed zero-based table
287
+ /**
288
+ * Return the total number of indices in zero-terminated style, which includes
289
+ * * all the indices in the packed zero-based table.
259
290
  * * one additional index for the zero-terminator of each facet.
260
- * @note Note that all index arrays (point, normal, param, color) have the same counts, so there
291
+ * @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there
261
292
  * is not a separate query for each of them.
262
293
  */
263
- get zeroTerminatedIndexCount() { return this.data.pointIndex.length + this._facetStart.length - 1; }
264
- /** Create an empty facet set, with coordinate and index data to be supplied later.
265
- * @param needNormals true if normals will be constructed
266
- * @param needParams true if uv parameters will be constructed
267
- * @param needColors true if colors will e constructed.
294
+ get zeroTerminatedIndexCount() {
295
+ return this.data.pointIndex.length + this._facetStart.length - 1;
296
+ }
297
+ /**
298
+ * Create an empty facet set with coordinate and index data to be supplied later.
299
+ * @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.
300
+ * @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.
301
+ * @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.
302
+ * @param twoSided `true` if the facets are to be considered viewable from the back; `false` (default) if not.
268
303
  */
269
304
  static create(needNormals = false, needParams = false, needColors = false, twoSided = false) {
270
305
  return new IndexedPolyface(new PolyfaceData(needNormals, needParams, needColors, twoSided));
271
306
  }
272
- /** add (a clone of ) a point. return its 0 based index.
273
- * @param point point coordinates
274
- * @param priorIndex optional index of prior point to check for repeated coordinates
275
- * @returns Returns the zero-based index of the added or reused point.
307
+ /**
308
+ * Add (a clone of) a point to point array.
309
+ * @param point the point.
310
+ * @param priorIndex (optional) index of prior point to check for possible duplicate value.
311
+ * @returns the zero-based index of the added or duplicate point.
276
312
  */
277
313
  addPoint(point, priorIndex) {
278
314
  if (priorIndex !== undefined) {
@@ -283,12 +319,21 @@ export class IndexedPolyface extends Polyface {
283
319
  this.data.point.pushXYZ(point.x, point.y, point.z);
284
320
  return this.data.point.length - 1;
285
321
  }
286
- /** add a point.
287
- * @returns Returns the zero-based index of the added point.
322
+ /**
323
+ * Add a point to point array.
324
+ * @param x the x coordinate of point.
325
+ * @param y the y coordinate of point.
326
+ * @param z the z coordinate of point.
327
+ * @returns the zero-based index of the added point.
288
328
  */
289
- addPointXYZ(x, y, z) { this.data.point.pushXYZ(x, y, z); return this.data.point.length - 1; }
290
- /** Add a uv param.
291
- * @returns 0-based index of the added param.
329
+ addPointXYZ(x, y, z) {
330
+ this.data.point.pushXYZ(x, y, z);
331
+ return this.data.point.length - 1;
332
+ }
333
+ /**
334
+ * Add (a clone of) a uv parameter to the parameter array.
335
+ * @param param the parameter.
336
+ * @returns zero-based index of the added param.
292
337
  */
293
338
  addParam(param) {
294
339
  if (!this.data.param)
@@ -296,10 +341,13 @@ export class IndexedPolyface extends Polyface {
296
341
  this.data.param.push(param);
297
342
  return this.data.param.length - 1;
298
343
  }
299
- /** Add a uv parameter to the parameter array.
344
+ /**
345
+ * Add a uv parameter to the parameter array.
346
+ * @param u the u part of parameter.
347
+ * @param v the v part of parameter.
300
348
  * @param priorIndexA first index to check for possible duplicate value.
301
349
  * @param priorIndexB second index to check for possible duplicate value.
302
- * @returns 0-based index of the added or reused param.
350
+ * @returns zero-based index of the added or duplicate parameter.
303
351
  */
304
352
  addParamUV(u, v, priorIndexA, priorIndexB) {
305
353
  if (!this.data.param)
@@ -311,37 +359,39 @@ export class IndexedPolyface extends Polyface {
311
359
  this.data.param.pushXY(u, v);
312
360
  return this.data.param.length - 1;
313
361
  }
314
- /** Add a normal vector
362
+ /**
363
+ * Add (a clone of) a normal vector to the normal array.
364
+ * @param normal the normal vector.
315
365
  * @param priorIndexA first index to check for possible duplicate value.
316
366
  * @param priorIndexB second index to check for possible duplicate value.
317
- * @returns 0-based index of the added or reused normal.
367
+ * @returns zero-based index of the added or duplicate normal.
318
368
  */
319
369
  addNormal(normal, priorIndexA, priorIndexB) {
370
+ // check if `normal` is duplicate of `dataNormal` at index `i`
371
+ const normalIsDuplicate = (i) => {
372
+ const distance = this.data.normal.distanceIndexToPoint(i, normal);
373
+ return distance !== undefined && Geometry.isSmallMetricDistance(distance);
374
+ };
320
375
  if (this.data.normal !== undefined) {
321
- let distance;
322
- if (priorIndexA !== undefined) {
323
- distance = this.data.normal.distanceIndexToPoint(priorIndexA, normal);
324
- if (distance !== undefined && Geometry.isSmallMetricDistance(distance))
325
- return priorIndexA;
326
- }
327
- if (priorIndexB !== undefined) {
328
- distance = this.data.normal.distanceIndexToPoint(priorIndexB, normal);
329
- if (distance !== undefined && Geometry.isSmallMetricDistance(distance))
330
- return priorIndexB;
331
- }
332
- // Note: Do NOT attempt to chain to tail if no prior indices given.
333
- // But if they are, look also to the tail.
376
+ if (priorIndexA !== undefined && normalIsDuplicate(priorIndexA))
377
+ return priorIndexA;
378
+ if (priorIndexB !== undefined && normalIsDuplicate(priorIndexB))
379
+ return priorIndexB;
380
+ // check the tail index for possible duplicate
334
381
  if (priorIndexA !== undefined || priorIndexB !== undefined) {
335
382
  const tailIndex = this.data.normal.length - 1;
336
- distance = this.data.normal.distanceIndexToPoint(tailIndex, normal);
337
- if (distance !== undefined && Geometry.isSmallMetricDistance(distance))
383
+ if (normalIsDuplicate(tailIndex))
338
384
  return tailIndex;
339
385
  }
340
386
  }
341
387
  return this.addNormalXYZ(normal.x, normal.y, normal.z);
342
388
  }
343
- /** Add a normal vector given by direct coordinates
344
- * @returns 0-based index of the added or reused param.
389
+ /**
390
+ * Add a normal vector to the normal array.
391
+ * @param x the x coordinate of normal.
392
+ * @param y the y coordinate of normal.
393
+ * @param z the z coordinate of normal.
394
+ * @returns zero-based index of the added normal vector.
345
395
  */
346
396
  addNormalXYZ(x, y, z) {
347
397
  if (!this.data.normal)
@@ -349,8 +399,10 @@ export class IndexedPolyface extends Polyface {
349
399
  this.data.normal.pushXYZ(x, y, z);
350
400
  return this.data.normal.length - 1;
351
401
  }
352
- /** Add a color
353
- * @returns 0-based index of the added or reused color.
402
+ /**
403
+ * Add a color to the color array
404
+ * @param color the color.
405
+ * @returns zero-based index of the added color.
354
406
  */
355
407
  addColor(color) {
356
408
  if (!this.data.color)
@@ -359,46 +411,54 @@ export class IndexedPolyface extends Polyface {
359
411
  return this.data.color.length - 1;
360
412
  }
361
413
  /** Add a point index with edge visibility flag. */
362
- addPointIndex(index, visible = true) { this.data.pointIndex.push(index); this.data.edgeVisible.push(visible); }
363
- /** Add a normal index */
414
+ addPointIndex(index, visible = true) {
415
+ this.data.pointIndex.push(index);
416
+ this.data.edgeVisible.push(visible);
417
+ }
418
+ /** Add a normal index. */
364
419
  addNormalIndex(index) {
365
420
  if (!this.data.normalIndex)
366
421
  this.data.normalIndex = [];
367
422
  this.data.normalIndex.push(index);
368
423
  }
369
- /** Add a param index */
424
+ /** Add a param index. */
370
425
  addParamIndex(index) {
371
426
  if (!this.data.paramIndex)
372
427
  this.data.paramIndex = [];
373
428
  this.data.paramIndex.push(index);
374
429
  }
375
- /** Add a color index */
430
+ /** Add a color index. */
376
431
  addColorIndex(index) {
377
432
  if (!this.data.colorIndex)
378
433
  this.data.colorIndex = [];
379
434
  this.data.colorIndex.push(index);
380
435
  }
381
- /** clean up the open facet. return the returnValue (so caller can easily return cleanupOpenFacet("message")) */
436
+ /**
437
+ * Clean up the open facet.
438
+ * @deprecated in 4.x to remove nebulous "open facet" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]
439
+ * instead.
440
+ */
382
441
  cleanupOpenFacet() {
383
442
  this.data.trimAllIndexArrays(this.data.pointIndex.length);
384
443
  }
385
- /** announce the end of construction of a facet.
386
- *
387
- * * The "open" facet is checked for:
388
- *
389
- * ** Same number of indices among all active index arrays -- point, normal, param, color
390
- * ** All indices are within bounds of the respective data arrays.
391
- * * in error cases, all index arrays are trimmed back to the size when previous facet was terminated.
392
- * * "undefined" return is normal. Any other return is a description of an error.
444
+ /**
445
+ * Announce the end of construction of a facet.
446
+ * * Optionally check for:
447
+ * * Same number of indices among all active index arrays -- point, normal, param, color
448
+ * * All indices are within bounds of the respective data arrays.
449
+ * * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.
450
+ * * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.
393
451
  */
394
452
  terminateFacet(validateAllIndices = true) {
395
453
  const numFacets = this._facetStart.length - 1;
396
- const lengthA = this._facetStart[numFacets]; // number of indices in accepted facets
397
- const lengthB = this.data.pointIndex.length; // number of indices including the open facet
454
+ // number of indices in accepted facets
455
+ const lengthA = this._facetStart[numFacets];
456
+ // number of indices in all facets (accepted facet plus the last facet to be accepted)
457
+ const lengthB = this.data.pointIndex.length;
398
458
  if (validateAllIndices) {
399
459
  const messages = [];
400
460
  if (lengthB < lengthA + 2)
401
- messages.push("Less than 3 indices in open facet");
461
+ messages.push("Less than 3 indices in the last facet");
402
462
  if (this.data.normalIndex && this.data.normalIndex.length !== lengthB)
403
463
  messages.push("normalIndex count must match pointIndex count");
404
464
  if (this.data.paramIndex && this.data.paramIndex.length !== lengthB)
@@ -407,71 +467,100 @@ export class IndexedPolyface extends Polyface {
407
467
  messages.push("colorIndex count must equal pointIndex count");
408
468
  if (this.data.edgeVisible.length !== lengthB)
409
469
  messages.push("visibleIndex count must equal pointIndex count");
470
+ if (!Polyface.areIndicesValid(this.data.pointIndex, lengthA, lengthB, this.data.point, this.data.point ? this.data.point.length : 0))
471
+ messages.push("invalid point indices in the last facet");
410
472
  if (!Polyface.areIndicesValid(this.data.normalIndex, lengthA, lengthB, this.data.normal, this.data.normal ? this.data.normal.length : 0))
411
- messages.push("invalid normal indices in open facet");
473
+ messages.push("invalid normal indices in the last facet");
474
+ if (!Polyface.areIndicesValid(this.data.paramIndex, lengthA, lengthB, this.data.param, this.data.param ? this.data.param.length : 0))
475
+ messages.push("invalid param indices in the last facet");
476
+ if (!Polyface.areIndicesValid(this.data.colorIndex, lengthA, lengthB, this.data.color, this.data.color ? this.data.color.length : 0))
477
+ messages.push("invalid color indices in the last facet");
412
478
  if (messages.length > 0) {
413
- this.cleanupOpenFacet();
479
+ this.data.trimAllIndexArrays(lengthA);
414
480
  return messages;
415
481
  }
416
482
  }
417
- // appending to facetStart accepts the facet !!!
418
- this._facetStart.push(lengthB);
483
+ this._facetStart.push(lengthB); // append start index of the future facet
419
484
  return undefined;
420
485
  }
421
- /**
422
- * All terminated facets added since the declaration of the previous face
423
- * will be grouped into a new face with their own 2D range.
424
- */
425
- /** (read-only property) number of facets */
426
- get facetCount() { return this._facetStart.length - 1; }
427
- /** (read-only property) number of faces */
428
- get faceCount() { return this.data.faceCount; }
429
- /** (read-only property) number of points */
430
- get pointCount() { return this.data.pointCount; }
431
- /** (read-only property) number of colors */
432
- get colorCount() { return this.data.colorCount; }
433
- /** (read-only property) number of parameters */
434
- get paramCount() { return this.data.paramCount; }
435
- /** (read-only property) number of normals */
436
- get normalCount() { return this.data.normalCount; }
486
+ /** Number of facets (read-only property). */
487
+ get facetCount() {
488
+ return this._facetStart.length - 1;
489
+ }
490
+ /** Number of faces (read-only property). */
491
+ get faceCount() {
492
+ return this.data.faceCount;
493
+ }
494
+ /** Number of points (read-only property). */
495
+ get pointCount() {
496
+ return this.data.pointCount;
497
+ }
498
+ /** Number of colors (read-only property). */
499
+ get colorCount() {
500
+ return this.data.colorCount;
501
+ }
502
+ /** Number of parameters (read-only property). */
503
+ get paramCount() {
504
+ return this.data.paramCount;
505
+ }
506
+ /** Number of normals (read-only property). */
507
+ get normalCount() {
508
+ return this.data.normalCount;
509
+ }
510
+ /** Test if `index` is a valid facet index. */
511
+ isValidFacetIndex(index) {
512
+ return index >= 0 && index < this.facetCount;
513
+ }
437
514
  /** Return the number of edges in a particular facet. */
438
515
  numEdgeInFacet(facetIndex) {
439
516
  if (this.isValidFacetIndex(facetIndex))
440
517
  return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];
441
518
  return 0;
442
519
  }
443
- /** test if `index` is a valid facet index. */
444
- isValidFacetIndex(index) { return index >= 0 && index + 1 < this._facetStart.length; }
445
- /** ASSUME valid facet index . .. return its start index in index arrays. */
446
- facetIndex0(index) { return this._facetStart[index]; }
447
- /** ASSUME valid facet index . .. return its end index in index arrays. */
448
- facetIndex1(index) { return this._facetStart[index + 1]; }
449
- /** create a visitor for this polyface */
450
- createVisitor(numWrap = 0) { return IndexedPolyfaceVisitor.create(this, numWrap); }
520
+ /** ASSUME valid facet index. Return start index of facet in pointIndex arrays. */
521
+ facetIndex0(index) {
522
+ return this._facetStart[index];
523
+ }
524
+ /** ASSUME valid facet index. Return one past end index of facet in pointIndex arrays. */
525
+ facetIndex1(index) {
526
+ return this._facetStart[index + 1];
527
+ }
528
+ /** Create a visitor for this polyface */
529
+ createVisitor(numWrap = 0) {
530
+ return IndexedPolyfaceVisitor.create(this, numWrap);
531
+ }
451
532
  /** Return the range of (optionally transformed) points in this mesh. */
452
- range(transform, result) { return this.data.range(result, transform); }
453
- /** Extend `range` with coordinates from this mesh */
454
- extendRange(range, transform) { this.data.range(range, transform); }
455
- /** Given the index of a facet, return the data pertaining to the face it is a part of. */
533
+ range(transform, result) {
534
+ return this.data.range(result, transform);
535
+ }
536
+ /** Extend `range` with coordinates from this mesh. */
537
+ extendRange(range, transform) {
538
+ this.data.range(range, transform);
539
+ }
540
+ /**
541
+ * Given the index of a facet, return the data pertaining to the face it is a part of.
542
+ * @deprecated in 4.x. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.
543
+ */
456
544
  getFaceDataByFacetIndex(facetIndex) {
457
545
  return this.data.face[this._facetToFaceData[facetIndex]];
458
546
  }
459
547
  /**
460
- * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object
461
- * using facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns true if successful, false otherwise.
548
+ * Set new FacetFaceData.
549
+ * * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object using
550
+ * facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns `true` if successful, `false` otherwise.
462
551
  */
463
552
  setNewFaceData(endFacetIndex = 0) {
464
553
  const facetStart = this._facetToFaceData.length;
465
554
  if (facetStart >= this._facetStart.length)
466
555
  return false;
467
- if (0 === endFacetIndex) // The default for endFacetIndex is really the last facet
468
- endFacetIndex = this._facetStart.length; // Last facetStart index corresponds to the next facet if we were to create one
556
+ if (0 === endFacetIndex) // the default for endFacetIndex is really the last facet
557
+ endFacetIndex = this._facetStart.length; // last facet index corresponds to the future facet
469
558
  const faceData = FacetFaceData.createNull();
470
559
  const visitor = IndexedPolyfaceVisitor.create(this, 0);
471
- if (!visitor.moveToReadIndex(facetStart)) { // Move visitor to first facet of new face
560
+ if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face
472
561
  return false;
473
562
  }
474
- // If parameter range is provided (by the polyface planeSet clipper) then use it
563
+ // if parameter range is provided (by the polyface planeSet clipper) then use it
475
564
  const paramDefined = this.data.param !== undefined;
476
565
  const setParamRange = faceData.paramRange.isNull && paramDefined;
477
566
  do {
@@ -486,7 +575,7 @@ export class IndexedPolyface extends Polyface {
486
575
  this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);
487
576
  return true;
488
577
  }
489
- /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)` */
578
+ /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */
490
579
  dispatchToGeometryHandler(handler) {
491
580
  return handler.handleIndexedPolyface(this);
492
581
  }