diff --git a/__test__/FeedingToolPath/FeedingToolPath.test.ts b/__test__/FeedingToolPath/FeedingToolPath.test.ts index 608a9a015..046e13092 100644 --- a/__test__/FeedingToolPath/FeedingToolPath.test.ts +++ b/__test__/FeedingToolPath/FeedingToolPath.test.ts @@ -1,7 +1,7 @@ import { Board } from "../../src/DatabaseServices/Board"; import { Factory } from "../../src/DatabaseServices/CADFactory"; import { CADFile } from "../../src/DatabaseServices/CADFile"; -import { FeedingToolPath } from "../../src/GraphicsSystem/FeedingToolPath"; +import { FeedingToolPath } from "../../src/GraphicsSystem/ToolPath/FeedingToolPath"; Factory(Board); function loadFile(data) diff --git a/src/Add-on/DrawTopline.ts b/src/Add-on/DrawTopline.ts index a5ec3f6cf..d6621f783 100644 --- a/src/Add-on/DrawTopline.ts +++ b/src/Add-on/DrawTopline.ts @@ -19,14 +19,12 @@ export class DrawTopline implements Command Filter: { filterTypes: [Polyline] } }); - if (outRes.Status === PromptStatus.Cancel) + if (outRes.SelectSet.SelectEntityList.length === 0 + || outRes.Status === PromptStatus.Cancel) return; - if (outRes.SelectSet.SelectEntityList.length === 0) return; - let outline = outRes.SelectSet.SelectEntityList[0].Clone() as Polyline; - outline.ApplyMatrix(outline.OCSInv); let min = outline.BoundingBox.min; outline.ApplyMatrix(MoveMatrix(min.negate())); @@ -58,13 +56,15 @@ export class DrawTopline implements Command Filter: { filterTypes: [Curve] } }) - if (cuRes.Status === PromptStatus.Cancel) + let paths = cuRes.SelectSet.SelectEntityList as Curve[]; + + if (cuRes.Status === PromptStatus.Cancel || paths.length === 0) { updateObjVisible(true); return; } - let group = curveLinkGroup(cuRes.SelectSet.SelectEntityList as Curve[]); + let group = curveLinkGroup(paths); let path = new Polyline(); if (group[0].length === 1) diff --git a/src/Add-on/test/testIntersect.ts b/src/Add-on/test/testIntersect.ts index af378e65d..6d96e9492 100644 --- a/src/Add-on/test/testIntersect.ts +++ b/src/Add-on/test/testIntersect.ts @@ -6,6 +6,7 @@ import { Curve } from "../../DatabaseServices/Curve"; import { Command } from "../../Editor/CommandMachine"; import { PromptStatus } from "../../Editor/PromptResult"; import { IntersectCircleAndCircle, IntersectLAndLFor3D, IntersectOption } from "../../GraphicsSystem/IntersectWith"; +import { Point } from "../../DatabaseServices/Point"; export class TestIntersect implements Command { @@ -37,7 +38,7 @@ export class TestIntersect implements Command for (let p of ipts) { - let cir = new Circle(p, 0.1); + let cir = new Point(p); app.m_Database.ModelSpace.Append(cir); } }