修复:墙在非Z0情况下,无法捕捉顶部和底部的线

pull/1950/head
ChenX 2 years ago
parent 4611f15198
commit a7bcd9c674

@ -68,21 +68,19 @@ export class RoomWallArc extends RoomWallBase
pts = pts.concat(Arc.prototype.GetObjectSnapPoints.call(this, snapMode, pickPoint, lastPoint, viewXform));
const CurveSnap = (curve: Curve) =>
{
let bakZ = curve.OCSNoClone.elements[14];
curve.OCSNoClone.elements[14] = this._Matrix.elements[14];
let bakZ = curve.Z;
//底部线
arrayPushArray(pts, curve.GetObjectSnapPoints(snapMode, pickPoint, lastPoint, viewXform));
//顶部线
let topZ = this._Height + this._Matrix.elements[14];
curve.OCSNoClone.elements[14] = topZ;
curve.Z += this._Height;
arrayPushArray(pts, curve.GetObjectSnapPoints(snapMode, pickPoint, lastPoint, viewXform));
curve.OCSNoClone.elements[14] = bakZ;
curve.Z = bakZ;
let spep = [curve.StartPoint, curve.EndPoint];
for (let p of spep)
{
let l = new Line(p, p.clone().setZ(topZ));
let l = new Line(p, p.clone().setZ(p.z + this._Height));
arrayPushArray(pts, l.GetObjectSnapPoints(snapMode, pickPoint, lastPoint, viewXform));
}
};

@ -132,30 +132,32 @@ export class RoomWallLine extends RoomWallBase
pts = pts.concat(Line.prototype.GetObjectSnapPoints.call(this, snapMode, pickPoint, lastPoint, viewXform));
const CurveSnap = (curve: Curve) =>
{
let bakZ = curve.OCSNoClone.elements[14];
curve.OCSNoClone.elements[14] = this._Matrix.elements[14];
let bakZ = curve.Z;
//底部线
arrayPushArray(pts, curve.GetObjectSnapPoints(snapMode, pickPoint, lastPoint, viewXform));
//顶部线
let topZ = this._Height + this._Matrix.elements[14];
curve.OCSNoClone.elements[14] = topZ;
curve.Z += this._Height;
arrayPushArray(pts, curve.GetObjectSnapPoints(snapMode, pickPoint, lastPoint, viewXform));
curve.OCSNoClone.elements[14] = bakZ;
curve.Z = bakZ;
//柱子线
SnapTempLine.OCSNoClone.copy(this._Matrix);
SnapTempLine.OCSNoClone.copy(curve.OCSNoClone);
//@ts-ignore
SnapTempLine._StartPoint.copy(curve._StartPoint);
//@ts-ignore
SnapTempLine._EndPoint.copy(curve._StartPoint).setZ(topZ);
SnapTempLine._EndPoint.copy(curve._StartPoint);
//@ts-ignore
SnapTempLine._EndPoint.z += this._Height;
arrayPushArray(pts, SnapTempLine.GetObjectSnapPoints(snapMode, pickPoint, lastPoint, viewXform));
//@ts-ignore
SnapTempLine._StartPoint.copy(curve._EndPoint);
//@ts-ignore
SnapTempLine._EndPoint.copy(curve._EndPoint).setZ(topZ);
SnapTempLine._EndPoint.copy(curve._EndPoint);
//@ts-ignore
SnapTempLine._EndPoint.z += this._Height;
arrayPushArray(pts, SnapTempLine.GetObjectSnapPoints(snapMode, pickPoint, lastPoint, viewXform));
};

Loading…
Cancel
Save