CaGe-graph / CaGe

The Chemical and abstract Graph environment
9 stars 2 forks source link

Exporting to SVG mirrors the rotation lists of every vertex #51

Open arnegoeteyn opened 3 years ago

arnegoeteyn commented 3 years ago

Exporting a cage-generated image to SVG results into a SVG file where the rotation around every vertex is mirrored. The 2D-viewer in CaGe shows the correct image.

Below I added a the writegraph2d file that was used for generating this image trough CaGe.

>>writegraph2d<<
1   0   0   2 4 3
2   0   0   1 5 18
3   0   0   1 6 5
4   0   0   1 8 7
5   0   0   2 3 9
6   0   0   10 3 24
7   0   0   11 12 4
8   0   0   4 19 15
9   0   0   5 22 17
10  0   0   20 6 14
11  0   0   28 7 16
12  0   0   7 27 13
13  0   0   25 12 26
14  0   0   23 21 10
15  0   0   19 16 8
16  0   0   28 11 15
17  0   0   22 18 9
18  0   0   17 19 2
19  0   0   15 8 18
20  0   0   22 10 21
21  0   0   23 20 14
22  0   0   17 9 20
23  0   0   21 14 24
24  0   0   23 6 25
25  0   0   24 13 26
26  0   0   25 13 27
27  0   0   26 12 28
28  0   0   27 11 16
0
nvcleemp commented 3 years ago

This is not necessarily an issue. The direction of the cyclic order is not determined by the file format. So either choice is actually valid. I do agree that it might be better that the viewer and the export use the same convention. I should have a closer look, but I think the reason is that both actually use the same coordinates, but they use a different coordinate system: origin in the bottom left corner vs origin in the top left corner.

A work-around for now is to simple open the image in any program that can manipulate SVG (like e.g. Inkscape) and just vertically mirror the image.