# Transform/Rotate polyData for OBBTree Intersection (vtk.js)

**URL:** https://discourse.vtk.org/t/transform-rotate-polydata-for-obbtree-intersection-vtk-js/8476
**Category:** Web
**Created:** [May 11, 2022, 1:05pm UTC](https://discourse.vtk.org/t/transform-rotate-polydata-for-obbtree-intersection-vtk-js/8476 "2022-05-11T13:05:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![BryonLewis](https://discourse.vtk.org/user_avatar/discourse.vtk.org/bryonlewis/32/5140_2.png) [@BryonLewis](https://discourse.vtk.org/u/BryonLewis)
#### Post date: [May 11, 2022, 1:05pm UTC](https://discourse.vtk.org/t/transform-rotate-polydata-for-obbtree-intersection-vtk-js/8476/1 "2022-05-11T13:05:40Z")

</div>

This is probably a simple issue but I can’t seem to figure it out currently. I have some geometry that I want to do some intersection displaying on. I can properly get it to load the data for a vtkXMLPoloyDataReader and pass in the values as a well as calculate and visualize the intersections.

I can rotate the actors properly but I’m not sure how to rotate the polyData as the input into the triangleFilter for the intersection calculations. I know there is a “vtkTransformPolyDataFilter” in VTK base but is there a corresponding way I can do the same/similar thing in vtk.js?

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [May 11, 2022, 2:32pm UTC](https://discourse.vtk.org/t/transform-rotate-polydata-for-obbtree-intersection-vtk-js/8476/2 "2022-05-11T14:32:03Z")

</div>

You can create your own filter that does the [following operation](https://github.com/Kitware/vtk-js/blob/master/Sources/Filters/Sources/ConeSource/index.js#L65-L69) to transform points location… Just make sure you clone the points so you do not modify your input.

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [May 11, 2022, 2:47pm UTC](https://discourse.vtk.org/t/transform-rotate-polydata-for-obbtree-intersection-vtk-js/8476/3 "2022-05-11T14:47:13Z")

</div>

you do not have to transform the polydata to do the OBB intersection, the intersection function parameter signature lets you pass in transform matrices

---

<div class="post-metadata">

### Author: ![BryonLewis](https://discourse.vtk.org/user_avatar/discourse.vtk.org/bryonlewis/32/5140_2.png) [@BryonLewis](https://discourse.vtk.org/u/BryonLewis)
#### Post date: [May 11, 2022, 2:49pm UTC](https://discourse.vtk.org/t/transform-rotate-polydata-for-obbtree-intersection-vtk-js/8476/4 "2022-05-11T14:49:32Z")

</div>

Thank you both, I see it now here: [vtk-js/index.js at 5f4a729aff007341459ed5a8bd943e53d07e0765 · Kitware/vtk-js · GitHub](https://github.com/Kitware/vtk-js/blob/5f4a729aff007341459ed5a8bd943e53d07e0765/Sources/Filters/General/OBBTree/index.js#L926)
