capytaine.meshes.predefined.cylinders module

Generate meshes of cylinders and disks

capytaine.meshes.predefined.cylinders.mesh_disk(*, radius=1.0, center=(0, 0, 0), normal=(0, 0, 1), resolution=(3, 6), faces_max_radius=None, reflection_symmetry=False, axial_symmetry=False, name=None, _theta_max=6.283185307179586)[source]

(One-sided) disk.

Parameters:
  • radius (float, optional) – radius of the disk

  • center (3-ple or array of shape (3,), optional) – position of the geometric center of the disk

  • normal (3-ple of floats, optional) – normal vector, default: along x axis

  • resolution (2-ple of int, optional) – number of panels along a radius and around the disk

  • faces_max_radius (float, optional) – maximal radius of a panel. (Default: no maximal radius.) If the provided resolution is too coarse, the number of panels is changed to fit the constraint on the maximal radius.

  • axial_symmetry (bool, optional) – if True, returns an AxialSymmetricMesh

  • reflection_symmetry (bool, optional) – if True, returns a ReflectionSymmetricMesh

  • name (str, optional) – a string naming the mesh

  • _theta_max (float, optional) – internal parameter, to return an arc circle instead of a full circle

capytaine.meshes.predefined.cylinders.mesh_horizontal_cylinder(*, length=10.0, radius=1.0, center=(0, 0, 0), resolution=(2, 8, 10), faces_max_radius=None, reflection_symmetry=False, translation_symmetry=False, name=None, _theta_max=6.283185307179586)[source]

Cylinder aligned along Ox axis.

Total number of panels = (2*resolution[0] + resolution[2])*resolution[1]

Parameters:
  • length (float, optional) – length of the cylinder

  • radius (float, optional) – radius of the cylinder

  • center (3-ple or array of shape (3,), optional) – position of the geometric center of the cylinder

  • resolution (3-ple of int, optional) – (number of panel along a radius at the end, number of panels around a slice, number of slices) Mnemonic: same ordering as the cylindrical coordinates (nr, ntheta, nz)

  • faces_max_radius (float, optional) – maximal radius of a panel. (Default: no maximal radius.) If the provided resolution is too coarse, the number of panels is changed to fit the constraint on the maximal radius.

  • reflection_symmetry (bool, optional) – if True, returns a ReflectionSymmetricMesh

  • translation_symmetry (bool, optional) – if True, uses a TranslationalSymmetricMesh internally for the main part of the cylinder

  • name (str, optional) – a string naming the mesh

  • _theta_max (float, optional) – internal parameter, to return an arc circle instead of a full circle

capytaine.meshes.predefined.cylinders.mesh_vertical_cylinder(*, length=10.0, radius=1.0, center=(0, 0, 0), resolution=(2, 8, 10), faces_max_radius=None, axial_symmetry=False, reflection_symmetry=False, name=None, _theta_max=6.283185307179586)[source]

Vertical cylinder.

Total number of panels = (2*resolution[0] + resolution[2])*resolution[1]

Parameters:
  • length (float, optional) – length of the cylinder

  • radius (float, optional) – radius of the cylinder

  • center (3-ple or array of shape (3,), optional) – position of the geometric center of the cylinder

  • resolution (3-ple of int, optional) – (number of panel along a radius at the end, number of panels around a slice, number of slices) Mnemonic: same ordering as the cylindrical coordinates (nr, ntheta, nz)

  • faces_max_radius (float, optional) – maximal radius of a panel. (Default: no maximal radius.) If the provided resolution is too coarse, the number of panels is changed to fit the constraint on the maximal radius.

  • axial_symmetry (bool, optional) – if True, returns an AxialSymmetricMesh

  • reflection_symmetry (bool, optional) – if True, returns a ReflectionSymmetricMesh

  • name (str, optional) – a string naming the mesh

  • _theta_max (float, optional) – internal parameter, to return an arc circle instead of a full circle