Hi, I’m trying to get the points inside of bounding box,
There are 4 bounding boxes and 6 points, 4 points are in the boxes,I could see that from the result of BoundingBox.Contains node and tried to get points which have true value = inside of the boxes…
I’ve changed the lacing of the List.FilterByBoolMask node and inputs levels but couldn’t get the correct result. Do I need to change the node or change levels of inputs?
When I’m in this situation, I query if any of the results are true in the sub list because there will only be one true if any of those 5 items exist in that bounding box. We can use List.AnyTrue and have it look at each bool in the sub list via list @ level.
Hopefully this helps!
1 Like
Change the list level of the mask
input to be @L2
. This will make it so that each sublist (representing the points in a particular bounding box) is filtering the list of points. Each sublist represents the bounding box and the filtered list will represent the points it contains.
3 Likes
Hi, @jaeho
Maybe simple python script can hepl you.
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
lns = IN[0]
pts = IN[1]
intersect = []
for pt in pts:
sublst = []
for ln in lns:
if Geometry.DoesIntersect(pt, ln):
intersect.append(pt)
OUT = intersect
1 Like
Thank you for all of your replies! I learned new thing!