Fix node_label() function to work with self-intersection
commitaf2f50d4fb838de13dfbb5243e2114c66fefba7b
authorPeter Clifton <pcjc2@cam.ac.uk>
Wed, 2 Jun 2010 20:09:51 +0000 (2 21:09 +0100)
committerPeter Clifton <pcjc2@cam.ac.uk>
Wed, 2 Jun 2010 20:28:13 +0000 (2 21:28 +0100)
treee88108deab9900512a8094f9765a8fff3f145621
parent4a44c883afc56747ea95522fcbdf9dc0b6a38952
Fix node_label() function to work with self-intersection

Rather than just giving up if we encounter our own edges in the
CVC list at first, skip them until we either run out of edges, or
find one belonging to the other polygon.

I'm not 100% sure this is the correct fix, but it "seems to work".

Test-case:

Layer(1 "component")
(
  Line[60000 70000 60000 90000 4000 2000 "clearline"]
  Line[80000 60000 80000 90000 4000 2000 "clearline"]
  Line[90000 90000 90000 50000 4000 6000 "clearline"]
  Line[60000 40000 80000 60000 4000 6000 "clearline"]
  Polygon("clearpoly")
  (
    [10000 10000] [140000 10000] [140000 140000] [10000 140000]
  )
)
src/polygon1.c