diff --git a/src/DatabaseServices/Entity/Entity.ts b/src/DatabaseServices/Entity/Entity.ts index f3e877366..a13b89249 100644 --- a/src/DatabaseServices/Entity/Entity.ts +++ b/src/DatabaseServices/Entity/Entity.ts @@ -110,6 +110,14 @@ export class Entity extends CADObject this.Update(UpdateDraw.Matrix); } + /** Z轴归0 */ + Z0() + { + this.WriteAllObjectRecord(); + this._Matrix.elements[14] = 0; + this.Update(UpdateDraw.Matrix); + } + get OCSInv(): Matrix4 { return new Matrix4().getInverse(this._Matrix); diff --git a/src/DatabaseServices/Shape.ts b/src/DatabaseServices/Shape.ts index 519323075..3a8fedee1 100644 --- a/src/DatabaseServices/Shape.ts +++ b/src/DatabaseServices/Shape.ts @@ -17,6 +17,7 @@ export class Shape this.m_Outline = out || new Contour(); hols && this.m_Holes.push(...hols); } + get Outline() { return this.m_Outline; @@ -50,6 +51,14 @@ export class Shape this.UpdateShape(); return this.m_Shape; } + + Z0() + { + this.m_Outline.Curve.Z0(); + for (let h of this.m_Holes) + h.Curve.Z0(); + } + ApplyMatrix(m: Matrix4) { this.m_Outline.Curve.ApplyMatrix(m); diff --git a/src/GraphicsSystem/ToolPath/FeedingToolPath.ts b/src/GraphicsSystem/ToolPath/FeedingToolPath.ts index 1f0b39894..64616d904 100644 --- a/src/GraphicsSystem/ToolPath/FeedingToolPath.ts +++ b/src/GraphicsSystem/ToolPath/FeedingToolPath.ts @@ -10,6 +10,7 @@ import { BoolOpeartionType } from "../BoolOperateUtils"; import { OptimizeToolPath } from "./OptimizeToolPath"; import { equalCurve, IsRect } from "../../Common/CurveUtils"; import { Vector3 } from "three"; +import { MoveMatrix } from "../../Geometry/GeUtils"; /** *计算走刀工具类 @@ -179,7 +180,7 @@ export class FeedingToolPath extends Singleton if (!knifeRadius) knifeRadius = 3; shape = shape.Clone(); - + shape.Z0(); this.GrooveAddLen(shape, addLen); if (thickness >= brThickness)