C# CreateFilletEdges method

Hello friends,

I want to create fillets on the some edges of the Brep object I created, but I couldn’t manage it. Can you help me please?


GastronormContainerComponent.cs (8.1 KB)

Hello,

Have a look at this.

 private void RunScript(Brep brep, double radius, ref object A)
  {
    List<int> indexes = new List<int>();
    List<double> radii = new List<double>();
    for (int i = 0; i < brep.Edges.Count; i++)
    {
      radii.Add(radius);
      indexes.Add(i);
    }


    A = Brep.CreateFilletEdges(brep, indexes, radii, radii, BlendType.Fillet, RailType.RollingBall, Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance);

  }

FilletAllEdges.gh (5.6 KB)

Thanks a lot for your answer. I imported it into my own code as you showed, but I’m having such a problem.

//Brep dönüşümü ve radüs denemesi
            Brep boxBrep = box.ToBrep();
            double radius = 10; 
            List<int> indexes = new List<int>();
            List<double> radii = new List<double>();
            for (int i = 0; i < boxBrep.Edges.Count; i++)
            {
                radii.Add(radius);
                indexes.Add(i);
            }

            object A = Brep.CreateFilletEdges(boxBrep, indexes, radii, radii, BlendType.Fillet, RailType.RollingBall, tol);


            //boxBrep.Faces

            //Brep[] filletedBox = Brep.CreateFilletEdges

            // Finally assign the spiral to the output parameter.
            DA.SetData(0, A);

Yes, A is an array of Brep but your output param is registered as an item. So GH can’t match a Brep to a single GH_Brep.
Also, the A output is only meaningful in a C# component, not in Visual Studio.

You may either change your GH_ParamAccess to .list, or be confident your fillet operation works and only return A[0]. For a box, you should be fine.

Brep boxBrep = box.ToBrep();
            double radius = 10; 
            List<int> indexes = new List<int>();
            List<double> radii = new List<double>();
            for (int i = 0; i < boxBrep.Edges.Count; i++)
            {
                radii.Add(radius);
                indexes.Add(i);
            }

            Brep[] A = Brep.CreateFilletEdges(boxBrep, indexes, radii, radii, BlendType.Fillet, RailType.RollingBall, tol);


            //boxBrep.Faces

            //Brep[] filletedBox = Brep.CreateFilletEdges

            // Finally assign the spiral to the output parameter.
            DA.SetData(0, A[0]);
1 Like

Thank you so much!