简体   繁体   中英

Union of two polygons defined by paths

I have two polygons which are defined by a list of points:

x1,y1; x2,y2; x3,y3; ...; xn,yn

and I would like to find their union, expressed in the same form.

It would be acceptable to assume that the two overlap leaving no holes. Better, for generality, would be to allow the two polygons to have holes but to fill them in.

Speed is not important in this application; an inefficient algorithm/implementation would be fine. I'm open to any type of answer: a library which solves the task, a, algorithm, or code.

You can try Clipper library by Angus Johnson. It may be used with C++, C# and Delphi.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM