MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / append

Method append

splashsurf_lib/src/mesh.rs:762–780  ·  view source on GitHub ↗

Appends the other mesh to this mesh This operation appends the content of the other mesh's vertex and triangle storage tho this mesh. The vertex indices of the appended triangles are adjusted accordingly. The other mesh will be empty after this operation.

(&mut self, other: &mut TriMesh3d<R>)

Source from the content-addressed store, hash-verified

760 /// The vertex indices of the appended triangles are adjusted accordingly.
761 /// The other mesh will be empty after this operation.
762 pub fn append(&mut self, other: &mut TriMesh3d<R>) {
763 let TriMesh3d {
764 vertices: new_verts,
765 triangles: new_tris,
766 } = other;
767
768 let vertex_offset = self.vertices.len();
769 let tri_offset = self.triangles.len();
770
771 self.vertices.append(new_verts);
772 self.triangles.append(new_tris);
773
774 // Update the vertex indices per triangle
775 for tri in self.triangles.iter_mut().skip(tri_offset) {
776 tri[0] += vertex_offset;
777 tri[1] += vertex_offset;
778 tri[2] += vertex_offset;
779 }
780 }
781
782 /// Same as [`Self::vertex_normal_directions_inplace`] but assumes that the output is already zeroed
783 fn vertex_normal_directions_inplace_assume_zeroed(&self, normal_directions: &mut [Vector3<R>]) {

Callers 6

extract_narrow_bandFunction · 0.45
stitchingFunction · 0.45
readbgeo_to_meshioFunction · 0.45
copy_materialsFunction · 0.45
registerFunction · 0.45

Calls 2

iter_mutMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected