SurfaceAreaCentroid and SurfaceArea slow

Hi,

I have a python script looping through a couple of surfaces to get rs.SurfaceAreaCentroid and rs.SurfaceArea from each of them.

When putting a timer between the commands I find that each of the commands take about 10sek to run.

Meaning that getting SurfaceAreaCentroid and SurfaceArea from ONE surface takes about 20sek.

Is it some error on my side or should it take this long?
The pythonscript is running within grasshopper by the way.

Thanks in advance.

Get a C# for tests (anyway the Methods are the same either in C# or P).

There’s 2 ways to cut the mustard on this: slow and slower than any HarleyDavidson (avoid at any cost).

Surface_AreaCentroid_EntryLevel_V1.gh (117.0 KB)

PS: Using the trad ways for testing performance: a very slow I5 and no //: Elapsed MAY be 1000 times slower (LOL).

Hi @socken,

I believe the rhinoscriptsyntax methods also calculate the second and product moments, in addition to area and first moments.

See if this works any faster.

test_surface_area_centroid.gh (6.3 KB)

– Dale