def vertex_dimension(self, face1=[], face2=[], parm='volume'):
        r"""
        Return the domain extent based on the vertices

        This function is better than using the pore coords as they may be far
        away from the original domain size.  And will alter the effective
        properties which should be based on the original domain sizes. Takes
        one or two sets of pores and works out different geometric properties
        if "length" is specified and two lists are given the planarity is
        determined and the appropriate length (x,y,z) is returned.

        Parameters
        ----------
        face1 : list or array containing pore indices for a face to include in
            calculations.

        parm : string
            Determines what information is returned:
                volume, area (_xy, _xz, _yz), length (_x, _y, _z), minmax.
            Default volume.

        """
        prj = self.project
        network = prj.network
        pores = np.array([], dtype=int)
        if 0 < len(face1):
            pores = np.hstack((pores, face1))
        if 0 < len(face2):
            pores = np.hstack((pores, face2))
        face1_coords = np.around(network['pore.coords'][face1], 12)
        face2_coords = np.around(network['pore.coords'][face2], 12)
        face1_planar = np.zeros(3)
        face2_planar = np.zeros(3)
        planar = np.zeros(3)
        for i in range(3):
            if len(np.unique(face1_coords[:, i])) == 1:
                face1_planar[i] = 1
            if len(np.unique(face2_coords[:, i])) == 1:
                face2_planar[i] = 1
        if 0 < len(face1) and 0 < len(face2):
            planar = face1_planar*face2_planar
        elif 0 < len(face1):
            planar = face1_planar
        elif 0 < len(face2):
            planar = face2_planar
        else:
            return 0
        verts = []
        for pore in pores:
            for vert in np.asarray(list(self['pore.vertices'][pore])):
                verts.append(vert)
        verts = np.asarray(verts)

        vx_min = verts[:, 0].min()
        vx_max = verts[:, 0].max()
        vy_min = verts[:, 1].min()
        vy_max = verts[:, 1].max()
        vz_min = verts[:, 2].min()
        vz_max = verts[:, 2].max()
        output = 0
        width = np.around(vx_max-vx_min, 10)
        depth = np.around(vy_max-vy_min, 10)
        height = np.around(vz_max-vz_min, 10)
        if parm == 'volume':
            output = width*depth*height
        elif parm == 'area_xy' or (parm == 'area' and planar[2] == 1):
            output = width*depth
        elif parm == 'area_xz' or (parm == 'area' and planar[1] == 1):
            output = width*height
        elif parm == 'area_yz' or (parm == 'area' and planar[0] == 1):
            output = depth*height
        elif parm == 'length_x' or (parm == 'length' and planar[0] == 1):
            output = width
        elif parm == 'length_y'or (parm == 'length' and planar[1] == 1):
            output = depth
        elif parm == 'length_z'or (parm == 'length' and planar[2] == 1):
            output = height
        elif parm == 'minmax':
            output = [vx_min, vx_max, vy_min, vy_max, vz_min, vz_max]
        return output
def vertex_dimension ( self , face1 = [ ] , face2 = [ ] , parm = 'volume' ) : prj = self . project network = prj . network pores = np . array ( [ ] , dtype = int ) if 0 < len ( face1 ) : pores = np . hstack ( ( pores , face1 ) ) if 0 < len ( face2 ) : pores = np . hstack ( ( pores , face2 ) ) face1_coords = np . around ( network [ 'pore.coords' ] [ face1 ] , 12 ) face2_coords = np . around ( network [ 'pore.coords' ] [ face2 ] , 12 ) face1_planar = np . zeros ( 3 ) face2_planar = np . zeros ( 3 ) planar = np . zeros ( 3 ) for i in range ( 3 ) : if len ( np . unique ( face1_coords [ : , i ] ) ) == 1 : face1_planar [ i ] = 1 if len ( np . unique ( face2_coords [ : , i ] ) ) == 1 : face2_planar [ i ] = 1 if 0 < len ( face1 ) and 0 < len ( face2 ) : planar = face1_planar * face2_planar elif 0 < len ( face1 ) : planar = face1_planar elif 0 < len ( face2 ) : planar = face2_planar else : return 0 verts = [ ] for pore in pores : for vert in np . asarray ( list ( self [ 'pore.vertices' ] [ pore ] ) ) : verts . append ( vert ) verts = np . asarray ( verts ) vx_min = verts [ : , 0 ] . min ( ) vx_max = verts [ : , 0 ] . max ( ) vy_min = verts [ : , 1 ] . min ( ) vy_max = verts [ : , 1 ] . max ( ) vz_min = verts [ : , 2 ] . min ( ) vz_max = verts [ : , 2 ] . max ( ) output = 0 width = np . around ( vx_max - vx_min , 10 ) depth = np . around ( vy_max - vy_min , 10 ) height = np . around ( vz_max - vz_min , 10 ) if parm == 'volume' : output = width * depth * height elif parm == 'area_xy' or ( parm == 'area' and planar [ 2 ] == 1 ) : output = width * depth elif parm == 'area_xz' or ( parm == 'area' and planar [ 1 ] == 1 ) : output = width * height elif parm == 'area_yz' or ( parm == 'area' and planar [ 0 ] == 1 ) : output = depth * height elif parm == 'length_x' or ( parm == 'length' and planar [ 0 ] == 1 ) : output = width elif parm == 'length_y' or ( parm == 'length' and planar [ 1 ] == 1 ) : output = depth elif parm == 'length_z' or ( parm == 'length' and planar [ 2 ] == 1 ) : output = height elif parm == 'minmax' : output = [ vx_min , vx_max , vy_min , vy_max , vz_min , vz_max ] return output
r"""
        Return the domain extent based on the vertices

        This function is better than using the pore coords as they may be far
        away from the original domain size.  And will alter the effective
        properties which should be based on the original domain sizes. Takes
        one or two sets of pores and works out different geometric properties
        if "length" is specified and two lists are given the planarity is
        determined and the appropriate length (x,y,z) is returned.

        Parameters
        ----------
        face1 : list or array containing pore indices for a face to include in
            calculations.

        parm : string
            Determines what information is returned:
                volume, area (_xy, _xz, _yz), length (_x, _y, _z), minmax.
            Default volume.