<div dir="ltr">The problem is that the VTK rendering pipeline expects polydata to contain only convex polygons, but following code can create a non-convex polygon:<div><br></div><div><div>        // Change the polylines into polygons</div><div><span class="" style="white-space:pre">     </span>vtkSmartPointer<vtkPolyData> boundaryPoly =</div><div><span class="" style="white-space:pre">          </span>vtkSmartPointer<vtkPolyData>::New();</div><div><span class="" style="white-space:pre"> </span>boundaryPoly->SetPoints(boundaryStrips->GetOutput()->GetPoints());</div><div><span class="" style="white-space:pre">        </span>boundaryPoly->SetPolys(boundaryStrips->GetOutput()->GetLines());</div><div><br></div><div>The vtkContourTriangulator filter (which I contributed to VTK) can fix this:</div><div><br></div><div><div>        // Triangulate the polyline contour</div><div><span class="" style="white-space:pre">    </span>vtkSmartPointer<vtkContourTriangulator> triangulator =</div><div><span class="" style="white-space:pre">               </span>vtkSmartPointer<vtkContourTriangulator>::New();</div></div><div>        triangulator->SetInputConnection(boundaryStrips->GetOutputPort());</div><div>        triangulator->Update();</div><div>        // use the triangulator output as the cap</div><div><br></div><div>Please let me know if this works for you.</div><div><br></div><div>Cheers,</div><div> - David </div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 10, 2015 at 3:38 AM, momo <span dir="ltr"><<a href="mailto:lilymagic2005@yahoo.com.hk" target="_blank">lilymagic2005@yahoo.com.hk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I have a surface like the left in the picture belows. I applied Cap Clip on<br>
the surface, and I append the original surface and the caps, then output to<br>
a .stl file. It looks well in the render window in VTK. However, when I used<br>
Paraview to view the output file, it looks the same as the original surface.<br>
The left of the picture shows the actual result of the output file after<br>
appending in Paraview. So what happened actually?Thanks.<br>
<br>
<<a href="http://vtk.1045678.n5.nabble.com/file/n5733821/Clip_Capture.jpg" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/file/n5733821/Clip_Capture.jpg</a>><br>
CapClip.cxx <<a href="http://vtk.1045678.n5.nabble.com/file/n5733821/CapClip.cxx" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/file/n5733821/CapClip.cxx</a>><br></blockquote></div></div></div></div>