(fixed) How to get the 'out' things of a function

Dear Community,

I’m trying to understand this code documentations:
(1) how can I get the ‘out’ items?

static Boolean BrepBrep(
Brep brepA, 
Brep brepB, 
Double tolerance, 
out Curve[] intersectionCurves, 
out Point3d[] intersectionPoints

I tried doing curves, points = BrepBrep(brep_a, brep_b, tolerance), but curves and points don’t receive anything
(2) How can I turn normal grasshopper things into this ienumerable? I just have Brep entering python script component, and it says function cannot run because it’s not innumerable

static Brep[] CreateBooleanSplit(
IEnumerable<Brep> firstSet, 
IEnumerable<Brep> secondSet, 
Double tolerance

Thanks so much!

Here’s a description of how to use out parameters in C#:

If you’re calling these functions from python, they end up returned in a tuple, so the result of the call is:

(breps, curves, point3ds) = CreateBooleanSplit(firstSet, secondSet, tolerance)

1 Like

Thanks very much for your help Brian! I got the BrepBrep() to work.

If you have time, could you please point me to a function that’s take in (brep, solid) and gives the part of ‘brep’ that’s inside ‘solid’? (here my brep is an open surface, so I know it’s not CreateBooleanIntersection)

It is actuall CreateBooleanIntersection, but you need to make sure your surface or open BRep has surface normals pointing “out”.

1 Like

Thanks again for your help! What I’m hoping to do seems different: by intersecting a plane (brep) with a cylinder (solid), I’m hoping to get the resulting part of the plane (e.g. a circular area), rather than part of the cylinder. Sorry for the confusion. The Split with Breps Multiple component does exactly this but, it’s very slow and I’m trying to parallel it though these codes

The function works but, I get part of the cutting 'solid’s being cut i.e. part of the cylinder–I tried reversing the order of input breps

Oh, then just use the BBX (BRep | BRep) component. It’ll give you curves that are the intersection of the two input objects. Those curves can be turned into a surface by running them into a Surface component (if it’s planar). See attached…
bbx.gh (4.7 KB)

Or, you can trim the plane with the cylinder and find the part that is within the bounding box of the cylinder.

1 Like

Thanks a lot! I will investigate this method!