@itwin/core-geometry 5.0.0-dev.3 → 5.0.0-dev.5

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 (185) hide show
  1. package/lib/cjs/curve/Arc3d.d.ts +25 -5
  2. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  3. package/lib/cjs/curve/Arc3d.js +44 -5
  4. package/lib/cjs/curve/Arc3d.js.map +1 -1
  5. package/lib/cjs/curve/CurveCollection.d.ts +6 -2
  6. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  7. package/lib/cjs/curve/CurveCollection.js +11 -2
  8. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  9. package/lib/cjs/curve/LineString3d.d.ts +12 -8
  10. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  11. package/lib/cjs/curve/LineString3d.js +29 -8
  12. package/lib/cjs/curve/LineString3d.js.map +1 -1
  13. package/lib/cjs/curve/Loop.d.ts +12 -6
  14. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  15. package/lib/cjs/curve/Loop.js +12 -6
  16. package/lib/cjs/curve/Loop.js.map +1 -1
  17. package/lib/cjs/curve/Query/CylindricalRange.d.ts +8 -6
  18. package/lib/cjs/curve/Query/CylindricalRange.d.ts.map +1 -1
  19. package/lib/cjs/curve/Query/CylindricalRange.js +13 -9
  20. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  21. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  22. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +24 -18
  23. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  24. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +14 -8
  25. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  26. package/lib/cjs/geometry3d/BarycentricTriangle.js +17 -8
  27. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  28. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +2 -0
  29. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  30. package/lib/cjs/geometry3d/GrowableFloat64Array.js +4 -0
  31. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  32. package/lib/cjs/geometry3d/Matrix3d.d.ts +8 -4
  33. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  34. package/lib/cjs/geometry3d/Matrix3d.js +25 -22
  35. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  36. package/lib/cjs/geometry3d/PolygonOps.d.ts +10 -4
  37. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  38. package/lib/cjs/geometry3d/PolygonOps.js +92 -45
  39. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  40. package/lib/cjs/numerics/Polynomials.d.ts +5 -5
  41. package/lib/cjs/numerics/Polynomials.js +6 -6
  42. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  43. package/lib/cjs/polyface/AuxData.d.ts +2 -2
  44. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  45. package/lib/cjs/polyface/AuxData.js +11 -3
  46. package/lib/cjs/polyface/AuxData.js.map +1 -1
  47. package/lib/cjs/polyface/Polyface.d.ts +3 -5
  48. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  49. package/lib/cjs/polyface/Polyface.js +6 -13
  50. package/lib/cjs/polyface/Polyface.js.map +1 -1
  51. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  52. package/lib/cjs/polyface/PolyfaceBuilder.js +23 -13
  53. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  54. package/lib/cjs/polyface/PolyfaceData.d.ts +13 -3
  55. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  56. package/lib/cjs/polyface/PolyfaceData.js +21 -4
  57. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  58. package/lib/cjs/polyface/PolyfaceQuery.d.ts +2 -2
  59. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  60. package/lib/cjs/polyface/PolyfaceQuery.js +4 -3
  61. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  62. package/lib/cjs/solid/Box.d.ts +9 -3
  63. package/lib/cjs/solid/Box.d.ts.map +1 -1
  64. package/lib/cjs/solid/Box.js +10 -5
  65. package/lib/cjs/solid/Box.js.map +1 -1
  66. package/lib/cjs/solid/Cone.d.ts +3 -2
  67. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  68. package/lib/cjs/solid/Cone.js +3 -3
  69. package/lib/cjs/solid/Cone.js.map +1 -1
  70. package/lib/cjs/solid/LinearSweep.d.ts +9 -3
  71. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  72. package/lib/cjs/solid/LinearSweep.js +9 -4
  73. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  74. package/lib/cjs/solid/RotationalSweep.d.ts +15 -4
  75. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  76. package/lib/cjs/solid/RotationalSweep.js +20 -7
  77. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  78. package/lib/cjs/solid/RuledSweep.d.ts +9 -3
  79. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  80. package/lib/cjs/solid/RuledSweep.js +11 -5
  81. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  82. package/lib/cjs/solid/Sphere.d.ts +17 -7
  83. package/lib/cjs/solid/Sphere.d.ts.map +1 -1
  84. package/lib/cjs/solid/Sphere.js +22 -16
  85. package/lib/cjs/solid/Sphere.js.map +1 -1
  86. package/lib/cjs/solid/SweepContour.d.ts +1 -1
  87. package/lib/cjs/solid/SweepContour.js +1 -1
  88. package/lib/cjs/solid/SweepContour.js.map +1 -1
  89. package/lib/cjs/solid/TorusPipe.d.ts +8 -2
  90. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  91. package/lib/cjs/solid/TorusPipe.js +9 -5
  92. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  93. package/lib/esm/curve/Arc3d.d.ts +25 -5
  94. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  95. package/lib/esm/curve/Arc3d.js +44 -5
  96. package/lib/esm/curve/Arc3d.js.map +1 -1
  97. package/lib/esm/curve/CurveCollection.d.ts +6 -2
  98. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  99. package/lib/esm/curve/CurveCollection.js +11 -2
  100. package/lib/esm/curve/CurveCollection.js.map +1 -1
  101. package/lib/esm/curve/LineString3d.d.ts +12 -8
  102. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  103. package/lib/esm/curve/LineString3d.js +29 -8
  104. package/lib/esm/curve/LineString3d.js.map +1 -1
  105. package/lib/esm/curve/Loop.d.ts +12 -6
  106. package/lib/esm/curve/Loop.d.ts.map +1 -1
  107. package/lib/esm/curve/Loop.js +12 -6
  108. package/lib/esm/curve/Loop.js.map +1 -1
  109. package/lib/esm/curve/Query/CylindricalRange.d.ts +8 -6
  110. package/lib/esm/curve/Query/CylindricalRange.d.ts.map +1 -1
  111. package/lib/esm/curve/Query/CylindricalRange.js +13 -9
  112. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  113. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  114. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +24 -18
  115. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  116. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +14 -8
  117. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  118. package/lib/esm/geometry3d/BarycentricTriangle.js +17 -8
  119. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  120. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +2 -0
  121. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  122. package/lib/esm/geometry3d/GrowableFloat64Array.js +4 -0
  123. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  124. package/lib/esm/geometry3d/Matrix3d.d.ts +8 -4
  125. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  126. package/lib/esm/geometry3d/Matrix3d.js +25 -22
  127. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  128. package/lib/esm/geometry3d/PolygonOps.d.ts +10 -4
  129. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  130. package/lib/esm/geometry3d/PolygonOps.js +92 -45
  131. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  132. package/lib/esm/numerics/Polynomials.d.ts +5 -5
  133. package/lib/esm/numerics/Polynomials.js +6 -6
  134. package/lib/esm/numerics/Polynomials.js.map +1 -1
  135. package/lib/esm/polyface/AuxData.d.ts +2 -2
  136. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  137. package/lib/esm/polyface/AuxData.js +11 -3
  138. package/lib/esm/polyface/AuxData.js.map +1 -1
  139. package/lib/esm/polyface/Polyface.d.ts +3 -5
  140. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  141. package/lib/esm/polyface/Polyface.js +6 -13
  142. package/lib/esm/polyface/Polyface.js.map +1 -1
  143. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  144. package/lib/esm/polyface/PolyfaceBuilder.js +23 -13
  145. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  146. package/lib/esm/polyface/PolyfaceData.d.ts +13 -3
  147. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  148. package/lib/esm/polyface/PolyfaceData.js +21 -4
  149. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  150. package/lib/esm/polyface/PolyfaceQuery.d.ts +2 -2
  151. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  152. package/lib/esm/polyface/PolyfaceQuery.js +4 -3
  153. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  154. package/lib/esm/solid/Box.d.ts +9 -3
  155. package/lib/esm/solid/Box.d.ts.map +1 -1
  156. package/lib/esm/solid/Box.js +10 -5
  157. package/lib/esm/solid/Box.js.map +1 -1
  158. package/lib/esm/solid/Cone.d.ts +3 -2
  159. package/lib/esm/solid/Cone.d.ts.map +1 -1
  160. package/lib/esm/solid/Cone.js +3 -3
  161. package/lib/esm/solid/Cone.js.map +1 -1
  162. package/lib/esm/solid/LinearSweep.d.ts +9 -3
  163. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  164. package/lib/esm/solid/LinearSweep.js +9 -4
  165. package/lib/esm/solid/LinearSweep.js.map +1 -1
  166. package/lib/esm/solid/RotationalSweep.d.ts +15 -4
  167. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  168. package/lib/esm/solid/RotationalSweep.js +20 -7
  169. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  170. package/lib/esm/solid/RuledSweep.d.ts +9 -3
  171. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  172. package/lib/esm/solid/RuledSweep.js +11 -5
  173. package/lib/esm/solid/RuledSweep.js.map +1 -1
  174. package/lib/esm/solid/Sphere.d.ts +17 -7
  175. package/lib/esm/solid/Sphere.d.ts.map +1 -1
  176. package/lib/esm/solid/Sphere.js +22 -16
  177. package/lib/esm/solid/Sphere.js.map +1 -1
  178. package/lib/esm/solid/SweepContour.d.ts +1 -1
  179. package/lib/esm/solid/SweepContour.js +1 -1
  180. package/lib/esm/solid/SweepContour.js.map +1 -1
  181. package/lib/esm/solid/TorusPipe.d.ts +8 -2
  182. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  183. package/lib/esm/solid/TorusPipe.js +9 -5
  184. package/lib/esm/solid/TorusPipe.js.map +1 -1
  185. package/package.json +3 -3
@@ -21,19 +21,25 @@ export declare class Loop extends CurveChain {
21
21
  isInner: boolean;
22
22
  /** Test if `other` is a `Loop` */
23
23
  isSameGeometryClass(other: GeometryQuery): boolean;
24
- /** Test if `other` is an instance of `Loop` */
25
24
  constructor();
26
25
  /**
27
- * Create a loop from variable length list of CurvePrimitives
28
- * @param curves array of individual curve primitives
26
+ * Create a loop from a variable length list of [[CurvePrimitive]]s.
27
+ * * A significant gap between the end of one curve and the start of the next, or between chain start and end,
28
+ * is not bridged and may cause unexpected behavior.
29
+ * @param curves array of individual curve primitives, assumed to form a closed planar loop.
29
30
  */
30
31
  static create(...curves: CurvePrimitive[]): Loop;
31
32
  /**
32
- * Create a loop from an array of curve primitives
33
- * @param curves array of individual curve primitives
33
+ * Create a loop from an array of [[CurvePrimitive]]s.
34
+ * * A significant gap between the end of one curve and the start of the next, or between chain start and end,
35
+ * is not bridged and may cause unexpected behavior.
36
+ * @param curves array of individual curve primitives, assumed to form a closed planar loop.
34
37
  */
35
38
  static createArray(curves: CurvePrimitive[]): Loop;
36
- /** Create a loop from an array of points */
39
+ /**
40
+ * Create a loop from an array of coplanar points.
41
+ * @param points vertices of polygon, closure point optional.
42
+ */
37
43
  static createPolygon(points: IndexedXYZCollection | Point3d[]): Loop;
38
44
  /** Create a loop with the stroked form of this loop. */
39
45
  cloneStroked(options?: StrokeOptions): Loop;
@@ -1 +1 @@
1
- {"version":3,"file":"Loop.d.ts","sourceRoot":"","sources":["../../../src/curve/Loop.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE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CurveChain {
18
18
  isSameGeometryClass(other) {
19
19
  return other instanceof Loop;
20
20
  }
21
- /** Test if `other` is an instance of `Loop` */
22
21
  constructor() {
23
22
  super();
24
23
  /** String name for schema properties */
@@ -27,8 +26,10 @@ class Loop extends CurveCollection_1.CurveChain {
27
26
  this.isInner = false;
28
27
  }
29
28
  /**
30
- * Create a loop from variable length list of CurvePrimitives
31
- * @param curves array of individual curve primitives
29
+ * Create a loop from a variable length list of [[CurvePrimitive]]s.
30
+ * * A significant gap between the end of one curve and the start of the next, or between chain start and end,
31
+ * is not bridged and may cause unexpected behavior.
32
+ * @param curves array of individual curve primitives, assumed to form a closed planar loop.
32
33
  */
33
34
  static create(...curves) {
34
35
  const result = new Loop();
@@ -41,13 +42,18 @@ class Loop extends CurveCollection_1.CurveChain {
41
42
  return result;
42
43
  }
43
44
  /**
44
- * Create a loop from an array of curve primitives
45
- * @param curves array of individual curve primitives
45
+ * Create a loop from an array of [[CurvePrimitive]]s.
46
+ * * A significant gap between the end of one curve and the start of the next, or between chain start and end,
47
+ * is not bridged and may cause unexpected behavior.
48
+ * @param curves array of individual curve primitives, assumed to form a closed planar loop.
46
49
  */
47
50
  static createArray(curves) {
48
51
  return this.create(...curves);
49
52
  }
50
- /** Create a loop from an array of points */
53
+ /**
54
+ * Create a loop from an array of coplanar points.
55
+ * @param points vertices of polygon, closure point optional.
56
+ */
51
57
  static createPolygon(points) {
52
58
  const linestring = LineString3d_1.LineString3d.create(points);
53
59
  linestring.addClosurePoint();
@@ -1 +1 @@
1
- {"version":3,"file":"Loop.js","sourceRoot":"","sources":["../../../src/curve/Loop.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAQ/F,+EAA4E;AAC5E,uDAA+C;AAI/C,iDAA8C;AAG9C;;;;GAIG;AACH,MAAa,IAAK,SAAQ,4BAAU;IAKlC,kCAAkC;IAC3B,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,IAAI,CAAC;IAC/B,CAAC;IACD,+C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,CAAC,eAAe,EAAE,CAAC;QAC5B,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IACD,gFAAgF;IACzE,eAAe;QACpB;;;;WAIG;QACH,OAAO,CAAC,CAAC;IACX,CAAC;IACD,2DAA2D;IACpD,wBAAwB,CAAC,SAAkC,EAAE,gBAAwB,CAAC,CAAC;QAC5F,OAAO,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACrD,CAAC;IACD,2CAA2C;IACpC,cAAc;QACnB,OAAO,IAAI,IAAI,EAAE,CAAC;IACpB,CAAC;IACD,uEAAuE;IAChE,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AA1ED,oBA0EC;AAED;;;GAGG;AACH,MAAa,kBAAkB;IAS7B,kBAAkB;IAClB,YACE,KAAuB,EAAE,MAAkC,EAAE,KAAuB,EAAE,MAAkC;QAExH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACD,uCAAuC;IAChC,IAAI,CAAC,IAAU,EAAE,KAAqB;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IACD,uCAAuC;IAChC,IAAI,CAAC,IAAU,EAAE,KAAqB;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;CACF;AA5BD,gDA4BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { CurveChainWithDistanceIndex } from \"./CurveChainWithDistanceIndex\";\r\nimport { CurveChain } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * A `Loop` is a curve chain that is the boundary of a closed (planar) loop.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class Loop extends CurveChain {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"loop\";\r\n /** Tag value that can be set to true for user code to mark inner and outer loops. */\r\n public override isInner: boolean = false;\r\n /** Test if `other` is a `Loop` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof Loop;\r\n }\r\n /** Test if `other` is an instance of `Loop` */\r\n public constructor() {\r\n super();\r\n }\r\n /**\r\n * Create a loop from variable length list of CurvePrimitives\r\n * @param curves array of individual curve primitives\r\n */\r\n public static create(...curves: CurvePrimitive[]): Loop {\r\n const result = new Loop();\r\n for (const curve of curves) {\r\n if (curve instanceof CurveChainWithDistanceIndex)\r\n result.children.push(...curve.path.children);\r\n else\r\n result.children.push(curve);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Create a loop from an array of curve primitives\r\n * @param curves array of individual curve primitives\r\n */\r\n public static createArray(curves: CurvePrimitive[]): Loop {\r\n return this.create(...curves);\r\n }\r\n /** Create a loop from an array of points */\r\n public static createPolygon(points: IndexedXYZCollection | Point3d[]): Loop {\r\n const linestring = LineString3d.create(points);\r\n linestring.addClosurePoint();\r\n return Loop.create(linestring);\r\n }\r\n /** Create a loop with the stroked form of this loop. */\r\n public cloneStroked(options?: StrokeOptions): Loop {\r\n const strokes = LineString3d.create();\r\n for (const curve of this.children)\r\n curve.emitStrokes(strokes, options);\r\n // eliminate near-duplicate points between children\r\n strokes.removeDuplicatePoints();\r\n if (strokes.isPhysicallyClosed) {\r\n strokes.popPoint();\r\n strokes.addClosurePoint();\r\n }\r\n return Loop.create(strokes);\r\n }\r\n /** Return the boundary type (2) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n /**\r\n * All \"Loop\" become \"outer\". TypeScript Loop object is equivalent to a native CurveVector with\r\n * boundaryType = BOUNDARY_TYPE_Outer. In other words, TypeScript has no flavor of Loop that\r\n * carries \"hole\" semantics.\r\n */\r\n return 2;\r\n }\r\n /** Invoke `processor.announceLoop(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceLoop(this, indexInParent);\r\n }\r\n /** Create a new `Loop` with no children */\r\n public cloneEmptyPeer(): Loop {\r\n return new Loop();\r\n }\r\n /** Second step of double dispatch: call `handler.handleLoop(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleLoop(this);\r\n }\r\n}\r\n\r\n/**\r\n * Structure carrying a pair of loops with curve geometry.\r\n * @public\r\n */\r\nexport class LoopCurveLoopCurve {\r\n /** First loop */\r\n public loopA?: Loop;\r\n /** A curve (typically an edge of loopA) */\r\n public curveA?: CurvePrimitive;\r\n /** second loop */\r\n public loopB?: Loop;\r\n /** A curve (typically an edge of loopB) */\r\n public curveB?: CurvePrimitive;\r\n /** Constructor */\r\n public constructor(\r\n loopA: Loop | undefined, curveA: CurvePrimitive | undefined, loopB: Loop | undefined, curveB: CurvePrimitive | undefined,\r\n ) {\r\n this.loopA = loopA;\r\n this.curveA = curveA;\r\n this.loopB = loopB;\r\n this.curveB = curveB;\r\n }\r\n /** Set the loopA and curveA members */\r\n public setA(loop: Loop, curve: CurvePrimitive) {\r\n this.loopA = loop;\r\n this.curveA = curve;\r\n }\r\n /** Set the loopB and curveB members */\r\n public setB(loop: Loop, curve: CurvePrimitive) {\r\n this.loopB = loop;\r\n this.curveB = curve;\r\n }\r\n}\r\n\r\n/**\r\n * Carrier object for loops characterized by area sign\r\n * @public\r\n */\r\nexport interface SignedLoops {\r\n /** Array of loops that have positive area sign (i.e. counterclockwise loops). */\r\n positiveAreaLoops: Loop[];\r\n /** Array of loops that have negative area sign (i.e. clockwise loops). */\r\n negativeAreaLoops: Loop[];\r\n /** Slivers where there are coincident sections of input curves. */\r\n slivers: Loop[];\r\n /** Array indicating edges between loops */\r\n edges?: LoopCurveLoopCurve[];\r\n}\r\n"]}
1
+ {"version":3,"file":"Loop.js","sourceRoot":"","sources":["../../../src/curve/Loop.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAQ/F,+EAA4E;AAC5E,uDAA+C;AAI/C,iDAA8C;AAG9C;;;;GAIG;AACH,MAAa,IAAK,SAAQ,4BAAU;IAKlC,kCAAkC;IAC3B,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,IAAI,CAAC;IAC/B,CAAC;IACD;QACE,KAAK,EAAE,CAAC;QATV,wCAAwC;QACxB,wBAAmB,GAAG,MAAM,CAAC;QAC7C,qFAAqF;QACrE,YAAO,GAAY,KAAK,CAAC;IAOzC,CAAC;IACD;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,GAAG,MAAwB;QAC9C,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QAC1B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,KAAK,YAAY,yDAA2B;gBAC9C,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;;gBAE7C,MAAM,CAAC,QAAQ,CAA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O,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AAhFD,oBAgFC;AAED;;;GAGG;AACH,MAAa,kBAAkB;IAS7B,kBAAkB;IAClB,YACE,KAAuB,EAAE,MAAkC,EAAE,KAAuB,EAAE,MAAkC;QAExH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACD,uCAAuC;IAChC,IAAI,CAAC,IAAU,EAAE,KAAqB;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IACD,uCAAuC;IAChC,IAAI,CAAC,IAAU,EAAE,KAAqB;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;CACF;AA5BD,gDA4BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { CurveChainWithDistanceIndex } from \"./CurveChainWithDistanceIndex\";\r\nimport { CurveChain } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * A `Loop` is a curve chain that is the boundary of a closed (planar) loop.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class Loop extends CurveChain {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"loop\";\r\n /** Tag value that can be set to true for user code to mark inner and outer loops. */\r\n public override isInner: boolean = false;\r\n /** Test if `other` is a `Loop` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof Loop;\r\n }\r\n public constructor() {\r\n super();\r\n }\r\n /**\r\n * Create a loop from a variable length list of [[CurvePrimitive]]s.\r\n * * A significant gap between the end of one curve and the start of the next, or between chain start and end,\r\n * is not bridged and may cause unexpected behavior.\r\n * @param curves array of individual curve primitives, assumed to form a closed planar loop.\r\n */\r\n public static create(...curves: CurvePrimitive[]): Loop {\r\n const result = new Loop();\r\n for (const curve of curves) {\r\n if (curve instanceof CurveChainWithDistanceIndex)\r\n result.children.push(...curve.path.children);\r\n else\r\n result.children.push(curve);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Create a loop from an array of [[CurvePrimitive]]s.\r\n * * A significant gap between the end of one curve and the start of the next, or between chain start and end,\r\n * is not bridged and may cause unexpected behavior.\r\n * @param curves array of individual curve primitives, assumed to form a closed planar loop.\r\n */\r\n public static createArray(curves: CurvePrimitive[]): Loop {\r\n return this.create(...curves);\r\n }\r\n /**\r\n * Create a loop from an array of coplanar points.\r\n * @param points vertices of polygon, closure point optional.\r\n */\r\n public static createPolygon(points: IndexedXYZCollection | Point3d[]): Loop {\r\n const linestring = LineString3d.create(points);\r\n linestring.addClosurePoint();\r\n return Loop.create(linestring);\r\n }\r\n /** Create a loop with the stroked form of this loop. */\r\n public cloneStroked(options?: StrokeOptions): Loop {\r\n const strokes = LineString3d.create();\r\n for (const curve of this.children)\r\n curve.emitStrokes(strokes, options);\r\n // eliminate near-duplicate points between children\r\n strokes.removeDuplicatePoints();\r\n if (strokes.isPhysicallyClosed) {\r\n strokes.popPoint();\r\n strokes.addClosurePoint();\r\n }\r\n return Loop.create(strokes);\r\n }\r\n /** Return the boundary type (2) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n /**\r\n * All \"Loop\" become \"outer\". TypeScript Loop object is equivalent to a native CurveVector with\r\n * boundaryType = BOUNDARY_TYPE_Outer. In other words, TypeScript has no flavor of Loop that\r\n * carries \"hole\" semantics.\r\n */\r\n return 2;\r\n }\r\n /** Invoke `processor.announceLoop(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceLoop(this, indexInParent);\r\n }\r\n /** Create a new `Loop` with no children */\r\n public cloneEmptyPeer(): Loop {\r\n return new Loop();\r\n }\r\n /** Second step of double dispatch: call `handler.handleLoop(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleLoop(this);\r\n }\r\n}\r\n\r\n/**\r\n * Structure carrying a pair of loops with curve geometry.\r\n * @public\r\n */\r\nexport class LoopCurveLoopCurve {\r\n /** First loop */\r\n public loopA?: Loop;\r\n /** A curve (typically an edge of loopA) */\r\n public curveA?: CurvePrimitive;\r\n /** second loop */\r\n public loopB?: Loop;\r\n /** A curve (typically an edge of loopB) */\r\n public curveB?: CurvePrimitive;\r\n /** Constructor */\r\n public constructor(\r\n loopA: Loop | undefined, curveA: CurvePrimitive | undefined, loopB: Loop | undefined, curveB: CurvePrimitive | undefined,\r\n ) {\r\n this.loopA = loopA;\r\n this.curveA = curveA;\r\n this.loopB = loopB;\r\n this.curveB = curveB;\r\n }\r\n /** Set the loopA and curveA members */\r\n public setA(loop: Loop, curve: CurvePrimitive) {\r\n this.loopA = loop;\r\n this.curveA = curve;\r\n }\r\n /** Set the loopB and curveB members */\r\n public setB(loop: Loop, curve: CurvePrimitive) {\r\n this.loopB = loop;\r\n this.curveB = curve;\r\n }\r\n}\r\n\r\n/**\r\n * Carrier object for loops characterized by area sign\r\n * @public\r\n */\r\nexport interface SignedLoops {\r\n /** Array of loops that have positive area sign (i.e. counterclockwise loops). */\r\n positiveAreaLoops: Loop[];\r\n /** Array of loops that have negative area sign (i.e. clockwise loops). */\r\n negativeAreaLoops: Loop[];\r\n /** Slivers where there are coincident sections of input curves. */\r\n slivers: Loop[];\r\n /** Array indicating edges between loops */\r\n edges?: LoopCurveLoopCurve[];\r\n}\r\n"]}
@@ -32,14 +32,16 @@ export declare class CylindricalRangeQuery extends RecurseToCurvesGeometryHandle
32
32
  */
33
33
  static computeMaxVectorFromRay(ray: Ray3d, geometry: GeometryQuery): Vector3d;
34
34
  /**
35
- * Recurse through geometry.children to find linestrings.
36
- * In each linestring, compute the surface normal annotation from
35
+ * Recurse through `geometry.children` to find linestrings.
36
+ * For each linestring, compute and store the normal of the rotational surface resulting from sweeping the
37
+ * geometry around `axis` through a positive angle, using:
37
38
  * * the curve tangent stored in the linestring
38
39
  * * the axis of rotation
39
- * * a default V vector to be used when the linestring point is close to the axis.
40
- * @param geometry
41
- * @param axis
42
- * @param defaultVectorV
40
+ * * a default V vector to be used when the linestring point is close to the axis
41
+ * @param geometry profile curve (e.g., linestring, parity region). The orientation of the curve should be such that
42
+ * the computed normal lies in the same half-space as the rotational sweep direction.
43
+ * @param axis rotational axis
44
+ * @param defaultVectorFromAxis default vector perpendicular to `axis` (e.g., sweepVector)
43
45
  */
44
46
  static buildRotationalNormalsInLineStrings(geometry: AnyCurve, axis: Ray3d, defaultVectorFromAxis: Vector3d): void;
45
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CylindricalRange.d.ts","sourceRoot":"","sources":["../../../../src/curve/Query/CylindricalRange.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAW,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,M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jD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,8BAA8B;IAEvE,OAAO,CAAC,WAAW,CAAW;IAC9B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAY;IACjC,kDAAkD;IAClD,OAAO;IAMP,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,aAAa;IAWL,mBAAmB,CAAC,QAAQ,EAAE,aAAa;IAI3C,kBAAkB,CAAC,GAAG,EAAE,YAAY;IAOpC,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,GAAG;IAc7C;;;;OAIG;WACW,uBAAuB,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,GAAG,QAAQ;IAMpF;;;;;;;;;;;OAWG;WACW,mCAAmC,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,qBAAqB,EAAE,QAAQ,GAAG,IAAI;CAgC1H"}
@@ -70,14 +70,16 @@ class CylindricalRangeQuery extends GeometryHandler_1.RecurseToCurvesGeometryHan
70
70
  return accumulator._perpVector.clone();
71
71
  }
72
72
  /**
73
- * Recurse through geometry.children to find linestrings.
74
- * In each linestring, compute the surface normal annotation from
73
+ * Recurse through `geometry.children` to find linestrings.
74
+ * For each linestring, compute and store the normal of the rotational surface resulting from sweeping the
75
+ * geometry around `axis` through a positive angle, using:
75
76
  * * the curve tangent stored in the linestring
76
77
  * * the axis of rotation
77
- * * a default V vector to be used when the linestring point is close to the axis.
78
- * @param geometry
79
- * @param axis
80
- * @param defaultVectorV
78
+ * * a default V vector to be used when the linestring point is close to the axis
79
+ * @param geometry profile curve (e.g., linestring, parity region). The orientation of the curve should be such that
80
+ * the computed normal lies in the same half-space as the rotational sweep direction.
81
+ * @param axis rotational axis
82
+ * @param defaultVectorFromAxis default vector perpendicular to `axis` (e.g., sweepVector)
81
83
  */
82
84
  static buildRotationalNormalsInLineStrings(geometry, axis, defaultVectorFromAxis) {
83
85
  if (geometry instanceof LineString3d_1.LineString3d) {
@@ -86,18 +88,20 @@ class CylindricalRangeQuery extends GeometryHandler_1.RecurseToCurvesGeometryHan
86
88
  const normals = geometry.ensureEmptySurfaceNormals();
87
89
  if (derivatives && normals) {
88
90
  const vectorU = Point3dVector3d_1.Vector3d.create();
89
- const vectorV = Point3dVector3d_1.Vector3d.create(); // v direction (forwward along sweep) for surface of rotation.
91
+ const vectorV = Point3dVector3d_1.Vector3d.create();
90
92
  const xyz = Point3dVector3d_1.Point3d.create();
91
93
  const n = points.length;
92
94
  for (let i = 0; i < n; i++) {
93
95
  points.getPoint3dAtUncheckedPointIndex(i, xyz);
94
96
  axis.perpendicularPartOfVectorToTarget(xyz, vectorU);
97
+ // compute the positive sweep direction. ASSUME: the rotational sweep angle is positive!
95
98
  if (vectorU.isAlmostZero)
96
99
  axis.direction.crossProduct(defaultVectorFromAxis, vectorV);
97
100
  else
98
101
  axis.direction.crossProduct(vectorU, vectorV);
99
- geometry.packedDerivatives.getVector3dAtCheckedVectorIndex(i, vectorU); // reuse vector U as curve derivative
100
- vectorU.crossProduct(vectorV, vectorV); // reuse vector V as normal!
102
+ // ASSUME: orientation-based profile normal is in the same half-space as vectorV
103
+ geometry.packedDerivatives.getVector3dAtCheckedVectorIndex(i, vectorU); // reuse vectorU
104
+ vectorU.crossProduct(vectorV, vectorV); // reuse vectorV
101
105
  vectorV.normalizeInPlace();
102
106
  normals.push(vectorV);
103
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CylindricalRange.js","sourceRoot":"","sources":["../../../../src/curve/Query/CylindricalRange.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sEAAkF;AAClF,sEAAqE;AAOrE,kDAA+C;AAC/C,oDAAiD;AAEjD;;;GAGG;AACH,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,mCAAmC,CAAC,KAAiB,EAAE,IAAI,EAAE,qBAAqB,CAAC,CAAC;YAC3F,CAAC;QACH,CAAC;IACH,CAAC;CACF;AArGD,sDAqGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { RecurseToCurvesGeometryHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Transform } from \"../../geometry3d/Transform\";\r\nimport { Arc3d } from \"../Arc3d\";\r\nimport { AnyCurve } from \"../CurveTypes\";\r\nimport { GeometryQuery } from \"../GeometryQuery\";\r\nimport { LineSegment3d } from \"../LineSegment3d\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { StrokeOptions } from \"../StrokeOptions\";\r\n\r\n/**\r\n * Context for computing geometry range around an axis.\r\n * * The publicly called method is `computeZRRange (ray, geometry)\r\n */\r\nexport class CylindricalRangeQuery extends RecurseToCurvesGeometryHandler {\r\n // private geometry0: GeometryQuery; <-- Never used\r\n private _perpVector: Vector3d;\r\n private _maxDistance: number;\r\n private _localToWorld: Transform;\r\n /** capture ray and initialize evolving ranges. */\r\n private constructor(ray: Ray3d) {\r\n super();\r\n this._perpVector = Vector3d.createZero();\r\n this._maxDistance = 0.0;\r\n this._localToWorld = ray.toRigidZFrame();\r\n }\r\n private _localPoint = Point3d.create();\r\n private _worldPoint = Point3d.create();\r\n private announcePoint(xyz: Point3d) {\r\n this._localToWorld.multiplyInversePoint3d(xyz, this._localPoint);\r\n const distance = this._localPoint.magnitudeXY();\r\n if (distance >= this._maxDistance) {\r\n this._maxDistance = distance;\r\n this._perpVector.setFromPoint3d(this._localPoint);\r\n this._perpVector.z = 0.0;\r\n this._localToWorld.matrix.multiplyXY(this._localPoint.x, this._localPoint.y, this._perpVector);\r\n }\r\n }\r\n\r\n public override handleLineSegment3d(segment0: LineSegment3d) {\r\n this.announcePoint(segment0.startPoint(this._worldPoint));\r\n this.announcePoint(segment0.endPoint(this._worldPoint));\r\n }\r\n public override handleLineString3d(ls0: LineString3d) {\r\n for (let i = 0; i < ls0.numPoints(); i++) {\r\n ls0.pointAt(i, this._worldPoint);\r\n this.announcePoint(this._worldPoint);\r\n }\r\n }\r\n\r\n public override handleArc3d(arc0: Arc3d): any {\r\n // humbug .. just stroke it ..\r\n // exact solution is:\r\n // project the arc to the z=0 plane of the local system.\r\n // find max distance to origin.\r\n const numStroke = StrokeOptions.applyAngleTol(undefined, 3, arc0.sweep.sweepRadians, 0.1);\r\n const df = 1.0 / numStroke;\r\n for (let i = 0; i <= numStroke; i++) {\r\n arc0.fractionToPoint(i * df, this._worldPoint);\r\n this.announcePoint(this._worldPoint);\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Compute the largest vector perpendicular to a ray and ending on the geometry.\r\n * @param geometry0 geometry to search\r\n * @returns vector from ray to geometry.\r\n */\r\n public static computeMaxVectorFromRay(ray: Ray3d, geometry: GeometryQuery): Vector3d {\r\n const accumulator = new CylindricalRangeQuery(ray);\r\n geometry.dispatchToGeometryHandler(accumulator);\r\n return accumulator._perpVector.clone();\r\n }\r\n\r\n /**\r\n * Recurse through geometry.children to find linestrings.\r\n * In each linestring, compute the surface normal annotation from\r\n * * the curve tangent stored in the linestring\r\n * * the axis of rotation\r\n * * a default V vector to be used when the linestring point is close to the axis.\r\n * @param geometry\r\n * @param axis\r\n * @param defaultVectorV\r\n */\r\n public static buildRotationalNormalsInLineStrings(geometry: AnyCurve, axis: Ray3d, defaultVectorFromAxis: Vector3d) {\r\n if (geometry instanceof LineString3d) {\r\n const points = geometry.packedPoints;\r\n const derivatives = geometry.packedDerivatives;\r\n const normals = geometry.ensureEmptySurfaceNormals();\r\n if (derivatives && normals) {\r\n const vectorU = Vector3d.create();\r\n const vectorV = Vector3d.create(); // v direction (forwward along sweep) for surface of rotation.\r\n const xyz = Point3d.create();\r\n const n = points.length;\r\n for (let i = 0; i < n; i++) {\r\n points.getPoint3dAtUncheckedPointIndex(i, xyz);\r\n axis.perpendicularPartOfVectorToTarget(xyz, vectorU);\r\n if (vectorU.isAlmostZero)\r\n axis.direction.crossProduct(defaultVectorFromAxis, vectorV);\r\n else\r\n axis.direction.crossProduct(vectorU, vectorV);\r\n geometry.packedDerivatives.getVector3dAtCheckedVectorIndex(i, vectorU); // reuse vector U as curve derivative\r\n vectorU.crossProduct(vectorV, vectorV); // reuse vector V as normal!\r\n vectorV.normalizeInPlace();\r\n normals.push(vectorV);\r\n }\r\n }\r\n } else if (geometry.children) {\r\n const children = geometry.children;\r\n for (const child of children) {\r\n this.buildRotationalNormalsInLineStrings(child as AnyCurve, axis, defaultVectorFromAxis);\r\n }\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CylindricalRange.js","sourceRoot":"","sources":["../../../../src/curve/Query/CylindricalRange.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sEAAkF;AAClF,sEAAqE;AAOrE,kDAA+C;AAC/C,oDAAiD;AAEjD;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,gDAA8B;IAKvE,kDAAkD;IAClD,YAAoB,GAAU;QAC5B,KAAK,EAAE,CAAC;QAKF,gBAAW,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;QAC/B,gBAAW,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;QALrC,IAAI,CAAC,WAAW,GAAG,0BAAQ,CAAC,UAAU,EAAE,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC;IAC3C,CAAC;IAGO,aAAa,CAAC,GAAY;QAChC,IAAI,CAAC,aAAa,CAAC,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AC,EAAE,EAAE,CAAC;oBAC3B,MAAM,CAAC,+BAA+B,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;oBAC/C,IAAI,CAAC,iCAAiC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;oBACrD,wFAAwF;oBACxF,IAAI,OAAO,CAAC,YAAY;wBACtB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;;wBAE5D,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBAChD,gFAAgF;oBAChF,QAAQ,CAAC,iBAAiB,CAAC,+BAA+B,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB;oBACxF,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAE,gBAAgB;oBACzD,OAAO,CAAC,gBAAgB,EAAE,CAAC;oBAC3B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC;QACH,CAAC;aAAM,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;YAC7B,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;YACnC,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;gBAC7B,IAAI,CAAC,mCAAmC,CAAC,KAAiB,EAAE,IAAI,EAAE,qBAAqB,CAAC,CAAC;YAC3F,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAzGD,sDAyGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { RecurseToCurvesGeometryHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Transform } from \"../../geometry3d/Transform\";\r\nimport { Arc3d } from \"../Arc3d\";\r\nimport { AnyCurve } from \"../CurveTypes\";\r\nimport { GeometryQuery } from \"../GeometryQuery\";\r\nimport { LineSegment3d } from \"../LineSegment3d\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { StrokeOptions } from \"../StrokeOptions\";\r\n\r\n/**\r\n * Context for computing geometry range around an axis.\r\n * * The publicly called method is `computeZRRange (ray, geometry)\r\n */\r\nexport class CylindricalRangeQuery extends RecurseToCurvesGeometryHandler {\r\n // private geometry0: GeometryQuery; <-- Never used\r\n private _perpVector: Vector3d;\r\n private _maxDistance: number;\r\n private _localToWorld: Transform;\r\n /** capture ray and initialize evolving ranges. */\r\n private constructor(ray: Ray3d) {\r\n super();\r\n this._perpVector = Vector3d.createZero();\r\n this._maxDistance = 0.0;\r\n this._localToWorld = ray.toRigidZFrame();\r\n }\r\n private _localPoint = Point3d.create();\r\n private _worldPoint = Point3d.create();\r\n private announcePoint(xyz: Point3d) {\r\n this._localToWorld.multiplyInversePoint3d(xyz, this._localPoint);\r\n const distance = this._localPoint.magnitudeXY();\r\n if (distance >= this._maxDistance) {\r\n this._maxDistance = distance;\r\n this._perpVector.setFromPoint3d(this._localPoint);\r\n this._perpVector.z = 0.0;\r\n this._localToWorld.matrix.multiplyXY(this._localPoint.x, this._localPoint.y, this._perpVector);\r\n }\r\n }\r\n\r\n public override handleLineSegment3d(segment0: LineSegment3d) {\r\n this.announcePoint(segment0.startPoint(this._worldPoint));\r\n this.announcePoint(segment0.endPoint(this._worldPoint));\r\n }\r\n public override handleLineString3d(ls0: LineString3d) {\r\n for (let i = 0; i < ls0.numPoints(); i++) {\r\n ls0.pointAt(i, this._worldPoint);\r\n this.announcePoint(this._worldPoint);\r\n }\r\n }\r\n\r\n public override handleArc3d(arc0: Arc3d): any {\r\n // humbug .. just stroke it ..\r\n // exact solution is:\r\n // project the arc to the z=0 plane of the local system.\r\n // find max distance to origin.\r\n const numStroke = StrokeOptions.applyAngleTol(undefined, 3, arc0.sweep.sweepRadians, 0.1);\r\n const df = 1.0 / numStroke;\r\n for (let i = 0; i <= numStroke; i++) {\r\n arc0.fractionToPoint(i * df, this._worldPoint);\r\n this.announcePoint(this._worldPoint);\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Compute the largest vector perpendicular to a ray and ending on the geometry.\r\n * @param geometry0 geometry to search\r\n * @returns vector from ray to geometry.\r\n */\r\n public static computeMaxVectorFromRay(ray: Ray3d, geometry: GeometryQuery): Vector3d {\r\n const accumulator = new CylindricalRangeQuery(ray);\r\n geometry.dispatchToGeometryHandler(accumulator);\r\n return accumulator._perpVector.clone();\r\n }\r\n\r\n /**\r\n * Recurse through `geometry.children` to find linestrings.\r\n * For each linestring, compute and store the normal of the rotational surface resulting from sweeping the\r\n * geometry around `axis` through a positive angle, using:\r\n * * the curve tangent stored in the linestring\r\n * * the axis of rotation\r\n * * a default V vector to be used when the linestring point is close to the axis\r\n * @param geometry profile curve (e.g., linestring, parity region). The orientation of the curve should be such that\r\n * the computed normal lies in the same half-space as the rotational sweep direction.\r\n * @param axis rotational axis\r\n * @param defaultVectorFromAxis default vector perpendicular to `axis` (e.g., sweepVector)\r\n */\r\n public static buildRotationalNormalsInLineStrings(geometry: AnyCurve, axis: Ray3d, defaultVectorFromAxis: Vector3d): void {\r\n if (geometry instanceof LineString3d) {\r\n const points = geometry.packedPoints;\r\n const derivatives = geometry.packedDerivatives;\r\n const normals = geometry.ensureEmptySurfaceNormals();\r\n if (derivatives && normals) {\r\n const vectorU = Vector3d.create();\r\n const vectorV = Vector3d.create();\r\n const xyz = Point3d.create();\r\n const n = points.length;\r\n for (let i = 0; i < n; i++) {\r\n points.getPoint3dAtUncheckedPointIndex(i, xyz);\r\n axis.perpendicularPartOfVectorToTarget(xyz, vectorU);\r\n // compute the positive sweep direction. ASSUME: the rotational sweep angle is positive!\r\n if (vectorU.isAlmostZero)\r\n axis.direction.crossProduct(defaultVectorFromAxis, vectorV);\r\n else\r\n axis.direction.crossProduct(vectorU, vectorV);\r\n // ASSUME: orientation-based profile normal is in the same half-space as vectorV\r\n geometry.packedDerivatives.getVector3dAtCheckedVectorIndex(i, vectorU); // reuse vectorU\r\n vectorU.crossProduct(vectorV, vectorV); // reuse vectorV\r\n vectorV.normalizeInPlace();\r\n normals.push(vectorV);\r\n }\r\n }\r\n } else if (geometry.children) {\r\n const children = geometry.children;\r\n for (const child of children) {\r\n this.buildRotationalNormalsInLineStrings(child as AnyCurve, axis, defaultVectorFromAxis);\r\n }\r\n }\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EllipticalArcApproximationContext.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/EllipticalArcApproximationContext.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,iCAAiC,EAA6B,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AA4BjE;;;EAGE;AACF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,UAAU,CAAW;IAC7B,OAAO,CAAC,wBAAwB,CAAU;IAC1C,OAAO,CAAC,sBAAsB,CAAU;IACxC,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO;IASP,uCAAuC;WACzB,MAAM,CAClB,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EACvB,SAAS,GAAE,MAAM,EAAO,EACxB,uBAAuB,GAAE,OAAc,EACvC,qBAAqB,GAAE,OAAc,GACpC,iB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ApproximationContext.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/EllipticalArcApproximationContext.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,iCAAiC,EAA6B,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AA4BjE;;;EAGE;AACF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,UAAU,CAAW;IAC7B,OAAO,CAAC,wBAAwB,CAAU;IAC1C,OAAO,CAAC,sBAAsB,CAAU;IACxC,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO;IASP,uCAAuC;WACzB,MAAM,CAClB,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EACvB,SAAS,GAAE,MAAM,EAAO,EACxB,uBAAuB,GAAE,OAAc,EACvC,qBAAqB,GAAE,OAAc,GACpC,iBAAiB;IAGpB;;;;;;OAMG;IACH,IAAW,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAEnC;IACD,0FAA0F;IAC1F,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;IACD,IAAW,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,EAE/B;IACD;;;;;;;OAOG;IACH,IAAW,uBAAuB,IAAI,OAAO,CAE5C;IACD,IAAW,uBAAuB,CAAC,WAAW,EAAE,OAAO,EAEtD;IACD;;;;;;;OAOG;IACH,IAAW,qBAAqB,IAAI,OAAO,CAE1C;IACD,IAAW,qBAAqB,CAAC,WAAW,EAAE,OAAO,EAEpD;IACD;;;;;;MA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ACnC,OAAO;IAmBP,iCAAiC;WACnB,MAAM,CAAC,aAAa,EAAE,KAAK;IAGzC;;;;OAIG;IACH,IAAW,aAAa,IAAI,KAAK,CAEhC;IACD;;;;OAIG;IACH,IAAW,YAAY,IAAI,SAAS,CAEnC;IACD;;;OAGG;IACH,IAAW,oBAAoB,IAAI,OAAO,CAEzC;IACD;;;;OAIG;IACI,aAAa,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS;IAe5D;;;;;;;;;;;MAWE;WACY,wBAAwB,CACpC,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,SAAS,EAAE,0BAA0B,GAC1F,IAAI;IAmGP;;;;;;;;;;OAUG;IACI,yBAAyB,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,uBAAuB,GAAG,SAAS;IASnG;;;;;;;;;;;;;;;;;;;;OAoBG;IACI,sBAAsB,CAC3B,OAAO,EAAE,iCAAiC,EAAE,gBAAgB,GAAE,OAAe,GAC5E,iBAAiB,EAAE,GAAG,MAAM,EAAE;IA2IjC,0EAA0E;IACnE,sCAAsC,CAAC,OAAO,CAAC,EAAE,iCAAiC,GAAG,UAAU,GAAG,SAAS;CAUnH"}
@@ -266,16 +266,19 @@ class ArcChainErrorProcessor extends QuadrantFractionsProcessor {
266
266
  }
267
267
  }
268
268
  /**
269
- * Processor for refining a single Q1 ordered interval [f0,f1] by perturbing an interior fraction f.
270
- * * This processor expects to repeatedly process a QuadrantFractions `q` with `q.quadrant` = 1 and fractions array
271
- * [fPrev, f0, f, f1], where fPrev is from the previously processed (possibly refined) adjacent interval; however, if
272
- * `q.interpolateStartTangent === true`, then no fPrev is necessary and [f0, f, f1] is expected.
273
- * * This is enough info to compute the two circular arcs spanning [f0,f] and [f,f1] and compare their approximation
274
- * errors.
275
- * * The basic idea is to perturb f so that the difference in the two arcs' errors is minimized.
276
- * * This processor keeps track of a bracket containing f so that when the caller repeatedly processes `q` via
277
- * [[EllipticalArcApproximationContext.processQuadrantFractions]], a bisection algorithm plays out, informed by the
278
- * heuristic that moving f toward one end of its bracket decreases the error of the approximating arc on that side of f.
269
+ * Processor for computing an optimal refinement of a single Q1 ordered interval [f0,f1] by perturbing an interior
270
+ * seed fraction f.
271
+ * * Typically the caller (cf. [[AdaptiveSubdivisionQ1ErrorProcessor.announceArc]] processes a
272
+ * QuadrantFractions `q` with `q.quadrant` = 1 until convergence. The `q.fractions` array is expected to have
273
+ * one of two forms:
274
+ * * [fPrev, f0, f, f1], where fPrev is from the adjacent interval (possibly just refined), or
275
+ * * [f0, f, f1], if `q.interpolateStartTangent === true`.
276
+ * * This processor implements a bisection algorithm that iteratively shrinks a sub-interval that brackets f,
277
+ * starting with [f0,f1]:
278
+ * * During processing, `announceArc` will be called twice to compute the approximation errors of the circular
279
+ * arcs on either side of f in the current bracket.
280
+ * * In `announceQuadrantEnd` if these two errors are almost equal, we are done refining [f0,f1]. Otherwise,
281
+ * we move f halfway to the endpoint of the bracket that decreases the error delta, and shrink our bracket.
279
282
  * @internal
280
283
  */
281
284
  class AdaptiveSubdivisionQ1IntervalErrorProcessor extends QuadrantFractionsProcessor {
@@ -347,14 +350,17 @@ class AdaptiveSubdivisionQ1IntervalErrorProcessor extends QuadrantFractionsProce
347
350
  /**
348
351
  * Processor for computing samples in Q1 for a subdivision-based arc chain approximation.
349
352
  * * The basic idea is to build a refinement of `q.fractions` for a QuadrantFractions q with q.quadrant = 1.
350
- * * Start off the refinement with a copy of `q.fractions`.
351
- * * When an announced arc exceeds a given maximum approximation error, compute a fraction f in the span
352
- * such that the error of arcs on either side of f would be almost equal, then add f to the refinement.
353
- * * If the announced arc does not exceed the maxError, its associated fraction span remains unchanged---no
354
- * additional samples are needed to decrease approximation error.
355
- * * After `q` processing completes, `q.fractions` is updated in place with the computed refinement.
356
- * * The caller typically re-processes `q` until `isRefined` returns false, at which point construction of an
357
- * approximation that is guaranteed not to exceed the desired error can commence.
353
+ * * In `announceQuadrantBegin` we start off the refinement with a copy of `q.fractions`.
354
+ * * In `announceArc` we are called to process the interval [f0,f1] in `q.fractions`. First we test if the
355
+ * announced arc's approximation error over [f0,f1] exceeds maxError.
356
+ * * If so, we employ [[AdaptiveSubdivisionQ1IntervalErrorProcessor]] to compute an interior fraction f
357
+ * that best refines the interval, which becomes [f0,f,f1].
358
+ * * Otherwise, the fraction span [f0,f1] is unchanged---no additional samples are needed to decrease the
359
+ * approximation error.
360
+ * * In `announceQuadrantEnd`, `q.fractions` is updated in place with the computed refinement.
361
+ * * The caller (e.g., [[AdaptiveSubdivisionSampler.computeRadiansStrictlyInsideQuadrant1]]) typically
362
+ * re-processes `q` until `isRefined` returns false, at which point construction of an approximation that is
363
+ * guaranteed not to exceed the desired error can commence.
358
364
  * @internal
359
365
  */
360
366
  class AdaptiveSubdivisionQ1ErrorProcessor extends QuadrantFractionsProcessor {