ITADN

Corners of mesh no longer contained in the mesh after calling `merge_polygons`

#99Openandrewhickman 创建于 2025-05-24
A
andrewhickmancommented
The following code constructs a small mesh, calls `merge_polygons` on it, and asserts that one of the corners has a closest point in the mesh: ```rust let triangulation = Triangulation::from_outer_edges(&[ Vec2::new(-1., -1.), Vec2::new(-1., 1.0), Vec2::new(0., 1.0), Vec2::new(1.5, 1.0), Vec2::new(1.0, -1.), ]); let mut mesh = triangulation.as_navmesh(); mesh.merge_polygons(); assert!(mesh.get_closest_point(Vec2::new(1.5, 1.0)).is_some()); ``` This succeeds without the `merge_polygons` call but fails with it.
0 条评论