Results 1 to 10 of 10

Thread: Polygon clipping

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Polygon clipping

    Has anyone implemented in VB the Weiler algorithm for polygon clipping by another polygon (not necessarily a rectangle!)?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  2. #2
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: Polygon clipping

    Actually I'm not familiar with Weiler algorithm. But I'm working with one of my project in C++, I found this project. I use this to find some polygon clipping are. You may useful it, just go and see.

    http://www.codeguru.com/Cpp/misc/mis...cle.php/c8965/
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Polygon clipping

    Quote Originally Posted by eranga262154
    Actually I'm not familiar with Weiler algorithm. But I'm working with one of my project in C++, I found this project. I use this to find some polygon clipping are. You may useful it, just go and see.

    http://www.codeguru.com/Cpp/misc/mis...cle.php/c8965/
    Unfortunately the Weiler algorithm is only mentioned but not described. Instead, the Sutherland-Hodgman a. is described in more detail and implemented in C but it's good only for clipping by a rectangle.

    In the meantime I've found in a library a book chapter with various such algorithms (including the W. alg.) and I have photocopied the interesting pages. They look a bit scary at first glance but I hope I can get to understand and eventually translate them to VB.

    Thanks for your reply anyway.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  4. #4
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: Polygon clipping

    It's ok pal. That's the only thing I know about clipping.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  5. #5

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Polygon clipping

    I've found Weiler's paper:

    http://www.cs.drexel.edu/~david/Clas...214-weiler.pdf

    and loads of information about the actual implementation. I guess I'm all set.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  6. #6
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: Polygon clipping

    It's explain the clipping algorithm nicely. Thanks krtxmrtz...
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  7. #7

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Polygon clipping

    If you're interested in polygon clipping, these are other algorithms you can Google for:

    Sutherland-Hodgman
    Liang-Barsky
    Maillot
    Vatti
    Greiner-Hormann

    To be sure, they have advantages and drawbacks, for example not all of them can handle concave or self-intersecting polygons.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  8. #8
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: Polygon clipping

    Thanks pal,

    Actually I've used Weiler algorithm, concept of it, on one of my application. That's why I'm looking it.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  9. #9

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Polygon clipping

    Quote Originally Posted by eranga262154
    Thanks pal,

    Actually I've used Weiler algorithm, concept of it, on one of my application. That's why I'm looking it.
    It's been a while since the last post here, but in case you're still interested, here's a very nice paper by 2 Korean guys:

    http://www.cadanda.com/CAD_A_3_1-4_48.PDF

    Also I've found a dll that has all the work alrerady done. It's written in C but if you want to use it with VB you can download the COM wrapper. I've tested it and works very nicely. Go to http://www.cs.man.ac.uk/~toby/alan/software/
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  10. #10
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: Polygon clipping

    Thanks pal.

    Yes it's a long time. I'm back to forum.

    Thanks for all informations too.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width