Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Enclosing line for a list of points

Enclosing line for a list of points

Scheduled Pinned Locked Moved C#
graphicshelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bernhard Hiller
    wrote on last edited by
    #1

    There are likely many examples for that task available on the web, but I do not know the technical terms. I have a list of point (in this case, System.Drawing.Point), and I am looking for a closed line around them. All points of the list must be inside, some other points may be inside additionally, but their number should be as low as possible. And, actually, I do not need the line proper: knowing its length is enough. Finding a rectangle enclosing all the points of the list is very easy - but there are too many other points enclosed. Another issue is that there might be "holes", not all points have a direct neighbor (in "8 neighborhood"). Could you give me some pointers where to look for? Thanks a lot.

    Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!

    L P 2 Replies Last reply
    0
    • B Bernhard Hiller

      There are likely many examples for that task available on the web, but I do not know the technical terms. I have a list of point (in this case, System.Drawing.Point), and I am looking for a closed line around them. All points of the list must be inside, some other points may be inside additionally, but their number should be as low as possible. And, actually, I do not need the line proper: knowing its length is enough. Finding a rectangle enclosing all the points of the list is very easy - but there are too many other points enclosed. Another issue is that there might be "holes", not all points have a direct neighbor (in "8 neighborhood"). Could you give me some pointers where to look for? Thanks a lot.

      Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, you want a “convex hull” algorithm; there are some excellent articles on the subject right here at CP, mostly by Eric Ouellet. :)

      Luc Pattyn [My Articles] Nil Volentibus Arduum

      P 1 Reply Last reply
      0
      • B Bernhard Hiller

        There are likely many examples for that task available on the web, but I do not know the technical terms. I have a list of point (in this case, System.Drawing.Point), and I am looking for a closed line around them. All points of the list must be inside, some other points may be inside additionally, but their number should be as low as possible. And, actually, I do not need the line proper: knowing its length is enough. Finding a rectangle enclosing all the points of the list is very easy - but there are too many other points enclosed. Another issue is that there might be "holes", not all points have a direct neighbor (in "8 neighborhood"). Could you give me some pointers where to look for? Thanks a lot.

        Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!

        P Offline
        P Offline
        Peter_in_2780
        wrote on last edited by
        #3

        Convex hull - Wikipedia[^] is probably a good starting point. Good hunting!

        Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

        1 Reply Last reply
        0
        • L Luc Pattyn

          Hi, you want a “convex hull” algorithm; there are some excellent articles on the subject right here at CP, mostly by Eric Ouellet. :)

          Luc Pattyn [My Articles] Nil Volentibus Arduum

          P Offline
          P Offline
          Peter_in_2780
          wrote on last edited by
          #4

          You type faster than me ;P

          Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups