how can I increase the number of Polydata cells?

Hi all,
I need to increase the number of Polydata points. I already used the vtkAdaptiveSubdivisionFilter:

ASF = vtk.vtkAdaptiveSubdivisionFilter()
ASF.SetInputData(part)
ASF.SetMaximumTriangleArea(0.2)
ASF.Update()

but its output has some bad edges and bad normals. I use vtkFeatureEdges to show bad edges.

featureEdges = vtk.vtkFeatureEdges()
featureEdges.SetInputConnection(self.lastEntity.Port)
featureEdges.BoundaryEdgesOn()
featureEdges.FeatureEdgesOff()
featureEdges.ManifoldEdgesOff()
featureEdges.NonManifoldEdgesOff()
featureEdges.Update()

see the picture below.

how can I fix it?

Are you sure what you are seeing are boundary edges and not feature edges? i.e., did you invoke FeatureEdgesOff() (by default feature edges are shown).

Also, if the input to the filter has boundary edges interior to the mesh, then you are going to get boundary edges in the interior after running a subdivision filter. Did you try a vtkCleanPolyData before the subdivision filter?

1 Like

Hi Will, thank you for your reply.

yes, I invoked featureEdgesOff but I didn’t write it in the question, sorry.

I used cleanPolyData before that but it wasn’t the solution.
I checked the point normals before and after the subdivision filter. In the before they looked good but in the after not. see pic below.

Hi all, I fix it by changing the SetMaximumTriangleArea method to SetMaximumEdgeLength.

ASF = vtk.vtkAdaptiveSubdivisionFilter()
ASF.SetInputData(part)
# ASF.SetMaximumTriangleArea(maxCell)
ASF.SetMaximumEdgeLength(maxCell)
ASF.Update()