computational geometry - Outermost Polygon from a set of Edges -


enter image description heresuppose have set of 2d line segments connected. need algorithm finds outermost segments in set. is, minimal subset bounds same region.

note: not same finding convex hull of points making segments.

edit: on top initial set of segments. below same outline interior segments deleted. (ignore little grey crosses, they're mark intersection points.)

how pencil...?

  1. find leftmost vertex (minimum x). if there's more one, choose lowest of them (minimum y). there no vertex below current one, take direction 'downwards' reference.
  2. find edges going current vertex , calculate directions (bearings). find 1 makes smallest positive angle (counter-clockwise) reference direction. outline segment.
  3. select other end new 'current' vertex , set direction from vertex recent one new reference direction.
  4. proceed step 2 until arrive start vertex.
  5. remove unvisited segments.
  6. remove orphaned vertices (if appeared in step 5).

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -