Mesh.join

Mesh.join(other, weld=False, precision=None)[source]

Add the vertices and faces of another mesh to the current mesh.

Parameters:
othercompas.datastructures.Mesh

The other mesh.

weldbool, optional

If True, weld close vertices after joining. Default is False.

precisionint, optional

The precision used for welding. Default is TOL.precision.

Returns:
None

The mesh is modified in place.

Examples

>>> from compas.geometry import Box
>>> from compas.geometry import Translation
>>> from compas.datastructures import Mesh
>>> a = Box.from_width_height_depth(1, 1, 1)
>>> b = Box.from_width_height_depth(1, 1, 1)
>>> T = Translation.from_vector([2, 0, 0])
>>> b.transform(T)
>>> a = Mesh.from_shape(a)
>>> b = Mesh.from_shape(b)
>>> a.number_of_vertices()
8
>>> a.number_of_faces()
6
>>> b.number_of_vertices()
8
>>> b.number_of_faces()
6
>>> a.join(b)
>>> a.number_of_vertices()
16
>>> a.number_of_faces()
12