Select objects inside solid

OK, I just want to make sure it works on a general level for everyone and any type of block instance. I’ll have a look in the next couple of days, right now I’m traveling…

Cheers, --Mitch

thanks Mitch you’re the best!

Hey Robert,

Sorry this took so long - I had a bunch of other stuff going on (still do) and it turned out not to be as simple as I thought with block instances, so I needed to completely re-write the script. Basically, as block instances aren’t real geometry but simply a definition of some real geometry that’s been transformed from elsewhere, I need to extract the geometry (virtually) from the block and transform it in the same way in order to check if it’s in or not. Still not sure if I’ve got it right, so please test, and post an example of what fails if anything…

–Mitch

SelObjsInsideSolidV2.py (6.2 KB)

Thank you Mitch! I will try to test it tonight.

@Mitch
I think Mikko is working on some volume selection tools for V6:
SelVolumeBox
SelVolumeObject
SelVolumePipe
SelVolumeSphere

SelBox
SelVolumePipe
SelVolumeSphere

are already in V5… SelVolumeObject is basically what I’m doing here…

–Mitch

Hi Mitch,

Is there a simple of way of adapting your code so that I can find any obj which is inside another curve?
The example here is that I want to find the object which is inside the highlighted closed curve.

Thanks,

Hossam

You might try SelBoundary and see if that works for you…

–Mitch

hi all,
You don’t have a feature in grasshopper that finds and groups every object inside a face with that specific face, do you?

see picture below on what I was thinking:

@Helvetosaur Curious to know if this ever got upgraded to use closed meshes as a selection volume.
I’m still in v5 land here. Thanks!

Yeah, this has been made obsolete by SelVolumeObject in V6. However I thought the script could be adapted with a few additional lines of code for the V5 and current Mac people, so in between bouts of student 3D printing and CNC milling, I hacked on it a bit. Turned out to be more work than I thought actually, but once I was rolling, I wanted to finish it…

So FWIW - SelObjsInsideSolidV3.py (8.0 KB)

Cheers, --Mitch

1 Like

Thanks Mitch!! Will give this a whirl in the next couple of days.

1 Like

This is a little hit and miss. I’ve gotten it to work perfectly in some cases, and get odd behavior in others.
-it’s not selecting point objects for me.
-in model view, it’s somehow selecting objects in my layouts (layout template stuff: curves, text etc (but still not points )).
-not consistently selecting everything inside of a mesh volume. It’s also selecting items outside of the mesh.

Let me know what I should check to see what might be contributing to weirdness.

thanks again!

OK, I was afraid of that - will have a look. I never tested anything with layout space, never considered it actually. Points should work though, don’t know why not yet.

As this is an obsolete script, I’m not going to spend much time on it - too many other things to do right now, but I will take a quick look. Maybe you can PM me a couple of the examples that aren’t working, that would help me track down the bugs.

So now I know… The RhinoCommon method for testing mesh point inclusion is documented as buggy for both V5 and V6, and may not even get fixed until V7. In any case it will not get fixed for V5, so unless I find a workaround, I’m afraid you’re going to be out of luck here… :frowning_face:

No worries Mitch, I understand if this doesn’t get resolved. I super appreciate the time you’ve already spent on this.

Out of curiosity, does the mesh volume select in v6 work well? I have been too slammed here to try latest v6 builds, and not planning to migrate our office until I hear less complaints and issues in general. But I might be tempted to deal with the hassle for this feature if it’s bulleproof there (well not for points, but for other entities at least).

I’ll shoot you a couple of simple examples of weirdness for your records.

As far as I can tell, SelVolumeObject does, yes. So they must be relying on a different method for point inclusion with mesh objects than the RhinoCommon method I have access to…

For a Grasshopper newbie, can any of you provide some guidance on how to apply this Python code? I have installed GhPython and pasted the code into the Python Script Component. However, I am unsure what inputs and outputs the editor will need in order to run the script. Any help would be much appreciated.

The script is primarily for selecting objects that already exist in a document, which is not really the case with Grasshopper geometry, so I’m not sure it will be useful. What is it you are trying to achieve?

Could work in Rhino. What I’m trying to do is to trim 3D voronoi cells and select those inside a mesh volume. Attached is a sample that gives the trim lines, but I still need to split the cells and select the ones inside the sphere.

sphere test.3dm (3.2 MB)
voronoi mesh intersect.gh (8.8 KB)