Grasshopper

algorithmic modeling for Rhino

I have a set of Breps and a set of points, where some points are inside the Breps.

I am trying to select from all the Breps which contain one (or more) of the points.

Basically the opposite of 'Point in Breps'

Does anyone know a way to do this?

Thanks!

Edit: GH file added. All geometry internalised.

Views: 682

Attachments:

Replies to This Discussion

Post some code!!!!!

Whoops thought I had! Post updated 

OK, so this is another approach to the question you asked earlier (where you also did not post code!  No code, no help.)?

Unbounded 3d voronoi from spheres

WARNING!  The 'Voronoi 3D' component in this file is VERY SLOW and should be disabled before enabling the solver.

This statement doesn't really make any sense: "I am trying to select from all the Breps which contain one (or more) of the points."

This one does: "Basically the opposite of 'Point in Breps'"

To get the list of breps that contain one or more points, just look at the 'Index' values from 'Point In Breps' - you can create a set from them:

And (ignoring "-1") sort them and/or use them as the index value for 'List Item':

Note the use of 'Dispatch' instead of two 'Cull Pattern' components.

Beyond that, I'm not sure what you're trying to achieve?  You might want a 'Bounding Box (BBox)' around the scaled spheres (right click for "Union Box") to use with 'Voronoi 3D'?

But in any case, 'Voronoi 3D' should be disabled until you have the correct inputs for it, whatever they may be.

Yes, I guess this is my attempt at approaching that question in another way, and yes I probably should have put code up for that one too.

Using the index is exactly what I was looking for, thanks. I am trying to pick the voronoi cells which correspond with the initial spheres, this works perfectly for that!

Thanks for the note about the union box, useful for removing that initial container I had loaded in.

Sorry about leaving the voronoi calculator on, I'm on a pretty fast computer and it runs in a few seconds so didn't think about that. Also I realised that I had the inputs for the voronoi wrong which didn't help things, I should have flattened the list of points going in, it creates two voronoi sets otherwise.

Without knowing exactly what you're trying to do here, I puttered a little, applying some of my own standard practices including some display work, which enhances the visualization process.

Added scaling to a 'Union BBox' for the 'Voronoi 3D'.

Then decided to use only the sphere centroids for the 'Voronoi 3D' and hide the random points.  What's the purpose for the random points again?  

Maybe you want spheres that don't collide?  It is significant, I think, that your goal is not yet clear - to me, at least.

Attachments:

Thanks very much for carrying on looking into this. Here's another attempt at trying to describe my goal... I am looking to generate Voronoi cells approximately the size of each of my spheres.

Using the '3D voronoi' on just the centre points of the spheres creates planar edges for the cells, which is not ideal. So what I am trying to do is to create a larger set of voronoi cells by using the random points (and culling these around the spheres), then pick only the voronoi cells that relate to the spheres.

The idea in the long term is that I can use a set of sphere's to represent program layout and area and generate a set of voronoi cells around them.

I've pretty much got there from your previous post, definition attached. Not perfect in terms of sizing the cells, but getting there in terms of selection.

Attachments:

I suggest that you put more effort into what the "preview" looks like WITHOUT the "Selected Only Preview" option, since that is not always ideal, esp. when nothing is visible when you open the file!

I plugged your new sphere pattern into my copy of the GH (posted above) and just wonder, if you understand 'Voronoi 3D' (as it sounds like you do?), can you please explain the crystal-like planar yellow surfaces emerging from the 'Voronoi 3D' | 'Boundary' output?

Attachments:

Hi Joe,

a side question - your standard practices, looks like you apply different color swatches to the geometry, which I think makes it easier to see for preview and debug? 

Yep, with some alpha channel transparency in this case.  Being able to see meaningful previews is a BIG DEAL for exploring and understanding GH, I think.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service