Closed schelmo closed 2 years ago
Sorry, @schelmo , I don't like an idea to cache property value inside object.
I know I already did it for orientation
property, and I don't like this too.
I will better change perimeter calculation, because this.edges
and edge.length
are slow methods.
Actually we don't need any iteration at all, because
perimeter = face.last.arc_length + face.last.length
I think performance after this fix will be acceptable.
By the way, what is the purpose of sampling point along face boundary? (Just curiosity)
Best, Alex
Hi @alexbol99, your method works too, thanks for that!
i use the pointAtLength for generating 3d geometries from polygons
this is an optimization for pointAtLength (#95) caching the perimeter increases the performance very much. i tried a big polygon with many edges and trying to get 3000 points from it with the cache, it went down from 1600ms to 12ms ;)
the cached perimeter is cleared if one arc length is recomputed