def copy(self):
        """
        Safely get a copy of the current mesh.

        Copied objects will have emptied caches to avoid memory
        issues and so may be slow on initial operations until
        caches are regenerated.

        Current object will *not* have its cache cleared.

        Returns
        ---------
        copied : trimesh.Trimesh
          Copy of current mesh
        """
        copied = Trimesh()

        # copy vertex and face data
        copied._data.data = copy.deepcopy(self._data.data)
        # copy visual information
        copied.visual = self.visual.copy()
        # get metadata
        copied.metadata = copy.deepcopy(self.metadata)
        # get center_mass and density
        if self._center_mass is not None:
            copied.center_mass = self.center_mass
        copied._density = self._density

        # make sure cache is set from here
        copied._cache.clear()

        return copied
def copy ( self ) : copied = Trimesh ( ) copied . _data . data = copy . deepcopy ( self . _data . data ) copied . visual = self . visual . copy ( ) copied . metadata = copy . deepcopy ( self . metadata ) if self . _center_mass is not None : copied . center_mass = self . center_mass copied . _density = self . _density copied . _cache . clear ( ) return copied
Safely get a copy of the current mesh.

        Copied objects will have emptied caches to avoid memory
        issues and so may be slow on initial operations until
        caches are regenerated.

        Current object will *not* have its cache cleared.

        Returns
        ---------
        copied : trimesh.Trimesh
          Copy of current mesh