Face

class plot3d.face.Face(nvertex: int = 4)[source]

Defines a Face of a block for example IMIN,JMIN,JMIN to IMAX,JMIN,JMIN

__eq__(f)[source]

Check to see if two faces are the same by looking at the I,J,K Checks to see if any of vertices x,y,z match

Parameters:

f (Face) – another face

Returns:

True if faces match, False if no match is found

Return type:

Boolean

__hash__()[source]

Return hash(self).

__ne__(f)[source]

Checks if two faces are not equal

Parameters:

f (Face) – another face

Returns:

True if faces match, False if no match is found

Return type:

Boolean

__str__()[source]

Return str(self).

add_vertex(x: float, y: float, z: float, i: int, j: int, k: int)[source]

Add vertex to define a face

Parameters:
  • x (float) – x-coordinate

  • y (float) – y-coordinate

  • z (float) – z-coordinate

  • i (int) – i-th index of the coordinates (x,y,z)

  • j (int) – j-th index of the coordinates (x,y,z)

  • k (int) – k-th index of the coordinates (x,y,z)

property diagonal_length: float

Returns the diagonal length of the face

Returns:

diagonal length computed using IMIN, IMAX, JMIN, JMAX, KMIN, KMAX

Return type:

float

get_corners() Tuple[source]

Get the corners defined by (IMIN,JMIN,KMIN), (IMAX,JMAX,KMAX),

Returns:

containing

  • (x,y,z) (float,float,float): at IMIN,JMIN,KMIN

  • (x,y,z) (float,float,float): at IMAX,JMAX,KMAX

Return type:

Tuple

Reference:
property get_val

Get the value where key (I,J,K) is equal to val

Parameters:
  • i_val (int) – value of I

  • j_val (int) – value of J

  • k_val (int) – value of K

Returns:

x value [float]: y value [float]: z value

Return type:

[float]

index_equals(f2)[source]

Check to see of the face indices are equal

Parameters:

f2 ([type]) – [description]

property isEdge

check if the face is actually an edge. This is an edge if two indicies IMIN == IMAX or JMIN=JMAX or KMIN=KMAX

Returns:

True if face is really an edge

Return type:

[bool]

property isPoint

check if the face is actually an edge. This is an edge if two indicies IMIN == IMAX or JMIN=JMAX or KMIN=KMAX

Returns:

True if face is really a point

Return type:

[type]

is_connected(f, tol: float = 1e-08)[source]

Determines if face is connected by looking at the face centroid

Parameters:

f (Face) – another face object

match_indices(f)[source]
Check to see if two faces are the same. Checks to see if any of vertices x,y,z match

Normally this is used by Face1==Face2

Parameters:

f (Face) – another face

Returns:

list of indicies where there’s a match.

Return type:

List[(int,int)]

normal(block)[source]

Computes the normal vector of the face not really used but if anyone wants it.

shift(dx: float, dy: float, dz: float)[source]

Shifts the faces

Parameters:
  • dx (float) – delta x

  • dy (float) – delta y

  • dz (float) – delta z

to_dict()[source]

Returns a dictionary representaon of a face

vertices_equals(f)[source]

Checks to see if two faces are the same by looking at the vertices

Parameters:

f (Face) – Another face

Returns:

True = face vertices are equal

Return type:

bool