@itwin/core-geometry 4.5.0-dev.21 → 4.5.0-dev.24

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 (72) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Geometry.js.map +1 -1
  3. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +1 -1
  4. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  5. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +1 -1
  6. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  7. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  8. package/lib/cjs/geometry3d/FrameBuilder.js +3 -0
  9. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  10. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +8 -2
  11. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  12. package/lib/cjs/geometry3d/GrowableXYZArray.js +11 -2
  13. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  14. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +1 -1
  15. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  16. package/lib/cjs/polyface/Polyface.d.ts +9 -7
  17. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  18. package/lib/cjs/polyface/Polyface.js +17 -10
  19. package/lib/cjs/polyface/Polyface.js.map +1 -1
  20. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +18 -10
  21. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  22. package/lib/cjs/polyface/PolyfaceBuilder.js +27 -21
  23. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  24. package/lib/cjs/polyface/PolyfaceData.d.ts +135 -84
  25. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  26. package/lib/cjs/polyface/PolyfaceData.js +279 -145
  27. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  28. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  29. package/lib/cjs/topology/Graph.d.ts +2 -8
  30. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  31. package/lib/cjs/topology/Graph.js +0 -3
  32. package/lib/cjs/topology/Graph.js.map +1 -1
  33. package/lib/cjs/topology/Triangulation.d.ts +18 -7
  34. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  35. package/lib/cjs/topology/Triangulation.js +50 -9
  36. package/lib/cjs/topology/Triangulation.js.map +1 -1
  37. package/lib/esm/Geometry.js.map +1 -1
  38. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +1 -1
  39. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  40. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +1 -1
  41. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  42. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  43. package/lib/esm/geometry3d/FrameBuilder.js +3 -0
  44. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  45. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +8 -2
  46. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  47. package/lib/esm/geometry3d/GrowableXYZArray.js +11 -2
  48. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  49. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +1 -1
  50. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  51. package/lib/esm/polyface/Polyface.d.ts +9 -7
  52. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  53. package/lib/esm/polyface/Polyface.js +17 -10
  54. package/lib/esm/polyface/Polyface.js.map +1 -1
  55. package/lib/esm/polyface/PolyfaceBuilder.d.ts +18 -10
  56. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  57. package/lib/esm/polyface/PolyfaceBuilder.js +27 -21
  58. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  59. package/lib/esm/polyface/PolyfaceData.d.ts +135 -84
  60. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  61. package/lib/esm/polyface/PolyfaceData.js +279 -145
  62. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  63. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  64. package/lib/esm/topology/Graph.d.ts +2 -8
  65. package/lib/esm/topology/Graph.d.ts.map +1 -1
  66. package/lib/esm/topology/Graph.js +0 -3
  67. package/lib/esm/topology/Graph.js.map +1 -1
  68. package/lib/esm/topology/Triangulation.d.ts +18 -7
  69. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  70. package/lib/esm/topology/Triangulation.js +50 -9
  71. package/lib/esm/topology/Triangulation.js.map +1 -1
  72. package/package.json +3 -3
@@ -88,8 +88,8 @@ class FacetSector {
88
88
  */
89
89
  loadIndexedPointAndDerivativeCoordinatesFromPackedArrays(i, packedXYZ, packedDerivatives, fractions, v) {
90
90
  packedXYZ.getPoint3dAtCheckedPointIndex(i, this.xyz);
91
- if (fractions && v !== undefined)
92
- this.uv = Point2dVector2d_1.Point2d.create(fractions.atUncheckedIndex(i), v);
91
+ if (this.uv && fractions && v !== undefined)
92
+ this.uv.set(fractions.atUncheckedIndex(i), v);
93
93
  this.xyzIndex = -1;
94
94
  this.normalIndex = -1;
95
95
  this.uvIndex = -1;
@@ -774,8 +774,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
774
774
  this.addIndexedTriangleNormalIndexes(sectorA0.normalIndex, sectorA1.normalIndex, sectorA2.normalIndex);
775
775
  if (this._options.needParams)
776
776
  this.addIndexedTriangleParamIndexes(sectorA0.uvIndex, sectorA1.uvIndex, sectorA2.uvIndex);
777
- this.addIndexedTrianglePointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorA2.xyzIndex);
778
- this._polyface.terminateFacet();
777
+ this.addIndexedTrianglePointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorA2.xyzIndex, true);
779
778
  }
780
779
  }
781
780
  addSectorQuadA01B01(sectorA0, sectorA1, sectorB0, sectorB1) {
@@ -791,8 +790,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
791
790
  this.addIndexedQuadNormalIndexes(sectorA0.normalIndex, sectorA1.normalIndex, sectorB0.normalIndex, sectorB1.normalIndex);
792
791
  if (this._options.needParams)
793
792
  this.addIndexedQuadParamIndexes(sectorA0.uvIndex, sectorA1.uvIndex, sectorB0.uvIndex, sectorB1.uvIndex);
794
- this.addIndexedQuadPointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorB0.xyzIndex, sectorB1.xyzIndex);
795
- this._polyface.terminateFacet();
793
+ this.addIndexedQuadPointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorB0.xyzIndex, sectorB1.xyzIndex, true);
796
794
  }
797
795
  }
798
796
  /** Add facets between lineStrings with matched point counts.
@@ -864,14 +862,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
864
862
  for (let i = 1; i < numPoints; i++) {
865
863
  if (this.options.shouldTriangulate) {
866
864
  if (distinctIndices(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i))) {
867
- this.addIndexedTrianglePointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i));
865
+ this.addIndexedTrianglePointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i), false);
868
866
  if (normalA && normalB)
869
867
  this.addIndexedTriangleNormalIndexes(normalA.atUncheckedIndex(i - 1), normalA.atUncheckedIndex(i), normalB.atUncheckedIndex(i - 1));
870
868
  if (paramA && paramB)
871
869
  this.addIndexedTriangleParamIndexes(paramA.atUncheckedIndex(i - 1), paramA.atUncheckedIndex(i), paramB.atUncheckedIndex(i - 1));
872
870
  }
873
871
  if (distinctIndices(pointB.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i - 1))) {
874
- this.addIndexedTrianglePointIndexes(pointA.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1));
872
+ this.addIndexedTrianglePointIndexes(pointA.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), false);
875
873
  if (normalA && normalB)
876
874
  this.addIndexedTriangleNormalIndexes(normalA.atUncheckedIndex(i - 1), normalB.atUncheckedIndex(i), normalB.atUncheckedIndex(i - 1));
877
875
  if (paramA && paramB)
@@ -880,14 +878,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
880
878
  }
881
879
  else {
882
880
  if (pointA.atUncheckedIndex(i - 1) !== pointA.atUncheckedIndex(i) || pointB.atUncheckedIndex(i - 1) !== pointB.atUncheckedIndex(i)) {
883
- this.addIndexedQuadPointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i));
881
+ this.addIndexedQuadPointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i), false);
884
882
  if (normalA && normalB)
885
883
  this.addIndexedQuadNormalIndexes(normalA.atUncheckedIndex(i - 1), normalA.atUncheckedIndex(i), normalB.atUncheckedIndex(i - 1), normalB.atUncheckedIndex(i));
886
884
  if (paramA && paramB)
887
885
  this.addIndexedQuadParamIndexes(paramA.atUncheckedIndex(i - 1), paramA.atUncheckedIndex(i), paramB.atUncheckedIndex(i - 1), paramB.atUncheckedIndex(i));
888
886
  }
889
- this._polyface.terminateFacet();
890
887
  }
888
+ this._polyface.terminateFacet();
891
889
  }
892
890
  }
893
891
  /** Add facets between lineStrings with matched point counts.
@@ -1531,11 +1529,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1531
1529
  /** add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
1532
1530
  addGeometryQuery(g) { g.dispatchToGeometryHandler(this); }
1533
1531
  /**
1534
- *
1535
- * * Visit all faces
1536
- * * Test each face with f(node) for any node on the face.
1537
- * * For each face that passes, pass its coordinates to the builder.
1538
- * * Rely on the builder's compress step to find common vertex coordinates
1532
+ * Add a graph to the builder.
1533
+ * * Visit one node per face
1534
+ * * If `acceptFaceFunction(node)` returns true, pass face coordinates to the builder
1535
+ * * Accepted face edge visibility is determined by `isEdgeVisibleFunction`.
1536
+ * * Rely on the builder's compress step to find common vertex coordinates.
1537
+ * @param graph faces to add as facets
1538
+ * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces
1539
+ * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges
1539
1540
  * @internal
1540
1541
  */
1541
1542
  addGraph(graph, acceptFaceFunction = (node) => Graph_1.HalfEdge.testNodeMaskNotExterior(node), isEdgeVisibleFunction = (node) => Graph_1.HalfEdge.testMateMaskExterior(node)) {
@@ -1574,7 +1575,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1574
1575
  * * terminate the facet
1575
1576
  * @internal
1576
1577
  */
1577
- addGraphFaces(_graph, faces) {
1578
+ addGraphFaces(faces) {
1578
1579
  let index = 0;
1579
1580
  for (const seed of faces) {
1580
1581
  let node = seed;
@@ -1586,21 +1587,26 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
1586
1587
  this._polyface.terminateFacet();
1587
1588
  }
1588
1589
  }
1589
- /** Create a polyface containing the faces of a HalfEdgeGraph, with test function to filter faces.
1590
+ /**
1591
+ * Create a polyface containing the faces of a HalfEdgeGraph, with test functions to filter faces and hide edges.
1592
+ * * This is a static wrapper of [[addGraph]].
1593
+ * @param graph faces to add as facets
1594
+ * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces
1595
+ * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges
1590
1596
  * @internal
1591
1597
  */
1592
- static graphToPolyface(graph, options, acceptFaceFunction = (node) => Graph_1.HalfEdge.testNodeMaskNotExterior(node)) {
1598
+ static graphToPolyface(graph, options, acceptFaceFunction = (node) => Graph_1.HalfEdge.testNodeMaskNotExterior(node), isEdgeVisibleFunction = (node) => Graph_1.HalfEdge.testMateMaskExterior(node)) {
1593
1599
  const builder = PolyfaceBuilder.create(options);
1594
- builder.addGraph(graph, acceptFaceFunction);
1600
+ builder.addGraph(graph, acceptFaceFunction, isEdgeVisibleFunction);
1595
1601
  builder.endFace();
1596
1602
  return builder.claimPolyface();
1597
1603
  }
1598
1604
  /** Create a polyface containing the faces of a HalfEdgeGraph that are specified by the HalfEdge array.
1599
1605
  * @internal
1600
1606
  */
1601
- static graphFacesToPolyface(graph, faces) {
1607
+ static graphFacesToPolyface(faces) {
1602
1608
  const builder = PolyfaceBuilder.create();
1603
- builder.addGraphFaces(graph, faces);
1609
+ builder.addGraphFaces(faces);
1604
1610
  builder.endFace();
1605
1611
  return builder.claimPolyface();
1606
1612
  }