通过vtkSTLReader加载了两个STL模型,通过vtkBooleanOperationPolyDataFilter进行差集运算,结果崩溃到了vtkGenericDataArray里面,请问有人遇到同样的问题么?最后怎么解决?
vtkSmartPointer<vtkSTLReader> reader = vtkSmartPointer<vtkSTLReader>::New();
reader->SetFileName("ball.stl");
reader->Update();
vtkSmartPointer<vtkSTLReader> reader1 = vtkSmartPointer<vtkSTLReader>::New();
reader1->SetFileName("ball_test2.stl");
reader1->Update();
vtkSmartPointer<vtkBooleanOperationPolyDataFilter> boolFilter = vtkSmartPointer<vtkBooleanOperationPolyDataFilter>::New();
boolFilter->SetOperation(vtkBooleanOperationPolyDataFilter::VTK_DIFFERENCE);
boolFilter->SetInputConnection(0, reader->GetOutputPort());
boolFilter->SetInputConnection(1, reader1->GetOutputPort());boolFilter->Update();
vtkSmartPointer<vtkSTLReader> reader = vtkSmartPointer<vtkSTLReader>::New();
reader->SetFileName("ball.stl");
reader->Update();
vtkSmartPointer<vtkSTLReader> reader1 = vtkSmartPointer<vtkSTLReader>::New();
reader1->SetFileName("ball_test2.stl");
reader1->Update();
vtkSmartPointer<vtkBooleanOperationPolyDataFilter> boolFilter = vtkSmartPointer<vtkBooleanOperationPolyDataFilter>::New();
boolFilter->SetOperation(vtkBooleanOperationPolyDataFilter::VTK_DIFFERENCE);
boolFilter->SetInputConnection(0, reader->GetOutputPort());
boolFilter->SetInputConnection(1, reader1->GetOutputPort());boolFilter->Update();