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. Simple Poygons(>2) union

Simple Poygons(>2) union

Scheduled Pinned Locked Moved C / C++ / MFC
9 Posts 2 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.
  • S Offline
    S Offline
    Shunya
    wrote on last edited by
    #1

    I have located fast libraries for unions of 2 polygons.Now, how does one merge a group of simple polygons.

    C 1 Reply Last reply
    0
    • S Shunya

      I have located fast libraries for unions of 2 polygons.Now, how does one merge a group of simple polygons.

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      Two by two?

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

      S 1 Reply Last reply
      0
      • C Code o mat

        Two by two?

        > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

        S Offline
        S Offline
        Shunya
        wrote on last edited by
        #3

        oh dear, what i meant was I want a program which takes a group of input simple polygons and merges them with the 2nd group of simple polygons. I have located 2 libraries (both use vatti's) algorithm for clipping. My polygons are without hoes,not self intersecting and only graze at edges(if at all). I want to merge them to get the outer contour of the final merged polygon. I presume that would be easier to do then the clip in the 2 heavy libraries.

        C 1 Reply Last reply
        0
        • S Shunya

          oh dear, what i meant was I want a program which takes a group of input simple polygons and merges them with the 2nd group of simple polygons. I have located 2 libraries (both use vatti's) algorithm for clipping. My polygons are without hoes,not self intersecting and only graze at edges(if at all). I want to merge them to get the outer contour of the final merged polygon. I presume that would be easier to do then the clip in the 2 heavy libraries.

          C Offline
          C Offline
          Code o mat
          wrote on last edited by
          #4

          YOu said you located 2 libraries that can "merge" 2 polygons, as i understood, i thought your problem was how you would merge more then two polygons. So actually what you want has nothing to do with the libraries because you don't want to use them but instead you want to do the task without the help of these, right? Well, if you are doing this under windows you could try creating regions from your polygons and merge them (windows can do this for you), how you get the points back from the resultiong region i don't know yet.

          > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

          S 1 Reply Last reply
          0
          • C Code o mat

            YOu said you located 2 libraries that can "merge" 2 polygons, as i understood, i thought your problem was how you would merge more then two polygons. So actually what you want has nothing to do with the libraries because you don't want to use them but instead you want to do the task without the help of these, right? Well, if you are doing this under windows you could try creating regions from your polygons and merge them (windows can do this for you), how you get the points back from the resultiong region i don't know yet.

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

            S Offline
            S Offline
            Shunya
            wrote on last edited by
            #5

            yes, i want to merge the regions and just get the outer contour. As simple as that and I have to use clipper?.(it is in borland delphi/c++)

            C 1 Reply Last reply
            0
            • S Shunya

              yes, i want to merge the regions and just get the outer contour. As simple as that and I have to use clipper?.(it is in borland delphi/c++)

              C Offline
              C Offline
              Code o mat
              wrote on last edited by
              #6

              I doubt Clipper is the only language you could implement this in.

              > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

              S 1 Reply Last reply
              0
              • C Code o mat

                I doubt Clipper is the only language you could implement this in.

                > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

                S Offline
                S Offline
                Shunya
                wrote on last edited by
                #7

                no it is in delphi/c++ and gpc is in c++.I dont a demo program to use the libraries under vs2010..that is the problem.both use a algorithm called vattis algorithm in computational Geometry. in vs2010 /c++(unmanaged) i dont know how to do graphics .

                C 1 Reply Last reply
                0
                • S Shunya

                  no it is in delphi/c++ and gpc is in c++.I dont a demo program to use the libraries under vs2010..that is the problem.both use a algorithm called vattis algorithm in computational Geometry. in vs2010 /c++(unmanaged) i dont know how to do graphics .

                  C Offline
                  C Offline
                  Code o mat
                  wrote on last edited by
                  #8

                  So let me get this straight: 1. one of the libraries you could use is written in C++ 2. the second one you could use is written in pure, standard C++ 3. you have sources, so not lib files 4. you want to work in VC++ with VS2010, use one of these libraries in it and display graphical representations of your polygons but you don't know how to: -use any of the libraries in VC++ -do graphics in VC++ If i am correct then i believe you should first learn some basic VC++/Windows programming before getting to the actual implementation of this polygon thing. If one of your libraries is written in standard C++, you probably whould be able to build it with VC++ too.

                  > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

                  S 1 Reply Last reply
                  0
                  • C Code o mat

                    So let me get this straight: 1. one of the libraries you could use is written in C++ 2. the second one you could use is written in pure, standard C++ 3. you have sources, so not lib files 4. you want to work in VC++ with VS2010, use one of these libraries in it and display graphical representations of your polygons but you don't know how to: -use any of the libraries in VC++ -do graphics in VC++ If i am correct then i believe you should first learn some basic VC++/Windows programming before getting to the actual implementation of this polygon thing. If one of your libraries is written in standard C++, you probably whould be able to build it with VC++ too.

                    > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

                    S Offline
                    S Offline
                    Shunya
                    wrote on last edited by
                    #9

                    yes,you got it right.I also know how to do some vc++(the old c++ not the new one with lambda,..).I know vb.net ok and also c++. I have asked a friend to help me in command line and probably when i show him my face next we will have a c++ program which readpolygons,readpoygons, perform union, write result polygons no graphics....so sad... ps:i have got 1 more library, in c of the previous decades.

                    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