I met a new problem. now the areas are in 3D. I need find the maximum incircles for each semi-closed part (I should find three or four incircles according to the shapes) using GH.

I applied the code from previous dicussion, but it doesn’t work because it’s for 2D. In 3D, the circle has wrong directions.

Hello
if you have a cylinder, you have an axis, if you have an axis you can project your curves on a plane having the Z parallel to the axis, then apply the 2D algorithm and extrude circles to cylinders.

Thank you for your explanation, @flokart!
I did projection work. However, the shape size changes since there are curvature (the whole model has many these shapes around a curved tube): the shape at inner curvature will be enlarged, while the shape at outer curvature will be reduced.
That’s the reason I just want to keep the 3D shape.

Then unroll it with a tool keeping the same mesh topology. For some reasons Ngon plugin transform a Mesh to a Brep that is the same topology as the mesh but when cast to mesh it doesn’t work !!! I here use my own tool that is in an unpublished Nautilus version. You can try some others tools as unrolling a mesh with no inner points is quite trivial.

Deconstruct the circle to points then using MeshMap from Kangaroo place the points on the 3D shape then use circle fit as the points on 3D shape are not on a plane. There is no guaranty that it will be good but it is not far from what you want.