@itwin/core-geometry 5.0.0-dev.22 → 5.0.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 (69) hide show
  1. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  2. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  3. package/lib/cjs/curve/Arc3d.d.ts +10 -1
  4. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  5. package/lib/cjs/curve/Arc3d.js +13 -1
  6. package/lib/cjs/curve/Arc3d.js.map +1 -1
  7. package/lib/cjs/curve/CurveFactory.d.ts +10 -4
  8. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  9. package/lib/cjs/curve/CurveFactory.js +50 -59
  10. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  11. package/lib/cjs/curve/StrokeOptions.d.ts +3 -3
  12. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  13. package/lib/cjs/curve/StrokeOptions.js +1 -1
  14. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  15. package/lib/cjs/geometry3d/PolylineOps.d.ts +2 -1
  16. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  17. package/lib/cjs/geometry3d/PolylineOps.js +2 -1
  18. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  19. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +27 -20
  20. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  21. package/lib/cjs/polyface/IndexedEdgeMatcher.js +56 -30
  22. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  23. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  24. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  25. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +2 -1
  26. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  27. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +4 -4
  28. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  29. package/lib/cjs/polyface/PolyfaceBuilder.js +18 -50
  30. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  31. package/lib/cjs/solid/SweepContour.d.ts +24 -15
  32. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  33. package/lib/cjs/solid/SweepContour.js +24 -15
  34. package/lib/cjs/solid/SweepContour.js.map +1 -1
  35. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  36. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  37. package/lib/esm/curve/Arc3d.d.ts +10 -1
  38. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  39. package/lib/esm/curve/Arc3d.js +13 -1
  40. package/lib/esm/curve/Arc3d.js.map +1 -1
  41. package/lib/esm/curve/CurveFactory.d.ts +10 -4
  42. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  43. package/lib/esm/curve/CurveFactory.js +50 -59
  44. package/lib/esm/curve/CurveFactory.js.map +1 -1
  45. package/lib/esm/curve/StrokeOptions.d.ts +3 -3
  46. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  47. package/lib/esm/curve/StrokeOptions.js +1 -1
  48. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  49. package/lib/esm/geometry3d/PolylineOps.d.ts +2 -1
  50. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  51. package/lib/esm/geometry3d/PolylineOps.js +2 -1
  52. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  53. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +27 -20
  54. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  55. package/lib/esm/polyface/IndexedEdgeMatcher.js +56 -30
  56. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  57. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  58. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  59. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +2 -1
  60. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  61. package/lib/esm/polyface/PolyfaceBuilder.d.ts +4 -4
  62. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  63. package/lib/esm/polyface/PolyfaceBuilder.js +19 -51
  64. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  65. package/lib/esm/solid/SweepContour.d.ts +24 -15
  66. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  67. package/lib/esm/solid/SweepContour.js +24 -15
  68. package/lib/esm/solid/SweepContour.js.map +1 -1
  69. package/package.json +3 -3
@@ -20,27 +20,31 @@ export declare class SweepContour {
20
20
  localToWorld: Transform;
21
21
  /** Axis used only in rotational case. */
22
22
  axis: Ray3d | undefined;
23
- /** caches */
23
+ /** Caches */
24
24
  private _xyStrokes?;
25
25
  private _facets?;
26
26
  private constructor();
27
- /** Create for linear sweep.
27
+ /**
28
+ * Create for linear sweep.
28
29
  * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.
29
30
  * @param defaultNormal optional default normal for guiding coordinate frame setup.
30
31
  */
31
32
  static createForLinearSweep(contour: AnyCurve, defaultNormal?: Vector3d): SweepContour | undefined;
32
- /** Create for linear sweep.
33
- * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in, parity logic is employed.
33
+ /**
34
+ * Create for linear sweep.
35
+ * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in,
36
+ * parity logic is employed.
34
37
  * For best results, all points should be coplanar.
35
38
  * @param defaultNormal optional default normal for guiding coordinate frame setup.
36
39
  */
37
40
  static createForPolygon(points: MultiLineStringDataVariant, defaultNormal?: Vector3d): SweepContour | undefined;
38
- /** Create for rotational sweep.
41
+ /**
42
+ * Create for rotational sweep.
39
43
  * @param contour curve to sweep, CAPTURED. For best results, contour should be coplanar with axis.
40
44
  * @param axis rotation axis
41
45
  */
42
46
  static createForRotation(contour: AnyCurve, axis: Ray3d): SweepContour | undefined;
43
- /** Return (Reference to) the curves */
47
+ /** Return (Reference to) the curves. */
44
48
  getCurves(): CurveCollection;
45
49
  /**
46
50
  * Apply `transform` to the curves, axis.
@@ -53,14 +57,15 @@ export declare class SweepContour {
53
57
  cloneTransformed(transform: Transform): SweepContour | undefined;
54
58
  /** Test for near equality of curves, frame, and axis. */
55
59
  isAlmostEqual(other: any): boolean;
56
- /** Recompute the local strokes cache for this contour */
60
+ /** Recompute the local strokes cache for this contour. */
57
61
  computeXYStrokes(options?: StrokeOptions): void;
58
- /** Return cached contour strokes */
62
+ /** Return cached contour strokes. */
59
63
  get xyStrokes(): CurveCollection | undefined;
60
64
  /**
61
65
  * Build the (cached) internal facets for the contour.
62
66
  * @param options primarily how to stroke the contour, but also how to facet it.
63
- * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
67
+ * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar
68
+ * triangles are removed to return maximally convex facets.
64
69
  */
65
70
  buildFacets(options?: StrokeOptions): void;
66
71
  /**
@@ -68,21 +73,25 @@ export declare class SweepContour {
68
73
  * * This protects against PolyfaceBuilder reusing facets constructed with different options settings.
69
74
  */
70
75
  purgeFacets(): void;
71
- /** Emit facets to a builder.
76
+ /**
77
+ * Emit facets to a builder.
72
78
  * This method may cache and reuse facets over multiple calls.
73
79
  */
74
80
  emitFacets(builder: PolyfaceBuilder, reverse: boolean, transform?: Transform): void;
75
- /** Emit facets to a function
81
+ /**
82
+ * Emit facets to a function.
76
83
  * This method may cache and reuse facets over multiple calls.
77
- * @param announce callback to receive the facet set
78
- * @param options how to stroke the contour
84
+ * @param announce callback to receive the facet set.
85
+ * @param options how to stroke the contour.
79
86
  */
80
87
  announceFacets(announce: (facets: IndexedPolyface) => void, options?: StrokeOptions): void;
81
88
  /**
82
89
  * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.
83
90
  * @param sweepVector the sweep direction and distance:
84
- * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite in both directions).
85
- * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the computed contour normal.
91
+ * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite
92
+ * in both directions).
93
+ * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the
94
+ * computed contour normal.
86
95
  * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.
87
96
  * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`.
88
97
  * @param options how to stroke the contour
@@ -1 +1 @@
1
- {"version":3,"file":"SweepContour.d.ts","sourceRoot":"","sources":["../../../src/solid/SweepContour.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAa,MAAM,qBAAqB,CAAC;AAM1D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAW,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D;;;;GAIG;AACH,qBAAa,YAAY;IACvB,0EAA0E;IACnE,MAAM,EAAE,eAAe,CAAC;IAC/B,yEAAyE;IAClE,YAAY,EAAE,SAAS,CAAC;IAC/B,yCAAyC;IAClC,IAAI,EAAE,KAAK,GAAG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IAiBtH;;;;OAIG;WACW,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,GAAG,YAAY,GAAG,SAAS;IAQzF,wCAAwC;IACjC,SAAS,IAAI,eAAe;IACnC;;;OAGG;IACI,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO;IAezD,2BAA2B;IACpB,KAAK,IAAI,YAAY;IAG5B,kCAAkC;IAC3B,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS;IAMvE,yDAAyD;IAClD,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAczC,0DAA0D;IACnD,gBAAgB,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAStD,qCAAqC;IACrC,IAAW,SAAS,IAAI,eAAe,GAAG,SAAS,CAElD;IACD;;;;;OAKG;IACI,WAAW,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAcjD;;;OAGG;IACI,WAAW;IAGlB;;;OAGG;IACI,UAAU,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS;IAKnF;;;;;OAKG;IACI,cAAc,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAKjG;;;;;;;;;;;OAWG;IACI,iCAAiC,CACtC,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAE,OAAe,EAAE,IAAI,GAAE,OAAe,EAAE,OAAO,CAAC,EAAE,aAAa,GAC5F,0BAA0B,GAAG,SAAS;CA8C1C"}
@@ -39,7 +39,8 @@ class SweepContour {
39
39
  this.localToWorld = map;
40
40
  this.axis = axis;
41
41
  }
42
- /** Create for linear sweep.
42
+ /**
43
+ * Create for linear sweep.
43
44
  * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.
44
45
  * @param defaultNormal optional default normal for guiding coordinate frame setup.
45
46
  */
@@ -50,8 +51,10 @@ class SweepContour {
50
51
  }
51
52
  return undefined;
52
53
  }
53
- /** Create for linear sweep.
54
- * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in, parity logic is employed.
54
+ /**
55
+ * Create for linear sweep.
56
+ * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in,
57
+ * parity logic is employed.
55
58
  * For best results, all points should be coplanar.
56
59
  * @param defaultNormal optional default normal for guiding coordinate frame setup.
57
60
  */
@@ -73,7 +76,8 @@ class SweepContour {
73
76
  }
74
77
  return undefined;
75
78
  }
76
- /** Create for rotational sweep.
79
+ /**
80
+ * Create for rotational sweep.
77
81
  * @param contour curve to sweep, CAPTURED. For best results, contour should be coplanar with axis.
78
82
  * @param axis rotation axis
79
83
  */
@@ -85,7 +89,7 @@ class SweepContour {
85
89
  }
86
90
  return undefined;
87
91
  }
88
- /** Return (Reference to) the curves */
92
+ /** Return (Reference to) the curves. */
89
93
  getCurves() { return this.curves; }
90
94
  /**
91
95
  * Apply `transform` to the curves, axis.
@@ -133,7 +137,7 @@ class SweepContour {
133
137
  return false;
134
138
  return true;
135
139
  }
136
- /** Recompute the local strokes cache for this contour */
140
+ /** Recompute the local strokes cache for this contour. */
137
141
  computeXYStrokes(options) {
138
142
  this._xyStrokes = undefined;
139
143
  const worldToLocal = this.localToWorld.inverse();
@@ -143,14 +147,15 @@ class SweepContour {
143
147
  this._xyStrokes = strokes;
144
148
  }
145
149
  }
146
- /** Return cached contour strokes */
150
+ /** Return cached contour strokes. */
147
151
  get xyStrokes() {
148
152
  return this._xyStrokes;
149
153
  }
150
154
  /**
151
155
  * Build the (cached) internal facets for the contour.
152
156
  * @param options primarily how to stroke the contour, but also how to facet it.
153
- * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
157
+ * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar
158
+ * triangles are removed to return maximally convex facets.
154
159
  */
155
160
  buildFacets(options) {
156
161
  if (this._facets)
@@ -173,7 +178,8 @@ class SweepContour {
173
178
  purgeFacets() {
174
179
  this._facets = undefined;
175
180
  }
176
- /** Emit facets to a builder.
181
+ /**
182
+ * Emit facets to a builder.
177
183
  * This method may cache and reuse facets over multiple calls.
178
184
  */
179
185
  emitFacets(builder, reverse, transform) {
@@ -181,10 +187,11 @@ class SweepContour {
181
187
  if (this._facets)
182
188
  builder.addIndexedPolyface(this._facets, reverse, transform);
183
189
  }
184
- /** Emit facets to a function
190
+ /**
191
+ * Emit facets to a function.
185
192
  * This method may cache and reuse facets over multiple calls.
186
- * @param announce callback to receive the facet set
187
- * @param options how to stroke the contour
193
+ * @param announce callback to receive the facet set.
194
+ * @param options how to stroke the contour.
188
195
  */
189
196
  announceFacets(announce, options) {
190
197
  this.buildFacets(options);
@@ -194,8 +201,10 @@ class SweepContour {
194
201
  /**
195
202
  * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.
196
203
  * @param sweepVector the sweep direction and distance:
197
- * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite in both directions).
198
- * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the computed contour normal.
204
+ * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite
205
+ * in both directions).
206
+ * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the
207
+ * computed contour normal.
199
208
  * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.
200
209
  * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`.
201
210
  * @param options how to stroke the contour
@@ -209,7 +218,7 @@ class SweepContour {
209
218
  sweepVector = this.localToWorld.matrix.columnZ();
210
219
  }
211
220
  options.maximizeConvexFacets = true; // produce fewer ConvexClipPlaneSets
212
- // It's a trip around the barn, but it's easy to make a polyface and scan it . . .
221
+ // it's a trip around the barn, but it's easy to make a polyface and scan it
213
222
  this.buildFacets(options);
214
223
  const facets = this._facets;
215
224
  if (facets) {
@@ -1 +1 @@
1
- {"version":3,"file":"SweepContour.js","sourceRoot":"","sources":["../../../src/solid/SweepContour.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,qDAAkD;AAClD,uEAAoE;AACpE,uFAAoF;AAEpF,4DAAyD;AAEzD,wDAAqD;AACrD,wCAAqC;AACrC,wDAAqD;AACrD,wCAAqC;AACrC,kDAA+C;AAC/C,0DAAuD;AACvD,6DAA0D;AAE1D,mEAAkE;AAMlE;;;;GAIG;AACH,MAAa,YAAY;IAYvB,YAAoB,OAAiB,EAAE,GAAc,EAAE,IAAuB;QAC5E,IAAI,OAAO,YAAY,+BAAc,EAAE,CAAC;YACtC,2FAA2F;YAC3F,4FAA4F;YAC5F,wFAAwF;YACxF,MAAM,SAAS,GAAG,OAAO,CAAC;YAC1B,OAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,WAAI,EAAE,CAAC,CAAC,CAAC,IAAI,WAAI,EAAE,CAAC;YAC3F,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,oBAAoB,CAAC,OAAiB,EAAE,aAAwB;QAC5E,MAAM,YAAY,GAAG,2BAAY,CAAC,sBAAsB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACjF,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;OAIG;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,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC;gBACnD,MAAM,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACpD,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;gBACtC,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;gBACvC,MAAM,OAAO,GAAG,uCAAkB,CAAC,WAAW,EAAE,CAAC;gBACjD,IAAI,IAAI;oBACN,OAAO,CAAC,mBAAmB,CAAC,qBAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,IAAI,IAAI;oBACN,OAAO,CAAC,mBAAmB,CAAC,qBAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1OD,oCA0OC","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 Solid\r\n */\r\n\r\nimport { ClipPlane } from \"../clipping/ClipPlane\";\r\nimport { ConvexClipPlaneSet } from \"../clipping/ConvexClipPlaneSet\";\r\nimport { UnionOfConvexClipPlaneSets } from \"../clipping/UnionOfConvexClipPlaneSets\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { AnyCurve, AnyRegion } from \"../curve/CurveTypes\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Loop } from \"../curve/Loop\";\r\nimport { ParityRegion } from \"../curve/ParityRegion\";\r\nimport { Path } from \"../curve/Path\";\r\nimport { RegionOps } from \"../curve/RegionOps\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\r\nimport { MultiLineStringDataVariant } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { IndexedPolyface } from \"../polyface/Polyface\";\r\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\r\n\r\n/**\r\n * Sweepable planar contour with Transform for local to world interaction.\r\n * * The surface/solid classes `LinearSweep`, `RotationalSweep`, `RuledSweep` use this for their swept contours.\r\n * @public\r\n */\r\nexport class SweepContour {\r\n /** The underlying curve collection, in its world coordinates position. */\r\n public curves: CurveCollection;\r\n /** coordinate frame that in which the curves are all in the xy plane. */\r\n public localToWorld: Transform;\r\n /** Axis used only in rotational case. */\r\n public axis: Ray3d | undefined;\r\n\r\n /** caches */\r\n private _xyStrokes?: CurveCollection;\r\n private _facets?: IndexedPolyface;\r\n\r\n private constructor(contour: AnyCurve, map: Transform, axis: Ray3d | undefined) {\r\n if (contour instanceof CurvePrimitive) {\r\n // this.curves is a CurveCollection (not AnyCurve) so that contour type determines closure.\r\n // This is the only time we detect CurvePrimitive closure and wrap as a relevant CurveChain.\r\n // Note that we are ASSUMING closure means planar here. This is potentially problematic.\r\n const primitive = contour;\r\n contour = contour.startPoint().isAlmostEqual(contour.endPoint()) ? new Loop() : new Path();\r\n contour.tryAddChild(primitive);\r\n }\r\n this.curves = contour;\r\n this.localToWorld = map;\r\n this.axis = axis;\r\n }\r\n /** Create for linear sweep.\r\n * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.\r\n * @param defaultNormal optional default normal for guiding coordinate frame setup.\r\n */\r\n public static createForLinearSweep(contour: AnyCurve, defaultNormal?: Vector3d): SweepContour | undefined {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, contour);\r\n if (localToWorld) {\r\n return new SweepContour(contour, localToWorld, undefined);\r\n }\r\n return undefined;\r\n }\r\n /** Create for linear sweep.\r\n * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in, parity logic is employed.\r\n * For best results, all points should be coplanar.\r\n * @param defaultNormal optional default normal for guiding coordinate frame setup.\r\n */\r\n public static createForPolygon(points: MultiLineStringDataVariant, defaultNormal?: Vector3d): SweepContour | undefined {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, points);\r\n if (localToWorld) {\r\n const linestrings = LineString3d.createArrayOfLineString3d(points);\r\n const loops = [];\r\n for (const ls of linestrings) {\r\n ls.addClosurePoint();\r\n loops.push(Loop.create(ls));\r\n }\r\n if (loops.length === 1) {\r\n return new SweepContour(loops[0], localToWorld, undefined);\r\n } else if (loops.length > 1) {\r\n return new SweepContour(ParityRegion.createLoops(loops), localToWorld, undefined);\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Create for rotational sweep.\r\n * @param contour curve to sweep, CAPTURED. For best results, contour should be coplanar with axis.\r\n * @param axis rotation axis\r\n */\r\n public static createForRotation(contour: AnyCurve, axis: Ray3d): SweepContour | undefined {\r\n // createRightHandedFrame -- the axis is a last-gasp resolver for in-plane vectors.\r\n const localToWorld = FrameBuilder.createRightHandedFrame(undefined, contour, axis);\r\n if (localToWorld) {\r\n return new SweepContour(contour, localToWorld, axis.clone());\r\n }\r\n return undefined;\r\n }\r\n /** Return (Reference to) the curves */\r\n public getCurves(): CurveCollection { return this.curves; }\r\n /**\r\n * Apply `transform` to the curves, axis.\r\n * * The local to world frame is reconstructed for the transformed curves.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (this.curves.tryTransformInPlace(transform)) {\r\n if (this.axis)\r\n this.axis.transformInPlace(transform);\r\n\r\n const localToWorld = this.axis !== undefined\r\n ? FrameBuilder.createRightHandedFrame(undefined, this.curves, this.axis)\r\n : FrameBuilder.createRightHandedFrame(undefined, this.curves);\r\n if (localToWorld) {\r\n this.localToWorld.setFrom(localToWorld);\r\n this._xyStrokes = undefined;\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Return a deep clone. */\r\n public clone(): SweepContour {\r\n return new SweepContour(this.curves.clone(), this.localToWorld.clone(), this.axis);\r\n }\r\n /** Return a transformed clone. */\r\n public cloneTransformed(transform: Transform): SweepContour | undefined {\r\n const newContour = this.clone();\r\n if (newContour.tryTransformInPlace(transform))\r\n return newContour;\r\n return undefined;\r\n }\r\n /** Test for near equality of curves, frame, and axis. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (! (other instanceof SweepContour))\r\n return false;\r\n if (!this.curves.isAlmostEqual(other.curves))\r\n return false;\r\n if (!this.localToWorld.isAlmostEqual(other.localToWorld))\r\n return false;\r\n if (this.axis && other.axis) {\r\n if (!this.axis.isAlmostEqual(other.axis))\r\n return false;\r\n } else if (this.axis || other.axis)\r\n return false;\r\n return true;\r\n }\r\n\r\n /** Recompute the local strokes cache for this contour */\r\n public computeXYStrokes(options?: StrokeOptions): void {\r\n this._xyStrokes = undefined;\r\n const worldToLocal = this.localToWorld.inverse();\r\n if (worldToLocal) {\r\n const strokes = this.curves.cloneStroked(options);\r\n if (strokes.tryTransformInPlace(worldToLocal))\r\n this._xyStrokes = strokes;\r\n }\r\n }\r\n /** Return cached contour strokes */\r\n public get xyStrokes(): CurveCollection | undefined {\r\n return this._xyStrokes;\r\n }\r\n\r\n /**\r\n * Build the (cached) internal facets for the contour.\r\n * @param options primarily how to stroke the contour, but also how to facet it.\r\n * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.\r\n */\r\n public buildFacets(options?: StrokeOptions): void {\r\n if (this._facets)\r\n return;\r\n if (!this.curves.isAnyRegion())\r\n return;\r\n const worldToLocal = this.localToWorld.inverse();\r\n if (!worldToLocal)\r\n return;\r\n const localRegion = this.curves.cloneTransformed(worldToLocal) as AnyRegion | undefined;\r\n if (!localRegion)\r\n return;\r\n if (this._facets = RegionOps.facetRegionXY(localRegion, options))\r\n this._facets.tryTransformInPlace(this.localToWorld);\r\n }\r\n /**\r\n * Delete facet cache.\r\n * * This protects against PolyfaceBuilder reusing facets constructed with different options settings.\r\n */\r\n public purgeFacets() {\r\n this._facets = undefined;\r\n }\r\n /** Emit facets to a builder.\r\n * This method may cache and reuse facets over multiple calls.\r\n */\r\n public emitFacets(builder: PolyfaceBuilder, reverse: boolean, transform?: Transform) {\r\n this.buildFacets(builder.options);\r\n if (this._facets)\r\n builder.addIndexedPolyface(this._facets, reverse, transform);\r\n }\r\n /** Emit facets to a function\r\n * This method may cache and reuse facets over multiple calls.\r\n * @param announce callback to receive the facet set\r\n * @param options how to stroke the contour\r\n */\r\n public announceFacets(announce: (facets: IndexedPolyface) => void, options?: StrokeOptions): void {\r\n this.buildFacets(options);\r\n if (this._facets)\r\n announce(this._facets);\r\n }\r\n /**\r\n * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.\r\n * @param sweepVector the sweep direction and distance:\r\n * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite in both directions).\r\n * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the computed contour normal.\r\n * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.\r\n * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`.\r\n * @param options how to stroke the contour\r\n * @returns clipper defined by faceting then sweeping the contour region\r\n */\r\n public sweepToUnionOfConvexClipPlaneSets(sweepVector?: Vector3d, cap0: boolean = false, cap1: boolean = false, options?: StrokeOptions): UnionOfConvexClipPlaneSets | undefined {\r\n if (!options)\r\n options = StrokeOptions.createForFacets();\r\n if (!sweepVector) {\r\n cap0 = cap1 = false;\r\n sweepVector = this.localToWorld.matrix.columnZ();\r\n }\r\n options.maximizeConvexFacets = true; // produce fewer ConvexClipPlaneSets\r\n // It's a trip around the barn, but it's easy to make a polyface and scan it . . .\r\n this.buildFacets(options);\r\n const facets = this._facets;\r\n if (facets) {\r\n const point0 = Point3d.create();\r\n const point1 = Point3d.create();\r\n const result = UnionOfConvexClipPlaneSets.createEmpty();\r\n const visitor = facets.createVisitor(1);\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n const numEdges = visitor.point.length - 1;\r\n const clipper = ConvexClipPlaneSet.createEmpty();\r\n for (let i = 0; i < numEdges; i++) {\r\n visitor.point.getPoint3dAtUncheckedPointIndex(i, point0);\r\n visitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);\r\n const plane = ClipPlane.createEdgeAndUpVector(point1, point0, sweepVector);\r\n const visible = visitor.edgeVisible[i];\r\n plane?.setFlags(!visible, !visible);\r\n clipper.addPlaneToConvexSet(plane);\r\n }\r\n result.addConvexSet(clipper);\r\n }\r\n if (cap0 || cap1) {\r\n const zVector = this.localToWorld.matrix.columnZ();\r\n const plane0Origin = this.localToWorld.getOrigin();\r\n const plane1Origin = plane0Origin.plus(sweepVector);\r\n const inwardNormal0 = zVector.clone();\r\n const inwardNormal1 = zVector.negate();\r\n const clipper = ConvexClipPlaneSet.createEmpty();\r\n if (cap0)\r\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal0, plane0Origin));\r\n if (cap1)\r\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal1, plane1Origin));\r\n result.addConvexSet(clipper);\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SweepContour.js","sourceRoot":"","sources":["../../../src/solid/SweepContour.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,qDAAkD;AAClD,uEAAoE;AACpE,uFAAoF;AAEpF,4DAAyD;AAEzD,wDAAqD;AACrD,wCAAqC;AACrC,wDAAqD;AACrD,wCAAqC;AACrC,kDAA+C;AAC/C,0DAAuD;AACvD,6DAA0D;AAE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oBACN,OAAO,CAAC,mBAAmB,CAAC,qBAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,IAAI,IAAI;oBACN,OAAO,CAAC,mBAAmB,CAAC,qBAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjPD,oCAiPC","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 Solid\r\n */\r\n\r\nimport { ClipPlane } from \"../clipping/ClipPlane\";\r\nimport { ConvexClipPlaneSet } from \"../clipping/ConvexClipPlaneSet\";\r\nimport { UnionOfConvexClipPlaneSets } from \"../clipping/UnionOfConvexClipPlaneSets\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { AnyCurve, AnyRegion } from \"../curve/CurveTypes\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Loop } from \"../curve/Loop\";\r\nimport { ParityRegion } from \"../curve/ParityRegion\";\r\nimport { Path } from \"../curve/Path\";\r\nimport { RegionOps } from \"../curve/RegionOps\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\r\nimport { MultiLineStringDataVariant } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { IndexedPolyface } from \"../polyface/Polyface\";\r\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\r\n\r\n/**\r\n * Sweepable planar contour with Transform for local to world interaction.\r\n * * The surface/solid classes `LinearSweep`, `RotationalSweep`, `RuledSweep` use this for their swept contours.\r\n * @public\r\n */\r\nexport class SweepContour {\r\n /** The underlying curve collection, in its world coordinates position. */\r\n public curves: CurveCollection;\r\n /** coordinate frame that in which the curves are all in the xy plane. */\r\n public localToWorld: Transform;\r\n /** Axis used only in rotational case. */\r\n public axis: Ray3d | undefined;\r\n /** Caches */\r\n private _xyStrokes?: CurveCollection;\r\n private _facets?: IndexedPolyface;\r\n\r\n private constructor(contour: AnyCurve, map: Transform, axis: Ray3d | undefined) {\r\n if (contour instanceof CurvePrimitive) {\r\n // this.curves is a CurveCollection (not AnyCurve) so that contour type determines closure.\r\n // This is the only time we detect CurvePrimitive closure and wrap as a relevant CurveChain.\r\n // Note that we are ASSUMING closure means planar here. This is potentially problematic.\r\n const primitive = contour;\r\n contour = contour.startPoint().isAlmostEqual(contour.endPoint()) ? new Loop() : new Path();\r\n contour.tryAddChild(primitive);\r\n }\r\n this.curves = contour;\r\n this.localToWorld = map;\r\n this.axis = axis;\r\n }\r\n /**\r\n * Create for linear sweep.\r\n * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.\r\n * @param defaultNormal optional default normal for guiding coordinate frame setup.\r\n */\r\n public static createForLinearSweep(contour: AnyCurve, defaultNormal?: Vector3d): SweepContour | undefined {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, contour);\r\n if (localToWorld) {\r\n return new SweepContour(contour, localToWorld, undefined);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create for linear sweep.\r\n * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in,\r\n * parity logic is employed.\r\n * For best results, all points should be coplanar.\r\n * @param defaultNormal optional default normal for guiding coordinate frame setup.\r\n */\r\n public static createForPolygon(points: MultiLineStringDataVariant, defaultNormal?: Vector3d): SweepContour | undefined {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, points);\r\n if (localToWorld) {\r\n const linestrings = LineString3d.createArrayOfLineString3d(points);\r\n const loops = [];\r\n for (const ls of linestrings) {\r\n ls.addClosurePoint();\r\n loops.push(Loop.create(ls));\r\n }\r\n if (loops.length === 1) {\r\n return new SweepContour(loops[0], localToWorld, undefined);\r\n } else if (loops.length > 1) {\r\n return new SweepContour(ParityRegion.createLoops(loops), localToWorld, undefined);\r\n }\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create for rotational sweep.\r\n * @param contour curve to sweep, CAPTURED. For best results, contour should be coplanar with axis.\r\n * @param axis rotation axis\r\n */\r\n public static createForRotation(contour: AnyCurve, axis: Ray3d): SweepContour | undefined {\r\n // createRightHandedFrame -- the axis is a last-gasp resolver for in-plane vectors.\r\n const localToWorld = FrameBuilder.createRightHandedFrame(undefined, contour, axis);\r\n if (localToWorld) {\r\n return new SweepContour(contour, localToWorld, axis.clone());\r\n }\r\n return undefined;\r\n }\r\n /** Return (Reference to) the curves. */\r\n public getCurves(): CurveCollection { return this.curves; }\r\n /**\r\n * Apply `transform` to the curves, axis.\r\n * * The local to world frame is reconstructed for the transformed curves.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (this.curves.tryTransformInPlace(transform)) {\r\n if (this.axis)\r\n this.axis.transformInPlace(transform);\r\n const localToWorld = this.axis !== undefined\r\n ? FrameBuilder.createRightHandedFrame(undefined, this.curves, this.axis)\r\n : FrameBuilder.createRightHandedFrame(undefined, this.curves);\r\n if (localToWorld) {\r\n this.localToWorld.setFrom(localToWorld);\r\n this._xyStrokes = undefined;\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Return a deep clone. */\r\n public clone(): SweepContour {\r\n return new SweepContour(this.curves.clone(), this.localToWorld.clone(), this.axis);\r\n }\r\n /** Return a transformed clone. */\r\n public cloneTransformed(transform: Transform): SweepContour | undefined {\r\n const newContour = this.clone();\r\n if (newContour.tryTransformInPlace(transform))\r\n return newContour;\r\n return undefined;\r\n }\r\n /** Test for near equality of curves, frame, and axis. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (!(other instanceof SweepContour))\r\n return false;\r\n if (!this.curves.isAlmostEqual(other.curves))\r\n return false;\r\n if (!this.localToWorld.isAlmostEqual(other.localToWorld))\r\n return false;\r\n if (this.axis && other.axis) {\r\n if (!this.axis.isAlmostEqual(other.axis))\r\n return false;\r\n } else if (this.axis || other.axis)\r\n return false;\r\n return true;\r\n }\r\n /** Recompute the local strokes cache for this contour. */\r\n public computeXYStrokes(options?: StrokeOptions): void {\r\n this._xyStrokes = undefined;\r\n const worldToLocal = this.localToWorld.inverse();\r\n if (worldToLocal) {\r\n const strokes = this.curves.cloneStroked(options);\r\n if (strokes.tryTransformInPlace(worldToLocal))\r\n this._xyStrokes = strokes;\r\n }\r\n }\r\n /** Return cached contour strokes. */\r\n public get xyStrokes(): CurveCollection | undefined {\r\n return this._xyStrokes;\r\n }\r\n /**\r\n * Build the (cached) internal facets for the contour.\r\n * @param options primarily how to stroke the contour, but also how to facet it.\r\n * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar\r\n * triangles are removed to return maximally convex facets.\r\n */\r\n public buildFacets(options?: StrokeOptions): void {\r\n if (this._facets)\r\n return;\r\n if (!this.curves.isAnyRegion())\r\n return;\r\n const worldToLocal = this.localToWorld.inverse();\r\n if (!worldToLocal)\r\n return;\r\n const localRegion = this.curves.cloneTransformed(worldToLocal) as AnyRegion | undefined;\r\n if (!localRegion)\r\n return;\r\n if (this._facets = RegionOps.facetRegionXY(localRegion, options))\r\n this._facets.tryTransformInPlace(this.localToWorld);\r\n }\r\n /**\r\n * Delete facet cache.\r\n * * This protects against PolyfaceBuilder reusing facets constructed with different options settings.\r\n */\r\n public purgeFacets() {\r\n this._facets = undefined;\r\n }\r\n /**\r\n * Emit facets to a builder.\r\n * This method may cache and reuse facets over multiple calls.\r\n */\r\n public emitFacets(builder: PolyfaceBuilder, reverse: boolean, transform?: Transform) {\r\n this.buildFacets(builder.options);\r\n if (this._facets)\r\n builder.addIndexedPolyface(this._facets, reverse, transform);\r\n }\r\n /**\r\n * Emit facets to a function.\r\n * This method may cache and reuse facets over multiple calls.\r\n * @param announce callback to receive the facet set.\r\n * @param options how to stroke the contour.\r\n */\r\n public announceFacets(announce: (facets: IndexedPolyface) => void, options?: StrokeOptions): void {\r\n this.buildFacets(options);\r\n if (this._facets)\r\n announce(this._facets);\r\n }\r\n /**\r\n * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.\r\n * @param sweepVector the sweep direction and distance:\r\n * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite\r\n * in both directions).\r\n * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the\r\n * computed contour normal.\r\n * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.\r\n * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`.\r\n * @param options how to stroke the contour\r\n * @returns clipper defined by faceting then sweeping the contour region\r\n */\r\n public sweepToUnionOfConvexClipPlaneSets(\r\n sweepVector?: Vector3d, cap0: boolean = false, cap1: boolean = false, options?: StrokeOptions,\r\n ): UnionOfConvexClipPlaneSets | undefined {\r\n if (!options)\r\n options = StrokeOptions.createForFacets();\r\n if (!sweepVector) {\r\n cap0 = cap1 = false;\r\n sweepVector = this.localToWorld.matrix.columnZ();\r\n }\r\n options.maximizeConvexFacets = true; // produce fewer ConvexClipPlaneSets\r\n // it's a trip around the barn, but it's easy to make a polyface and scan it\r\n this.buildFacets(options);\r\n const facets = this._facets;\r\n if (facets) {\r\n const point0 = Point3d.create();\r\n const point1 = Point3d.create();\r\n const result = UnionOfConvexClipPlaneSets.createEmpty();\r\n const visitor = facets.createVisitor(1);\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n const numEdges = visitor.point.length - 1;\r\n const clipper = ConvexClipPlaneSet.createEmpty();\r\n for (let i = 0; i < numEdges; i++) {\r\n visitor.point.getPoint3dAtUncheckedPointIndex(i, point0);\r\n visitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);\r\n const plane = ClipPlane.createEdgeAndUpVector(point1, point0, sweepVector);\r\n const visible = visitor.edgeVisible[i];\r\n plane?.setFlags(!visible, !visible);\r\n clipper.addPlaneToConvexSet(plane);\r\n }\r\n result.addConvexSet(clipper);\r\n }\r\n if (cap0 || cap1) {\r\n const zVector = this.localToWorld.matrix.columnZ();\r\n const plane0Origin = this.localToWorld.getOrigin();\r\n const plane1Origin = plane0Origin.plus(sweepVector);\r\n const inwardNormal0 = zVector.clone();\r\n const inwardNormal1 = zVector.negate();\r\n const clipper = ConvexClipPlaneSet.createEmpty();\r\n if (cap0)\r\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal0, plane0Origin));\r\n if (cap1)\r\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal1, plane1Origin));\r\n result.addConvexSet(clipper);\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BezierCurveBase.d.ts","sourceRoot":"","sources":["../../../src/bspline/BezierCurveBase.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBA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EAAE,SAAS,CAAC,CAAC;QACvE,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF","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/** @packageDocumentation\r\n * @module Bspline\r\n */\r\n\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { CurveOffsetXYHandler } from \"../curve/internalContexts/CurveOffsetXYHandler\";\r\nimport { PlaneAltitudeRangeContext } from \"../curve/internalContexts/PlaneAltitudeRangeContext\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { OffsetOptions } from \"../curve/OffsetOptions\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { IStrokeHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { UnivariateBezier } from \"../numerics/BezierPolynomials\";\r\nimport { Bezier1dNd } from \"./Bezier1dNd\";\r\nimport { KnotVector } from \"./KnotVector\";\r\n\r\n/**\r\n * Base class for CurvePrimitive (necessarily 3D) with _polygon.\r\n * * This has a Bezier1dNd polygon as a member, and implements dimension-independent methods\r\n * * This exists to support\r\n * * BezierCurve3d -- 3 coordinates x,y,z per block in the Bezier1dNd poles\r\n * * BezierCurve3dH -- 4 coordinates x,y,z,w per block in the Bezier1dNd poles\r\n * * The implementations of \"pure 3d\" queries is based on calling `getPolePoint3d`.\r\n * * This has the subtle failure difference that `getPolePoint3d` call with a valid index on on a 3d curve always succeeds, but on 3dH curve fails when weight is zero.\r\n * @public\r\n */\r\nexport abstract class BezierCurveBase extends CurvePrimitive {\r\n /** String name for schema properties */\r\n public readonly curvePrimitiveType = \"bezierCurve\";\r\n\r\n /** Control points */\r\n protected _polygon: Bezier1dNd;\r\n /** scratch data blocks accessible by concrete class. Initialized to correct blockSize in constructor. */\r\n protected _workData0: Float64Array;\r\n /** scratch data blocks accessible by concrete class. Initialized to correct blockSize in constructor. */\r\n protected _workData1: Float64Array;\r\n /** Scratch xyz point accessible by derived classes. */\r\n protected _workPoint0: Point3d;\r\n /** Scratch xyz point accessible by derived classes. */\r\n protected _workPoint1: Point3d;\r\n\r\n protected constructor(blockSize: number, data: Float64Array) {\r\n super();\r\n this._polygon = new Bezier1dNd(blockSize, data);\r\n this._workPoint0 = Point3d.create();\r\n this._workPoint1 = Point3d.create();\r\n this._workData0 = new Float64Array(blockSize);\r\n this._workData1 = new Float64Array(blockSize);\r\n\r\n }\r\n /** reverse the poles in place */\r\n public reverseInPlace(): void { this._polygon.reverseInPlace(); }\r\n /** saturate the pole in place, using knot intervals from `spanIndex` of the `knotVector` */\r\n public saturateInPlace(knotVector: KnotVector, spanIndex: number): boolean {\r\n const boolStat = this._polygon.saturateInPlace(knotVector, spanIndex);\r\n if (boolStat) {\r\n this.setInterval(\r\n knotVector.spanFractionToFraction(spanIndex, 0.0),\r\n knotVector.spanFractionToFraction(spanIndex, 1.0));\r\n }\r\n return boolStat;\r\n }\r\n /** (property accessor) Return the polynomial degree (one less than order) */\r\n public get degree(): number {\r\n return this._polygon.order - 1;\r\n }\r\n /** (property accessor) Return the polynomial order */\r\n public get order(): number { return this._polygon.order; }\r\n /** (property accessor) Return the number of poles (aka control points) */\r\n public get numPoles(): number { return this._polygon.order; }\r\n /** Get pole `i` as a Point3d.\r\n * * For 3d curve, this is simple a pole access, and only fails (return `undefined`) for invalid index\r\n * * For 4d curve, this deweights the homogeneous pole and can fail due to 0 weight.\r\n */\r\n public abstract getPolePoint3d(i: number, point?: Point3d): Point3d | undefined;\r\n\r\n /** Get pole `i` as a Point4d.\r\n * * For 3d curve, this accesses the simple pole and returns with weight 1.\r\n * * For 4d curve, this accesses the (weighted) pole.\r\n */\r\n public abstract getPolePoint4d(i: number, point?: Point4d): Point4d | undefined;\r\n /** Set mapping to parent curve (e.g. if this bezier is a span extracted from a bspline, this is the knot interval of the span) */\r\n public setInterval(a: number, b: number) { this._polygon.setInterval(a, b); }\r\n /** map `fraction` from this Bezier curves inherent 0..1 range to the (a,b) range of parent\r\n * * ( The parent range should have been previously defined with `setInterval`)\r\n */\r\n public fractionToParentFraction(fraction: number): number { return this._polygon.fractionToParentFraction(fraction); }\r\n\r\n /** append stroke points to a linestring, based on `strokeCount` and `fractionToPoint` from derived class*/\r\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\r\n const numPerSpan = this.computeStrokeCountForOptions(options);\r\n const fractionStep = 1.0 / numPerSpan;\r\n for (let i = 0; i <= numPerSpan; i++) {\r\n const fraction = i * fractionStep;\r\n this.fractionToPoint(fraction, this._workPoint0);\r\n dest.appendStrokePoint(this._workPoint0);\r\n }\r\n }\r\n /** announce intervals with stroke counts */\r\n public emitStrokableParts(handler: IStrokeHandler, _options?: StrokeOptions): void {\r\n const numPerSpan = this.computeStrokeCountForOptions(_options);\r\n handler.announceIntervalForUniformStepStrokes(this, numPerSpan, 0.0, 1.0);\r\n }\r\n /** Return a simple array of arrays with the control points as `[[x,y,z],[x,y,z],..]` */\r\n public copyPolesAsJsonArray(): any[] { return this._polygon.unpackToJsonArrays(); }\r\n\r\n /** return true if all poles are on a plane. */\r\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\r\n let point: Point3d | undefined = this._workPoint0;\r\n for (let i = 0; ; i++) {\r\n point = this.getPolePoint3d(i, point);\r\n if (!point)\r\n return true;\r\n if (!plane.isPointInPlane(point))\r\n break; // which gets to return false, which is otherwise unreachable . . .\r\n }\r\n return false;\r\n }\r\n /** Return the length of the control polygon. */\r\n public polygonLength(): number {\r\n if (!this.getPolePoint3d(0, this._workPoint0))\r\n return 0.0;\r\n let i = 0;\r\n let sum = 0.0;\r\n while (this.getPolePoint3d(++i, this._workPoint1)) {\r\n sum += this._workPoint0.distance(this._workPoint1);\r\n this._workPoint0.setFrom(this._workPoint1);\r\n }\r\n return sum;\r\n }\r\n /** Return the start point. (first control point) */\r\n public override startPoint(): Point3d {\r\n const result = this.getPolePoint3d(0)!; // ASSUME non-trivial pole set -- if null comes back, it bubbles out\r\n return result;\r\n }\r\n /** Return the end point. (last control point) */\r\n public override endPoint(): Point3d {\r\n const result = this.getPolePoint3d(this.order - 1)!; // ASSUME non-trivial pole set\r\n return result;\r\n }\r\n /** Return the control polygon length as a quick length estimate. */\r\n public quickLength(): number { return this.polygonLength(); }\r\n /** Concrete classes must implement extendRange . . . */\r\n public abstract override extendRange(rangeToExtend: Range3d, transform?: Transform): void;\r\n /**\r\n * 1D bezier coefficients for use in range computations.\r\n * @internal\r\n */\r\n protected _workBezier?: UnivariateBezier; // available for bezier logic within a method\r\n /** scratch array for use by derived classes, using allocateAndZeroBezierWorkData for sizing. */\r\n protected _workCoffsA?: Float64Array;\r\n /** scratch array for use by derived classes, using allocateAndZeroBezierWorkData for sizing. */\r\n protected _workCoffsB?: Float64Array;\r\n\r\n /**\r\n * set up the _workBezier members with specific order.\r\n * * Try to reuse existing members if their sizes match.\r\n * * Ignore members corresponding to args that are 0 or negative.\r\n * @param primaryBezierOrder order of expected bezier\r\n * @param orderA length of _workCoffsA (simple array)\r\n * @param orderB length of _workCoffsB (simple array)\r\n */\r\n protected allocateAndZeroBezierWorkData(primaryBezierOrder: number, orderA: number, orderB: number) {\r\n if (primaryBezierOrder > 0) {\r\n if (this._workBezier !== undefined && this._workBezier.order === primaryBezierOrder) {\r\n this._workBezier.zero();\r\n } else\r\n this._workBezier = new UnivariateBezier(primaryBezierOrder);\r\n }\r\n if (orderA > 0) {\r\n if (this._workCoffsA !== undefined && this._workCoffsA.length === orderA)\r\n this._workCoffsA.fill(0);\r\n else\r\n this._workCoffsA = new Float64Array(orderA);\r\n }\r\n if (orderB > 0) {\r\n if (this._workCoffsB !== undefined && this._workCoffsB.length === orderB)\r\n this._workCoffsB.fill(0);\r\n else\r\n this._workCoffsB = new Float64Array(orderB);\r\n }\r\n }\r\n /**\r\n * Assess length and turn to determine a stroke count.\r\n * * this method is used by both BSplineCurve3d and BSplineCurve3dH.\r\n * * points are accessed via getPolePoint3d.\r\n * * Hence a zero-weight pole will be a problem\r\n * @param options stroke options structure.\r\n */\r\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\r\n\r\n this.getPolePoint3d(0, this._workPoint0);\r\n this.getPolePoint3d(1, this._workPoint1);\r\n let numStrokes = 1;\r\n if (this._workPoint0 && this._workPoint1) {\r\n let dx0 = this._workPoint1.x - this._workPoint0.x;\r\n let dy0 = this._workPoint1.y - this._workPoint0.y;\r\n let dz0 = this._workPoint1.z - this._workPoint0.z;\r\n let dx1, dy1, dz1; // first differences of leading edge\r\n let sumRadians = 0.0;\r\n let thisLength = Geometry.hypotenuseXYZ(dx0, dy0, dz0);\r\n this._workPoint1.setFromPoint3d(this._workPoint0);\r\n let sumLength = thisLength;\r\n let maxLength = thisLength;\r\n let maxRadians = 0.0;\r\n let thisRadians;\r\n for (let i = 2; this.getPolePoint3d(i, this._workPoint1); i++) {\r\n dx1 = this._workPoint1.x - this._workPoint0.x;\r\n dy1 = this._workPoint1.y - this._workPoint0.y;\r\n dz1 = this._workPoint1.z - this._workPoint0.z;\r\n thisRadians = Angle.radiansBetweenVectorsXYZ(dx0, dy0, dz0, dx1, dy1, dz1);\r\n sumRadians += thisRadians;\r\n maxRadians = Geometry.maxAbsXY(thisRadians, maxRadians);\r\n thisLength = Geometry.hypotenuseXYZ(dx1, dy1, dz1);\r\n sumLength += thisLength;\r\n maxLength = Geometry.maxXY(maxLength, thisLength);\r\n dx0 = dx1;\r\n dy0 = dy1;\r\n dz0 = dz1;\r\n this._workPoint0.setFrom(this._workPoint1);\r\n }\r\n const length1 = maxLength * this.degree; // This may be larger than sumLength\r\n const length2 = Math.sqrt(length1 * sumLength); // This is in between\r\n let radians1 = maxRadians * (this.degree - 1); // As if worst case keeps happening.\r\n if (this.degree < 3)\r\n radians1 *= 3; // so quadratics aren't under-stroked\r\n const radians2 = Math.sqrt(radians1 * sumRadians);\r\n const minCount = this.degree; // NOTE: this means 1) a small, nontrivial, straight Bezier is over-stroked, and 2) options.minStrokesPerPrimitive is ignored\r\n numStrokes = StrokeOptions.applyAngleTol(options,\r\n StrokeOptions.applyMaxEdgeLength(options, minCount, length2), radians2, 0.1);\r\n if (options) {\r\n numStrokes = options.applyChordTolToLengthAndRadians(numStrokes, sumLength, radians1);\r\n }\r\n }\r\n return numStrokes;\r\n }\r\n\r\n /** Return a deep clone. */\r\n public abstract override clone(): BezierCurveBase;\r\n\r\n /** Return a transformed deep clone. */\r\n public override cloneTransformed(transform: Transform): BezierCurveBase {\r\n const curve1 = this.clone();\r\n curve1.tryTransformInPlace(transform);\r\n return curve1;\r\n }\r\n\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset\r\n * for an aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\r\n */\r\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined {\r\n const options = OffsetOptions.create(offsetDistanceOrOptions);\r\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\r\n this.emitStrokableParts(handler, options.strokeOptions);\r\n return handler.claimResult();\r\n }\r\n\r\n /** Return a curve primitive which is a portion of this curve.\r\n * @param fractionA [in] start fraction\r\n * @param fractionB [in] end fraction\r\n */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): BezierCurveBase {\r\n const partialCurve = this.clone();\r\n partialCurve._polygon.subdivideToIntervalInPlace(fractionA, fractionB);\r\n return partialCurve;\r\n }\r\n\r\n /** Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BezierCurveBase.js","sourceRoot":"","sources":["../../../src/bspline/BezierCurveBase.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAEhG,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAKlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C;;;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B;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC5B,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACa,iBAAiB,CAAC,uBAA+C;QAC/E,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,IAAI,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAC3E,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QACxD,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACa,iBAAiB,CAAC,SAAiB,EAAE,SAAiB;QACpE,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAClC,YAAY,CAAC,QAAQ,CAAC,0BAA0B,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACvE,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF","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/** @packageDocumentation\r\n * @module Bspline\r\n */\r\n\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { CurveOffsetXYHandler } from \"../curve/internalContexts/CurveOffsetXYHandler\";\r\nimport { PlaneAltitudeRangeContext } from \"../curve/internalContexts/PlaneAltitudeRangeContext\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { OffsetOptions } from \"../curve/OffsetOptions\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { IStrokeHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { UnivariateBezier } from \"../numerics/BezierPolynomials\";\r\nimport { Bezier1dNd } from \"./Bezier1dNd\";\r\nimport { KnotVector } from \"./KnotVector\";\r\n\r\n/**\r\n * Base class for CurvePrimitive (necessarily 3D) with _polygon.\r\n * * This has a Bezier1dNd polygon as a member, and implements dimension-independent methods\r\n * * This exists to support\r\n * * BezierCurve3d -- 3 coordinates x,y,z per block in the Bezier1dNd poles\r\n * * BezierCurve3dH -- 4 coordinates x,y,z,w per block in the Bezier1dNd poles\r\n * * The implementations of \"pure 3d\" queries is based on calling `getPolePoint3d`.\r\n * * This has the subtle failure difference that `getPolePoint3d` call with a valid index on on a 3d curve always succeeds, but on 3dH curve fails when weight is zero.\r\n * @public\r\n */\r\nexport abstract class BezierCurveBase extends CurvePrimitive {\r\n /** String name for schema properties */\r\n public readonly curvePrimitiveType = \"bezierCurve\";\r\n\r\n /** Control points */\r\n protected _polygon: Bezier1dNd;\r\n /** scratch data blocks accessible by concrete class. Initialized to correct blockSize in constructor. */\r\n protected _workData0: Float64Array;\r\n /** scratch data blocks accessible by concrete class. Initialized to correct blockSize in constructor. */\r\n protected _workData1: Float64Array;\r\n /** Scratch xyz point accessible by derived classes. */\r\n protected _workPoint0: Point3d;\r\n /** Scratch xyz point accessible by derived classes. */\r\n protected _workPoint1: Point3d;\r\n\r\n protected constructor(blockSize: number, data: Float64Array) {\r\n super();\r\n this._polygon = new Bezier1dNd(blockSize, data);\r\n this._workPoint0 = Point3d.create();\r\n this._workPoint1 = Point3d.create();\r\n this._workData0 = new Float64Array(blockSize);\r\n this._workData1 = new Float64Array(blockSize);\r\n\r\n }\r\n /** reverse the poles in place */\r\n public reverseInPlace(): void { this._polygon.reverseInPlace(); }\r\n /** saturate the pole in place, using knot intervals from `spanIndex` of the `knotVector` */\r\n public saturateInPlace(knotVector: KnotVector, spanIndex: number): boolean {\r\n const boolStat = this._polygon.saturateInPlace(knotVector, spanIndex);\r\n if (boolStat) {\r\n this.setInterval(\r\n knotVector.spanFractionToFraction(spanIndex, 0.0),\r\n knotVector.spanFractionToFraction(spanIndex, 1.0));\r\n }\r\n return boolStat;\r\n }\r\n /** (property accessor) Return the polynomial degree (one less than order) */\r\n public get degree(): number {\r\n return this._polygon.order - 1;\r\n }\r\n /** (property accessor) Return the polynomial order */\r\n public get order(): number { return this._polygon.order; }\r\n /** (property accessor) Return the number of poles (aka control points) */\r\n public get numPoles(): number { return this._polygon.order; }\r\n /** Get pole `i` as a Point3d.\r\n * * For 3d curve, this is simple a pole access, and only fails (return `undefined`) for invalid index\r\n * * For 4d curve, this deweights the homogeneous pole and can fail due to 0 weight.\r\n */\r\n public abstract getPolePoint3d(i: number, point?: Point3d): Point3d | undefined;\r\n\r\n /** Get pole `i` as a Point4d.\r\n * * For 3d curve, this accesses the simple pole and returns with weight 1.\r\n * * For 4d curve, this accesses the (weighted) pole.\r\n */\r\n public abstract getPolePoint4d(i: number, point?: Point4d): Point4d | undefined;\r\n /** Set mapping to parent curve (e.g. if this bezier is a span extracted from a bspline, this is the knot interval of the span) */\r\n public setInterval(a: number, b: number) { this._polygon.setInterval(a, b); }\r\n /** map `fraction` from this Bezier curves inherent 0..1 range to the (a,b) range of parent\r\n * * ( The parent range should have been previously defined with `setInterval`)\r\n */\r\n public fractionToParentFraction(fraction: number): number { return this._polygon.fractionToParentFraction(fraction); }\r\n\r\n /** append stroke points to a linestring, based on `strokeCount` and `fractionToPoint` from derived class*/\r\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\r\n const numPerSpan = this.computeStrokeCountForOptions(options);\r\n const fractionStep = 1.0 / numPerSpan;\r\n for (let i = 0; i <= numPerSpan; i++) {\r\n const fraction = i * fractionStep;\r\n this.fractionToPoint(fraction, this._workPoint0);\r\n dest.appendStrokePoint(this._workPoint0);\r\n }\r\n }\r\n /** announce intervals with stroke counts */\r\n public emitStrokableParts(handler: IStrokeHandler, _options?: StrokeOptions): void {\r\n const numPerSpan = this.computeStrokeCountForOptions(_options);\r\n handler.announceIntervalForUniformStepStrokes(this, numPerSpan, 0.0, 1.0);\r\n }\r\n /** Return a simple array of arrays with the control points as `[[x,y,z],[x,y,z],..]` */\r\n public copyPolesAsJsonArray(): any[] { return this._polygon.unpackToJsonArrays(); }\r\n\r\n /** return true if all poles are on a plane. */\r\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\r\n let point: Point3d | undefined = this._workPoint0;\r\n for (let i = 0; ; i++) {\r\n point = this.getPolePoint3d(i, point);\r\n if (!point)\r\n return true;\r\n if (!plane.isPointInPlane(point))\r\n break; // which gets to return false, which is otherwise unreachable . . .\r\n }\r\n return false;\r\n }\r\n /** Return the length of the control polygon. */\r\n public polygonLength(): number {\r\n if (!this.getPolePoint3d(0, this._workPoint0))\r\n return 0.0;\r\n let i = 0;\r\n let sum = 0.0;\r\n while (this.getPolePoint3d(++i, this._workPoint1)) {\r\n sum += this._workPoint0.distance(this._workPoint1);\r\n this._workPoint0.setFrom(this._workPoint1);\r\n }\r\n return sum;\r\n }\r\n /** Return the start point. (first control point) */\r\n public override startPoint(): Point3d {\r\n const result = this.getPolePoint3d(0)!; // ASSUME non-trivial pole set -- if null comes back, it bubbles out\r\n return result;\r\n }\r\n /** Return the end point. (last control point) */\r\n public override endPoint(): Point3d {\r\n const result = this.getPolePoint3d(this.order - 1)!; // ASSUME non-trivial pole set\r\n return result;\r\n }\r\n /** Return the control polygon length as a quick length estimate. */\r\n public quickLength(): number { return this.polygonLength(); }\r\n /** Concrete classes must implement extendRange . . . */\r\n public abstract override extendRange(rangeToExtend: Range3d, transform?: Transform): void;\r\n /**\r\n * 1D bezier coefficients for use in range computations.\r\n * @internal\r\n */\r\n protected _workBezier?: UnivariateBezier; // available for bezier logic within a method\r\n /** scratch array for use by derived classes, using allocateAndZeroBezierWorkData for sizing. */\r\n protected _workCoffsA?: Float64Array;\r\n /** scratch array for use by derived classes, using allocateAndZeroBezierWorkData for sizing. */\r\n protected _workCoffsB?: Float64Array;\r\n\r\n /**\r\n * set up the _workBezier members with specific order.\r\n * * Try to reuse existing members if their sizes match.\r\n * * Ignore members corresponding to args that are 0 or negative.\r\n * @param primaryBezierOrder order of expected bezier\r\n * @param orderA length of _workCoffsA (simple array)\r\n * @param orderB length of _workCoffsB (simple array)\r\n */\r\n protected allocateAndZeroBezierWorkData(primaryBezierOrder: number, orderA: number, orderB: number) {\r\n if (primaryBezierOrder > 0) {\r\n if (this._workBezier !== undefined && this._workBezier.order === primaryBezierOrder) {\r\n this._workBezier.zero();\r\n } else\r\n this._workBezier = new UnivariateBezier(primaryBezierOrder);\r\n }\r\n if (orderA > 0) {\r\n if (this._workCoffsA !== undefined && this._workCoffsA.length === orderA)\r\n this._workCoffsA.fill(0);\r\n else\r\n this._workCoffsA = new Float64Array(orderA);\r\n }\r\n if (orderB > 0) {\r\n if (this._workCoffsB !== undefined && this._workCoffsB.length === orderB)\r\n this._workCoffsB.fill(0);\r\n else\r\n this._workCoffsB = new Float64Array(orderB);\r\n }\r\n }\r\n /**\r\n * Assess length and turn to determine a stroke count.\r\n * * this method is used by both BSplineCurve3d and BSplineCurve3dH.\r\n * * points are accessed via getPolePoint3d.\r\n * * Hence a zero-weight pole will be a problem\r\n * @param options stroke options structure.\r\n */\r\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\r\n\r\n this.getPolePoint3d(0, this._workPoint0);\r\n this.getPolePoint3d(1, this._workPoint1);\r\n let numStrokes = 1;\r\n if (this._workPoint0 && this._workPoint1) {\r\n let dx0 = this._workPoint1.x - this._workPoint0.x;\r\n let dy0 = this._workPoint1.y - this._workPoint0.y;\r\n let dz0 = this._workPoint1.z - this._workPoint0.z;\r\n let dx1, dy1, dz1; // first differences of leading edge\r\n let sumRadians = 0.0;\r\n let thisLength = Geometry.hypotenuseXYZ(dx0, dy0, dz0);\r\n this._workPoint1.setFromPoint3d(this._workPoint0);\r\n let sumLength = thisLength;\r\n let maxLength = thisLength;\r\n let maxRadians = 0.0;\r\n let thisRadians;\r\n for (let i = 2; this.getPolePoint3d(i, this._workPoint1); i++) {\r\n dx1 = this._workPoint1.x - this._workPoint0.x;\r\n dy1 = this._workPoint1.y - this._workPoint0.y;\r\n dz1 = this._workPoint1.z - this._workPoint0.z;\r\n thisRadians = Angle.radiansBetweenVectorsXYZ(dx0, dy0, dz0, dx1, dy1, dz1);\r\n sumRadians += thisRadians;\r\n maxRadians = Geometry.maxAbsXY(thisRadians, maxRadians);\r\n thisLength = Geometry.hypotenuseXYZ(dx1, dy1, dz1);\r\n sumLength += thisLength;\r\n maxLength = Geometry.maxXY(maxLength, thisLength);\r\n dx0 = dx1;\r\n dy0 = dy1;\r\n dz0 = dz1;\r\n this._workPoint0.setFrom(this._workPoint1);\r\n }\r\n const length1 = maxLength * this.degree; // This may be larger than sumLength\r\n const length2 = Math.sqrt(length1 * sumLength); // This is in between\r\n let radians1 = maxRadians * (this.degree - 1); // As if worst case keeps happening.\r\n if (this.degree < 3)\r\n radians1 *= 3; // so quadratics aren't under-stroked\r\n const radians2 = Math.sqrt(radians1 * sumRadians);\r\n const minCount = this.degree; // NOTE: this means 1) a small, nontrivial, straight Bezier is over-stroked, and 2) options.minStrokesPerPrimitive is ignored\r\n numStrokes = StrokeOptions.applyAngleTol(\r\n options, StrokeOptions.applyMaxEdgeLength(options, minCount, length2), radians2, 0.1,\r\n );\r\n if (options) {\r\n numStrokes = options.applyChordTolToLengthAndRadians(numStrokes, sumLength, radians1);\r\n }\r\n }\r\n return numStrokes;\r\n }\r\n\r\n /** Return a deep clone. */\r\n public abstract override clone(): BezierCurveBase;\r\n\r\n /** Return a transformed deep clone. */\r\n public override cloneTransformed(transform: Transform): BezierCurveBase {\r\n const curve1 = this.clone();\r\n curve1.tryTransformInPlace(transform);\r\n return curve1;\r\n }\r\n\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset\r\n * for an aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\r\n */\r\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined {\r\n const options = OffsetOptions.create(offsetDistanceOrOptions);\r\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\r\n this.emitStrokableParts(handler, options.strokeOptions);\r\n return handler.claimResult();\r\n }\r\n\r\n /** Return a curve primitive which is a portion of this curve.\r\n * @param fractionA [in] start fraction\r\n * @param fractionB [in] end fraction\r\n */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): BezierCurveBase {\r\n const partialCurve = this.clone();\r\n partialCurve._polygon.subdivideToIntervalInPlace(fractionA, fractionB);\r\n return partialCurve;\r\n }\r\n\r\n /** Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
@@ -176,7 +176,16 @@ export declare class Arc3d extends CurvePrimitive implements BeJSONFunctions {
176
176
  get vector0(): Vector3d;
177
177
  /** Read property for (clone of) vector90. */
178
178
  get vector90(): Vector3d;
179
- /** Read property for (clone of) plane normal, with arbitrary length. */
179
+ /**
180
+ * Compute an arc binormal vector with arbitrary length.
181
+ * * The arc parameterization is counter-clockwise with respect to this vector.
182
+ * * This vector is parallel to [[perpendicularVector]] and possibly opposite.
183
+ */
184
+ binormalVector(result?: Vector3d): Vector3d;
185
+ /**
186
+ * Read property for (clone of) plane normal, with arbitrary length.
187
+ * * Does not take arc sweep direction into account. See also [[binormalVector]].
188
+ */
180
189
  get perpendicularVector(): Vector3d;
181
190
  /** Read property for (clone of) matrix of vector0, vector90, unit normal. */
182
191
  matrixClone(): Matrix3d;
@@ -1 +1 @@
1
- {"version":3,"file":"Arc3d.d.ts","sourceRoot":"","sources":["../../../src/curve/Arc3d.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAa,eAAe,EAAY,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,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AAG,SAAS;IAmB5C;;;;;;OAMG;IACa,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,kCAAkC,GAAG,OAAO;IAG/G,kGAAkG;IAC3F,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS;IAkBnE;;;;;;;;;;;;;;;;;;;OAmBG;WACW,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY;IAgC9G,+DAA+D;IACxD,uBAAuB,CAAC,WAAW,EAAE,MAAM;IAGlD,8GAA8G;IACvG,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAclE;;;OAGG;IACa,iBAAiB,CAC/B,uBAAuB,EAAE,MAAM,GAAG,aAAa,GAC9C,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS;IA4BhD;;;;;OAKG;IACa,uBAAuB,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;IAGtG;;;;OAIG;IACI,sCAAsC,CAAC,OAAO,CAAC,EAAE,iCAAiC,GAAG,UAAU,GAAG,KAAK,GAAG,SAAS;CAS3H"}
@@ -171,7 +171,19 @@ export class Arc3d extends CurvePrimitive {
171
171
  get vector90() {
172
172
  return this._matrix.columnY();
173
173
  }
174
- /** Read property for (clone of) plane normal, with arbitrary length. */
174
+ /**
175
+ * Compute an arc binormal vector with arbitrary length.
176
+ * * The arc parameterization is counter-clockwise with respect to this vector.
177
+ * * This vector is parallel to [[perpendicularVector]] and possibly opposite.
178
+ */
179
+ binormalVector(result) {
180
+ const plane = this.fractionToPointAnd2Derivatives(0.0);
181
+ return plane.vectorU.crossProduct(plane.vectorV, result);
182
+ }
183
+ /**
184
+ * Read property for (clone of) plane normal, with arbitrary length.
185
+ * * Does not take arc sweep direction into account. See also [[binormalVector]].
186
+ */
175
187
  get perpendicularVector() {
176
188
  return this._matrix.columnZ();
177
189
  }