# Detect the collosion of models, and change model outlook realtime

**URL:** <https://discourse.slicer.org/t/detect-the-collosion-of-models-and-change-model-outlook-realtime/19921>\
**Category:** Support\
**Created:** [September 30, 2021, 3:01am UTC](https://discourse.slicer.org/t/detect-the-collosion-of-models-and-change-model-outlook-realtime/19921 "2021-09-30T03:01:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xianger-qi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xianger-qi/32/11944_2.png) [@xianger-qi](https://discourse.slicer.org/u/xianger-qi)\
**Post date:** [September 30, 2021, 3:01am UTC](https://discourse.slicer.org/t/detect-the-collosion-of-models-and-change-model-outlook-realtime/19921/1 "2021-09-30T03:01:33Z")

</div>

Hi:  
Thanks for your reading. There are a question confused me. In mine scene, there are a femur model, and probe model. I control the probe to grind the femur. I can capture the collision caused by probe and femur. BUT I want to change the femur model outlook realtime. JUSH LIKE BELOW PICTURE

![Screenshot from 2021-09-29 22-45-23](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/2/020142641c0b3735490a467fc4ed05373310e7d3.png)

the white part is femur bone, and the green part is grinded region, if the probe model contacts the green part, the triangle cell will be change, the green part will disappear gradually.

how can i implement this effect?

---

<div class="post-metadata">

**Author:** ![xianger-qi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xianger-qi/32/11944_2.png) [@xianger-qi](https://discourse.slicer.org/u/xianger-qi)\
**Post date:** [September 30, 2021, 3:02am UTC](https://discourse.slicer.org/t/detect-the-collosion-of-models-and-change-model-outlook-realtime/19921/2 "2021-09-30T03:02:31Z")

</div>

I use vtkcollosiondetectfilter to capture the collosion caused by model nodes.

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [September 30, 2021, 1:36pm UTC](https://discourse.slicer.org/t/detect-the-collosion-of-models-and-change-model-outlook-realtime/19921/3 "2021-09-30T13:36:30Z")

</div>

You can detect collisions with that filter you mention inside a periodic timer callback function supposing you have probe position tracked and you can update the femur model polydata using combineModel’s logic to make a boolean difference operation that would remove the material the probe is touching but I have my concers regarding implementation of that, I think it would be easier to use the segmentEditor erase effect to get what you want, you just need a way to get the mouse to move where the probe is. Maybe this last thing is easier to achieve.
