Need a Nudge for Method Brep.Split in c#

How do I add additional Cutting Curves in

Plane Cutpl1;
Plane Cutpl2;
Curve[] CutCurves;
Brep[] BrepInitial;
Brep[] BrepCut;


CutCurves = Brep.CreateContourCurves(BrepInitial[0],Cutpl1);
CutCurves = Brep.CreateContourCurves(BrepInitial[0],Cutpl2);

BrepCut = BrepInitial[0].Split(CutCurves,0.1);

This does not work as it only takes the last CutCurve(as expected).
When I use

List<Brep> Cutters = new List<Brep>();

I can
Cutters.Add(AdditionalBrep)
additional Breps as Cutters.
What method can I use do add Curves to CutCurves[#]?

Hi @Fabian_897 ,

// Define planes for cutting
Plane Cutpl1;
Plane Cutpl2;

// Initialize a list to hold all cutting curves
List<Curve> CutCurvesList = new List<Curve>();

// Get cutting curves from the first plane and add them to the list
Curve[] curvesFromCutpl1 = Brep.CreateContourCurves(BrepInitial[0], Cutpl1);
CutCurvesList.AddRange(curvesFromCutpl1);

// Get cutting curves from the second plane and add them to the list
Curve[] curvesFromCutpl2 = Brep.CreateContourCurves(BrepInitial[0], Cutpl2);
CutCurvesList.AddRange(curvesFromCutpl2);

// If you have additional planes or curves to add, repeat the above step
// Example: Adding additional cutting curves from another plane
Plane AdditionalCutpl; // Define this plane as needed
Curve[] additionalCurves = Brep.CreateContourCurves(BrepInitial[0], AdditionalCutpl);
CutCurvesList.AddRange(additionalCurves);

// Convert the list back to an array for the Split method
Curve[] CutCurves = CutCurvesList.ToArray();

// Split the initial Brep using all the accumulated cutting curves
BrepCut = BrepInitial[0].Split(CutCurves, 0.1);

I think that you can find a better approach, but this will work just fine
Hope this sparks some ideas,

Farouk

Thanks for the quick solution!
This does hit all the simple cuts, now I can pore over the other ones.