How to calculate the surface area generated from vtkCutter?

Hi,
I’m using vtkCutter to cut my 3d model(vtkPolydata). Through this I get a cutter surface. Now I want to calculate the area of the surface. Here is a part of my code:

        vtkSmartPointer<vtkCutter> Cutter = vtkSmartPointer<vtkCutter>::New();
        Cutter->SetInputData(m_PD);
        CutterPlane->SetOrigin(Origin[0], Origin[1], Origin[2]);
		CutterPlane->SetNormal(Nx, Ny, Nz);

		Cutter->SetCutFunction(CutterPlane.Get());
		Cutter->GenerateCutScalarsOff(); 
		Cutter->Update();
		
		vtkPolyData* cutpd = vtkPolyData::New();
		cutpd->DeepCopy(Cutter->GetOutput());
		vtkSmartPointer<vtkTriangleFilter> triangles = vtkSmartPointer<vtkTriangleFilter>::New();
		triangles->SetInputData(cutpd);
		triangles->Update();

		auto nums = triangles->GetOutput()->GetNumberOfPoints();
		vtkSmartPointer<vtkMassProperties> massProp = vtkSmartPointer<vtkMassProperties>::New();
		massProp->SetInputData(triangles->GetOutput());
		double area = massProp->GetSurfaceArea();

The program reports an error in the last code sentence:

vtkMassProperties (000001D12CD995E0): Input data type must be VTK_TRIANGLE not 3