i have quite a lot of shapes, and i want to sort them into concave and convex shapes.

i came up with the solution but it is quite long and is taking up quite a lot of time to load. is there any better way to do it that takes up less memory and doesnt slow down everything (i have quite a lot of shapes)

(attached image of the script and the grasshopper file)

so what i am doing is that i am making a circle at each vertex of every shape, them trimming the circle with the shape, then using the arc length to find the internal angle, then if there is an angle greater than 180 the shape is concave otherwise convex

i took a part of the current solution from HS-kim Angle in a polyline

(rhino6)