From f4bae73056eb4980dbae3ebc78e0d350ce2a8d65 Mon Sep 17 00:00:00 2001 From: zhinanheshang Date: Fri, 25 Oct 2024 22:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=E5=8C=85?= =?UTF-8?q?=E5=9B=B4=E7=9B=92=E5=87=BD=E6=95=B0=E6=B7=BB=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=E4=BA=8E=E5=A1=AB=E5=85=85=E7=9A=84=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IFoxCAD.sln | 3 ++- .../ExtensionMethod/Entity/EntityBoundingInfo.cs | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/IFoxCAD.sln b/IFoxCAD.sln index 3480358..8419ced 100644 --- a/IFoxCAD.sln +++ b/IFoxCAD.sln @@ -62,7 +62,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{DA8EA8E7-A EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestGcad2024", "tests\TestGcad2024\TestGcad2024.csproj", "{FEC39964-9ECB-4567-8F68-94F80A39FA02}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestZcad2024", "tests\TestZcad2024\TestZcad2024.csproj", "{890D0AA3-1621-47F2-9E47-75D16A51D36E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestZcad2024", "tests\TestZcad2024\TestZcad2024.csproj", "{890D0AA3-1621-47F2-9E47-75D16A51D36E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -141,6 +141,7 @@ Global src\CAD\IFox.CAD.Shared\IFox.CAD.Shared.projitems*{20f254f7-aee5-42ae-a9b3-149bbdc7397f}*SharedItemsImports = 13 src\CAD\IFox.CAD.Shared\IFox.CAD.Shared.projitems*{3d7d095d-ef0a-40b3-9776-5f08c61fd614}*SharedItemsImports = 5 tests\TestShared\TestShared.projitems*{5f478f68-19bc-4a3a-af39-8728f8d396dd}*SharedItemsImports = 5 + tests\TestShared\TestShared.projitems*{890d0aa3-1621-47f2-9e47-75d16a51d36e}*SharedItemsImports = 5 src\Basal\IFox.Basal.Shared\IFox.Basal.Shared.projitems*{c823514a-2bc2-45c2-aced-18924a7b80bf}*SharedItemsImports = 13 tests\TestShared\TestShared.projitems*{ced63d2d-0af6-4831-806d-5e8e9b0d0a07}*SharedItemsImports = 13 src\CAD\IFox.CAD.Shared\IFox.CAD.Shared.projitems*{ef20e632-70a9-40eb-8c9a-539fd85fafad}*SharedItemsImports = 5 diff --git a/src/CAD/IFox.CAD.Shared/ExtensionMethod/Entity/EntityBoundingInfo.cs b/src/CAD/IFox.CAD.Shared/ExtensionMethod/Entity/EntityBoundingInfo.cs index be4b770..ed1f847 100644 --- a/src/CAD/IFox.CAD.Shared/ExtensionMethod/Entity/EntityBoundingInfo.cs +++ b/src/CAD/IFox.CAD.Shared/ExtensionMethod/Entity/EntityBoundingInfo.cs @@ -23,7 +23,7 @@ public static class EntityBoundingInfo static Extents3d GetMTextBox(MText mText) { var ext = new Extents3d(); - GetMTextBoxCorners(mText).ForEach(p=>ext.AddPoint(p)); + GetMTextBoxCorners(mText).ForEach(p => ext.AddPoint(p)); return ext; } /// @@ -175,6 +175,17 @@ public static Point3d[] GetMTextBoxCorners(MText mtext) Extents3d? ext = null; switch (ent) { + case Hatch hatch: + var hc = new HatchConverter(hatch); + hc.GetBoundarysData(); + var extTmp = new Extents3d(); + foreach (var curve in hc.CreateBoundary()) + { + extTmp.AddExtents(GetEntityBoxEx(curve)!.Value); + curve.Dispose(); + } + ext = extTmp; + break; case Spline spl: ext = spl.ToPolyline().GeometricExtents; break; @@ -198,7 +209,7 @@ public static Point3d[] GetMTextBoxCorners(MText mtext) var mat = Matrix3d.Identity; block!.GetBlockBox(ref blockExt, ref mat); if (!blockExt.IsEmptyExt()) - ext = blockExt; + ext = blockExt; break; default: if (ent.Bounds.HasValue) -- Gitee