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

Getting Error "EdgeEvent - Point on constrained edge not supported yet" in c# #7

Open
Supriya05 opened this issue Feb 26, 2016 · 6 comments

Comments

@Supriya05
Copy link

Hello, When i am trying to convert some polygon points to triangle i am getting following error please help me out. " EdgeEvent - Point on constrained edge not supported yet "

my data point is as follow.

0,0
26.1011,0
26.3587,16.8932
22.9269,14.909
22.5945,1.7841
3.3232,1.7841
3.3232,15.0749
22.9269,14.909
26.3587,16.8932
-0.219999999999999,17.0728

@630Studios
Copy link

630Studios commented Apr 22, 2017

In your case this is because you have points within the polygon that are duplicates.
The c# version of poly2tri does not appear to support multiple points in a path that exist at the same point in space. It also does not appear to support self-intersecting polygons.

I posted this response mainly for anyone else having the same issue, as i doubt the OP is still waiting for an answer over a year later.

@z3nth10n
Copy link

z3nth10n commented Dec 4, 2018

So, if I understood I can't have points with the same X or Y? https://pastebin.com/k1swSSfq

And, why is this not implemented?

// TODO: Split edge in two
////            splitEdge( ep, eq, p1 );
//            edgeEvent( tcx, p1, eq, triangle, point );
//            edgeEvent( tcx, ep, p1, triangle, p1 );
//            return;

If I comment the Exception part and I put a return; on this lines a StackOverflowException happens in: https://github.com/MaulingMonkey/poly2tri-cs/blob/master/Utility/FixedArray3.cs#L59

@630Studios
Copy link

630Studios commented Dec 4, 2018

The can not have the same X AND Y, you can have duplicate X's or Duplicate Y's, but you can not have multiple entries that have the same X AND Y.

Also the path may not intersect itself. So something like a figure 8 is self intersecting and would fail.

From your post, it sounds like your path is self intersecting.

@z3nth10n
Copy link

z3nth10n commented Dec 9, 2018

I have erased any duplicated point (calling Linq Distinct with a own class that inherits from IEqualityComparer), try to paste (the Pastebin I provided) it on Sublime Text and do the following:

...

You will notice that any point is duplicated...

@630Studios
Copy link

Distinct points is only one thing that must be adhered to.

The second part is the geometry can not be self intersecting. Which means two line segments can not cross or overlap in any way.

I can not tell from looking at the points, but from your previous posts, it seems that its more then likely your geometry is self intersecting.

@z3nth10n
Copy link

z3nth10n commented Dec 12, 2018

I solved this using LibTessDotNet. Sorry.

https://www.youtube.com/watch?v=7yY3MIyRtPw

https://www.youtube.com/watch?v=7dFpMTP9NFc

In the first video, the points I provided was cyan and magenta pixels, you can see they aren't self-intersecting.

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

3 participants