@itwin/core-geometry 4.0.0-dev.99 → 4.1.0-dev.11

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 (127) hide show
  1. package/lib/cjs/Geometry.d.ts.map +1 -1
  2. package/lib/cjs/Geometry.js +8 -5
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/curve/Arc3d.d.ts +70 -86
  5. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  6. package/lib/cjs/curve/Arc3d.js +109 -96
  7. package/lib/cjs/curve/Arc3d.js.map +1 -1
  8. package/lib/cjs/curve/CurveCollection.d.ts +47 -30
  9. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  10. package/lib/cjs/curve/CurveCollection.js +63 -34
  11. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  12. package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +1 -1
  13. package/lib/cjs/curve/CurveCurveIntersectXY.js +3 -3
  14. package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
  15. package/lib/cjs/curve/CurveLocationDetail.d.ts +41 -42
  16. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  17. package/lib/cjs/curve/CurveLocationDetail.js +32 -36
  18. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  19. package/lib/cjs/curve/CurvePrimitive.d.ts +137 -92
  20. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  21. package/lib/cjs/curve/CurvePrimitive.js +114 -75
  22. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  23. package/lib/cjs/curve/GeometryQuery.d.ts +26 -20
  24. package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
  25. package/lib/cjs/curve/GeometryQuery.js +11 -9
  26. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  27. package/lib/cjs/curve/LineSegment3d.d.ts +34 -25
  28. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  29. package/lib/cjs/curve/LineSegment3d.js +76 -38
  30. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  31. package/lib/cjs/curve/LineString3d.d.ts +70 -51
  32. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  33. package/lib/cjs/curve/LineString3d.js +120 -71
  34. package/lib/cjs/curve/LineString3d.js.map +1 -1
  35. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +3 -2
  36. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  37. package/lib/cjs/curve/Query/PlanarSubdivision.js +57 -43
  38. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  39. package/lib/cjs/curve/Query/StrokeCountMap.d.ts +14 -13
  40. package/lib/cjs/curve/Query/StrokeCountMap.d.ts.map +1 -1
  41. package/lib/cjs/curve/Query/StrokeCountMap.js +9 -8
  42. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  43. package/lib/cjs/curve/RegionOps.d.ts +7 -5
  44. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  45. package/lib/cjs/curve/RegionOps.js +17 -16
  46. package/lib/cjs/curve/RegionOps.js.map +1 -1
  47. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +1 -1
  48. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  49. package/lib/cjs/curve/StrokeOptions.d.ts +29 -21
  50. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  51. package/lib/cjs/curve/StrokeOptions.js +44 -22
  52. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  53. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +9 -9
  54. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  55. package/lib/cjs/geometry3d/CoincidentGeometryOps.js +82 -56
  56. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  57. package/lib/cjs/geometry3d/Matrix3d.d.ts +2 -2
  58. package/lib/cjs/geometry3d/Matrix3d.js +3 -3
  59. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  60. package/lib/cjs/topology/Merging.d.ts +1 -0
  61. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  62. package/lib/cjs/topology/Merging.js +1 -0
  63. package/lib/cjs/topology/Merging.js.map +1 -1
  64. package/lib/esm/Geometry.d.ts.map +1 -1
  65. package/lib/esm/Geometry.js +8 -5
  66. package/lib/esm/Geometry.js.map +1 -1
  67. package/lib/esm/curve/Arc3d.d.ts +70 -86
  68. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  69. package/lib/esm/curve/Arc3d.js +109 -96
  70. package/lib/esm/curve/Arc3d.js.map +1 -1
  71. package/lib/esm/curve/CurveCollection.d.ts +47 -30
  72. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  73. package/lib/esm/curve/CurveCollection.js +63 -34
  74. package/lib/esm/curve/CurveCollection.js.map +1 -1
  75. package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +1 -1
  76. package/lib/esm/curve/CurveCurveIntersectXY.js +3 -3
  77. package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
  78. package/lib/esm/curve/CurveLocationDetail.d.ts +41 -42
  79. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  80. package/lib/esm/curve/CurveLocationDetail.js +32 -36
  81. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  82. package/lib/esm/curve/CurvePrimitive.d.ts +137 -92
  83. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  84. package/lib/esm/curve/CurvePrimitive.js +114 -75
  85. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  86. package/lib/esm/curve/GeometryQuery.d.ts +26 -20
  87. package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
  88. package/lib/esm/curve/GeometryQuery.js +11 -9
  89. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  90. package/lib/esm/curve/LineSegment3d.d.ts +34 -25
  91. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  92. package/lib/esm/curve/LineSegment3d.js +76 -38
  93. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  94. package/lib/esm/curve/LineString3d.d.ts +70 -51
  95. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  96. package/lib/esm/curve/LineString3d.js +120 -71
  97. package/lib/esm/curve/LineString3d.js.map +1 -1
  98. package/lib/esm/curve/Query/PlanarSubdivision.d.ts +3 -2
  99. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  100. package/lib/esm/curve/Query/PlanarSubdivision.js +58 -44
  101. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  102. package/lib/esm/curve/Query/StrokeCountMap.d.ts +14 -13
  103. package/lib/esm/curve/Query/StrokeCountMap.d.ts.map +1 -1
  104. package/lib/esm/curve/Query/StrokeCountMap.js +9 -8
  105. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  106. package/lib/esm/curve/RegionOps.d.ts +7 -5
  107. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  108. package/lib/esm/curve/RegionOps.js +17 -16
  109. package/lib/esm/curve/RegionOps.js.map +1 -1
  110. package/lib/esm/curve/RegionOpsClassificationSweeps.js +1 -1
  111. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  112. package/lib/esm/curve/StrokeOptions.d.ts +29 -21
  113. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  114. package/lib/esm/curve/StrokeOptions.js +44 -22
  115. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  116. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +9 -9
  117. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  118. package/lib/esm/geometry3d/CoincidentGeometryOps.js +82 -56
  119. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  120. package/lib/esm/geometry3d/Matrix3d.d.ts +2 -2
  121. package/lib/esm/geometry3d/Matrix3d.js +3 -3
  122. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  123. package/lib/esm/topology/Merging.d.ts +1 -0
  124. package/lib/esm/topology/Merging.d.ts.map +1 -1
  125. package/lib/esm/topology/Merging.js +1 -0
  126. package/lib/esm/topology/Merging.js.map +1 -1
  127. package/package.json +3 -3
@@ -1,5 +1,6 @@
1
1
  import { Angle } from "../geometry3d/Angle";
2
- /** tolerance blob for various stroking methods.
2
+ /**
3
+ * Tolerance blob for various stroking methods.
3
4
  *
4
5
  * * Across many applications, the critical concepts are: chordTol, angleTol, maxEdgeLength
5
6
  * * Chord error is an distance measured from a curve or facet to its approximating stroke or facet.
@@ -21,17 +22,17 @@ import { Angle } from "../geometry3d/Angle";
21
22
  * @public
22
23
  */
23
24
  export declare class StrokeOptions {
24
- /** distance from stroke to actual geometry */
25
+ /** Distance from stroke to actual geometry */
25
26
  chordTol?: number;
26
- /** turning angle between strokes. */
27
+ /** Turning angle between strokes. */
27
28
  angleTol?: Angle;
28
- /** maximum length of a single stroke. */
29
+ /** Maximum length of a single stroke. */
29
30
  maxEdgeLength?: number;
30
- /** caller expects convex facets. */
31
+ /** Caller expects convex facets. */
31
32
  needConvexFacets?: boolean;
32
- /** minimum strokes on a primitive */
33
+ /** Minimum strokes on a primitive */
33
34
  minStrokesPerPrimitive?: number;
34
- /** whether or not to triangulate each added facet */
35
+ /** Whether or not to triangulate each added facet */
35
36
  shouldTriangulate: boolean;
36
37
  private _needNormals?;
37
38
  private _needTwoSided?;
@@ -45,27 +46,29 @@ export declare class StrokeOptions {
45
46
  /** Whether twoSided is requested. */
46
47
  get needTwoSided(): boolean;
47
48
  set needTwoSided(value: boolean);
48
- /** optional color request flag */
49
+ /** Optional color request flag */
49
50
  needColors?: boolean;
50
- /** default number of strokes for a circle. */
51
+ /** Default number of strokes for a circle. */
51
52
  defaultCircleStrokes: number;
52
- /** ask if angleTol is specified */
53
+ /** Ask if angleTol is specified */
53
54
  get hasAngleTol(): boolean;
54
- /** ask if chordTol is specified */
55
+ /** Ask if chordTol is specified */
55
56
  get hasChordTol(): boolean;
56
- /** ask if maxEdgeLength is specified */
57
+ /** Ask if maxEdgeLength is specified */
57
58
  get hasMaxEdgeLength(): boolean;
58
59
  /** Return a deep clone */
59
60
  clone(): StrokeOptions;
60
- /** return stroke count which is the larger of the minCount or count needed for edge length condition. */
61
+ /** Return stroke count which is the larger of the minCount or count needed for edge length condition. */
61
62
  applyMaxEdgeLength(minCount: number, totalLength: number): number;
62
63
  /**
63
- * return stroke count which is the larger of the existing count or count needed for angle condition for given sweepRadians
64
+ * Return stroke count which is the larger of the existing count or count needed for angle condition for given
65
+ * sweepRadians.
64
66
  * * defaultStepRadians is assumed to be larger than zero.
65
67
  */
66
68
  applyAngleTol(minCount: number, sweepRadians: number, defaultStepRadians: number): number;
67
69
  /**
68
- * return stroke count which is the larger of minCount and the count required to turn sweepRadians, using tolerance from the options.
70
+ * Return stroke count which is the larger of minCount and the count required to turn sweepRadians, using tolerance
71
+ * from the options.
69
72
  */
70
73
  static applyAngleTol(options: StrokeOptions | undefined, minCount: number, sweepRadians: number, defaultStepRadians?: number): number;
71
74
  /**
@@ -76,22 +79,27 @@ export declare class StrokeOptions {
76
79
  */
77
80
  static applyMaxEdgeLength(options: StrokeOptions | undefined, minCount: number, edgeLength: number): number;
78
81
  /**
79
- * Determine a stroke count for a (partial) circular arc of given radius. This considers angle, maxEdgeLength, chord, and minimum stroke.
82
+ * Determine a stroke count for a (partial) circular arc of given radius. This considers angle, maxEdgeLength,
83
+ * chord, and minimum stroke.
80
84
  */
81
85
  applyTolerancesToArc(radius: number, sweepRadians?: number): number;
82
- /** return stroke count which is the larger of existing count or count needed for circular arc chord tolerance condition. */
86
+ /** Return stroke count which is the larger of existing count or count needed for circular arc chord tolerance condition. */
83
87
  applyChordTol(minCount: number, radius: number, sweepRadians: number): number;
84
- /** return stroke count which is the larger of existing count or count needed for circular arc chord tol with given arc length and radians
88
+ /**
89
+ * Return stroke count which is the larger of existing count or count needed for circular arc chord tol with given
90
+ * arc length and radians
85
91
  */
86
92
  applyChordTolToLengthAndRadians(minCount: number, length: number, sweepRadians: number): number;
87
- /** return stroke count which is the larger of existing count or `this.minStrokesPerPrimitive` */
93
+ /** Return stroke count which is the larger of existing count or `this.minStrokesPerPrimitive` */
88
94
  applyMinStrokesPerPrimitive(minCount: number): number;
89
- /** create `StrokeOptions` with defaults appropriate for curves.
95
+ /**
96
+ * Create `StrokeOptions` with defaults appropriate for curves.
90
97
  * * angle tolerance of 15 degrees.
91
98
  * * all others inactive.
92
99
  */
93
100
  static createForCurves(): StrokeOptions;
94
- /** create `StrokeOptions` with defaults appropriate for surfaces facets
101
+ /**
102
+ * Create `StrokeOptions` with defaults appropriate for surfaces facets
95
103
  * * angle tolerance of 22.5 degrees.
96
104
  * * all others inactive.
97
105
  */
@@ -1 +1 @@
1
- {"version":3,"file":"StrokeOptions.d.ts","sourceRoot":"","sources":["../../../src/curve/StrokeOptions.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,aAAa;IAExB,8CAA8C;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IACzB,qCAAqC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC;IACxB,yCAAyC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IAC9B,qCAAqC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAClC,qCAAqC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACvC,qDAAqD;IAC9C,iBAAiB,EAAE,OAAO,CAAS;IAC1C,OAAO,CAAC,YAAY,CAAC,CAAU;IAC/B,OAAO,CAAC,aAAa,CAAC,CAAU;IAChC,OAAO,CAAC,WAAW,CAAC,CAAU;IAC9B,oCAAoC;IACpC,IAAW,UAAU,IAAI,OAAO,CAAsE;IACtG,IAAW,UAAU,CAAC,KAAK,EAAE,OAAO,EAA+B;IACn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-eslint/naming-convention, no-empty */
11
- /** tolerance blob for various stroking methods.
11
+ /**
12
+ * Tolerance blob for various stroking methods.
12
13
  *
13
14
  * * Across many applications, the critical concepts are: chordTol, angleTol, maxEdgeLength
14
15
  * * Chord error is an distance measured from a curve or facet to its approximating stroke or facet.
@@ -31,26 +32,40 @@ import { Angle } from "../geometry3d/Angle";
31
32
  */
32
33
  export class StrokeOptions {
33
34
  constructor() {
34
- /** whether or not to triangulate each added facet */
35
+ /** Whether or not to triangulate each added facet */
35
36
  this.shouldTriangulate = false;
36
- /** default number of strokes for a circle. */
37
+ /** Default number of strokes for a circle. */
37
38
  this.defaultCircleStrokes = 16;
38
39
  }
39
40
  /** Whether params are requested. */
40
- get needParams() { return this._needParams !== undefined ? this._needParams : false; }
41
- set needParams(value) { this._needParams = value; }
41
+ get needParams() {
42
+ return this._needParams !== undefined ? this._needParams : false;
43
+ }
44
+ set needParams(value) {
45
+ this._needParams = value;
46
+ }
42
47
  /** Whether normals are requested */
43
- get needNormals() { return this._needNormals !== undefined ? this._needNormals : false; }
48
+ get needNormals() {
49
+ return this._needNormals !== undefined ? this._needNormals : false;
50
+ }
44
51
  set needNormals(value) { this._needNormals = value; }
45
52
  /** Whether twoSided is requested. */
46
- get needTwoSided() { return this._needTwoSided !== undefined ? this._needTwoSided : false; }
53
+ get needTwoSided() {
54
+ return this._needTwoSided !== undefined ? this._needTwoSided : false;
55
+ }
47
56
  set needTwoSided(value) { this._needTwoSided = value; }
48
- /** ask if angleTol is specified */
49
- get hasAngleTol() { return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0; }
50
- /** ask if chordTol is specified */
51
- get hasChordTol() { return this.chordTol !== undefined && this.chordTol > 0.0; }
52
- /** ask if maxEdgeLength is specified */
53
- get hasMaxEdgeLength() { return this.maxEdgeLength !== undefined && this.maxEdgeLength > 0.0; }
57
+ /** Ask if angleTol is specified */
58
+ get hasAngleTol() {
59
+ return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0;
60
+ }
61
+ /** Ask if chordTol is specified */
62
+ get hasChordTol() {
63
+ return this.chordTol !== undefined && this.chordTol > 0.0;
64
+ }
65
+ /** Ask if maxEdgeLength is specified */
66
+ get hasMaxEdgeLength() {
67
+ return this.maxEdgeLength !== undefined && this.maxEdgeLength > 0.0;
68
+ }
54
69
  /** Return a deep clone */
55
70
  clone() {
56
71
  const options = new StrokeOptions();
@@ -67,7 +82,7 @@ export class StrokeOptions {
67
82
  options.defaultCircleStrokes = this.defaultCircleStrokes;
68
83
  return options;
69
84
  }
70
- /** return stroke count which is the larger of the minCount or count needed for edge length condition. */
85
+ /** Return stroke count which is the larger of the minCount or count needed for edge length condition. */
71
86
  applyMaxEdgeLength(minCount, totalLength) {
72
87
  totalLength = Math.abs(totalLength);
73
88
  if (this.maxEdgeLength && this.maxEdgeLength > 0.0 && minCount * this.maxEdgeLength < totalLength) {
@@ -76,14 +91,16 @@ export class StrokeOptions {
76
91
  return minCount;
77
92
  }
78
93
  /**
79
- * return stroke count which is the larger of the existing count or count needed for angle condition for given sweepRadians
94
+ * Return stroke count which is the larger of the existing count or count needed for angle condition for given
95
+ * sweepRadians.
80
96
  * * defaultStepRadians is assumed to be larger than zero.
81
97
  */
82
98
  applyAngleTol(minCount, sweepRadians, defaultStepRadians) {
83
99
  return StrokeOptions.applyAngleTol(this, minCount, sweepRadians, defaultStepRadians);
84
100
  }
85
101
  /**
86
- * return stroke count which is the larger of minCount and the count required to turn sweepRadians, using tolerance from the options.
102
+ * Return stroke count which is the larger of minCount and the count required to turn sweepRadians, using tolerance
103
+ * from the options.
87
104
  */
88
105
  static applyAngleTol(options, minCount, sweepRadians, defaultStepRadians) {
89
106
  sweepRadians = Math.abs(sweepRadians);
@@ -111,7 +128,8 @@ export class StrokeOptions {
111
128
  return minCount;
112
129
  }
113
130
  /**
114
- * Determine a stroke count for a (partial) circular arc of given radius. This considers angle, maxEdgeLength, chord, and minimum stroke.
131
+ * Determine a stroke count for a (partial) circular arc of given radius. This considers angle, maxEdgeLength,
132
+ * chord, and minimum stroke.
115
133
  */
116
134
  applyTolerancesToArc(radius, sweepRadians = Math.PI * 2) {
117
135
  let numStrokes = 1;
@@ -121,7 +139,7 @@ export class StrokeOptions {
121
139
  numStrokes = this.applyMinStrokesPerPrimitive(numStrokes);
122
140
  return numStrokes;
123
141
  }
124
- /** return stroke count which is the larger of existing count or count needed for circular arc chord tolerance condition. */
142
+ /** Return stroke count which is the larger of existing count or count needed for circular arc chord tolerance condition. */
125
143
  applyChordTol(minCount, radius, sweepRadians) {
126
144
  if (this.chordTol && this.chordTol > 0.0 && this.chordTol < radius) {
127
145
  const a = this.chordTol;
@@ -130,7 +148,9 @@ export class StrokeOptions {
130
148
  }
131
149
  return minCount;
132
150
  }
133
- /** return stroke count which is the larger of existing count or count needed for circular arc chord tol with given arc length and radians
151
+ /**
152
+ * Return stroke count which is the larger of existing count or count needed for circular arc chord tol with given
153
+ * arc length and radians
134
154
  */
135
155
  applyChordTolToLengthAndRadians(minCount, length, sweepRadians) {
136
156
  if (this.chordTol && this.chordTol > 0.0) {
@@ -140,14 +160,15 @@ export class StrokeOptions {
140
160
  }
141
161
  return minCount;
142
162
  }
143
- /** return stroke count which is the larger of existing count or `this.minStrokesPerPrimitive` */
163
+ /** Return stroke count which is the larger of existing count or `this.minStrokesPerPrimitive` */
144
164
  applyMinStrokesPerPrimitive(minCount) {
145
165
  if (this.minStrokesPerPrimitive !== undefined && Number.isFinite(this.minStrokesPerPrimitive)
146
166
  && this.minStrokesPerPrimitive > minCount)
147
167
  minCount = this.minStrokesPerPrimitive;
148
168
  return minCount;
149
169
  }
150
- /** create `StrokeOptions` with defaults appropriate for curves.
170
+ /**
171
+ * Create `StrokeOptions` with defaults appropriate for curves.
151
172
  * * angle tolerance of 15 degrees.
152
173
  * * all others inactive.
153
174
  */
@@ -156,7 +177,8 @@ export class StrokeOptions {
156
177
  options.angleTol = Angle.createDegrees(15.0);
157
178
  return options;
158
179
  }
159
- /** create `StrokeOptions` with defaults appropriate for surfaces facets
180
+ /**
181
+ * Create `StrokeOptions` with defaults appropriate for surfaces facets
160
182
  * * angle tolerance of 22.5 degrees.
161
183
  * * all others inactive.
162
184
  */
@@ -1 +1 @@
1
- {"version":3,"file":"StrokeOptions.js","sourceRoot":"","sources":["../../../src/curve/StrokeOptions.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,mEAAmE;AAEnE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,aAAa;IAA1B;QAYE,qDAAqD;QAC9C,sBAAiB,GAAY,KAAK,CAAC;QAe1C,8CAA8C;QACvC,yBAAoB,GAAG,EAAE,CAAC;IA+HnC,CAAC;IA3IC,oCAAoC;IACpC,IAAW,UAAU,KAAc,OAAO,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACtG,IAAW,UAAU,CAAC,KAAc,IAAI,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC;IACnE,oCAAoC;IACpC,IAAW,WAAW,KAAc,OAAO,IAAI,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACzG,IAAW,WAAW,CAAC,KAAc,IAAI,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC;IACrE,qCAAqC;IACrC,IAAW,YAAY,KAAc,OAAO,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5G,IAAW,YAAY,CAAC,KAAc,IAAI,IAAI,CAAC,aAAa,GAAG,K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AE,QAAQ,CAAC,CAAC;SACpE;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD;OACG;IACI,+BAA+B,CAAC,QAAgB,EAAE,MAAc,EAAE,YAAoB;QAC3F,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE;YACxC,MAAM,MAAM,GAAG,QAAQ,CAAC,yBAAyB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YACxE,IAAI,MAAM,KAAK,SAAS;gBACtB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;SAC7D;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,iGAAiG;IAC1F,2BAA2B,CAAC,QAAgB;QACjD,IAAI,IAAI,CAAC,sBAAsB,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC;eACxF,IAAI,CAAC,sBAAsB,GAAG,QAAQ;YACzC,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,eAAe;QAC3B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,eAAe;QAC3B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,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\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n\r\n/** tolerance blob for various stroking methods.\r\n *\r\n * * Across many applications, the critical concepts are: chordTol, angleTol, maxEdgeLength\r\n * * Chord error is an distance measured from a curve or facet to its approximating stroke or facet.\r\n * * angle is the angle between two contiguous strokes or across a facet edge.\r\n * * maxEdgeLength is the length of a stroke or a edge of a facet.\r\n *\r\n * It is rare for all three to be active at once:\r\n * * Nearly all stroke and facet use cases will apply an angle tolerance.\r\n * * * For curves, 15 degrees is typical\r\n * * * For facets, 22.5 degrees is typical.\r\n * * * Halving the angle tolerance will (roughly) make curves get twice as many strokes, and surfaces get 4 times as many facets.\r\n * * * The angle tolerance has the useful property that its effect is independent of scale of that data. If data is suddenly scaled into millimeters rather than meters, the facet counts remain the same.\r\n * * When creating output for devices such as 3D printing will want a chord tolerance.\r\n * * For graphics display, use an angle tolerance of around 15 degrees and an chord tolerance which is the size of several pixels.\r\n * * Analysis meshes (e.g. Finite Elements) commonly need to apply maxEdgeLength.\r\n * * * Using maxEdgeLength for graphics probably produces too many facets. For example, it causes long cylinders to get many nearly-square facets instead of the small number of long quads usually used for graphics.\r\n * * Facet tolerances are, as the Pirates' Code, guidelines, not absolute rules. Facet and stroke code may ignore tolerances in awkward situations.\r\n * * If multiple tolerances are in effect, the actual count will usually be based on the one that demands the most strokes or facets, unless it is so high that it violates some upper limit on the number of facets on an arc or a section of a curve.\r\n * @public\r\n */\r\nexport class StrokeOptions {\r\n\r\n /** distance from stroke to actual geometry */\r\n public chordTol?: number;\r\n /** turning angle between strokes. */\r\n public angleTol?: Angle;\r\n /** maximum length of a single stroke. */\r\n public maxEdgeLength?: number;\r\n /** caller expects convex facets. */\r\n public needConvexFacets?: boolean;\r\n /** minimum strokes on a primitive */\r\n public minStrokesPerPrimitive?: number;\r\n /** whether or not to triangulate each added facet */\r\n public shouldTriangulate: boolean = false;\r\n private _needNormals?: boolean;\r\n private _needTwoSided?: boolean;\r\n private _needParams?: boolean;\r\n /** Whether params are requested. */\r\n public get needParams(): boolean { return this._needParams !== undefined ? this._needParams : false; }\r\n public set needParams(value: boolean) { this._needParams = value; }\r\n /** Whether normals are requested */\r\n public get needNormals(): boolean { return this._needNormals !== undefined ? this._needNormals : false; }\r\n public set needNormals(value: boolean) { this._needNormals = value; }\r\n /** Whether twoSided is requested. */\r\n public get needTwoSided(): boolean { return this._needTwoSided !== undefined ? this._needTwoSided : false; }\r\n public set needTwoSided(value: boolean) { this._needTwoSided = value; }\r\n /** optional color request flag */\r\n public needColors?: boolean;\r\n /** default number of strokes for a circle. */\r\n public defaultCircleStrokes = 16;\r\n /** ask if angleTol is specified */\r\n public get hasAngleTol(): boolean { return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0; }\r\n /** ask if chordTol is specified */\r\n public get hasChordTol(): boolean { return this.chordTol !== undefined && this.chordTol > 0.0; }\r\n /** ask if maxEdgeLength is specified */\r\n public get hasMaxEdgeLength(): boolean { return this.maxEdgeLength !== undefined && this.maxEdgeLength > 0.0; }\r\n\r\n /** Return a deep clone */\r\n public clone(): StrokeOptions {\r\n const options = new StrokeOptions();\r\n options.chordTol = this.chordTol;\r\n options.angleTol = this.angleTol?.clone();\r\n options.maxEdgeLength = this.maxEdgeLength;\r\n options.needConvexFacets = this.needConvexFacets;\r\n options.minStrokesPerPrimitive = this.minStrokesPerPrimitive;\r\n options.shouldTriangulate = this.shouldTriangulate;\r\n options._needNormals = this._needNormals;\r\n options._needTwoSided = this._needTwoSided;\r\n options._needParams = this._needParams;\r\n options.needColors = this.needColors;\r\n options.defaultCircleStrokes = this.defaultCircleStrokes;\r\n return options;\r\n }\r\n\r\n /** return stroke count which is the larger of the minCount or count needed for edge length condition. */\r\n public applyMaxEdgeLength(minCount: number, totalLength: number): number {\r\n totalLength = Math.abs(totalLength);\r\n if (this.maxEdgeLength && this.maxEdgeLength > 0.0 && minCount * this.maxEdgeLength < totalLength) {\r\n minCount = Geometry.stepCount(this.maxEdgeLength, totalLength, minCount);\r\n }\r\n return minCount;\r\n }\r\n\r\n /**\r\n * return stroke count which is the larger of the existing count or count needed for angle condition for given sweepRadians\r\n * * defaultStepRadians is assumed to be larger than zero.\r\n */\r\n public applyAngleTol(minCount: number, sweepRadians: number, defaultStepRadians: number): number {\r\n return StrokeOptions.applyAngleTol(this, minCount, sweepRadians, defaultStepRadians);\r\n }\r\n /**\r\n * return stroke count which is the larger of minCount and the count required to turn sweepRadians, using tolerance from the options.\r\n */\r\n public static applyAngleTol(options: StrokeOptions | undefined, minCount: number, sweepRadians: number, defaultStepRadians?: number): number {\r\n sweepRadians = Math.abs(sweepRadians);\r\n let stepRadians = defaultStepRadians ? defaultStepRadians : Math.PI / 8.0;\r\n if (options && options.angleTol && options.angleTol.radians > 0.0)\r\n stepRadians = options.angleTol.radians;\r\n if (minCount * stepRadians < sweepRadians)\r\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\r\n return minCount;\r\n }\r\n /**\r\n * Return the number of strokes needed for given edgeLength curve.\r\n * @param options\r\n * @param minCount smallest allowed count\r\n * @param edgeLength\r\n */\r\n public static applyMaxEdgeLength(options: StrokeOptions | undefined, minCount: number, edgeLength: number): number {\r\n if (edgeLength < 0)\r\n edgeLength = - edgeLength;\r\n if (minCount < 1)\r\n minCount = 1;\r\n if (options && options.maxEdgeLength && options.maxEdgeLength * minCount < edgeLength) {\r\n minCount = Geometry.stepCount(options.maxEdgeLength, edgeLength, minCount);\r\n }\r\n return minCount;\r\n }\r\n /**\r\n * Determine a stroke count for a (partial) circular arc of given radius. This considers angle, maxEdgeLength, chord, and minimum stroke.\r\n */\r\n public applyTolerancesToArc(radius: number, sweepRadians: number = Math.PI * 2): number {\r\n let numStrokes = 1;\r\n numStrokes = this.applyAngleTol(numStrokes, sweepRadians, Math.PI * 0.25);\r\n numStrokes = this.applyMaxEdgeLength(numStrokes, sweepRadians * radius);\r\n numStrokes = this.applyChordTol(numStrokes, radius, sweepRadians);\r\n numStrokes = this.applyMinStrokesPerPrimitive(numStrokes);\r\n return numStrokes;\r\n }\r\n\r\n /** return stroke count which is the larger of existing count or count needed for circular arc chord tolerance condition. */\r\n public applyChordTol(minCount: number, radius: number, sweepRadians: number): number {\r\n if (this.chordTol && this.chordTol > 0.0 && this.chordTol < radius) {\r\n const a = this.chordTol;\r\n const stepRadians = 2.0 * Math.acos((1.0 - a / radius));\r\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\r\n }\r\n return minCount;\r\n }\r\n /** return stroke count which is the larger of existing count or count needed for circular arc chord tol with given arc length and radians\r\n */\r\n public applyChordTolToLengthAndRadians(minCount: number, length: number, sweepRadians: number): number {\r\n if (this.chordTol && this.chordTol > 0.0) {\r\n const radius = Geometry.conditionalDivideFraction(length, sweepRadians);\r\n if (radius !== undefined)\r\n return this.applyChordTol(minCount, radius, sweepRadians);\r\n }\r\n return minCount;\r\n }\r\n\r\n /** return stroke count which is the larger of existing count or `this.minStrokesPerPrimitive` */\r\n public applyMinStrokesPerPrimitive(minCount: number): number {\r\n if (this.minStrokesPerPrimitive !== undefined && Number.isFinite(this.minStrokesPerPrimitive)\r\n && this.minStrokesPerPrimitive > minCount)\r\n minCount = this.minStrokesPerPrimitive;\r\n return minCount;\r\n }\r\n\r\n /** create `StrokeOptions` with defaults appropriate for curves.\r\n * * angle tolerance of 15 degrees.\r\n * * all others inactive.\r\n */\r\n public static createForCurves(): StrokeOptions {\r\n const options = new StrokeOptions();\r\n options.angleTol = Angle.createDegrees(15.0);\r\n return options;\r\n }\r\n /** create `StrokeOptions` with defaults appropriate for surfaces facets\r\n * * angle tolerance of 22.5 degrees.\r\n * * all others inactive.\r\n */\r\n public static createForFacets(): StrokeOptions {\r\n const options = new StrokeOptions();\r\n options.angleTol = Angle.createDegrees(22.5);\r\n return options;\r\n }\r\n}\r\n"]}
1
+ {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I,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE;YACxC,MAAM,MAAM,GAAG,QAAQ,CAAC,yBAAyB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YACxE,IAAI,MAAM,KAAK,SAAS;gBACtB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;SAC7D;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,iGAAiG;IAC1F,2BAA2B,CAAC,QAAgB;QACjD,IAAI,IAAI,CAAC,sBAAsB,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC;eACxF,IAAI,CAAC,sBAAsB,GAAG,QAAQ;YACzC,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,eAAe;QAC3B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,eAAe;QAC3B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,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\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n\r\n/**\r\n * Tolerance blob for various stroking methods.\r\n *\r\n * * Across many applications, the critical concepts are: chordTol, angleTol, maxEdgeLength\r\n * * Chord error is an distance measured from a curve or facet to its approximating stroke or facet.\r\n * * angle is the angle between two contiguous strokes or across a facet edge.\r\n * * maxEdgeLength is the length of a stroke or a edge of a facet.\r\n *\r\n * It is rare for all three to be active at once:\r\n * * Nearly all stroke and facet use cases will apply an angle tolerance.\r\n * * * For curves, 15 degrees is typical\r\n * * * For facets, 22.5 degrees is typical.\r\n * * * Halving the angle tolerance will (roughly) make curves get twice as many strokes, and surfaces get 4 times as many facets.\r\n * * * The angle tolerance has the useful property that its effect is independent of scale of that data. If data is suddenly scaled into millimeters rather than meters, the facet counts remain the same.\r\n * * When creating output for devices such as 3D printing will want a chord tolerance.\r\n * * For graphics display, use an angle tolerance of around 15 degrees and an chord tolerance which is the size of several pixels.\r\n * * Analysis meshes (e.g. Finite Elements) commonly need to apply maxEdgeLength.\r\n * * * Using maxEdgeLength for graphics probably produces too many facets. For example, it causes long cylinders to get many nearly-square facets instead of the small number of long quads usually used for graphics.\r\n * * Facet tolerances are, as the Pirates' Code, guidelines, not absolute rules. Facet and stroke code may ignore tolerances in awkward situations.\r\n * * If multiple tolerances are in effect, the actual count will usually be based on the one that demands the most strokes or facets, unless it is so high that it violates some upper limit on the number of facets on an arc or a section of a curve.\r\n * @public\r\n */\r\nexport class StrokeOptions {\r\n /** Distance from stroke to actual geometry */\r\n public chordTol?: number;\r\n /** Turning angle between strokes. */\r\n public angleTol?: Angle;\r\n /** Maximum length of a single stroke. */\r\n public maxEdgeLength?: number;\r\n /** Caller expects convex facets. */\r\n public needConvexFacets?: boolean;\r\n /** Minimum strokes on a primitive */\r\n public minStrokesPerPrimitive?: number;\r\n /** Whether or not to triangulate each added facet */\r\n public shouldTriangulate: boolean = false;\r\n private _needNormals?: boolean;\r\n private _needTwoSided?: boolean;\r\n private _needParams?: boolean;\r\n /** Whether params are requested. */\r\n public get needParams(): boolean {\r\n return this._needParams !== undefined ? this._needParams : false;\r\n }\r\n public set needParams(value: boolean) {\r\n this._needParams = value;\r\n }\r\n /** Whether normals are requested */\r\n public get needNormals(): boolean {\r\n return this._needNormals !== undefined ? this._needNormals : false;\r\n }\r\n public set needNormals(value: boolean) { this._needNormals = value; }\r\n /** Whether twoSided is requested. */\r\n public get needTwoSided(): boolean {\r\n return this._needTwoSided !== undefined ? this._needTwoSided : false;\r\n }\r\n public set needTwoSided(value: boolean) { this._needTwoSided = value; }\r\n /** Optional color request flag */\r\n public needColors?: boolean;\r\n /** Default number of strokes for a circle. */\r\n public defaultCircleStrokes = 16;\r\n /** Ask if angleTol is specified */\r\n public get hasAngleTol(): boolean {\r\n return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0;\r\n }\r\n /** Ask if chordTol is specified */\r\n public get hasChordTol(): boolean {\r\n return this.chordTol !== undefined && this.chordTol > 0.0;\r\n }\r\n /** Ask if maxEdgeLength is specified */\r\n public get hasMaxEdgeLength(): boolean {\r\n return this.maxEdgeLength !== undefined && this.maxEdgeLength > 0.0;\r\n }\r\n /** Return a deep clone */\r\n public clone(): StrokeOptions {\r\n const options = new StrokeOptions();\r\n options.chordTol = this.chordTol;\r\n options.angleTol = this.angleTol?.clone();\r\n options.maxEdgeLength = this.maxEdgeLength;\r\n options.needConvexFacets = this.needConvexFacets;\r\n options.minStrokesPerPrimitive = this.minStrokesPerPrimitive;\r\n options.shouldTriangulate = this.shouldTriangulate;\r\n options._needNormals = this._needNormals;\r\n options._needTwoSided = this._needTwoSided;\r\n options._needParams = this._needParams;\r\n options.needColors = this.needColors;\r\n options.defaultCircleStrokes = this.defaultCircleStrokes;\r\n return options;\r\n }\r\n /** Return stroke count which is the larger of the minCount or count needed for edge length condition. */\r\n public applyMaxEdgeLength(minCount: number, totalLength: number): number {\r\n totalLength = Math.abs(totalLength);\r\n if (this.maxEdgeLength && this.maxEdgeLength > 0.0 && minCount * this.maxEdgeLength < totalLength) {\r\n minCount = Geometry.stepCount(this.maxEdgeLength, totalLength, minCount);\r\n }\r\n return minCount;\r\n }\r\n /**\r\n * Return stroke count which is the larger of the existing count or count needed for angle condition for given\r\n * sweepRadians.\r\n * * defaultStepRadians is assumed to be larger than zero.\r\n */\r\n public applyAngleTol(minCount: number, sweepRadians: number, defaultStepRadians: number): number {\r\n return StrokeOptions.applyAngleTol(this, minCount, sweepRadians, defaultStepRadians);\r\n }\r\n /**\r\n * Return stroke count which is the larger of minCount and the count required to turn sweepRadians, using tolerance\r\n * from the options.\r\n */\r\n public static applyAngleTol(\r\n options: StrokeOptions | undefined, minCount: number, sweepRadians: number, defaultStepRadians?: number\r\n ): number {\r\n sweepRadians = Math.abs(sweepRadians);\r\n let stepRadians = defaultStepRadians ? defaultStepRadians : Math.PI / 8.0;\r\n if (options && options.angleTol && options.angleTol.radians > 0.0)\r\n stepRadians = options.angleTol.radians;\r\n if (minCount * stepRadians < sweepRadians)\r\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\r\n return minCount;\r\n }\r\n /**\r\n * Return the number of strokes needed for given edgeLength curve.\r\n * @param options\r\n * @param minCount smallest allowed count\r\n * @param edgeLength\r\n */\r\n public static applyMaxEdgeLength(\r\n options: StrokeOptions | undefined, minCount: number, edgeLength: number\r\n ): number {\r\n if (edgeLength < 0)\r\n edgeLength = - edgeLength;\r\n if (minCount < 1)\r\n minCount = 1;\r\n if (options && options.maxEdgeLength && options.maxEdgeLength * minCount < edgeLength) {\r\n minCount = Geometry.stepCount(options.maxEdgeLength, edgeLength, minCount);\r\n }\r\n return minCount;\r\n }\r\n /**\r\n * Determine a stroke count for a (partial) circular arc of given radius. This considers angle, maxEdgeLength,\r\n * chord, and minimum stroke.\r\n */\r\n public applyTolerancesToArc(radius: number, sweepRadians: number = Math.PI * 2): number {\r\n let numStrokes = 1;\r\n numStrokes = this.applyAngleTol(numStrokes, sweepRadians, Math.PI * 0.25);\r\n numStrokes = this.applyMaxEdgeLength(numStrokes, sweepRadians * radius);\r\n numStrokes = this.applyChordTol(numStrokes, radius, sweepRadians);\r\n numStrokes = this.applyMinStrokesPerPrimitive(numStrokes);\r\n return numStrokes;\r\n }\r\n /** Return stroke count which is the larger of existing count or count needed for circular arc chord tolerance condition. */\r\n public applyChordTol(minCount: number, radius: number, sweepRadians: number): number {\r\n if (this.chordTol && this.chordTol > 0.0 && this.chordTol < radius) {\r\n const a = this.chordTol;\r\n const stepRadians = 2.0 * Math.acos((1.0 - a / radius));\r\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\r\n }\r\n return minCount;\r\n }\r\n /**\r\n * Return stroke count which is the larger of existing count or count needed for circular arc chord tol with given\r\n * arc length and radians\r\n */\r\n public applyChordTolToLengthAndRadians(minCount: number, length: number, sweepRadians: number): number {\r\n if (this.chordTol && this.chordTol > 0.0) {\r\n const radius = Geometry.conditionalDivideFraction(length, sweepRadians);\r\n if (radius !== undefined)\r\n return this.applyChordTol(minCount, radius, sweepRadians);\r\n }\r\n return minCount;\r\n }\r\n /** Return stroke count which is the larger of existing count or `this.minStrokesPerPrimitive` */\r\n public applyMinStrokesPerPrimitive(minCount: number): number {\r\n if (this.minStrokesPerPrimitive !== undefined && Number.isFinite(this.minStrokesPerPrimitive)\r\n && this.minStrokesPerPrimitive > minCount)\r\n minCount = this.minStrokesPerPrimitive;\r\n return minCount;\r\n }\r\n /**\r\n * Create `StrokeOptions` with defaults appropriate for curves.\r\n * * angle tolerance of 15 degrees.\r\n * * all others inactive.\r\n */\r\n public static createForCurves(): StrokeOptions {\r\n const options = new StrokeOptions();\r\n options.angleTol = Angle.createDegrees(15.0);\r\n return options;\r\n }\r\n /**\r\n * Create `StrokeOptions` with defaults appropriate for surfaces facets\r\n * * angle tolerance of 22.5 degrees.\r\n * * all others inactive.\r\n */\r\n public static createForFacets(): StrokeOptions {\r\n const options = new StrokeOptions();\r\n options.angleTol = Angle.createDegrees(22.5);\r\n return options;\r\n }\r\n}\r\n"]}
@@ -1,6 +1,3 @@
1
- /** @packageDocumentation
2
- * @module CartesianGeometry
3
- */
4
1
  import { Arc3d } from "../curve/Arc3d";
5
2
  import { CurveLocationDetail, CurveLocationDetailPair } from "../curve/CurveLocationDetail";
6
3
  import { Point3d } from "./Point3dVector3d";
@@ -13,6 +10,8 @@ import { Point3d } from "./Point3dVector3d";
13
10
  export declare class CoincidentGeometryQuery {
14
11
  private _vectorU?;
15
12
  private _vectorV?;
13
+ private _point0?;
14
+ private _point1?;
16
15
  private _tolerance;
17
16
  get tolerance(): number;
18
17
  private constructor();
@@ -36,12 +35,13 @@ export declare class CoincidentGeometryQuery {
36
35
  */
37
36
  coincidentSegmentRangeXY(pointA0: Point3d, pointA1: Point3d, pointB0: Point3d, pointB1: Point3d, restrictToBounds?: boolean): CurveLocationDetailPair | undefined;
38
37
  /**
39
- * Create a CurveLocationDetailPair from . . .
38
+ * Create a CurveLocationDetailPair for a coincident interval of two overlapping curves
40
39
  * @param cpA curveA
41
- * @param cpB curve B
42
- * @param fractionsOnA fractions of an active section of curveA
43
- * @param fractionB0 fraction of an original containing B interval
44
- * @param fractionB1 end fraction of an original containing B interval
40
+ * @param cpB curveB
41
+ * @param fractionsOnA coincident interval of curveB in fraction space of curveA
42
+ * @param fractionB0 curveB start in fraction space of curveA
43
+ * @param fractionB1 curveB end in fraction space of curveA
44
+ * @param reverse whether curveB and curveA have opposite direction
45
45
  */
46
46
  private createDetailPair;
47
47
  private appendDetailPair;
@@ -50,7 +50,7 @@ export declare class CoincidentGeometryQuery {
50
50
  * @param arcA
51
51
  * @param arcB
52
52
  * @param _restrictToBounds
53
- * @return 0, 1, or 2 overlap intervals.
53
+ * @return 0, 1, or 2 overlap points/intervals
54
54
  */
55
55
  coincidentArcIntersectionXY(arcA: Arc3d, arcB: Arc3d, _restrictToBounds?: boolean): CurveLocationDetailPair[] | undefined;
56
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CoincidentGeometryOps.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/C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
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module CartesianGeometry
7
+ */
8
+ import { assert } from "@itwin/core-bentley";
5
9
  import { CurveLocationDetail, CurveLocationDetailPair } from "../curve/CurveLocationDetail";
6
10
  import { Geometry } from "../Geometry";
7
11
  import { AngleSweep } from "./AngleSweep";
@@ -59,71 +63,71 @@ export class CoincidentGeometryQuery {
59
63
  * @param pointB1 end point of segment B
60
64
  */
61
65
  coincidentSegmentRangeXY(pointA0, pointA1, pointB0, pointB1, restrictToBounds = true) {
62
- const detailAOnB = this.projectPointToSegmentXY(pointA0, pointB0, pointB1);
63
- if (pointA0.distanceXY(detailAOnB.point) > this._tolerance)
66
+ const detailA0OnB = this.projectPointToSegmentXY(pointA0, pointB0, pointB1);
67
+ if (pointA0.distanceXY(detailA0OnB.point) > this._tolerance)
64
68
  return undefined;
65
69
  const detailA1OnB = this.projectPointToSegmentXY(pointA1, pointB0, pointB1);
66
70
  if (pointA1.distanceXY(detailA1OnB.point) > this._tolerance)
67
71
  return undefined;
68
- const detailBOnA = this.projectPointToSegmentXY(pointB0, pointA0, pointA1);
69
- if (pointB0.distanceXY(detailBOnA.point) > this._tolerance)
72
+ const detailB0OnA = this.projectPointToSegmentXY(pointB0, pointA0, pointA1);
73
+ if (pointB0.distanceXY(detailB0OnA.point) > this._tolerance)
70
74
  return undefined;
71
75
  const detailB1OnA = this.projectPointToSegmentXY(pointB1, pointA0, pointA1);
72
76
  if (pointB1.distanceXY(detailB1OnA.point) > this._tolerance)
73
77
  return undefined;
74
- detailAOnB.fraction1 = detailA1OnB.fraction;
75
- detailAOnB.point1 = detailA1OnB.point; // capture -- detailB0OnA is not reused.
76
- detailBOnA.fraction1 = detailB1OnA.fraction;
77
- detailBOnA.point1 = detailB1OnA.point;
78
+ detailA0OnB.fraction1 = detailA1OnB.fraction;
79
+ detailA0OnB.point1 = detailA1OnB.point; // capture -- detailA1OnB is not reused.
80
+ detailB0OnA.fraction1 = detailB1OnA.fraction;
81
+ detailB0OnA.point1 = detailB1OnA.point;
78
82
  if (!restrictToBounds)
79
- return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);
80
- const segment = Segment1d.create(detailBOnA.fraction, detailBOnA.fraction1);
83
+ return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);
84
+ const segment = Segment1d.create(detailB0OnA.fraction, detailB0OnA.fraction1);
81
85
  if (segment.clampDirectedTo01()) {
82
- segment.reverseIfNeededForDeltaSign(1.0);
83
86
  const f0 = segment.x0;
84
87
  const f1 = segment.x1;
85
- const h0 = detailBOnA.inverseInterpolateFraction(f0);
86
- const h1 = detailBOnA.inverseInterpolateFraction(f1);
88
+ const h0 = detailB0OnA.inverseInterpolateFraction(f0);
89
+ const h1 = detailB0OnA.inverseInterpolateFraction(f1);
87
90
  // recompute fractions and points..
88
- CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailBOnA, f0, f1, pointA0, pointA1);
89
- CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailAOnB, h0, h1, pointB0, pointB1);
90
- return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);
91
+ CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailB0OnA, f0, f1, pointA0, pointA1, f0 > f1);
92
+ CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailA0OnB, h0, h1, pointB0, pointB1, h0 > h1);
93
+ return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);
91
94
  }
92
95
  else {
93
96
  if (segment.signedDelta() < 0.0) {
94
- if (detailBOnA.point.isAlmostEqual(pointA0)) {
95
- detailBOnA.collapseToStart();
96
- detailAOnB.collapseToStart();
97
- return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);
97
+ if (detailB0OnA.point.isAlmostEqual(pointA0, this.tolerance)) {
98
+ detailB0OnA.collapseToStart();
99
+ detailA0OnB.collapseToStart();
100
+ return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);
98
101
  }
99
- if (detailBOnA.point1.isAlmostEqual(pointA1)) {
100
- detailBOnA.collapseToEnd();
101
- detailAOnB.collapseToEnd();
102
- return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);
102
+ if (detailB0OnA.point1.isAlmostEqual(pointA1, this.tolerance)) {
103
+ detailB0OnA.collapseToEnd();
104
+ detailA0OnB.collapseToEnd();
105
+ return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);
103
106
  }
104
107
  }
105
108
  else {
106
- if (detailBOnA.point.isAlmostEqual(pointA1)) {
107
- detailBOnA.collapseToStart();
108
- detailAOnB.collapseToEnd();
109
- return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);
109
+ if (detailB0OnA.point.isAlmostEqual(pointA1, this.tolerance)) {
110
+ detailB0OnA.collapseToStart();
111
+ detailA0OnB.collapseToEnd();
112
+ return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);
110
113
  }
111
- if (detailBOnA.point1.isAlmostEqual(pointA0)) {
112
- detailBOnA.collapseToEnd();
113
- detailAOnB.collapseToStart();
114
- return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);
114
+ if (detailB0OnA.point1.isAlmostEqual(pointA0, this.tolerance)) {
115
+ detailB0OnA.collapseToEnd();
116
+ detailA0OnB.collapseToStart();
117
+ return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);
115
118
  }
116
119
  }
117
120
  }
118
121
  return undefined;
119
122
  }
120
123
  /**
121
- * Create a CurveLocationDetailPair from . . .
124
+ * Create a CurveLocationDetailPair for a coincident interval of two overlapping curves
122
125
  * @param cpA curveA
123
- * @param cpB curve B
124
- * @param fractionsOnA fractions of an active section of curveA
125
- * @param fractionB0 fraction of an original containing B interval
126
- * @param fractionB1 end fraction of an original containing B interval
126
+ * @param cpB curveB
127
+ * @param fractionsOnA coincident interval of curveB in fraction space of curveA
128
+ * @param fractionB0 curveB start in fraction space of curveA
129
+ * @param fractionB1 curveB end in fraction space of curveA
130
+ * @param reverse whether curveB and curveA have opposite direction
127
131
  */
128
132
  createDetailPair(cpA, cpB, fractionsOnA, fractionB0, fractionB1, reverse) {
129
133
  const deltaB = fractionB1 - fractionB0;
@@ -132,10 +136,8 @@ export class CoincidentGeometryQuery {
132
136
  if (g0 !== undefined && g1 !== undefined) {
133
137
  const detailA = CurveLocationDetail.createCurveEvaluatedFractionFraction(cpA, fractionsOnA.x0, fractionsOnA.x1);
134
138
  const detailB = CurveLocationDetail.createCurveEvaluatedFractionFraction(cpB, g0, g1);
135
- if (reverse) {
139
+ if (reverse)
136
140
  detailA.swapFractionsAndPoints();
137
- detailB.swapFractionsAndPoints();
138
- }
139
141
  return CurveLocationDetailPair.createCapture(detailA, detailB);
140
142
  }
141
143
  return undefined;
@@ -153,11 +155,11 @@ export class CoincidentGeometryQuery {
153
155
  * @param arcA
154
156
  * @param arcB
155
157
  * @param _restrictToBounds
156
- * @return 0, 1, or 2 overlap intervals.
158
+ * @return 0, 1, or 2 overlap points/intervals
157
159
  */
158
160
  coincidentArcIntersectionXY(arcA, arcB, _restrictToBounds = true) {
159
161
  let result;
160
- if (arcA.center.isAlmostEqual(arcB.center)) {
162
+ if (arcA.center.isAlmostEqual(arcB.center, this.tolerance)) {
161
163
  const matrixBToA = arcA.matrixRef.multiplyMatrixInverseMatrix(arcB.matrixRef);
162
164
  if (matrixBToA) {
163
165
  const ux = matrixBToA.at(0, 0);
@@ -171,25 +173,49 @@ export class CoincidentGeometryQuery {
171
173
  if (Geometry.isAlmostEqualNumber(ru, 1.0)
172
174
  && Geometry.isAlmostEqualNumber(rv, 1.0)
173
175
  && Geometry.isAlmostEqualNumber(0, dot)) {
174
- const alphaB0Radians = Math.atan2(uy, ux); // angular position of arcB 0 point in A sweep
175
- const sweepDirection = cross > 0 ? 1.0 : -1.0; // 1 if arcB's parameter space sweeps forward, -1 if reverse
176
- const betaStartRadians = alphaB0Radians + sweepDirection * arcB.sweep.startRadians;
177
- const betaEndRadians = alphaB0Radians + sweepDirection * arcB.sweep.endRadians;
176
+ const alphaB0Radians = Math.atan2(uy, ux); // angular position of arcB 0 point in arcA sweep
177
+ const sweepDirection = cross > 0 ? 1.0 : -1.0; // 1 if arcB parameter space sweeps in same direction as arcA, -1 if opposite
178
+ const betaStartRadians = alphaB0Radians + sweepDirection * arcB.sweep.startRadians; // arcB start in arcA parameter space
179
+ const betaEndRadians = alphaB0Radians + sweepDirection * arcB.sweep.endRadians; // arcB end in arcA parameter space
178
180
  const fractionSpacesReversed = (sweepDirection * arcA.sweep.sweepRadians * arcB.sweep.sweepRadians) < 0;
179
181
  const sweepB = AngleSweep.createStartEndRadians(betaStartRadians, betaEndRadians);
180
182
  const sweepA = arcA.sweep;
181
183
  const fractionPeriodA = sweepA.fractionPeriod();
182
- const fractionB0 = sweepA.radiansToPositivePeriodicFraction(sweepB.startRadians);
183
- const fractionSweep = sweepB.sweepRadians / sweepA.sweepRadians;
184
- const fractionB1 = fractionB0 + fractionSweep;
184
+ const fractionB0 = sweepA.radiansToPositivePeriodicFraction(sweepB.startRadians); // arcB start in arcA fraction space
185
+ assert(fractionB0 >= 0.0);
186
+ const fractionSweep = sweepB.sweepRadians / sweepA.sweepRadians; // arcB sweep in arcA fraction space
187
+ const fractionB1 = fractionB0 + fractionSweep; // arcB end in arcA fraction space
185
188
  const fractionSweepB = Segment1d.create(fractionB0, fractionB1);
186
- if (fractionSweepB.clampDirectedTo01())
187
- result = this.appendDetailPair(result, this.createDetailPair(arcA, arcB, fractionSweepB, fractionB0, fractionB1, fractionSpacesReversed));
188
- if (fractionB1 > fractionPeriodA) {
189
- const fractionSweepBWrap = Segment1d.create(fractionB0 - fractionPeriodA, fractionB1 - fractionPeriodA);
190
- if (fractionSweepBWrap.clampDirectedTo01())
191
- result = this.appendDetailPair(result, this.createDetailPair(arcA, arcB, fractionSweepBWrap, fractionB0, fractionB1, fractionSpacesReversed));
192
- }
189
+ /** lambda to add a coincident interval or isolated intersection, given inputs in arcA fraction space
190
+ * @param arcBInArcAFractionSpace span of arcB in arcA fraction space. On return, clamped to [0,1] if nontrivial.
191
+ * @param testStartOfArcA if no nontrivial coincident interval was found, look for an isolated intersection at the start (true) or end (false) of arcA
192
+ * @returns whether a detail pair was appended to result
193
+ */
194
+ const appendCoincidentIntersection = (arcBInArcAFractionSpace, testStartOfArcA) => {
195
+ const size = result ? result.length : 0;
196
+ const arcBStart = arcBInArcAFractionSpace.x0;
197
+ const arcBEnd = arcBInArcAFractionSpace.x1;
198
+ if (arcBInArcAFractionSpace.clampDirectedTo01() && !Geometry.isSmallRelative(arcBInArcAFractionSpace.absoluteDelta())) {
199
+ result = this.appendDetailPair(result, this.createDetailPair(arcA, arcB, arcBInArcAFractionSpace, arcBStart, arcBEnd, fractionSpacesReversed));
200
+ }
201
+ else { // test isolated intersection
202
+ const testStartOfArcB = fractionSpacesReversed ? testStartOfArcA : !testStartOfArcA;
203
+ const arcAPt = this._point0 = testStartOfArcA ? arcA.startPoint(this._point0) : arcA.endPoint(this._point0);
204
+ const arcBPt = this._point1 = testStartOfArcB ? arcB.startPoint(this._point1) : arcB.endPoint(this._point1);
205
+ if (arcAPt.isAlmostEqual(arcBPt, this.tolerance)) {
206
+ const detailA = CurveLocationDetail.createCurveFractionPoint(arcA, testStartOfArcA ? 0 : 1, arcAPt);
207
+ const detailB = CurveLocationDetail.createCurveFractionPoint(arcB, testStartOfArcB ? 0 : 1, arcBPt);
208
+ result = this.appendDetailPair(result, CurveLocationDetailPair.createCapture(detailA, detailB));
209
+ }
210
+ }
211
+ return result !== undefined && result.length > size;
212
+ };
213
+ appendCoincidentIntersection(fractionSweepB, false); // compute overlap in strict interior, or at end of arcA
214
+ // check overlap at start of arcA with a periodic shift of fractionSweepB
215
+ if (fractionB1 >= fractionPeriodA)
216
+ appendCoincidentIntersection(Segment1d.create(fractionB0 - fractionPeriodA, fractionB1 - fractionPeriodA), true);
217
+ else if (fractionB0 === 0.0)
218
+ appendCoincidentIntersection(Segment1d.create(fractionB0 + fractionPeriodA, fractionB1 + fractionPeriodA), true);
193
219
  }
194
220
  }
195
221
  }