checking intersecting/overlapping surfaces

   11737   4   2
User Avatar
Member
3 posts
Joined: March 2011
Offline
How do I check if I have any overlapping or intersecting surfaces in say, a cluster of rectangles/cubes?

Let's say I have a cluster of cubes that I copied to random points and I want to delete off any intersecting ones. Wondering what kind of function I can use to check which are overlapping/intersecting each other.

Thanks in advance
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
One method is to use volumes.

Check out my last Old School Blog on calculating intersections using volumes here:

http://www.sidefx.com/index.php?option=com_content&task=view&id=1815&Itemid=216 [sidefx.com]
There's at least one school like the old school!
User Avatar
Member
3 posts
Joined: March 2011
Offline
Thank you Jeff for the link and tutorial, really interesting!
It is not quite what I am looking for though,.. in your tutorial, you are detecting overlapping/intersecting region and use it for something else.

What I wanted is to check if the two objects actually intersect each other and if they do, to cancel operation. Any ideas? Or is there some method in the tutorial that I am missing?

Thank you
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
A quick and dirty approach would be to use a Cookie SOP and boolean the two objects. If you have no geometry in the Cookie SOP, then you don't have overlapping geometry. If you have geometry no matter how nasty, you have an overlap.

You can use an expression like this to set the state:

if( npoints(“../my_cookie_sop”) == 0, 0, 1)

Done.
There's at least one school like the old school!
User Avatar
Member
3 posts
Joined: March 2011
Offline
Thanks Jeff!


now another question, how do you delete points and lines of two overlapping surfaces so that the overlapped ones get fused to be one single polygons?

Like in the file attached, I have 41 polygons that are overlapping each other, I want to have the “outline” shape (i.e. deleting points and line in between)
–> instead of 41 polygons I want them merged to be 10 polygons

If I boolean union them I still have to keep the lines and points in between (they do not get ‘merged’) and ended up with even more polygon

Attachments:
qn.hipnc (56.0 KB)
qn.jpg (97.5 KB)

  • Quick Links