# Method for clash detection in rhino 7

**URL:** <https://discourse.mcneel.com/t/method-for-clash-detection-in-rhino-7/139390>\
**Category:** Rhino Developer\
**Tags:** windows\
**Created:** [March 14, 2022, 6:35am UTC](https://discourse.mcneel.com/t/method-for-clash-detection-in-rhino-7/139390 "2022-03-14T06:35:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![seong\_jun\_kim](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/seong_jun_kim/32/366351_2.png) [@seong\_jun\_kim](https://discourse.mcneel.com/u/seong_jun_kim)\
**Post date:** [March 14, 2022, 6:35am UTC](https://discourse.mcneel.com/t/method-for-clash-detection-in-rhino-7/139390/1 "2022-03-14T06:35:29Z")

</div>

Is there any way to get information on the base method or reference of the clash detection function in Rhino 7?

For example, I found a paper describing a method for clash detection on the web. ([Intersection Detection Algorithm Based on Hybrid Bounding Box for Geological Modeling With Faults | IEEE Journals & Magazine | IEEE Xplore](https://ieeexplore.ieee.org/document/8986597))

and I want to know the method of Rhino’s (just basic principle or reference paper used to develop the function…)

Of course I’m not talking about the exact raw source or very detailed method, just basic concept used in Rhino clash detection function.

Any comment would be helpful.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![11159](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/11159/32/776698_2.png) [@11159](https://discourse.mcneel.com/u/11159)\
**Post date:** [March 16, 2022, 1:35am UTC](https://discourse.mcneel.com/t/method-for-clash-detection-in-rhino-7/139390/2 "2022-03-16T01:35:46Z")

</div>

Hello.  
When you executed in Rhino, the following methods appear to be available.

> **[MeshClash.Search Method (IEnumerable(RhinoObject), IEnumerable(RhinoObject),...](https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Intersect_MeshClash_Search_2.htm)**
>
> Searches for locations where the distance from a RhinoObject, in one set of objects, is less than the specified distance to another RhinoObject in a second set of objects. This function uses the object's mesh to calculate the interferences.

---

<div class="post-metadata">

**Author:** ![seong\_jun\_kim](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/seong_jun_kim/32/366351_2.png) [@seong\_jun\_kim](https://discourse.mcneel.com/u/seong_jun_kim)\
**Post date:** [March 22, 2022, 5:17am UTC](https://discourse.mcneel.com/t/method-for-clash-detection-in-rhino-7/139390/3 "2022-03-22T05:17:37Z")

</div>

Thanks for the reply.

Actually, I mean the internal algorithm used in the method for searching.

I found some references about collision detection algorithms like below.

> **[Fast, Minimum Storage Ray-Triangle Intersection](https://www.tandfonline.com/doi/abs/10.1080/10867651.1997.10487468)**
>
> (1997). Fast, Minimum Storage Ray-Triangle Intersection. Journal of Graphics Tools: Vol. 2, No. 1, pp. 21-28.

> **[Holistic clash detection improvement using a component dependent network in...](https://www.sciencedirect.com/science/article/abs/pii/S0926580519301980)**
>
> Building information modeling (BIM) has been increasingly used for design coordination, and clash detection is one important application. However, som…

> **[\[PDF\] IFC-based clash detection for the open-source BIMserver | Semantic Scholar](https://www.semanticscholar.org/paper/IFC-based-clash-detection-for-the-open-source-Helm-Bohms/f0347a354fc72edc305a39d79a474db85af940a7)**
>
> This paper will demonstrate how to combine the best collision detection methods with the structure provided by IFC, making clash detection fast enough to be used inside a real time environment like a server. When designing construction objects,...

Still, it would be great if it is possible to get some basic ideas used in the Rhinoceros’s clash detection function.

---

<div class="post-metadata">

**Author:** ![aesthetik0717](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/aesthetik0717/32/647357_2.png) [@aesthetik0717](https://discourse.mcneel.com/u/aesthetik0717)\
**Post date:** [March 22, 2022, 12:11pm UTC](https://discourse.mcneel.com/t/method-for-clash-detection-in-rhino-7/139390/4 "2022-03-22T12:11:21Z")

</div>

This is also an interesting question to me, too.  
Just want to contribute some algorithms I knew for collision detections.

- AABB(Axis Aligned Bounding Box)
- SAT(Separated Axis Theorem)

I found this page illustrate it well, so it might helps.

> **[3D collision detection - Game development | MDN](https://developer.mozilla.org/en-US/docs/Games/Techniques/3D_collision_detection)**
>
> This article provides an introduction to the different bounding volume techniques used to implement collision detection in 3D environments. Followup articles will cover implementations in specific 3D libraries.

Although in the article it only mention simple collision of simple stuffs.  
Such as:

- Sphere
- Box

According to this QA from StackOverflow:

> <https://stackoverflow.com/questions/1960560/how-does-3d-collision-object-detection-work>

work

I think the algorithm for more sophisticated meshes collision, might be a in a recursive structure, traversing the faces/ boundingBox in that mesh with `kdTree`, `QuadTree` or `RTree` helps.

These are just some of my ideas, a really interesting question.

OneLoneCoder’s explaination did a great job, FYI.

[![](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/2/7/5/275fc74dd5c2c6bbda481da473cbd7d742ddb4f1.jpeg "Convex Polygon Collisions #1") ](https://www.youtube.com/watch?v=7Ik2vowGcU0)

---

<div class="post-metadata">

**Author:** ![seong\_jun\_kim](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/seong_jun_kim/32/366351_2.png) [@seong\_jun\_kim](https://discourse.mcneel.com/u/seong_jun_kim)\
**Post date:** [March 23, 2022, 2:09am UTC](https://discourse.mcneel.com/t/method-for-clash-detection-in-rhino-7/139390/5 "2022-03-23T02:09:08Z")

</div>

Thank you for your comment.

OneLoneCoder’s tutorial is really helpful.

I also think that McNeel uses something complex method consisting of multiple procedures including inspection for collision candidates based on AABB, OBB, and some tree structures.

I wish someday McNeel held conferences or sessions for developers.
