コード例 #1
0
ファイル: polygon.py プロジェクト: MattAndersonPE/anuga_core
def not_line_intersect(triangles, line, verbose=False):
    """Determine if a polyline and triangle overlap

    """
    line = ensure_numeric(line)
    triangles = ensure_numeric(triangles)
    
    M = triangles.shape[0]/3  # Number of triangles

    indices = num.zeros(M, num.int)

    count = _line_intersect(line, triangles, indices)

    if verbose:
        log.critical('Found %d triangles (out of %d) that intersect the line' % (count, M))

    return indices[count:]    
コード例 #2
0
ファイル: polygon.py プロジェクト: MattAndersonPE/anuga_core
def line_intersect(triangles, line, verbose=False):
    """Determine which of a list of trianglee intersect a line

    """
    line = ensure_numeric(line)
    triangles = ensure_numeric(triangles)
    
    M = triangles.shape[0]/3  # Number of triangles

    indices = num.zeros(M, num.int)

    count = _line_intersect(line, triangles, indices)

    if verbose:
        log.critical('Found %d triangles (out of %d) that intersect line' % (count, M))

    return indices[:count]
コード例 #3
0
ファイル: polygon.py プロジェクト: chrimerss/anuga_core
def not_line_intersect(triangles, line, verbose=False):
    """Determine if a polyline and triangle overlap

    """
    line = ensure_numeric(line)
    triangles = ensure_numeric(triangles)

    M = triangles.shape[0] / 3  # Number of triangles

    indices = num.zeros(M, num.int)

    count = _line_intersect(line, triangles, indices)

    if verbose:
        log.critical('Found %d triangles (out of %d) that intersect the line' %
                     (count, M))

    return indices[count:]
コード例 #4
0
ファイル: polygon.py プロジェクト: chrimerss/anuga_core
def line_intersect(triangles, line, verbose=False):
    """Determine which of a list of trianglee intersect a line

    """
    line = ensure_numeric(line)
    triangles = ensure_numeric(triangles)

    M = triangles.shape[0] / 3  # Number of triangles

    indices = num.zeros(M, num.int)

    count = _line_intersect(line, triangles, indices)

    if verbose:
        log.critical('Found %d triangles (out of %d) that intersect line' %
                     (count, M))

    return indices[:count]