@itwin/core-geometry 5.11.0-dev.11 → 5.11.0-dev.14

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Change Log - @itwin/core-geometry
2
2
 
3
- This log was last generated on Thu, 11 Jun 2026 21:11:10 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 16 Jun 2026 13:00:23 GMT and should not be manually modified.
4
+
5
+ ## 5.10.3
6
+ Tue, 16 Jun 2026 12:58:32 GMT
7
+
8
+ _Version update only_
4
9
 
5
10
  ## 5.10.2
6
11
  Thu, 11 Jun 2026 21:09:38 GMT
@@ -73,20 +73,51 @@ export interface MiteredSweepOptions {
73
73
  */
74
74
  export interface CreateFilletsInLineStringOptions {
75
75
  /**
76
- * Allow creation of retrograde edges to join large-radius fillets.
77
- * * If `true` (default), cusps are present in the output `Path` when the radius is too large.
78
- * * If `false`, a fillet with overly large radius is disallowed, resulting in a simple corner.
76
+ * Whether to allow cusps in the output `Path`. Default value is `true`.
77
+ * * A _cusp_ forms when a fillet's radius is large enough to consume an adjacent line string segment, or when two
78
+ * fillets intersect.
79
+ * * Each cusp results in a retrograde "cusp segment" or gap in the output `Path`, as per the `cuspSegments` option.
80
+ * * The length of cusp segments in the output `Path` is bounded above by the `cuspTolerance` option.
81
+ * * When this option is `false`, cusps are avoided by suppressing one or both of their constituent fillets. Where two
82
+ * fillets combine to form a cusp, but either fillet by itself does not form a cusp, the fillet with smaller chain
83
+ * index survives.
79
84
  */
80
85
  allowCusp?: boolean;
81
86
  /**
82
- * Whether to fillet the closure.
87
+ * Whether to fillet the closure of the input line string. Default value is `false`.
83
88
  * * If `true`, the input line string is treated as a polygon (closure point optional), and the output `Path` is
84
89
  * closed and has a fillet at its start point. If both first and last input points are identical, the last point's
85
90
  * entry in the radius array is ignored.
86
- * * If `false` (default), the first and last points receive no fillet and their respective entries in the radius
87
- * array are ignored.
91
+ * * If `false`, the first and last points receive no fillet and their respective entries in the radius array are
92
+ * ignored.
88
93
  */
89
94
  filletClosure?: boolean;
95
+ /**
96
+ * Maximum distance between first and last input points for the line string to be considered closed. Default value is
97
+ * [[Geometry.smallMetricDistance]].
98
+ * * This distance is used when `filletClosure` is `true` to detect whether the last point is redundant and thus to
99
+ * be ignored during processing.
100
+ */
101
+ closureTolerance?: number;
102
+ /**
103
+ * Maximum allowable length of a cusp when `allowCusp` is `true`. Default value is [[Geometry.smallMetricDistance]].
104
+ * * A cusp's length is defined to be the length of its "cusp segment", regardless of whether the cusp segment
105
+ * appears in the output `Path` (cf. option `cuspSegments`).
106
+ * * A cusp whose length exceeds `cuspTolerance` is avoided by suppressing one or both of the cusp's constituent
107
+ * fillets. Where two fillets combine to form such a cusp, but either fillet by itself produces a cusp shorter than
108
+ * `cuspTolerance`, the fillet that generates the shorter cusp survives; if the fillets by themselves generate equal
109
+ * length cusps, the fillet with smaller chain index survives.
110
+ */
111
+ cuspTolerance?: number;
112
+ /**
113
+ * Whether to output a `LineSegment3d` for each cusp segment. Default value is `true`.
114
+ * * The _cusp segment_ of a cusp is the retrograde line segment that bridges the gap formed by the cusp along its
115
+ * consumed line string edge, possibly extended.
116
+ * * When `allowCusp` and `cuspSegments` are `true`, the output `Path` is guaranteed to be continuous; otherwise, the
117
+ * output `Path` has a gap at each cusp, and downstream processing may not tolerate these gaps if they are too large.
118
+ * * Compare this option to `allowCusp`, which controls the presence of the cusps themselves.
119
+ */
120
+ cuspSegments?: boolean;
90
121
  }
91
122
  /**
92
123
  * Options used for method [[CurveFactory.fromFilletedLineString]].
@@ -123,7 +154,7 @@ export declare class CurveFactory {
123
154
  */
124
155
  static createArcPointTangentPoint(start: Point3d, tangentAtStart: Vector3d, end: Point3d): Arc3d | undefined;
125
156
  /**
126
- * Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.
157
+ * Construct a sequence of alternating lines and arcs with each arc creating a smooth transition between consecutive edges.
127
158
  * * If the radius parameter is a number, that radius is used throughout.
128
159
  * * If the radius parameter is an array of numbers, `radius[i]` is applied at `point[i]`.
129
160
  * * A zero radius for any point indicates to leave the as a simple corner.
@@ -1 +1 @@
1
- {"version":3,"file":"CurveFactory.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveFactory.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1G,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAG1F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAgB,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAa,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,O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;;OASG;WACW,6BAA6B,CACzC,UAAU,EAAE,wBAAwB,EACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,aAAa,EAAE,GAAG,SAAS;IAsD9B,iDAAiD;WACnC,yBAAyB,CACrC,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,sBAAsB,GAAG,KAAK,GAAG,SAAS;CAsBrF"}
@@ -74,7 +74,7 @@ class CurveFactory {
74
74
  return undefined;
75
75
  }
76
76
  /**
77
- * Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.
77
+ * Construct a sequence of alternating lines and arcs with each arc creating a smooth transition between consecutive edges.
78
78
  * * If the radius parameter is a number, that radius is used throughout.
79
79
  * * If the radius parameter is an array of numbers, `radius[i]` is applied at `point[i]`.
80
80
  * * A zero radius for any point indicates to leave the as a simple corner.
@@ -87,20 +87,18 @@ class CurveFactory {
87
87
  return this.createFilletsInLineString(new Point3dArrayCarrier_1.Point3dArrayCarrier(points), radius, allowCuspOrOptions);
88
88
  if (points instanceof LineString3d_1.LineString3d)
89
89
  return this.createFilletsInLineString(points.packedPoints, radius, allowCuspOrOptions);
90
- let allowCusp = true;
91
- let filletClosure = false;
92
- if (typeof allowCuspOrOptions === "boolean") {
93
- allowCusp = allowCuspOrOptions;
94
- }
95
- else {
96
- allowCusp = allowCuspOrOptions.allowCusp ?? true;
97
- filletClosure = allowCuspOrOptions.filletClosure ?? false;
98
- }
90
+ const haveBoolean = typeof allowCuspOrOptions === "boolean";
91
+ const allowCusp = haveBoolean ? allowCuspOrOptions : allowCuspOrOptions.allowCusp ?? true;
92
+ const filletClosure = haveBoolean ? false : allowCuspOrOptions.filletClosure ?? false;
93
+ const closureTolerance = haveBoolean ? Geometry_1.Geometry.smallMetricDistance : allowCuspOrOptions.closureTolerance ?? Geometry_1.Geometry.smallMetricDistance;
94
+ const cuspTolerance = haveBoolean ? Geometry_1.Geometry.smallMetricDistance : allowCuspOrOptions.cuspTolerance ?? Geometry_1.Geometry.smallMetricDistance;
95
+ const cuspSegments = haveBoolean ? true : allowCuspOrOptions.cuspSegments ?? true;
99
96
  let n = points.length;
100
- if (filletClosure && points.almostEqualIndexIndex(0, n - 1))
97
+ if (filletClosure && points.almostEqualIndexIndex(0, n - 1, closureTolerance))
101
98
  n--; // ignore closure point
102
99
  if (n <= 1)
103
100
  return undefined;
101
+ // create blend data at each vertex
104
102
  const pointA = Point3dVector3d_1.Point3d.create();
105
103
  const pointB = Point3dVector3d_1.Point3d.create();
106
104
  const pointC = Point3dVector3d_1.Point3d.create();
@@ -121,17 +119,41 @@ class CurveFactory {
121
119
  }
122
120
  }
123
121
  (0, core_bentley_1.assert)(blendArray.length === n);
124
- if (!allowCusp) {
125
- // suppress arcs that overlap a neighboring arc, or that consume the entire segment
126
- for (let i = 0; i < n; i++) {
127
- const bB = blendArray[i];
128
- if (!bB.arc)
129
- continue;
130
- const bA = blendArray[Geometry_1.Geometry.modulo(i - 1, n)];
131
- const bC = blendArray[Geometry_1.Geometry.modulo(i + 1, n)];
132
- if (bB.fraction10 > 1 || bB.fraction12 > 1 || bB.fraction10 + bA.fraction12 > 1 || bB.fraction12 + bC.fraction10 > 1) {
133
- bB.fraction10 = bB.fraction12 = 0;
134
- bB.arc = undefined;
122
+ // For each edge, look at its 0|1|2 fillets to determine whether/which to suppress.
123
+ // When a cusp is generated by 2 fillets, use this HEURISTIC:
124
+ // * Prefer to keep the fillet that results in the smaller allowable cusp segment.
125
+ // * If by itself, each fillet results in a cusp segment of equal allowable length (possibly zero), keep the first.
126
+ const edgeHasCusp = (fillet0, fillet1) => fillet0.fraction12 + fillet1.fraction10 > 1;
127
+ const cuspSegmentLength = (checkedEdgeIndex, fillet0, fillet1) => points.distanceUncheckedIndexIndex(checkedEdgeIndex, points.cyclicIndex(checkedEdgeIndex + 1)) * (fillet0.fraction12 + fillet1.fraction10 - 1);
128
+ const filletOvershootsEdge = (fillet, filletIndex) => filletIndex === 0 ? fillet.fraction12 > 1 : fillet.fraction10 > 1;
129
+ const cuspNeedsRemoval = (checkedEdgeIndex, fillet0, fillet1) => edgeHasCusp(fillet0, fillet1) && (!allowCusp || cuspSegmentLength(checkedEdgeIndex, fillet0, fillet1) > cuspTolerance);
130
+ const removeFillet = (fillet) => { fillet.fraction10 = fillet.fraction12 = 0; fillet.arc = undefined; };
131
+ for (let iEdge = 0; iEdge < (filletClosure ? n : n - 1); iEdge++) {
132
+ const fillet0 = blendArray[iEdge];
133
+ const fillet1 = blendArray[Geometry_1.Geometry.modulo(iEdge + 1, n)];
134
+ if (cuspNeedsRemoval(iEdge, fillet0, fillet1)) {
135
+ const fillet0OvershootsEdge = filletOvershootsEdge(fillet0, 0);
136
+ const fillet1OvershootsEdge = filletOvershootsEdge(fillet1, 1);
137
+ // prefer to remove just one fillet
138
+ if (fillet0OvershootsEdge && !fillet1OvershootsEdge) {
139
+ removeFillet(fillet0);
140
+ }
141
+ else if (!fillet0OvershootsEdge && fillet1OvershootsEdge) {
142
+ removeFillet(fillet1);
143
+ }
144
+ else if (!fillet0OvershootsEdge && !fillet1OvershootsEdge) {
145
+ removeFillet(fillet1); // fillets intersect (arbitrary choice)
146
+ }
147
+ else if (fillet1.fraction10 < fillet0.fraction12) {
148
+ removeFillet(fillet0); // fillet1 yields smaller cusp segment
149
+ }
150
+ else {
151
+ removeFillet(fillet1); // fillet0 yields smaller cusp segment, or they are equal (arbitrary choice)
152
+ }
153
+ // re-evaluate the edge after removal of a fillet; if a disallowed cusp persists, remove the other fillet
154
+ if (cuspNeedsRemoval(iEdge, fillet0, fillet1)) {
155
+ removeFillet(fillet0);
156
+ removeFillet(fillet1);
135
157
  }
136
158
  }
137
159
  }
@@ -141,7 +163,7 @@ class CurveFactory {
141
163
  path.tryAddChild(b0.arc);
142
164
  if (i + 1 < n || filletClosure) {
143
165
  const b1 = blendArray[Geometry_1.Geometry.modulo(i + 1, n)];
144
- this.addPartialSegment(path, allowCusp, b0.point, b1.point, b0.fraction12, 1 - b1.fraction10);
166
+ this.addPartialSegment(path, cuspSegments, b0.point, b1.point, b0.fraction12, 1 - b1.fraction10);
145
167
  }
146
168
  }
147
169
  return path;