1

Closed

Stuck in a loop

description

First of all I've been using this libarary for a while now and really loving it.
I'm occisionally getting this error though (might be after upgrading to beta4, I'm not sure) and finally managed to find a sample for it.
As far as I can see, it goes into FindDirection function and gets stuck in "while (leftflag)" loop, freezing the whole application. Now this might be due to bad vertex placement and I can preprocess them but I just can't identify the problem precisely.

Points are shown below (I'll try to add them as text right after posting this)

file attachments

Closed Jun 14 at 12:08 AM by wo80

comments

brnkhy wrote Jun 13 at 2:15 PM

466.385314941406-25.8568592071533,
481.911590576172-25.8568592071533,
482.210144042969-24.5720443725586,
474.1484375-24.73264503479,
469.072540283203-24.73264503479,
463.996643066406-24.73264503479,
464.295227050781-25.5356540679932,
466.385314941406-25.5356540679932,

466.385314941406-25.8568592071533,

423.688049316406-23.608434677124,
464.295227050781-23.608434677124,
463.996643066406-24.73264503479,
423.389465332031-23.2872314453125,
423.688049316406-23.608434677124

This is what I'm passing to Triangulate function with polygon objcet. That's 14 vertices there, I added a separator and two parts are supposed to be different polygons (but probably sharing an edge or something).

thanks in advance

wo80 wrote Jun 13 at 8:34 PM

I cannot reproduce the problem (using beta 4). The following node file triangulates as expected (with some warnings about duplicate vertices). Do you apply any custom settings (like quality constraints)?

The values you gave in text format are not the same as in the screenshot. Is this intended? I used the following input:
# file: test.node
14
0 466.385314941406 25.8568592071533
1 481.911590576172 25.8568592071533
2 482.210144042969 24.5720443725586
3 474.1484375 24.73264503479
4 469.072540283203 24.73264503479
5 463.996643066406 24.73264503479
6 464.295227050781 25.5356540679932
7 466.385314941406 25.5356540679932
8 466.385314941406 25.8568592071533
9 423.688049316406 23.608434677124
10 464.295227050781 23.608434677124
11 463.996643066406 24.73264503479
12 423.389465332031 23.2872314453125
13 423.688049316406 23.608434677124

brnkhy wrote Jun 13 at 9:09 PM

Ah my bad, I printed the wrong coordinates up there, correct list should be;


466.385314941406-340.682220458984,
481.911590576172-340.383636474609,
482.210144042969-291.117584228516,
474.1484375-291.117584228516,
469.072540283203-288.430358886719,
463.996643066406-292.311920166016,
464.295227050781-327.544616699219,
466.385314941406-327.544616699219,
466.385314941406-340.682220458984,

423.688049316406-328.738952636719,
464.295227050781-328.440368652344,
463.996643066406-289.624664306641,
423.389465332031-289.923248291016,
423.688049316406-328.738952636719

wrote Jun 13 at 10:55 PM

brnkhy wrote Jun 13 at 10:55 PM

I believe it should looks something like this but in lower res. First part is on the right and second part is on the left.

wrote Jun 13 at 11:10 PM

brnkhy wrote Jun 13 at 11:10 PM

brnkhy wrote Jun 13 at 11:11 PM

uh new file attached at the first post, didn't know it works like that.

wo80 wrote Jun 14 at 12:07 AM

There are overlapping segments in your input. This will always cause trouble.

The problem is not the FindDirection function, but ongoing refinement of the mesh. Though the polygon is triangulated on my machine without an error, the mesh.Triangles.Count property is way too high. One option might be to set ConformingDelaunay = false?

I will close this issue. Please use the discussions section if you have any further questions!

wrote Jun 14 at 12:08 AM