Get Open CASCADE TopoDS_Shape from vtkPolyData

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

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

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.

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