def check_dist_to_edges(v, or_verts, or_radius, edges, sides_space):
    d = 0
    min_dist = 2.0e-5
    for ed, s in zip(edges, sides_space):
        v1 = or_verts[ed[0]]
        v2 = or_verts[ed[1]]
        r1 = or_radius[ed[0]]
        r2 = or_radius[ed[1]]
        if v1 == v and r1 < min_dist or v2 == v and r2 < min_dist or r1 < min_dist and r2 < min_dist:
            continue

        in_tirangle_a = pt_in_triangle(v, s[2], s[0], s[1])
        in_tirangle_b = pt_in_triangle(v, s[2], s[1], s[3])

        if in_tirangle_a or in_tirangle_b:
            d = 1
            break
    return d
Exemple #2
0
def check_dist_to_edges(v, or_verts, or_radius, edges, sides_space, sides_space_bbox):
    d = 0
    min_dist = 2.0e-5
    for ed, s, sb in zip(edges, sides_space, sides_space_bbox):
        v1 = or_verts[ed[0]]
        v2 = or_verts[ed[1]]
        r1 = or_radius[ed[0]]
        r2 = or_radius[ed[1]]
        if v1 == v and r1 < min_dist or v2 == v and r2 < min_dist or r1 < min_dist and r2 < min_dist:
            continue
        if out_of_bbox(v, sb):
            continue

        if pt_in_triangle(v, s[2], s[0], s[1]) or pt_in_triangle(v, s[2], s[1], s[3]):
            d = 1
            break

    return d