Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dual edges uv direction problem #50

Closed
duchaoyu opened this issue Aug 6, 2020 · 2 comments
Closed

dual edges uv direction problem #50

duchaoyu opened this issue Aug 6, 2020 · 2 comments
Assignees
Labels
bug something that is not working

Comments

@duchaoyu
Copy link
Member

duchaoyu commented Aug 6, 2020

There is a bug in the dual edge when drawing edgelabels in the forceartist.
line 85: text = {edge: index for index, edge in enumerate(self.diagram.ordered_edges(self.diagram.dual))}
in this function, the uv direction might switch, which leads to incorrect display of edgelabel color.

I tried this in scripts/test_where_dual.py.
list(form.edges()) : [(0, 1), (1, 3), (1, 11), (1, 14), (1, 15), (2, 3), (3, 11), (3, 5), (4, 5), (5, 11), (5, 12), (5, 13), (6, 7), (7, 14), (7, 15), (8, 9), (9, 10), (9, 12), (9, 13), (11, 13), (11, 15), (12, 13), (14, 15)]
form.edge_index(): {(6, 7): 12, (7, 14): 13, (8, 9): 15, (9, 10): 16, (5, 12): 10, (1, 3): 1, (2, 3): 5, (1, 14): 3, (12, 13): 21, (1, 11): 2, (3, 5): 7, (7, 15): 14, (14, 15): 22, (9, 13): 18, (5, 11): 9, (0, 1): 0, (11, 15): 20, (3, 11): 6, (4, 5): 8, (5, 13): 11, (1, 15): 4, (9, 12): 17, (11, 13): 19}

list(force.edges()): [(0, 1), (0, 5), (1, 2), (1, 11), (1, 13), (2, 9), (2, 3), (3, 8), (3, 4), (4, 5), (4, 12), (4, 6), (5, 7), (5, 10), (5, 12), (5, 13), (6, 7), (6, 12), (7, 8), (8, 9), (9, 10), (10, 11), (11, 13)]
[force.dual_edge(edge) for edge in force.edges()]: [(9, 8), (10, 9), (5, 4), (12, 5), (9, 12), (5, 3), (3, 2), (3, 1), (1, 0), (7, 6), (14, 7), (1, 14), (15, 11), (11, 13), (7, 15), (13, 9), (1, 15), (15, 14), (1, 11), (3, 11), (5, 11), (5, 13), (12, 13)]

so, for ForceDiagram edge (0,1), its dual_edge is (9,8). However, in the FormDiagram, this edge is (8,9). I think we need to check again whether the dual_edge exist in the dual_diagram in the dual_edge function. Another option is to modify the forcediagram.edge_index(self, form=None) function to solve this problem.

@duchaoyu duchaoyu assigned tomvanmele and ghost Aug 6, 2020
@tomvanmele
Copy link
Contributor

okay, will have look. nice debugging!

@ricardoavelino ricardoavelino added the bug something that is not working label Aug 6, 2020
@ricardoavelino ricardoavelino added this to the ags beta milestone Aug 6, 2020
tomvanmele added a commit that referenced this issue Aug 11, 2020
@tomvanmele
Copy link
Contributor

this should be solved now. please check...

duchaoyu added a commit to duchaoyu/compas_ags that referenced this issue Aug 11, 2020
* upstream/master:
  solves BlockResearchGroup#60
  when no scale is used the manual modification works
  solves BlockResearchGroup#50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something that is not working
Projects
None yet
Development

No branches or pull requests

3 participants