-
-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Labels
Description
Hi there,
I put this in the Discord too, but just for good measure I'll open an issue too.
It appears that ConvexPolyhedron::from_convex_hull(&points) produces invalid topology:
use std::fs::File;
use parry3d::na::Point3;
use parry3d::shape::{ConvexPolyhedron, TriMeshFlags};
fn main() {
let decoded: Vec<f32> = bincode::deserialize_from(File::open("points.bin").unwrap()).unwrap();
let points : Vec<Point3<f32>> = decoded.chunks(3).map(|c| Point3::new(c[0], c[1], c[2])).collect();
let convex = ConvexPolyhedron::from_convex_hull(&points)
.expect("Failed to compute convex hull of mesh");
let (vertices, mut indices) = convex.to_trimesh();
let mut convex_mesh = parry3d::shape::TriMesh::new(vertices, indices)
.expect("Failed to convert convex polyhedron to triangle mesh");
// This panics.
convex_mesh.set_flags(TriMeshFlags::HALF_EDGE_TOPOLOGY).unwrap()
}
Here's the input data (remove the .txt, GitHub refused to upload it otherwise)
Reactions are currently unavailable