Hi all,
I’m working with a Grasshopper Python component where I loop over a set of street meshes (provided as a DataTree
) and compare them against a single view mesh (provided as a list
) using
rg.Mesh.CreateBooleanIntersection()
to check overlaps.
However, I’ve run into a puzzling issue:
- Only the first branch (idx 0) correctly reports a successful intersection.
- All subsequent branches return no intersection, even though visually they overlap the view mesh.
In the screenshot:
The orange-colored rectangles are the street meshes (organized as separate branches).
The green circular mesh is the view mesh used as the intersection check target.
The blue-colored patch is the intersection result (what my script currently detects).
What I’ve already checked:
- Each street mesh is correctly retrieved (I print out bounding boxes, vertex counts, etc., and they match what I see visually).
- The view mesh is a single, fixed mesh used for all comparisons.
- I apply Z-axis flattening (
Min.Z
or absolute0
) to ensure everything is aligned on the XY plane. - The intersection call
rg.Mesh.CreateBooleanIntersection([street], [view])
always works only once (on the first hit) and then returnsNone
or an empty result for the others.
For testing, I even set up a simple case:
- Four rectangular street meshes laid out in a row.
- One circular view mesh overlapping two of them.
Yet only the first street mesh is ever reported as intersecting.
My questions:
- Does
rg.Mesh.CreateBooleanIntersection()
have any internal state or caching that makes repeated calls inside a loop unreliable? - Is there a recommended or more robust way to perform per-branch mesh intersection tests inside a Grasshopper Python component?
Here is the .gh
file which I am working with:
test_stClip.gh (31.9 KB)
Any advice or insights would be greatly appreciated — thanks!