Skip to main content

vertices_in

Function vertices_in 

Source
pub fn vertices_in(
    mesh: &Mesh,
    bvh: &Bvh,
    region: &Region,
    out: &mut Vec<VertexId>,
) -> Result<usize>
Expand description

Appends to out, in ascending order and without duplicates, every vertex inside region that belongs to an alive triangle, and returns how many were appended. Elements already in out are kept and stay in front; only the appended part is sorted.

A vertex that no triangle uses is not found: the search runs over triangles.

During the traversal the appended range is compacted (sorted and deduplicated in place) whenever it reaches twice its size at the last compaction, so it never holds much more than twice the final result, and needs no extra memory; out keeps that capacity afterwards.

ยงErrors

As for triangles_in.