diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7cf75b3..e9e798c 100755 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,16 +1,22 @@ Changelog ========= +2.2.3 (2022-10-11) +------------------- + +* reverting changes of version ``2.2.2`` + + 2.2.2 (2022-07-10) ------------------- -* minor improvement in the visibility graph computation: if a candidate point is closer to the query point than both vertices of an edge, it surely lies in front of that edge -> skip actually checking point visibility for this edge +* [DEPRECATED] 2.2.1 (2022-07-10) ------------------- -* packaging completely based on pyproject.toml (poetry) +* packaging completely based on ``pyproject.toml`` (poetry) * CI/CD: automatic publishing based on GitHub Actions 2.2.0 (2021-01-25) diff --git a/Makefile b/Makefile index ad35000..f065ce4 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ hook: @pre-commit install @pre-commit run --all-files -hook2: +hookupdate: @pre-commit autoupdate clean: diff --git a/extremitypathfinder/helper_fcts.py b/extremitypathfinder/helper_fcts.py index 19bfc55..193e2ce 100644 --- a/extremitypathfinder/helper_fcts.py +++ b/extremitypathfinder/helper_fcts.py @@ -462,6 +462,7 @@ def find_visible(vertex_candidates, edges_to_check): if len(vertex_candidates) == 0: return visible_vertices + # used for increasing the priority of "closer" edges priority_edges = set() # goal: eliminating all vertices lying 'behind' any edge # TODO improvement in combination with priority: process edges roughly in sequence, but still allow jumps @@ -569,26 +570,19 @@ def find_visible(vertex_candidates, edges_to_check): if len(vertices_to_check) == 0: continue + # if a candidate is farther away from the query point than both vertices of the edge, + # it surely lies behind the edge + # ATTENTION: even if a candidate is closer to the query point than both vertices of the edge, + # it still needs to be checked! v1_dist = v1.get_distance_to_origin() v2_dist = v2.get_distance_to_origin() - - # if a candidate is farther away from the query point than both vertices of the edge, - # it surely lies behind the edge max_distance = max(v1_dist, v2_dist) vertices_behind = {v for v in vertices_to_check if v.get_distance_to_origin() > max_distance} - # they do not have to be checked, no intersection computation necessary # TODO improvement: increase the neighbouring edges' priorities when there were extremities behind vertices_to_check.difference_update(vertices_behind) - # if a candidate is closer to the query point than both vertices of the edge, - # it surely lies in front of the edge -> doesn't need to be checked - # Edge case: vertices directly on the edge are allowed (not eliminated)! -> also skip equally distant points - min_distance = min(v1_dist, v2_dist) - # used for increasing the priority of "closer" edges - vertices_in_front = {v for v in vertices_to_check if v.get_distance_to_origin() <= min_distance} - vertices_to_check.difference_update(vertices_in_front) - + vertices_in_front = set() # for all remaining vertices v it has to be tested if the line segment from query point (=origin) to v # has an intersection with the current edge p1---p2 p1 = v1.get_coordinates_translated() @@ -609,10 +603,10 @@ def find_visible(vertex_candidates, edges_to_check): # (prioritize them) # they lie in front and hence will eliminate other vertices faster # the fewer vertex candidates remain, the faster the procedure - # TODO improvement: increase priority every time and draw highest priority items + # TODO possible improvement: increase priority every time and draw highest priority items # but this involves sorting (expensive for large polygons!) # idea: work with a list of sets, add new set for higher priority, no real sorting, but still managing! - # TODO test speed impact + # test speed impact. for e in vertices_in_front: # only add the neighbour edges to the priority set if they still have to be checked! if isinstance(e, PolygonVertex): diff --git a/pyproject.toml b/pyproject.toml index 8589c78..7b21b03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "extremitypathfinder" -version = "2.2.2" +version = "2.2.3" license = "MIT" readme = "README.rst" repository = "https://github.com/jannikmi/extremitypathfinder"