Get center of series of circles

Hi,
I’m working to a C# Grasshopper component. I need to find the center of a series of circle: the center of each individual circle and the centroid of all circles. I have found something on the forum byt don’t work:

         Brep FstBrep = new Brep();
            VolumeMassProperties vmp;
            for (int cv = 0; cv < m_Curves.Count; cv++)
            {
                Brep[] brep = Brep.CreatePlanarBreps(m_Curves[cv]);
                for (int br = 0; br < brep.Length; br++)
                {
                    if(brep[br].Faces.Count < 2)
                    {
                        for (int fc = 0; fc < brep[br].Faces.Count; fc++)
                        {
                            Fasteners.Faces.Add(brep[br].Faces[fc]);
                            VolumeMassProperties vmpFst = VolumeMassProperties.Compute(brep[br].Faces[fc]);
                            Fastener fstObjects = new Fastener(vmpFst.Centroid);
                            fastnersArray.Add(fstObjects);
                        }
                    }
                    else
                    {
                        this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, string.Concat(new object[] { "Error"}));
                    }
                }
            }
            vmp = VolumeMassProperties.Compute(FstBrep);
            Point3d FastenersCentroid = vmp.Centroid;

Where i’m wrong?
Thanks

Hi
Hope this help you.


CircleCenter.gh (10.2 KB)

@robertdamian.vochesc if you encase code with triple ticks: ``` on the line above and below it will format correctly.

Do you mean the centroid as in the average centre-point, or the area centroid assuming all circles represent uniform density disks, or the curve centroid assuming all circles represent uniform density wires?