VTK- 实现倒角(完整源码)

前言:本博文主要研究在VTK中如何实现倒角,并附源码。

一波三折的过程,终于有了结果。回过头看看自己做了好多无用功。

1. 沿边界生成圆柱体进行布尔减操作(行不通,vtkBooleanOperationPolyDataFilter出错)

vtkNew<vtkPoints> plPts;
vtkPolyLineSource* pl = vtkPolyLineSource::New();
for (vtkIdType id = 0; id < npts; id++)
{
    
    plPts->InsertNextPoint(inPts->GetPoint(pts[id]));            
    pl->SetPoints(plPts);
}
vtkTubeFilter* tube = vtkTubeFilter::New();
tube->SetInputConnection(pl->GetOutputPort());
tube->SetRadius(2.);
tube->SetNumberOfSides(100);
tube->CappingOn();
tube->SetSidesShareVertices(true);
tube->Update();

 2. 沿边界的每条线段进行剪切体的创建,进而迭

猜你喜欢

转载自blog.csdn.net/qq_40041064/article/details/129012623