# Plane and model intersection

**URL:** <https://discourse.slicer.org/t/plane-and-model-intersection/34713>\
**Category:** Support\
**Created:** [March 5, 2024, 11:28am UTC](https://discourse.slicer.org/t/plane-and-model-intersection/34713 "2024-03-05T11:28:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![soukup.la](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/soukup.la/32/17954_2.png) [@soukup.la](https://discourse.slicer.org/u/soukup.la)\
**Post date:** [March 5, 2024, 11:28am UTC](https://discourse.slicer.org/t/plane-and-model-intersection/34713/1 "2024-03-05T11:28:13Z")

</div>

Hello,  
I have cropped a surface model using the four planes. Now, I need to get curves or lines that correspond with the coroped model and the plane touch. So the model’s boundary edge is divided into four curves by the planes. Or, at least four corner points.

thank you  
Ladislav

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/f/af8527eb11ecf81058f4409b80f959f29c2bf3f9.png)

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [March 5, 2024, 11:46am UTC](https://discourse.slicer.org/t/plane-and-model-intersection/34713/2 "2024-03-05T11:46:24Z")

</div>

Hello @soukup.la. To do this you probably are going to need your own python script that:

1. Retrieves the markups planes and the model
2. Generates new models (corresponding to the sliced contours)
3. Use [vtkCutter](https://vtk.org/doc/nightly/html/classvtkCutter.html) with the geometry of the planes to generate the contours and populate your new models

If you want this to be interactive, the script will be only a little more complicated as you would need to observe the markups planes and update your contour modules accordingly.

---

<div class="post-metadata">

**Author:** ![soukup.la](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/soukup.la/32/17954_2.png) [@soukup.la](https://discourse.slicer.org/u/soukup.la)\
**Post date:** [March 6, 2024, 11:01am UTC](https://discourse.slicer.org/t/plane-and-model-intersection/34713/3 "2024-03-06T11:01:59Z")

</div>

Hello,  
I have one more question related to this. When I applied vtkPoissonDiskSampler to the corpped model, it included points related to the original model too. How is it possible?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/3/53cfd73df60421587818420cac3de25736b78533.png)

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [March 13, 2024, 7:47am UTC](https://discourse.slicer.org/t/plane-and-model-intersection/34713/4 "2024-03-13T07:47:59Z")

</div>

Check carefully that you are applying the sampler to a cropped model. Could you provide more details about how yo do the cropping and apply the Poisson sampler? Are you using any script or a combination of script and the Slicer gui?

Maybe a good test could be to save the cropped model in a .vtk file then load it in a clean scene and see the effect of the Poisson sampler.
