IEnumerable <string> ExportPoly(GeomPoly poly) { foreach (var pair in poly.arcs) { yield return(String.Concat( pair.Item2 ? '-' : '+', pair.Item1.id )); } }
// 简单检查多边形包含关系 // 不考虑孔洞、凹多边形等 public bool IncludeSimple(GeomPoly other) { foreach (var p in other.IterPoints()) { if (!Include(p)) { return(false); } } return(true); }
// 输出多边形内所有弧段 void DumpPoly(GeomPoly poly, bool leftInner) { foreach (var pair in poly.arcs) { bool isRight = leftInner ^ pair.Item2; var container = isRight ? arcRight : arcLeft; if (container.ContainsKey(pair.Item1)) { throw new Exception("重边"); } container[pair.Item1] = poly; } }