Region Intersection with ghpythonlib

Hello!

I am having some trouble replicating region intersection in python that I have been able to achieve with the gh nodes, in code. The key part is below (albeit with different variables - line 315 in the script);

import ghpythonlib.components as ghcomp

curve1 = None
curve2 = None
                
Grasshopper.Kernel.GH_Convert.ToCurve(curve1 ,new_curve1 , Grasshopper.Kernel.GH_Conversion.Both)
Grasshopper.Kernel.GH_Convert.ToCurve(curve1 ,new_curve2, Grasshopper.Kernel.GH_Conversion.Both)
                
slab_intersections = ghcomp.RegionIntersection(new_curve1 , new_curve2)

I’m not too confident on… all of the above!

Apologies for a not too cropped script but it seems my mistakes the past have started further up than I expected.

Thanks anyone, everyone :slight_smile:

GridAreaLoading_HELP.gh (1.0 MB)

I’d recommend this method. It’s static so you can call by Curve.CreateBooleanIntersection()
https://apidocs.co/apps/rhinocommon/6.14.19118/Overload_Rhino_Geometry_Curve_CreateBooleanIntersection.htm
I honestly never had much luck incorporating ghpythonlib.components library in my code