(self, size=(1, 1, 1))
return  {key: (val*self._direction).flatten()
             for key, val in vertices.items()}
Make vertices for the four net meshes by offsetting net polygons.
Make vertices for the four net meshes by offsetting net polygons.
Make vertices for the four net meshes by offsetting net polygons .
def _make_net_vertices(self, size=(1, 1, 1)):
    """Make vertices for the four net meshes by offsetting net polygons."""
    thickness = _NET_RELATIVE_SIZE * sum(size) / 3
    # Get mesh offsets, compensate for mesh.scale deformation.
    dx = np.array((thickness / size[0], 0, 0))
    dy = np.array((0, thickness / size[1], 0))
    dz = np.array((0, 0, thickness / size[2]))
    # Make mesh vertices with specified thickness.
    top = [v+dz for v in _NET['top']] + [v-dz for v in _NET['top']]
    right = [v+dy for v in _NET['right']] + [v-dy for v in _NET['right']]
    left = [v+dy for v in _NET['left']] + [v-dy for v in _NET['left']]
    back = ([v+dz for v in _NET['back'] if v[2] == 1] +
            [v-dz for v in _NET['back'] if v[2] == 1] +
            [v+dx for v in _NET['back'] if v[2] == -1] +
            [v-dx for v in _NET['back'] if v[2] == -1])
    vertices = {'top': top, 'back': back, 'left': left, 'right': right}
    return  {key: (val*self._direction).flatten()
             for key, val in vertices.items()}
def _make_net_vertices ( self , size = ( 1 , 1 , 1 ) ) : thickness = _NET_RELATIVE_SIZE * sum ( size ) / 3 # Get mesh offsets, compensate for mesh.scale deformation. dx = np . array ( ( thickness / size [ 0 ] , 0 , 0 ) ) dy = np . array ( ( 0 , thickness / size [ 1 ] , 0 ) ) dz = np . array ( ( 0 , 0 , thickness / size [ 2 ] ) ) # Make mesh vertices with specified thickness. top = [ v + dz for v in _NET [ 'top' ] ] + [ v - dz for v in _NET [ 'top' ] ] right = [ v + dy for v in _NET [ 'right' ] ] + [ v - dy for v in _NET [ 'right' ] ] left = [ v + dy for v in _NET [ 'left' ] ] + [ v - dy for v in _NET [ 'left' ] ] back = ( [ v + dz for v in _NET [ 'back' ] if v [ 2 ] == 1 ] + [ v - dz for v in _NET [ 'back' ] if v [ 2 ] == 1 ] + [ v + dx for v in _NET [ 'back' ] if v [ 2 ] == - 1 ] + [ v - dx for v in _NET [ 'back' ] if v [ 2 ] == - 1 ] ) vertices = { 'top' : top , 'back' : back , 'left' : left , 'right' : right } return { key : ( val * self . _direction ) . flatten ( ) for key , val in vertices . items ( ) }