Equalise the spherical polygons' area

Hi every one,

I have a goal object to equalise spherical polygons’ area . Since The area of each spherical n-gon is:

An = [(q1+q2+…+qn)–(n-2)pi]x R^2 in which qi angles are the angles measured at the vertices along the surface of the sphere, so equalising the summation of the angles means equal spherical area.

I have written a C# code to achieve the goal. Although the code doesn’t show any error but when I run it using Kangaroo solver, I receive this error:

“1. Solution exception: One or more errors occurred.”

I would much appreciate any idea why this is happening and how to solve it.

I have attached my file.

EqualSphArea.gh (18.1 KB)

Thanks
Anooshe

Hi @anooshe.rezaeejavan

It looks like the first problem here is the indexing - at lines 122 and 123 it tries to access items i+1 and i-1 of the array even when that will be after the end or before the start.
Removing that and initializing the vectors lets it run.
EqualSphArea2.gh (21.2 KB)
It looks like it still needs some changes or to be combined with other goals to keep it regular though.

Hi Daniel,

Thank you so much. It works now.

Could you please advise me how can I get various possible results which satisfy my goal object? (I know that I have more than one answer to achieve my goal object but by running using Kangaroo I would get just one).

Thanks