# how to get the cross section perpendicular z axis base on the z user input?

**URL:** https://discourse.vtk.org/t/how-to-get-the-cross-section-perpendicular-z-axis-base-on-the-z-user-input/4137
**Category:** Support
**Created:** [September 3, 2020, 8:11am UTC](https://discourse.vtk.org/t/how-to-get-the-cross-section-perpendicular-z-axis-base-on-the-z-user-input/4137 "2020-09-03T08:11:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ori](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ori/32/2282_2.png) [@ori](https://discourse.vtk.org/u/ori)
#### Post date: [September 3, 2020, 8:11am UTC](https://discourse.vtk.org/t/how-to-get-the-cross-section-perpendicular-z-axis-base-on-the-z-user-input/4137/1 "2020-09-03T08:11:12Z")

</div>

I want read a **stl** file. Then capture a image of cross section perpendicular to z axis, the z value is given by user. And output the intersection to image.

I already know how to read a file by [https://lorensen.github.io/VTKExamples/site/Python/IO/ReadSTL/](https://lorensen.github.io/VTKExamples/site/Python/IO/ReadSTL/)

and image write on this site. [https://lorensen.github.io/VTKExamples/site/Python/IO/ImageWriter/](https://lorensen.github.io/VTKExamples/site/Python/IO/ImageWriter/)

I think make a plane z axis perpendicular and get all intersection points and make them to a image will get what I need.

But I get confused when I read the plane intersection part code.  
[https://lorensen.github.io/VTKExamples/site/Python/GeometricObjects/PlanesIntersection/](https://lorensen.github.io/VTKExamples/site/Python/GeometricObjects/PlanesIntersection/)

I haven’t found the part to define a plane so how the intersection happened? All code related to the sphere and the bounds I don’t know why use bounds either.

Thank you for you help~

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [September 3, 2020, 11:14pm UTC](https://discourse.vtk.org/t/how-to-get-the-cross-section-perpendicular-z-axis-base-on-the-z-user-input/4137/2 "2020-09-03T23:14:38Z")

</div>

You can use vtkCutter to get a cross-section of a surface mesh.
