mymesh.mesh.mesh.Crop#

mesh.Crop(bounds, method='centroids', InPlace=False, cleanup=False)[source]#

Crop the mesh to specified bounds. Cropping with this method doesn’t modify any elements, it keeps the elements of the original mesh that are within the cropping bounds.

Parameters:
  • bounds (array_like) – Six element list of of cropping bounds, formatted as [xmin, xmax, ymin, ymax, zmin, zmax].

  • method (str, optional) –

    Cropping method, by default ‘centroids’

    • ’centroids’ - keep elements whose centroids are within the bounds

    • ’nodes’ - keep elements who have all of their nodes within the bound

  • InPlace (bool, optional) – If True, the original mesh will be modified in place, otherwise a copy will be made and modified, leaving the original mesh unaltered. By default False

  • cleanup (bool, optional) – Option to run mesh.cleanup(), removing nodes that are no longer in the cropped mesh, by default False.

Returns:

M – Cropped mesh. If InPlace=True, the output will be a reference to the same mesh instance as the input.

Return type:

mymesh.mesh