krakentools.geometry.Square2D

class krakentools.geometry.Square2D(x0=0.0, y0=0.0, pitch=1.0)

Bases: Shape2D

__init__(x0=0.0, y0=0.0, pitch=1.0)

Methods

__init__([x0, y0, pitch])

coordinates_to_corner(xy[, tolerance])

rtype:

Tuple[str, int]

coordinates_to_face(xyz[, tolerance])

rtype:

Tuple[str, int]

get_all_corner_coordinates([inward])

rtype:

ndarray

get_all_face_coordinates([inward])

rtype:

ndarray

get_face_center_coordinates(face[, inward])

rtype:

ndarray

get_face_sgns([inward, inverted])

rtype:

ndarray

get_single_corner_coordinates(corner[, inward])

Calculates the coordinates of a given corner shifted towards the center of the node by inward.

sgn_to_face(tangent[, tolerance, print_debug])

rtype:

Tuple[str, int, bool]

get_single_corner_coordinates(corner, inward=0.0)

Calculates the coordinates of a given corner shifted towards the center of the node by inward.

Parameters:
  • corner (Union[str, int]) – Name and index of the corner.

  • inward (float, optional) – The value for how much the coordinates are shifted towards the center. Defaults to 0.0.

Raises:

RuntimeError – Corner name doesn’t match the corners of the shape.

Returns:

Coordinates x,y,z

Return type:

np.ndarray