Grasshopper

algorithmic modeling for Rhino

Ingress game simulation -- cull intersecting / overlapping Breps

What is an easy way to cull a list of partially overlapping / intersecting Breps? thx.

Views: 1503

Replies to This Discussion

If you're looking to cull duplicates: check for the bounding box and it's similarity. Otherwise a fast option is to first check if the bounding boxes intersect, and after that if the breps intersect, and then make a decision about with you wish to keep.

Arend,

I'm trying to mimic the Ingress game maps (google ingress map images). I got most of it going, just looking for an example of how to cull a list of triangles where none of the triangles in the list may overlap with any of the triangles in the list. The triangles are made from points / intcrv, so a collection of closed intcrv's.

Could you show me an example in GH?

Anton

This could be one way to do it.

cheers

alex

Attachments:

alex, thx got me closer. what if the point is not in curve, rather overlaps without point in curve?

Would like to eliminate overlapping triangles from the attached.

Attachments:

oh i see. my solution does not work when triangles share an edge.

let me look into this an get back to you.

I think that does it.

cheers

alex

Attachments:

Looking at it, I'm still puzzling on why it appears it still has conditions that overlap. Will keep looking.

Attachments:

yes you are right.

i will also look into it and get back at you.

edit. it is because only tA is being used. in the file you uploaded the triangle that overlaps happens to intersect in its edges where the discontinuities are.

the solution is to use also tB, but i am unable to try it at the moment.

Ok i did try this real quick. seems to be working through many slider changes. but needs testing.

would love to see this project when finished. google ingress maps yields nice images.

cheers

alex

Attachments:
Alex, the. See some of the green triangles still overlap in the image. Can't figure out why. This is exactly what I'm looking for.

One cull component outputs non overlaping triangles. The other cull component outputs the ones that overlap, they are just there for display purposes. Use the blue ones.

unless i am missing what you are after.

Alex, my approach for generating fields randomly followed by filtering duplicates did not yield the desired outcome, see the attached mess -- too many overlapping fields. This seems to be due to fields being randomly created rather than with the Ingress strategy in mind, triangles would not be randomly in Ingress. Have to start from scratch with a strategy.

 

It may have to go with something more iterative (Anemone?) 

 

Ultimately I would like to be able to alter the number of resonators per portal and portal counts to see the fields update accordingly. This for an animation with timing for field alterations.

 

Some basic Ingress rules: (leaving out portal key requirements of the game)

-      Two sets (teams) of portals (resistance (blue) and enlightened (green) team)

-      Portals can have 0 to 8 resonators

-      Portals with 8 resonators can be linked within team portals

-      Portal links cannot cross other links (from either team)

-      3 links that form a triangle form a “field”

-      A portal can be part of multiple fields

-      Fields can share a link

 

Here what I think the strategy could be:

1. Create map boundary (at some point the US map with google map background and ingress styling)

2. Populate with random amount of portals per team

3. Randomly assign 0..8 resonators per portal

4. Randomly assign max fields for given portal

5. Create first field

6. Eliminate / flag portals in the field for future linking (would violate intersecting links)

7. Create next field till max fields for given portal (may not reach max fields pending portal options)

 

Not sure if this is getting too complex and would require something in python or C?

 

Thoughts?

 

Anton

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