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

TriMesh.connected_components() gives meaningless face_colors for quite simple meshes #105

Closed
wlinna opened this issue Nov 5, 2022 · 1 comment

Comments

@wlinna
Copy link
Contributor

wlinna commented Nov 5, 2022

Face color computation doesn't seem to work. In my simple test case, all the values were equal to u32::MAX.

    let verts = vec![
        // Tri 1
        na::Point3::new(0.0, 0.0, 0.0),
        na::Point3::new(10.0, 0.0, 0.0),
        na::Point3::new(10.0, 0.0, 10.0),
        // Tri 2
        na::Point3::new(0.0, 1.0, 0.0),
        na::Point3::new(10.0, 1.0, 0.0),
        na::Point3::new(10.0, 1.0, -1.0)
    ];

    let trimesh = TriMesh::with_flags(
        verts,
        vec![[0, 1, 2], [3, 4, 5]],
        TriMeshFlags::CONNECTED_COMPONENTS
    );

    let components = trimesh.connected_components().unwrap();

    dbg!(components);

    assert!(components.face_colors.iter().all(|v| *v != u32::MAX)); // Fails! All of the values are equal to u32::MAX

Here's the output of dbg!(components)

[src/main.rs:24] components = TriMeshConnectedComponents {
    face_colors: [
        4294967295,
        4294967295,
    ],
    grouped_faces: [
        0,
        1,
    ],
    ranges: [
        0,
        1,
        2,
    ],
}

I noticed this first on parry3d 0.10.0, but it appears with parry3d 0.11.1 as well.
rustc: 1.65.0

@wlinna
Copy link
Contributor Author

wlinna commented May 1, 2024

I tested this on parry3d 0.14, and the bug is gone.

@wlinna wlinna closed this as completed May 1, 2024
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