在使用GPC计算多边形的交的时候,出现问题ip
//1.2. 另外一种方法,判断新的多边形是否和老多边形相交
Poly cross = (PolyDefault) Clip.intersection( filed, polyNig );
get
若filed 为两个分离的多边形,则出现计算问题:io
catch (Exception exception) {class
exception.printStackTrace();
}List
不知道如何解决!!!file
后记:exception
没办法,只能修改掉,使用遍历方式遍历
// 对一个复合多边形判断交 public static Poly intersection(Poly poly, Poly p2) { Poly p0 = new PolyDefault(); List<Poly> p1 = new ArrayList<>(); int num = poly.getNumInnerPoly(); if (num > 1) { for (int i = 0; i < num; ++i) { Poly psin = (PolyDefault) poly.getInnerPoly(i); p1.add(psin); } p0 = intersection(p1, p2); } else { p0 = (PolyDefault) Clip.intersection(poly, p2); } return p0; }