capytaine.meshes.collections module

A set of meshes that can be used as a Mesh.

class capytaine.meshes.collections.CollectionOfMeshes(meshes: Iterable[Union[Mesh, CollectionOfMeshes]], name=None)[source]

Bases: SurfaceIntegralsMixin, Abstract3DObject

A tuple of meshes. It gives access to all the vertices of all the sub-meshes as if it were a mesh itself. Collections can be nested to store meshes in a tree structure.

Parameters:
  • meshes (Iterable of Mesh or CollectionOfMeshes) – meshes in the collection

  • name (str, optional) – a name for the collection

property axis_aligned_bbox

Get the axis aligned bounding box of the mesh.

Returns:

(xmin, xmax, ymin, ymax, zmin, zmax)

Return type:

tuple

property center_of_mass_of_nodes
clip(*args, inplace=True, name=None, **kwargs)
clipped(plane, **kwargs)[source]
compute_quadrature(method)[source]
copy(name=None)[source]
property diameter_of_nodes
extract_faces(*args, **kwargs)[source]
extract_one_face(id_face)[source]
property faces

Return the indices of the vertices forming each of the faces. For the later submeshes, the indices of the vertices has to be shifted to correspond to their index in the concatenated array self.vertices.

property faces_areas
property faces_centers
property faces_normals
property faces_radiuses
heal_mesh(*args, inplace=True, name=None, **kwargs)
immersed_part(free_surface=0.0, sea_bottom=-inf)[source]
indices_of_mesh(mesh_index: int) slice[source]

Return the indices of the faces for the sub-mesh given as argument.

keep_immersed_part(*args, inplace=True, name=None, **kwargs)
merged(name=None) Mesh[source]

Merge the sub-meshes and return a full mesh. If the collection contains other collections, they are merged recursively. Optionally, a new name can be given to the resulting mesh.

mirror(*args, inplace=True, name=None, **kwargs)
property nb_faces
property nb_submeshes
property nb_vertices
prune_empty_meshes(*args, inplace=True, name=None, **kwargs)
property quadrature_method
property quadrature_points
rotate(*args, inplace=True, name=None, **kwargs)
show(**kwargs)[source]
show_matplotlib(*args, **kwargs)[source]
sliced_by_plane(plane)[source]
submesh_containing_face(id_face)[source]
symmetrized(plane)[source]
translate(*args, inplace=True, name=None, **kwargs)
tree_view(**kwargs)[source]
property vertices
property volume

Returns volume of the mesh.