capytaine.meshes.collections module

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

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

Bases: ClippableMixin, 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)
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
generate_lid(*args, **kwargs)[source]
heal_mesh(*args, inplace=True, name=None, **kwargs)
indices_of_mesh(mesh_index: int) slice[source]

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

lowest_lid_position(*args, **kwargs)[source]
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
path_to_leaf()[source]

Builds a list of lists of paths from the collection corresponding to the root of the tree to the submeshes corresponding to the leaves

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.

with_normal_vector_going_down(*args, inplace=True, name=None, **kwargs)