Skip to content

Commit 80c7184

Browse files
authored
Merge pull request #48 from jannikmi/2.2.3
v2.2.3
2 parents 899f223 + 5a56143 commit 80c7184

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
Changelog
22
=========
33

4+
2.2.3 (2022-10-11)
5+
-------------------
6+
7+
* reverting changes of version ``2.2.2``
8+
9+
410
2.2.2 (2022-07-10)
511
-------------------
612

7-
* 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
13+
* [DEPRECATED]
814

915

1016
2.2.1 (2022-07-10)
1117
-------------------
1218

13-
* packaging completely based on pyproject.toml (poetry)
19+
* packaging completely based on ``pyproject.toml`` (poetry)
1420
* CI/CD: automatic publishing based on GitHub Actions
1521

1622
2.2.0 (2021-01-25)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ hook:
1919
@pre-commit install
2020
@pre-commit run --all-files
2121

22-
hook2:
22+
hookupdate:
2323
@pre-commit autoupdate
2424

2525
clean:

extremitypathfinder/helper_fcts.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ def find_visible(vertex_candidates, edges_to_check):
462462
if len(vertex_candidates) == 0:
463463
return visible_vertices
464464

465+
# used for increasing the priority of "closer" edges
465466
priority_edges = set()
466467
# goal: eliminating all vertices lying 'behind' any edge
467468
# 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):
569570
if len(vertices_to_check) == 0:
570571
continue
571572

573+
# if a candidate is farther away from the query point than both vertices of the edge,
574+
# it surely lies behind the edge
575+
# ATTENTION: even if a candidate is closer to the query point than both vertices of the edge,
576+
# it still needs to be checked!
572577
v1_dist = v1.get_distance_to_origin()
573578
v2_dist = v2.get_distance_to_origin()
574-
575-
# if a candidate is farther away from the query point than both vertices of the edge,
576-
# it surely lies behind the edge
577579
max_distance = max(v1_dist, v2_dist)
578580
vertices_behind = {v for v in vertices_to_check if v.get_distance_to_origin() > max_distance}
579-
580581
# they do not have to be checked, no intersection computation necessary
581582
# TODO improvement: increase the neighbouring edges' priorities when there were extremities behind
582583
vertices_to_check.difference_update(vertices_behind)
583584

584-
# if a candidate is closer to the query point than both vertices of the edge,
585-
# it surely lies in front of the edge -> doesn't need to be checked
586-
# Edge case: vertices directly on the edge are allowed (not eliminated)! -> also skip equally distant points
587-
min_distance = min(v1_dist, v2_dist)
588-
# used for increasing the priority of "closer" edges
589-
vertices_in_front = {v for v in vertices_to_check if v.get_distance_to_origin() <= min_distance}
590-
vertices_to_check.difference_update(vertices_in_front)
591-
585+
vertices_in_front = set()
592586
# for all remaining vertices v it has to be tested if the line segment from query point (=origin) to v
593587
# has an intersection with the current edge p1---p2
594588
p1 = v1.get_coordinates_translated()
@@ -609,10 +603,10 @@ def find_visible(vertex_candidates, edges_to_check):
609603
# (prioritize them)
610604
# they lie in front and hence will eliminate other vertices faster
611605
# the fewer vertex candidates remain, the faster the procedure
612-
# TODO improvement: increase priority every time and draw highest priority items
606+
# TODO possible improvement: increase priority every time and draw highest priority items
613607
# but this involves sorting (expensive for large polygons!)
614608
# idea: work with a list of sets, add new set for higher priority, no real sorting, but still managing!
615-
# TODO test speed impact
609+
# test speed impact.
616610
for e in vertices_in_front:
617611
# only add the neighbour edges to the priority set if they still have to be checked!
618612
if isinstance(e, PolygonVertex):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "extremitypathfinder"
3-
version = "2.2.2"
3+
version = "2.2.3"
44
license = "MIT"
55
readme = "README.rst"
66
repository = "https://github.com/jannikmi/extremitypathfinder"

0 commit comments

Comments
 (0)