Figured it out from an old post I saw somewhere on this forum for anyone trying to do the same thing:
private MultipolygonShape BuildPiePolygon(PointShape centerPointShape, double radius, double startAngle, double sweepAngle)
{
PolygonShape polygonShape = new PolygonShape();
EllipseShape ellipseShape = new EllipseShape(centerPointShape, radius);
PointShape pointShape1 = new PointShape(ellipseShape.Center.X, ellipseShape.Center.Y);
pointShape1.TranslateByDegree(ellipseShape.Width, CorrectAngle(startAngle));
polygonShape.OuterRing.Vertices.Add(new Vertex(ellipseShape.Center));
polygonShape.OuterRing.Vertices.Add(new Vertex(pointShape1));
if ((sweepAngle > 90) && (sweepAngle <= 180))
{
PointShape midPointShape1 = new PointShape(ellipseShape.Center.X, ellipseShape.Center.Y);
midPointShape1.TranslateByDegree(ellipseShape.Width, CorrectAngle(startAngle + 90));
polygonShape.OuterRing.Vertices.Add(new Vertex(midPointShape1));
}
else if ((sweepAngle > 180) && (sweepAngle <= 275))
{
PointShape midPointShape1 = new PointShape(ellipseShape.Center.X, ellipseShape.Center.Y);
midPointShape1.TranslateByDegree(ellipseShape.Width, CorrectAngle(startAngle + 90));
PointShape midPointShape2 = new PointShape(ellipseShape.Center.X, ellipseShape.Center.Y);
midPointShape2.TranslateByDegree(ellipseShape.Width, CorrectAngle(startAngle + 180));
polygonShape.OuterRing.Vertices.Add(new Vertex(midPointShape1));
polygonShape.OuterRing.Vertices.Add(new Vertex(midPointShape2));
}
else if ((sweepAngle > 275) && (sweepAngle <= 360))
{
PointShape midPointShape1 = new PointShape(ellipseShape.Center.X, ellipseShape.Center.Y);
midPointShape1.TranslateByDegree(ellipseShape.Width, CorrectAngle(startAngle + 90));
PointShape midPointShape2 = new PointShape(ellipseShape.Center.X, ellipseShape.Center.Y);
midPointShape2.TranslateByDegree(ellipseShape.Width, CorrectAngle(startAngle + 180));
PointShape midPointShape3 = new PointShape(ellipseShape.Center.X, ellipseShape.Center.Y);
midPointShape3.TranslateByDegree(ellipseShape.Width, CorrectAngle(startAngle + 275));
polygonShape.OuterRing.Vertices.Add(new Vertex(midPointShape1));
polygonShape.OuterRing.Vertices.Add(new Vertex(midPointShape2));
polygonShape.OuterRing.Vertices.Add(new Vertex(midPointShape3));
}
PointShape pointShapeSweep = new PointShape(ellipseShape.Center.X, ellipseShape.Center.Y);
pointShapeSweep.TranslateByDegree(ellipseShape.Width, CorrectAngle(startAngle + sweepAngle));
polygonShape.OuterRing.Vertices.Add(new Vertex(pointShapeSweep));
polygonShape.OuterRing.Vertices.Add(new Vertex(ellipseShape.Center));
MultipolygonShape intersectionMultiPolygonShape = ellipseShape.GetIntersection(polygonShape);
return intersectionMultiPolygonShape;
//return polygonShape;
}
private double CorrectAngle(double angle)
{
double correctAngle;
if (angle > 360)
correctAngle = angle - 360;
else
correctAngle = angle;
return correctAngle;
}
}