Ticket #257 (closed defect: fixed)

Opened 9 years ago

Last modified 7 years ago

Catch error if polygons are warped

Reported by: ole Owned by: hudson
Priority: normal Milestone:
Component: Functionality and features Version:
Severity: normal Keywords:
Cc:

Description

Petar Milevsky of Wollongong created a mesh with a warped polygon (see attached). A mesh was created, but excessive values for stage and momentum occurred. ANUGA should catch this condition and raise a meaningful exception.

See code in  https://datamining.anu.edu.au/anuga/browser/anuga_work/debug

Turn it into a unit test and implement a proper exception.

Attachments

polygon2.png Download (36.1 KB) - added by ole 9 years ago.
This is a polygon that causes a bad mesh

Change History

Changed 9 years ago by ole

This is a polygon that causes a bad mesh

Changed 9 years ago by ole

  • owner changed from ole to jane

A simple algorithm would check each segment against every other and use the newly developed intersection algorithm to detect crossings. The algorithmic complexity would be N2/2 if N is the number of segments, but given the expected size of polygons this seems like a good start.

Changed 7 years ago by hudson

  • owner changed from jane to hudson

This error could probably be caught while building the octree.

Changed 7 years ago by hudson

  • status changed from new to assigned

Changed 7 years ago by hudson

NOTE: This is the same bug as #346. We need a fast algorithm to convert complex polygons to concave ones, or raise an exception on complex polygons with an algorithm such as this:

 http://www.lems.brown.edu/~wq/projects/cs252.html

I've already implemeted a brute-force check that has found some pathological data in the unit tests.

Changed 7 years ago by hudson

  • status changed from assigned to closed
  • resolution set to fixed

Rev 7690 - exception is raised on a pathological poly. An O(n log n) algorithm is used.

Also, one of the files used for the unit tests, mainland_only.csv, had a bad poly, and this has been fixed by hand.

Note: See TracTickets for help on using tickets.