Skip to content

Conversation

@mx-moth
Copy link
Contributor

@mx-moth mx-moth commented Aug 13, 2024

The ear clipping method is correct for all polygons, but slow. For convex polygons a fan triangulation is much quicker. Most polygons will be convex. For an example dataset this sped up triangulation on my machine from around 6 seconds to 1 second.

@mx-moth mx-moth self-assigned this Aug 13, 2024
@mx-moth mx-moth force-pushed the optimise-triangulation branch from 02c9ea7 to da3ebab Compare August 13, 2024 06:35
@david-sh-csiro
Copy link
Collaborator

When tested with MoVE we saw the following improvements.

v0.7.0 time

Time elapsed during the process: 4.897634860997641

Time elapsed during the process: 4.988207356000203

Optimised Triangulation time

Time elapsed during the process: 1.4324180190014886

Time elapsed during the process: 1.7977412979998917

I haven't noticed any regressions in MoVE, however MoVE was previously using emsarray 0.4.1.

@frizwi
Copy link
Contributor

frizwi commented Aug 23, 2024

I'm getting similar speed ups to David, so for the larger National model data, they go from ~5mins down to 1.5 mins

The ear clipping method is correct for all polygons, but slow. For
convex polygons a fan triangulation is much quicker. Most polygons will
be convex. For an example dataset this sped up triangulation on my
machine from around 6 seconds to 1 second.
@mx-moth mx-moth force-pushed the optimise-triangulation branch from da3ebab to c8b9fcb Compare September 4, 2024 04:39
@mx-moth mx-moth merged commit 4abcb69 into main Sep 4, 2024
@mx-moth mx-moth deleted the optimise-triangulation branch September 4, 2024 04:44
@mx-moth mx-moth mentioned this pull request Sep 12, 2024
@mx-moth mx-moth mentioned this pull request Nov 4, 2024
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

Successfully merging this pull request may close these issues.

4 participants