Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null pointer exception with a very simple polygon #112

Open
mattbeghin opened this issue Dec 5, 2019 · 0 comments
Open

Null pointer exception with a very simple polygon #112

mattbeghin opened this issue Dec 5, 2019 · 0 comments

Comments

@mattbeghin
Copy link

I found this very simple polygon which generates a null pointer access violation. Any idea why ?

std::vector<p2t::Point*> polyline = {
    new p2t::Point(-0.611580879999999993401615938637,0.0104235565411950892311665484158),
    new p2t::Point(-0.611580879999999993401615938637,0.1483950316905975341796875),
    new p2t::Point(-0.578899596898762469621146919962,0.227294628589359948289683188705),
    new p2t::Point(-0.5,0.259975911690597527581303438637),
    new p2t::Point(0.5,0.259975911690597527581303438637),
    new p2t::Point(0.578899596898762469621146919962,0.227294628589359948289683188705),
    new p2t::Point(0.611580879999999993401615938637,0.1483950316905975341796875),
    new p2t::Point(0.611580879999999993401615938637,0.0104235565411950614755909327869),
    new p2t::Point(0.388419120000000006598384061363,0.0104235565411950892311665484158),
    new p2t::Point(0.388419120000000006598384061363,0.0368141516905975130224959457337),
    new p2t::Point(-0.388419120000000006598384061363,0.0368141516905975269002837535481),
    new p2t::Point(-0.388419120000000006598384061363,0.0104235565411950892311665484158)
};

p2t::CDT cdt(polyline);
cdt.Triangulate();

Screenshot 2019-12-05 at 13 20 21

You can check the WKT of the polygon (for instance here http://dev.openlayers.org/examples/vector-formats.html):
POLYGON((-0.611580879999999993401615938637 0.0104235565411950892311665484158,-0.611580879999999993401615938637 0.1483950316905975341796875,-0.578899596898762469621146919962 0.227294628589359948289683188705,-0.5 0.259975911690597527581303438637,0.5 0.259975911690597527581303438637,0.578899596898762469621146919962 0.227294628589359948289683188705,0.611580879999999993401615938637 0.1483950316905975341796875,0.611580879999999993401615938637 0.0104235565411950614755909327869,0.388419120000000006598384061363 0.0104235565411950892311665484158,0.388419120000000006598384061363 0.0368141516905975130224959457337,-0.388419120000000006598384061363 0.0368141516905975269002837535481,-0.388419120000000006598384061363 0.0104235565411950892311665484158,-0.611580879999999993401615938637 0.0104235565411950892311665484158))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant