diff --git a/src/DatabaseServices/Spline.ts b/src/DatabaseServices/Spline.ts index cf45d0561..54fefa172 100644 --- a/src/DatabaseServices/Spline.ts +++ b/src/DatabaseServices/Spline.ts @@ -35,14 +35,14 @@ export class Spline extends Curve { return this._PointList; } - set Points(v: Vector3[]) + set Points(pts: Vector3[]) { - if (v.length < 2) return; + if (pts.length < 2) return; this.WriteAllObjectRecord(); let ocsInv = this.OCSInv; - this._PointList = v.map(p => p.clone().applyMatrix4(ocsInv)); + this._PointList = pts.map(p => p.clone().applyMatrix4(ocsInv)); - if (v.length > 2 && equalv3(this._PointList[0], arrayLast(this._PointList), 1e-3)) + if (pts.length > 2 && equalv3(this._PointList[0], arrayLast(this._PointList), 1e-3)) { this._PointList.pop(); this._ClosedMark = true; @@ -113,7 +113,7 @@ export class Spline extends Curve GetGripPoints() { - return this._PointList.map(p => p.clone().applyMatrix4(this.OCS)); + return this._PointList.map(p => p.clone().applyMatrix4(this.OCSNoClone)); } GetStretchPoints() { @@ -121,7 +121,7 @@ export class Spline extends Curve } MoveGripPoints(indexList: Array, vec: Vector3) { - vec = vec.clone().applyMatrix4(this.OCSInv).setZ(0); + vec = vec.clone().applyMatrix4(this.OCSInv.setPosition(0, 0, 0)).setZ(0); this.WriteAllObjectRecord(); for (let index of indexList) this._PointList[index].add(vec); @@ -129,7 +129,7 @@ export class Spline extends Curve } MoveStretchPoints(indexList: Array, vec: Vector3) { - vec = vec.clone().applyMatrix4(this.OCSInv).setZ(0); + vec = vec.clone().applyMatrix4(this.OCSInv.setPosition(0, 0, 0)).setZ(0); this.WriteAllObjectRecord(); for (let index of indexList) this._PointList[index].add(vec);