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

Behavior of method utils.collapseIntoTriangles #33

Open
thiloSchlemmer opened this issue Dec 26, 2018 · 1 comment
Open

Behavior of method utils.collapseIntoTriangles #33

thiloSchlemmer opened this issue Dec 26, 2018 · 1 comment

Comments

@thiloSchlemmer
Copy link

thiloSchlemmer commented Dec 26, 2018

Hi Loic,

merry Christmas and a happy new year ... and so on :)

I was preparing a PR for a solution of the vertex normals on the tile edges and stumbled over the (for me irritating) behavior of the method utils.collapseIntoTriangles.

Long story short, i try to give the TerrainTopology a 'effectiveBoundary' and a list of overlapping triangles ( i guess you mentioned something like this in a earlier discussion).
The TerrainTopology splits the triangles on the boundary and creates so a outer and a inner (effective) List of Faces.

For this design i used the collapseIntoTriangles-Method, but came up with irritating artefacts.
Then i tried to replace 'collapseIntoTriangles'-Method with the shapely.ops.triangulate-Method.
The result with 'shapely.ops.triangulate'-method (delauney-triangulation from geos-lib) gives a expected result of outer and inner faces.
And...of course.. the unittests in TestCollapseIntoTriangle all failed, if i substitute the result of 'shapely.ops.triangulate' into 'collapseIntoTriangles'.

So , for now i dont get into the algorithmus of collapseIntoTriangles. Can you give me any hints to understand the concept?

Oh, i forgot...what i want to achieve...calculateNormals with all faces and use only the effective faces for the terrain tile.

@loicgasser
Copy link
Owner

Hi! Merry christmas! 🎅 Yes collapse into triangles is a home made solution that works only for certain cases, when you cut an existing triangle with a straight line or a corner. It is a stupid optimization and using delaunay is probably better.
So I have no quarry against you replacing it with delaunay and removing the tests for it entirely.

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

2 participants