Add polygon shape

This commit is contained in:
Evgeny Redikultsev
2025-09-14 19:47:23 +05:00
parent c31e56869c
commit 35fccfaa11
56 changed files with 867 additions and 113 deletions

View File

@@ -9,6 +9,18 @@ namespace StructureHelperCommon.Models.Shapes
{
public static class PolygonGeometryUtils
{
public static IPolygonShape GetTratsfromedPolygon(IPolygonShape polygon, double dx, double dy)
{
IPolygonShape newPolygon = new PolygonShape(Guid.Empty);
var updateLogic = new PolygonShapeUpdateStrategy();
updateLogic.Update(newPolygon, polygon);
foreach (var item in newPolygon.Vertices)
{
item.Point.X += dx;
item.Point.Y += dy;
}
return newPolygon;
}
public static bool DoPolygonsEdgesIntersect(IPolygonShape polygon)
{
var vertices = polygon.Vertices;