方法一
//ofstream outfile;
//outfile.open("D:\\tooth_tata_lvsilin\\IOS_single_o\\correspondences.txt", ios::in);//打开文件
//获取边界点的坐标
_vertices_bdr = bdr_polyData->GetPoints();
if (boundary == NULL) boundary = Vertices::New();
boundary->SetNumberOfPoints(_vertices_bdr->GetNumberOfPoints());
for (int i = 0; i < _vertices_bdr->GetNumberOfPoints(); ++i) {
double pb[3];
bdr_polyData->GetPoint(i, pb);
boundary->SetPoint(i, pb);
//std::cout << p[0] << " "<< p[1]<<" "<< p[2]<<std::endl;//边界点的坐标
//outfile << pb[0] << " " << pb[1] << " " << pb[2] << endl;//获取对应点的坐标
}
//outfile.close();//关闭文件,保存文件
方法二
//获取边界点的坐标
vtkSmartPointer<vtkPoints> boundary = vtkSmartPointer<vtkPoints>::New();
vtkPoints *pb = boundaryEdges->GetOutput()->GetPoints();
for (int i = 0; i < pb->GetNumberOfPoints(); ++i) {
double *point_bdr = pb->GetPoint(i);
boundary->InsertNextPoint(point_bdr);
//std::cout << p[0] << " "<< p[1]<<" "<< p[2]<<std::endl;//边界点的坐标
}