我使用Region来寻找两条路径的交点(由两个多边形创建)。
GraphicsPath gp1 = new GraphicsPath();
gp1.AddPolygon(P);//P - array of points [first polygon]
Region d = new Region(gp1);
GraphicsPath gp2 = new GraphicsPath();
gp2.AddPolygon(P_);//P_ - array of points [second polygon]
d.Intersect(gp2);//founded intersection如何获得区域d的交点?
发布于 2012-11-21 13:12:02
我推荐使用适合此任务的多边形交点库。
下面是一个可以从C#中使用的最优秀的示例
http://www.angusj.com/delphi/clipper.php
我也相信如果需要的话,也有很多其他的用C#写的。这是一个关于这个话题的问答:
发布于 2013-04-16 13:00:10
使用检查graphicspath是否相交
if(!d.IsEmpty(this.CreateGraphics())
{
RectangleF rectBound=d.GetBound(this.CreateGraphics());
Pointf intersectionPoint=new Pointf(rectBound.X+rectBound.Width/2,rectBound.Y+rectBound.Height/2);
}https://stackoverflow.com/questions/13486071
复制相似问题