修复:使用了错误的api导致的拉伸夹点失败

pull/1495/MERGE
ChenX 3 years ago
parent 51a8177259
commit c215716e6a

@ -130,7 +130,7 @@ export class LineAngularDimension extends Entity
this._L2EndPoint, this._L2EndPoint,
this._DimPoint, this._DimPoint,
]; ];
vec = vec.clone().transformDirection(this.OCSInv); vec = vec.clone().applyMatrix4(this.OCSInv.setPosition(0, 0, 0));
for (let i of indexList) for (let i of indexList)
arr[i].add(vec); arr[i].add(vec);

@ -554,6 +554,8 @@ export class AlignedDimension extends Entity
{ {
this.WriteAllObjectRecord(); this.WriteAllObjectRecord();
let inv = this.OCSInv; let inv = this.OCSInv;
let inv0 = inv.clone().setPosition(0, 0, 0);
let vec0 = vec.clone().applyMatrix4(inv0);
for (let i of indexList) for (let i of indexList)
{ {
if (i === 5) if (i === 5)
@ -561,8 +563,7 @@ export class AlignedDimension extends Entity
let dalucs = this.DalUcs; let dalucs = this.DalUcs;
//开始拖拽引线dragPt //开始拖拽引线dragPt
this.isDragLeadOutPt = true; this.isDragLeadOutPt = true;
vec = vec.clone().transformDirection(inv); this._LeadOutPts.dragPt.add(vec0);
this._LeadOutPts.dragPt.add(vec);
let calcV = this._LeadOutPts.dragPt.clone().applyMatrix4(dalucs).sub(midPoint(this._ArmP1, this._ArmP2).applyMatrix4(dalucs)); let calcV = this._LeadOutPts.dragPt.clone().applyMatrix4(dalucs).sub(midPoint(this._ArmP1, this._ArmP2).applyMatrix4(dalucs));
this._LeadOutOffsetY = calcV.y; this._LeadOutOffsetY = calcV.y;
this._LeadOutOffsetX = Math.abs(calcV.x); this._LeadOutOffsetX = Math.abs(calcV.x);
@ -580,11 +581,10 @@ export class AlignedDimension extends Entity
} }
else else
{ {
vec = vec.clone().transformDirection(inv);
if (i === 0) if (i === 0)
this._FootP1.add(vec); this._FootP1.add(vec0);
else else
this._FootP2.add(vec); this._FootP2.add(vec0);
this.ChangeFootPt(); this.ChangeFootPt();
} }

@ -226,7 +226,7 @@ export class RadiusDimension extends Entity
{ {
this.WriteAllObjectRecord(); this.WriteAllObjectRecord();
let inv = this.OCSInv; let inv = this.OCSInv;
let v = vec.clone().transformDirection(inv); let vec0 = vec.clone().applyMatrix4(inv.clone().setPosition(0, 0, 0));
let rad = this.startPt.distanceTo(this.center); let rad = this.startPt.distanceTo(this.center);
for (let i of indexList) for (let i of indexList)
@ -244,9 +244,9 @@ export class RadiusDimension extends Entity
else else
{ {
if (i === 0) if (i === 0)
this.startPt.add(v); this.startPt.add(vec0);
else else
this.endPt.add(v); this.endPt.add(vec0);
let dir = this.endPt.clone().sub(this.startPt).normalize().multiplyScalar(rad); let dir = this.endPt.clone().sub(this.startPt).normalize().multiplyScalar(rad);
this.center.copy(this.startPt.clone().add(dir)); this.center.copy(this.startPt.clone().add(dir));
} }

Loading…
Cancel
Save