@mlightcad/geometry-engine 3.1.8 → 3.1.9

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.
@@ -5502,6 +5502,31 @@ class ss extends Xn {
5502
5502
  addVertexAt(e, i) {
5503
5503
  e <= 0 ? this._vertices.unshift(i) : this._vertices.splice(e, 0, i), this._boundingBoxNeedsUpdate = !0;
5504
5504
  }
5505
+ /**
5506
+ * This function removes a vertex from the polyline at the specified index.
5507
+ *
5508
+ * @param index Input index (0 based) of the vertex to remove
5509
+ * @throws Error if the index is out of bounds
5510
+ */
5511
+ removeVertexAt(e) {
5512
+ if (e < 0 || e >= this._vertices.length)
5513
+ throw new Error(
5514
+ `Index ${e} is out of bounds. Valid range is 0 to ${this._vertices.length - 1}.`
5515
+ );
5516
+ this._vertices.splice(e, 1), this._boundingBoxNeedsUpdate = !0;
5517
+ }
5518
+ /**
5519
+ * This function resets the polyline by optionally retaining some vertices.
5520
+ * If reuse is true, the numVerts number of vertices are left intact and all vertices
5521
+ * beyond that number are deleted. If reuse is false, numVerts is ignored and all
5522
+ * existing vertex information will be deleted.
5523
+ *
5524
+ * @param reuse Input boolean indicating whether or not to retain some vertices
5525
+ * @param numVerts Input number of vertices to retain (only used when reuse is true)
5526
+ */
5527
+ reset(e, i) {
5528
+ e ? i !== void 0 && i >= 0 && i < this._vertices.length && (this._vertices = this._vertices.slice(0, i), this._boundingBoxNeedsUpdate = !0) : (this._vertices = new Array(), this._boundingBoxNeedsUpdate = !0);
5529
+ }
5505
5530
  /**
5506
5531
  * Get the 2d location of the vertex index in the polyline's own object coordinate system (OCS).
5507
5532
  *