0

http://postimg.org/image/sgl1q3vf5/ http://postimg.org/image/787d8ogy9/

As the pics shown above, I tried to calculate the minkowski sum of a polyline and a circle and the resulting shape covers the area of the polygon Im trying to generate. I use the sample code from boost to implement the minkowski sum. My question would be what are some efficient ways to extract the nonconvex hull(for lack of a better term) of the minkowski sum result(the boundary), thanks.

genpfault
  • 51,148
  • 11
  • 85
  • 139
david lin
  • 39
  • 6

2 Answers2

0

To extract a non-convex hull, you'll have to implement Alpha Shapes, I'm in the middle of implementing the algorithm for my project right now, unfortunately, it's not easy.

An alternative to implementing it yourself is to use CGAL, it has an Alpha Shapes implementation (although that part of the library is GPL).

voodooattack
  • 1,127
  • 9
  • 16
  • You can check my [project](https://github.com/voodooattack/ADWIF/blob/master/mapgenerator.cpp#L213) for sample code, it's not very well documented and it's certainly broken but it's a start. – voodooattack Nov 19 '13 at 07:41
  • Thanks.However, it seems that alpha shape can not add additional points that could be generated from polygon union,i.e.the point where the polyline in pic 1 changes angle.So what I need exactly is probably more than a non-convex hull. – david lin Nov 20 '13 at 00:02
0

If it's any help, I've recently added Minkowski sum to my Clipper library: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm

enter image description here

Angus Johnson
  • 4,565
  • 2
  • 26
  • 28