Skip to content

infinite loop in intersection_with_local_plane in some cases #398

@KnstAnt

Description

@KnstAnt

I have infinite loop in intersection_with_local_plane in some cases in this block:

'traversal: while let Some(current) = next {
seen[*current] = true;
polyline_indices.push([prev as u32, *current as u32]);
for neighbor in index_adjacencies[*current].iter() {
if *neighbor != prev && *neighbor != first {
prev = *current;
next = Some(neighbor);
continue 'traversal;
} else if *neighbor != prev && *neighbor == first {
// If the next index is same as the first, close the polyline and exit
polyline_indices.push([*current as u32, first as u32]);
next = None;
continue 'traversal;
}
}
}

I think the cheking "if !seen" should be repeated inside the loop:

...
'traversal: while let Some(current) = next {
    if seen[*current] {
        break;
    } 
    seen[*current] = true;
    polyline_indices.push([prev as u32, *current as u32]);
    for neighbor in &index_adjacencies[*current] {
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions