Hi @riccardo.foschi2, thanks for testing it.
Yes, I agree - it would make sense to add a component that just takes a mesh and handles this point selection and indexing internally. Several other goals now work like this - planarize and smooth for example - the actual internal Goal functions take a list of points (for each face in the case of planarize, or each internal vert and its neighbours for smooth), but the component simply takes a mesh.
Yes, the goal only affects the vertex at the apex of each angle. I did also briefly look at adding a reaction force so the neighbours are also affected, but it seemed to make things less stable.
Note also that it only really makes sense to make angles around internal vertices sum to 2 pi. If the aim is to make something that can flatten out to a sheet with straight edges, you could make angles around edge vertices sum to 1 pi. The indexing becomes a bit more complex though, since you can’t just take all the angles between successive edges- you need to make sure not to include the angle between the 2 connected naked edges. You’d also need to identify and treat the corners differently - if you want it to flatten to a rectangular sheet, the face angles around each corner could sum to pi/2.
Any examples of use cases you have in mind would be helpful for making a good interface for this goal.