实现持续画点(esc结束); 优化div命令在闭合曲线/多段线上的效果

pull/86/head
janetX97 6 years ago
parent c22bb8a97b
commit 55886f7653

@ -58,6 +58,11 @@ export class CMD_Divide implements Command
let cu = enRes.Entity;
let len = cu.Length;
let divLen = len / numRes.Value;
console.log(cu.IsClose);
if (cu.IsClose) //闭合曲线分割点+1
{
divCount += 1;
}
for (let i = 0; i < divCount - 1; i++)
{
let pt = cu.GetPointAtDistance(divLen * (i + 1));

@ -7,11 +7,19 @@ import { PromptStatus, PromptEntityResult } from '../Editor/PromptResult';
export class CMD_DrawPoint implements Command
{
async exec()
{
while (true)
{
let ptRes = await app.m_Editor.GetPoint({ Msg: "请输入或点取点的位置" });
if (ptRes.Status != PromptStatus.OK)
return;
break;
else
{
let ptEnt = new Point(ptRes.Value);
app.m_Database.ModelSpace.Append(ptEnt);
continue;
}
}
}
}

@ -368,9 +368,9 @@ export class Polyline extends Curve
let cu = cus[i];
let len = cu.Length;
if (dist <= len)
{
return i + cu.GetParamAtDist(dist);
}
else if (equaln(dist, len, 1e-8))
return i + 1;
dist -= len;
}
if (!this.m_ClosedMark)

@ -45,6 +45,8 @@ export class GetEntityServices implements EditorService
prompt = prompt || {};
this.m_Editor.m_InputState &= InputState.Entsel;
this.m_Editor.m_SelectCtrl.Cancel();
//光标变换
this.m_Viewer.m_PreViewer.ToEntsel();
this.m_Viewer.m_PreViewer.UpdateScreen();

Loading…
Cancel
Save