# Get Open CASCADE TopoDS\_Shape from vtkPolyData

**URL:** https://discourse.vtk.org/t/get-open-cascade-topods-shape-from-vtkpolydata/8068
**Category:** Support
**Tags:** jobs
**Created:** [March 16, 2022, 9:27am UTC](https://discourse.vtk.org/t/get-open-cascade-topods-shape-from-vtkpolydata/8068 "2022-03-16T09:27:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![KeyboardMan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/keyboardman/32/968_2.png) [@KeyboardMan](https://discourse.vtk.org/u/KeyboardMan)
#### Post date: [March 16, 2022, 9:27am UTC](https://discourse.vtk.org/t/get-open-cascade-topods-shape-from-vtkpolydata/8068/1 "2022-03-16T09:27:40Z")

</div>

I got the output vtkPolyData of vtkContourFilter, next I want to generate TopoDS\_Shape by vtkPolyData.PolyData is a completely closed box）

My current approach is to store the PolyData as an STL file, then use Open CASCADE to read the file, and finally use BRepBuilderAPI\_Sewing to concatenate the data to get the TopoDS\_Shape. But the splicing process is relatively slow, usually takes a few minutes, and I don’t think this can meet my requirements.

Is there a better way to solve this problem, please let me know, thanks

---

<div class="post-metadata">

### Author: ![KeyboardMan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/keyboardman/32/968_2.png) [@KeyboardMan](https://discourse.vtk.org/u/KeyboardMan)
#### Post date: [March 30, 2022, 1:33am UTC](https://discourse.vtk.org/t/get-open-cascade-topods-shape-from-vtkpolydata/8068/2 "2022-03-30T01:33:26Z")

</div>

This is a temporary solution that, while not very efficient, did solve my problem. [http://cppdebug.com/archives/282](http://cppdebug.com/archives/282)

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [March 30, 2022, 2:36am UTC](https://discourse.vtk.org/t/get-open-cascade-topods-shape-from-vtkpolydata/8068/3 "2022-03-30T02:36:44Z")

</div>

Why would you want to construct a topological shape from contour data? Perhaps you could construct wires from the contour lines and overlay them on the original topological surface using OCC.

---

<div class="post-metadata">

### Author: ![KeyboardMan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/keyboardman/32/968_2.png) [@KeyboardMan](https://discourse.vtk.org/u/KeyboardMan)
#### Post date: [March 31, 2022, 9:53am UTC](https://discourse.vtk.org/t/get-open-cascade-topods-shape-from-vtkpolydata/8068/4 "2022-03-31T09:53:39Z")

</div>

I have such a requirement, the user inputs a function about F(x,y,z), and then generates solid through this function.
