chemtools.utils.mesh.plane_mesh

chemtools.utils.mesh.plane_mesh(plane_points, spacing, extension)[source]

Return the grid points on the plane spanned by the given three coordinates.

Parameters:
  • plane_points (np.ndarray(3, 3)) – Points that are on the plane. Rows corespond to the different points, columns correspond to the x, y, and z components. The first set of coordinate will be used to establish the new vertical (i.e. y) direction in the plane.
  • spacing (float) – Upper bound to the spacing between adjacent grid points. This means that the spacing between adjacent points will be less than the given value.
  • extension (float) – Distance from the center of the three points that will define the edges of the mesh.
Returns:

grid_points – Points on the plane spanned by the given three points. First index corresponds to the position along the vertical direction of the plane mesh. This direction is the same as the direction of the first coordinate wrt origin. N_v is the number of points vertically along the the mesh. Second index corresponds to the position along the horizontal direction of the plane mesh. N_v is the number of points horizontally along the the mesh.

Return type:

np.ndarray(N_v, N_h, 3)

Raises:
  • TypeError – If plane_points is not two-dimensional numpy array of shape (3, 3). If spacing is not a float. If extension is not int or float.
  • ValueError – If spacing is less than or equal to zero. If extension is less than or equal to zero. If the three points on the plane are on a line.