Grasshopper

algorithmic modeling for Rhino

Removing overlap in randomized rectangles on a plane

I'm trying to make a field of randomized rectangles on a vertical plane, but I'm stuck on how to remove overlaps, since I just want them on their own. I understand I could use Cull Duplicates with Leave One or something to that end, but as far as I know that only works as a radius, and I'd like to have it test within the rectangle's area.

Views: 1100

Attachments:

Replies to This Discussion

Hello, can you internalise your surface and maybe join an example of what you want? If you want to test within the rectangle´s area you can use Point in curve component, or point in brep.

Here's the internalized file. I could do that, but then how would I selectively delete them so they aren't overlapping? I don't want to delete every one that overlaps, just enough that none of them touch.

Whoops, here it is.

Attachments:

This is something related to this:

http://www.grasshopper3d.com/forum/topics/cull-one-colliding-object...

I haven't completed the c# script/method yet... I'm not good enough in scripting...

But maybe you'll find something interesting in that already discussed thread.

My idea was/is something like this:

The set is the list of all yours rectangles;

A group is a sub-set of the total, where ALL member of the sub-set collide with every other member in the same sub-set. (1st hard part, finding and creating all groups)

As in each group ONLY ONE member can "survive" the rest is "easy".

Starting from smallest groups (couples) to biggest, iteratively, one group at time, remove the 1 member that have the highest number of TOTAL collisions, OR, just keep only the member that have least. (still to decide this)

Every time an object/rectangle is removed, each group must be updated, refreshed...

If every member have the same number of collisions, step to next group.

If every member have just a number collisions = the number of member minus 1 , just keep only 1 random member, as the group is isolated.

This method would work (IF it works) in 1D, 2D, 3D, 4D etc... as it just work blindly, by just comparing collision indexes. It is just a boolean math.

Chances are that Peter Fotiadis will come here and BAM! (maybe) XD....

Or in future (far) I'll find some time to continue this.

Attached my very INCOMPLETE (and probably useless) work.

Good luck :D

Attachments:

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