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>)
| 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>]) { |
no test coverage detected