|
|
@ -288,21 +288,21 @@ export class DrawSpline implements Command
|
|
|
|
{
|
|
|
|
{
|
|
|
|
app.m_Editor.m_CommandStore.Prompt("请输入一个点:");
|
|
|
|
app.m_Editor.m_CommandStore.Prompt("请输入一个点:");
|
|
|
|
let ptRes = await app.m_Editor.GetPoint({ Msg: "请输入第一个点:" });
|
|
|
|
let ptRes = await app.m_Editor.GetPoint({ Msg: "请输入第一个点:" });
|
|
|
|
|
|
|
|
|
|
|
|
if (ptRes.Status != PromptStatus.OK)
|
|
|
|
if (ptRes.Status != PromptStatus.OK)
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
let i = 0;
|
|
|
|
|
|
|
|
let p1 = ptRes.Value;
|
|
|
|
let p1 = ptRes.Value;
|
|
|
|
|
|
|
|
|
|
|
|
let pts = [];
|
|
|
|
|
|
|
|
let ptLast = new Vector2(p1.x, p1.y);
|
|
|
|
let ptLast = new Vector2(p1.x, p1.y);
|
|
|
|
pts.push(ptLast);
|
|
|
|
let pts = [ptLast];
|
|
|
|
let spline = new Spline(pts);
|
|
|
|
let spline = new Spline(pts);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.m_Database.ModelSpace.Append(spline);
|
|
|
|
|
|
|
|
app.m_Editor.AddNoSnapEntity(spline.Draw(RenderType.Wireframe));
|
|
|
|
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
ptLast = ptLast.clone();
|
|
|
|
|
|
|
|
pts.push(ptLast);
|
|
|
|
app.m_Editor.m_CommandStore.Prompt("请输入点2:");
|
|
|
|
app.m_Editor.m_CommandStore.Prompt("请输入点2:");
|
|
|
|
ptRes = await app.m_Editor.GetPoint({
|
|
|
|
ptRes = await app.m_Editor.GetPoint({
|
|
|
|
Msg: "请输入点2:",
|
|
|
|
Msg: "请输入点2:",
|
|
|
@ -311,20 +311,14 @@ export class DrawSpline implements Command
|
|
|
|
KeyWordList: [{ msg: "放弃", key: "U" }],
|
|
|
|
KeyWordList: [{ msg: "放弃", key: "U" }],
|
|
|
|
Callback: (v) =>
|
|
|
|
Callback: (v) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let p = new Vector2(v.x, v.y);
|
|
|
|
ptLast.set(v.x, v.y);
|
|
|
|
let tmpPts = pts.slice(0);
|
|
|
|
spline.Points = pts;
|
|
|
|
tmpPts.push(p);
|
|
|
|
|
|
|
|
spline.Points = tmpPts;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (ptRes.Status == PromptStatus.OK)
|
|
|
|
if (ptRes.Status == PromptStatus.OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ptLast = new Vector2(ptRes.Value.x, ptRes.Value.y);
|
|
|
|
|
|
|
|
app.m_Database.ModelSpace.Append(spline);
|
|
|
|
|
|
|
|
pts.push(ptLast);
|
|
|
|
|
|
|
|
p1 = ptRes.Value;
|
|
|
|
p1 = ptRes.Value;
|
|
|
|
spline.Points = pts;
|
|
|
|
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -332,8 +326,6 @@ export class DrawSpline implements Command
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export class DrawTest implements Command
|
|
|
|
export class DrawTest implements Command
|
|
|
|