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

2D geometry issues #3

Open
hlg opened this issue Jun 6, 2023 · 2 comments
Open

2D geometry issues #3

hlg opened this issue Jun 6, 2023 · 2 comments

Comments

@hlg
Copy link

hlg commented Jun 6, 2023

Great to see InViewer-Desktop support 2D geometries for cellspaces!
However there are a couple of issues some of which I have isolated in small sample files.

Sample 01 CS overlap

These are two cellspaces which clearly do not overlap, but appear in somehow wrong scale in the viewer. Their states should be centered, but are not.

InViewer-issues_01_cs-overlap
InViewer-issues_01_cs-overlap.gml.txt

Sample 02 CS/state/transition constellation

This is a more complex setting with two cellspaces, corresponding states and two transitions. It contains multiple issues, which can be seen in isolation in samples 03 and 04.

InViewer-issues_02_complex
InViewer-issues_02_complex.gml.txt

Sample 03 state offset

This file contains one of the cellspaces with its state from sample 02. Looking at the coordinates it can be seen that the state is clearly inside of the cellspace geometry, but appears outside. I added two states at the diagonal corners of the cellspace rectangle and they are not affected from the offset.

InViewer-issues_03_state-offset
InViewer-issues_03_state-offset.gml.txt

Sample 04 collinear

This file contains the other cellspace from sample 02. The polygon is scrambled in the viewer and not filled (for a much more messed up example, see sample 05). I suspect it to be caused by collinear points on some of the polygon edges. As soon as I remove those (modified cellspace in file), the issue is gone.

InViewer-issues_04_collinear
InViewer-issues_04_collinear.gml.txt

Sample 05 complex geometry

Here we have a cellspace polygon with many points. But the geometry is quite simple, the additional points are due to a faceted circular segment. InViewer-Desktop crashes with this file, but I could get it to display something instead by removing the last point which was unnecessarily repeated (sample 05-mod).

InViewer-issues_05_complex-mod
InViewer-issues_05_complex.gml.txt
InViewer-issues_05_complex-mod.gml.txt

@hlg
Copy link
Author

hlg commented Jun 14, 2023

After some more research, I came to the conclusion that some issues (04 and 05) are related to the limitations of the poly2tri algorithm. For example, it does not accept collinear or similar points. With the js-port of poly2tri the geometries seem to work, but it is probably improved, see e.g. the online demo here http://r3mi.github.io/poly2tri.js/. Issues 01 and 03 however are probably caused by some wrong scaling and offset maybe carried out to align the scene towards the origin. Not sure though. I have also seen geometries that work perfectly fine.

@hlg
Copy link
Author

hlg commented Jul 5, 2023

One more note: Strange enough, we have one notebook where these samples are displayed just fine. We have no idea what is different about this machine. I would be interested to know if anyone else is able to properly view the above data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant