Skip to content

Crash when vertices overlay #52

@StealthyKamereon

Description

@StealthyKamereon

Let's say I have a first shape with points [(0, 0), (1, 0), (1, 1)] and a second shape with points [(0, 0), (1, 0), (1, -1)]
This crashes the program with error :

File "pyvisgraph/vis_graph.py", line 82, in build
    for edge in _vis_graph(self.graph, batch):
  File "pyvisgraph/vis_graph.py", line 156, in _vis_graph
    for p2 in visible_vertices(p1, graph, scan='half'):
  File "pyvisgraph/visible_vertices.py", line 110, in visible_vertices
    insort(open_edges, k)
  File "pyvisgraph/visible_vertices.py", line 346, in insort
    if x < a[mid]: hi = mid
  File "pyvisgraph/visible_vertices.py", line 388, in __lt__
    aslf = angle2(self.p1, self.p2, self.edge.get_adjacent(same_point))
UnboundLocalError: local variable 'same_point' referenced before assignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions