简体   繁体   中英

Create concave polygon passing through all given points

Given a set of points, I want to create a concave non-intersecting polygon using these points. A convex hull would negate the concave part, while arranging them by x/y coordinates or angles from centre would create spiky artefacts. Is there a simple way to do this?

An example of the kind of polygon I want to create:

例子

If you only have the perimeter vertices and can guarantee that the distance between perimeter vertices will be less than the distance between edges of the perimeter then you could use a minimum spanning tree.

使用最小生成树检测的周长

The top example shows where a MST works (with the first and last vertices in the resulting polyline joined)

The bottom example is what happens if edges of the perimeter get too close.

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