mirror of https://gitee.com/cf-fz/WebCAD.git
!1902 修复:应用二维刀路时,未能够提供正确的坐标系
parent
70e7ccf5aa
commit
06538fb759
@ -0,0 +1,30 @@
|
||||
import { app } from "../../ApplicationServices/Application";
|
||||
import { Board } from "../../DatabaseServices/Entity/Board";
|
||||
import { Command } from "../../Editor/CommandMachine";
|
||||
import { PromptStatus } from "../../Editor/PromptResult";
|
||||
import { Polyline } from "../../ueapi";
|
||||
|
||||
export class Command_Fix2DPath implements Command
|
||||
{
|
||||
async exec()
|
||||
{
|
||||
let ssRes = await app.Editor.GetSelection({ Filter: { filterTypes: [Board] } });
|
||||
if (ssRes.Status !== PromptStatus.OK) return;
|
||||
let ents = ssRes.SelectSet.SelectEntityList as Board[];
|
||||
|
||||
for (let br of ents)
|
||||
{
|
||||
let ms = br.Modeling2D;
|
||||
for (let m of ms)
|
||||
{
|
||||
let cus = m.path.Explode();
|
||||
let color = m.path.ColorIndex;
|
||||
m.path = new Polyline;
|
||||
m.path.ColorIndex = color;
|
||||
for (let c of cus)
|
||||
m.path.Join(c, true, 1e-4);
|
||||
}
|
||||
br.Modeling2D = ms;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue