Test Intersection - Curve Surface C#

I’m trying to get a list of surface that is intersected by a curve.

    List<Brep> faceIntersected = new List<Brep>();
    foreach (Brep face in faces)
    {
        double[] t;
        Curve[] overlapCurves;
        Point3d[] intersectionPoints;
        bool checkIntersection = Intersection.CurveBrep(analyzeCurve, face, (RhinoDoc.ActiveDoc.ModelAbsoluteTolerance), out overlapCurves, out intersectionPoints);
        if (checkIntersection == true)
            FaceIntersected.Add(face);
    }

however, all of the faces i tested is considered as true.
is there a method to check if an intersection is true or false?
thanks in advance

See attached

Ccx_BrepFace_Curves_EntryLevel_V1.3dm (220.4 KB)
Ccx_BrepFace_Curves_EntryLevel_V1.gh (117.4 KB)

Greatly appreciated Pfotiad0,
but this is not actually what i’m looking for.
Sorry I did not give any image previously.

Let’s say I deconstruct the brep of boxes you made,
I just want to extract the faces that is intersected by the curves.

So, from your reference it would look something like this

Great stuff. Had been looking up for such stuff quite a long while

I haven’t figured it out. I did it by selecting them manually :slight_smile:
Would be great to see some insight to this.

That’s elementary my Dear Watson: see attached.

Note: left the C# unfinished with regard connectivity > take the challenge and finish it [we need 2 trees - see some multiple curves added in the demo that yield points BUT NOT faces since they already sampled due to some previous ccx Event].

Ccx_BrepFace_Curves_EntryLevel_V1A.3dm (220.1 KB)
Ccx_BrepFace_Curves_EntryLevel_V1A.gh (118.7 KB)

if (ccxPts != null && ccxPts.Length > 0)
wow.
Excellent! Case closed.
Thank you very much.
If i may ask, why do you prefer DataTree rather than List?

A DT (kinda a Dictionary of Lists) is a “higher” order of classification: see the newly added split curves option (works via a classic recursion) that is rather impossible to manage without a DT (or some other type of “nested” collection in case that you have aspirations to work outside GH).

Curve_SplitWithBreps_V1.gh (125.9 KB)
Curve_SplitWithBreps_V1.3dm (683.3 KB)

But in real-life I rarely use DataTrees since GH plays a rather small role in the whole practice (AEC market sector) workflow … meaning that all C#'s must be as application neutral as possible.

BTW: Making geometry is nothing. Making connectivity is everything: thus take the challenge and try to do a connectivity Tree related with the splitted curve segments IN ONE go (i.e. inside the recursion).

BTW: See this as well (using another [rather primitive] approach than recursion):

Curve_Split_V1.3dm (79.5 KB)
Curve_Split_V1.gh (128.6 KB)