|
|
@ -62,7 +62,8 @@ interface SupportSnapEntity
|
|
|
|
interface SupportSnapPoint
|
|
|
|
interface SupportSnapPoint
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Point?: Vector3;
|
|
|
|
Point?: Vector3;
|
|
|
|
Entitys?: SupportSnapEntity[];
|
|
|
|
Entity?: Entity;//捕捉到的实体
|
|
|
|
|
|
|
|
Entitys?: SupportSnapEntity[];//辅助捕捉实体
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//正交捕捉轴
|
|
|
|
//正交捕捉轴
|
|
|
@ -82,6 +83,8 @@ export class SnapServices
|
|
|
|
SnapModeEnable: ObjectSnapMode = ObjectSnapMode.All;
|
|
|
|
SnapModeEnable: ObjectSnapMode = ObjectSnapMode.All;
|
|
|
|
EnablePolarSnap: boolean = true;//允许极轴捕捉
|
|
|
|
EnablePolarSnap: boolean = true;//允许极轴捕捉
|
|
|
|
CustomAxis: Vector3[] = [];//自定义捕捉轴
|
|
|
|
CustomAxis: Vector3[] = [];//自定义捕捉轴
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SnapEntity: Entity;//当前捕捉点来自的实体(仅当切线捕捉时有效)
|
|
|
|
private _SnapType: ObjectSnapMode = ObjectSnapMode.None;//当前点的捕捉类型
|
|
|
|
private _SnapType: ObjectSnapMode = ObjectSnapMode.None;//当前点的捕捉类型
|
|
|
|
private _DynPrompt: PromptBlock;
|
|
|
|
private _DynPrompt: PromptBlock;
|
|
|
|
private _HasBasePoint: boolean = false;
|
|
|
|
private _HasBasePoint: boolean = false;
|
|
|
@ -235,6 +238,7 @@ export class SnapServices
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this._SupportExtLinePts.length = 0;
|
|
|
|
this._SupportExtLinePts.length = 0;
|
|
|
|
this._SnapType = ObjectSnapMode.None;
|
|
|
|
this._SnapType = ObjectSnapMode.None;
|
|
|
|
|
|
|
|
this.SnapEntity = undefined;
|
|
|
|
|
|
|
|
|
|
|
|
if (this.Disabled)
|
|
|
|
if (this.Disabled)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -334,6 +338,7 @@ export class SnapServices
|
|
|
|
if (SnapPoint(pv, vcsP, this.SnapSize))
|
|
|
|
if (SnapPoint(pv, vcsP, this.SnapSize))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.SnapType = ObjectSnapMode.Tan;
|
|
|
|
this.SnapType = ObjectSnapMode.Tan;
|
|
|
|
|
|
|
|
this.SnapEntity = e;
|
|
|
|
return p;
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -389,6 +394,7 @@ export class SnapServices
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
this.SnapType = mode;
|
|
|
|
this.SnapType = mode;
|
|
|
|
|
|
|
|
this.SnapEntity = snapData.Entity;
|
|
|
|
return snapData.Point;
|
|
|
|
return snapData.Point;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -399,9 +405,9 @@ export class SnapServices
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let cus = sel.SelectEntityList.filter(e => e instanceof Curve || e instanceof RoomWallBase) as Curve[];
|
|
|
|
let cus = sel.SelectEntityList.filter(e => e instanceof Curve || e instanceof RoomWallBase) as Curve[];
|
|
|
|
let cuIns = new CurveIntersection(cus);
|
|
|
|
let cuIns = new CurveIntersection(cus);
|
|
|
|
for (let [, pMap] of cuIns.intersect)
|
|
|
|
for (let [e1, pMap] of cuIns.intersect)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (let [, pts] of pMap)
|
|
|
|
for (let [e2, pts] of pMap)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (let p of pts)
|
|
|
|
for (let p of pts)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -497,6 +503,7 @@ export class SnapServices
|
|
|
|
{
|
|
|
|
{
|
|
|
|
minZ = z;
|
|
|
|
minZ = z;
|
|
|
|
snapData.Point = p;
|
|
|
|
snapData.Point = p;
|
|
|
|
|
|
|
|
snapData.Entity = en;
|
|
|
|
snapData.Entitys = this.GetSupportEntity(mode, en, baseP, p, pIndex);
|
|
|
|
snapData.Entitys = this.GetSupportEntity(mode, en, baseP, p, pIndex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (dist < 2 * this.SnapSize ** 2 && dist < minDistance)
|
|
|
|
else if (dist < 2 * this.SnapSize ** 2 && dist < minDistance)
|
|
|
@ -504,6 +511,7 @@ export class SnapServices
|
|
|
|
minZ = z;
|
|
|
|
minZ = z;
|
|
|
|
minDistance = dist;
|
|
|
|
minDistance = dist;
|
|
|
|
snapData.Point = p;
|
|
|
|
snapData.Point = p;
|
|
|
|
|
|
|
|
snapData.Entity = en;
|
|
|
|
snapData.Entitys = this.GetSupportEntity(mode, en, baseP, p, pIndex);
|
|
|
|
snapData.Entitys = this.GetSupportEntity(mode, en, baseP, p, pIndex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|