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 / C++ / MFC
  4. Converting lines to polygons?

Converting lines to polygons?

Scheduled Pinned Locked Moved C / C++ / MFC
algorithmsquestion
5 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.
  • C Offline
    C Offline
    cdsmith
    wrote on last edited by
    #1

    Hello, I am working on an application where I get passed a list of line segments. I want to convert the line segments into polygons. Anybody have a reference to an algorithm or code fragment that can do this? Anybody have a quick sketch of an algorithm to do this. Thanks for any ideas. Craig

    J 1 Reply Last reply
    0
    • C cdsmith

      Hello, I am working on an application where I get passed a list of line segments. I want to convert the line segments into polygons. Anybody have a reference to an algorithm or code fragment that can do this? Anybody have a quick sketch of an algorithm to do this. Thanks for any ideas. Craig

      J Offline
      J Offline
      John R Shaw
      wrote on last edited by
      #2

      BOOL Polygon( HDC hdc, // handle to DC CONST POINT *lpPoints, // polygon vertices int nCount // count of polygon vertices ); or am I missing something? INTP

      R C 2 Replies Last reply
      0
      • J John R Shaw

        BOOL Polygon( HDC hdc, // handle to DC CONST POINT *lpPoints, // polygon vertices int nCount // count of polygon vertices ); or am I missing something? INTP

        R Offline
        R Offline
        Ryan Binns
        wrote on last edited by
        #3

        John R. Shaw wrote: or am I missing something? Nope. That would be my suggestion as well :)

        Ryan

        "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

        1 Reply Last reply
        0
        • J John R Shaw

          BOOL Polygon( HDC hdc, // handle to DC CONST POINT *lpPoints, // polygon vertices int nCount // count of polygon vertices ); or am I missing something? INTP

          C Offline
          C Offline
          cdsmith
          wrote on last edited by
          #4

          If only it were that ease...:) Yup, you are missing something. The lines are from a wire mesh drawing, there are thousands of lines and they make up hundereds of polygons. The trick is to figure out what lines grouped together make up a polygon. Craig

          J 1 Reply Last reply
          0
          • C cdsmith

            If only it were that ease...:) Yup, you are missing something. The lines are from a wire mesh drawing, there are thousands of lines and they make up hundereds of polygons. The trick is to figure out what lines grouped together make up a polygon. Craig

            J Offline
            J Offline
            John R Shaw
            wrote on last edited by
            #5

            Search for "3D Graph ActiveX Control" at codeprject. I have not studied the code but it should help. There is no lack of graphics related sites on the www. INTP

            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