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

function hang infinitely #215

Open
feyleth opened this issue Jul 1, 2024 · 2 comments
Open

function hang infinitely #215

feyleth opened this issue Jul 1, 2024 · 2 comments

Comments

@feyleth
Copy link

feyleth commented Jul 1, 2024

'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;
}

when none of condition it will hang infinitely

@Vrixyz
Copy link
Contributor

Vrixyz commented Jul 23, 2024

Do you happen to have an example trimesh ready to reproduce this ?

@feyleth
Copy link
Author

feyleth commented Jul 24, 2024

yes

use parry3d::{math::Point, na::Vector3, query::IntersectResult, shape::TriMesh};

fn main() {
    let points = vec![
        Point::from([0.0, 0.0, 0.0]),
        Point::from([0.0, 0.0, 1.0]),
        Point::from([1.0, 0.0, 0.0]),
        Point::from([1.0, 0.0, 1.0]),
    ];
    let indices = vec![[0, 1, 2], [1, 3, 2]];
    let trimesh = TriMesh::new(points, indices);
    let colid = trimesh.intersection_with_local_plane(&Vector3::<f32>::x_axis(), 0.5, 0.0005);
    match colid {
        IntersectResult::Intersect(points) => {
            println!("poliline {:#?}", points);
        }
        IntersectResult::Negative => {
            println!("positif");
        }
        IntersectResult::Positive => {
            println!("negatif");
        }
    }
}

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

2 participants