Grasshopper

algorithmic modeling for Rhino

how to get a list of geometry inside the perimeter of other geometry

Hi All,

Any ideas how I can get a list of just the circles that are inside the square/rectangle?


I have also attached a starting GH definition as an example of my circles and rectangle.

Also I'd like to know if  would be possible to create a tolerance % of what is consider inside vs. outside. For example on this attached definition this is what ideally I'd like to get:

Any help will be greatly appreciated.

Gustavo

Views: 2318

Attachments:

Replies to This Discussion

There is a containment component that will test a point for inclusion with in a closed curve. Its output is 0 for coincident, 1 for inside and 2 for outside. If you divide each circle into a number of points and test each set you will get a summed value that you can apply a tolerance to for example if each has 10 points and all of them are inside then the summed value will be 10 if some are outside then the summed value will be greater than 10 and if all are outside then the summed value will be 20. Setting up a cull pattern based on these values you can select the desired circles. If some values fall on the line and have zero value then this might have an effect on your summed values so you might need to go through the list first and replace all 0 with 2.

click to enlarge
Attachments:

Hey there,

 

i`m trying the same with lines, but i  want lines outside a geomtry - i know it should work the same way but i dint´t get it work.

 

can u help?

 

Patrick

 

 

It just needs a tweak of the number logic.

 

Attachments:
Here is my lame solution. It works for square surface areas given on a plane only, (i.e. your specific project parameters) It works, but I'm certain it's not the most elegant method. Drag the Percentage of Circle Included to change the "tolerance" for how much of the included circles (by furthest distance, not area) are inside the surface.

I started off with the Inside component that tests for point inclusion in a Brep, but go no results. I next tried it with the Trim Inclusion with better results, but not adequate. I haven't used either of these components before, so not sure what was up with that.
Attachments:
Oh, I like Danny's method better. I wasn't aware of the curve containment component. Here I adapted mine to use that instead. This one is lighter than Danny's but you have more control with his and it's just trick.
Attachments:
Hi Danny and Shaw,

Thanks so much for your help. I like both solutions and especially how much I learn from them. Non I have some ideas of what other things to try :)

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service