getPerimeter checks and updates the cache if necessary. If cache is dirty, and getPerimeter has to go through calculating the length for each segment, I think it makes sense to save those lengths in case anyone else needs them.   


Memo Akten
+44 7958 783 832
www.memo.tv (http://www.memo.tv)
www.twitter.com/memotv (http://www.twitter.com/memotv)


The Mega Super Awesome Visuals Company
www.msavisuals.com (http://www.msavisuals.com)


Marshmallow Laser Feast
www.marshmallowlaserfeast.com (http://www.marshmallowlaserfeast.com)


On Tuesday, 21 May 2013 at 10:25, Christoph Buchner wrote:

> In libs/openFrameworks/graphics/ofPolyline.h:
> > @@ -124,22 +127,70 @@ class ofPolyline { > > vector<ofPoint> & getVertices(); > > - float getPerimeter() const; > + float getPerimeter();  
> I'm curious, why is this not const anymore?
>  
> —
> Reply to this email directly or view it on GitHub (https://github.com/openframeworks/openFrameworks/pull/2053/files#r4313354).
>  
>  
>