'How to generate Open CASCADE TopoDS_Shape object 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



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source