A question: How to make CurveIntersection inside GHpython?

An error occurred when I tired to make curve intersection in GHpython. Can any kind person help me?
The code is as follows:

import rhinoscriptsyntax as rs
import ghpythonlib.components as ghcomp

intersection = ghcomp.RegionIntersection(R1 , R2)
out = intersection

The error is as follows:

Warning: Region Intersection: input 1 curves_a. error: Data conversion failed from Guid to Curve
Warning: Region Intersection: input 2 curves_b. error: Data conversion failed from Guid to Curve
Warning: Region Intersection: solver component. error: Data conversion failed from Guid to Curve
Warning: Region Intersection: solver component. error: Data conversion failed from Guid to Curve

Moved to Scripting category.

Hi @ruishuyan,

Use Intersection.CurveCurve.

– Dale

Thank you so much. Which library does the Intersection.CurveCurve belongs to? Could you spell it full? or provide a documentation link about the library.

Here’s a minimal example:

210310_CurveCurveIntersection_00.gh (3.2 KB)

Note that there are many other properties you can extract in the IntersectionEvent class, other than just PointA that I’m grabbing here.

Update: Looking at your original post, you’re probably looking for this method though:

210310_CurveCurveRegionBoolean_00.gh (2.7 KB)

Or better yet, the Curve.CreateBooleanRegions class, which is new in Rhino 7.

Thank you so much for your detailed explanation. It’s very helpful!

1 Like