[vtkusers] Why does a vtkFeatureEdge return non-scalar output?

pnt1614 minpu.code at gmail.com
Tue May 1 22:52:18 EDT 2018


I am using a vtkFeatureEdge to extract a boundary edges and everything works
fine. Now I want to render points on the boundary edge so I try to use
vtkEdgePoints but there is an "No scalar data to contour
" error. I found out that the boundary edge has no scalars. Is there
something missing? or is this a bug?


                // Load a stl file 
                //...
		vtkSmartPointer<vtkPolyData> data = pSTLReader->GetOutput();				//
vtkPolyData 형식으로 받아오기
																									// Create a mapper and actor
		vtkSmartPointer<vtkPolyDataMapper> mapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
		mapper->SetInputData(data);

		vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
		actor->SetMapper(mapper);


		//---------------edges-----------
		vtkSmartPointer<vtkFeatureEdges> edges =
vtkSmartPointer<vtkFeatureEdges>::New();
		edges->SetInputConnection(pSTLReader->GetOutputPort());
		edges->BoundaryEdgesOn();
		edges->FeatureEdgesOff();
		edges->ManifoldEdgesOff();
		edges->NonManifoldEdgesOff();
		edges->Update();

                int test = edges->GetColoring(); // the result is 1

		vtkSmartPointer<vtkPolyDataMapper> edgeMapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
		edgeMapper->SetInputConnection(edges->GetOutputPort());
		
		vtkSmartPointer<vtkActor> edgeActor = vtkSmartPointer<vtkActor>::New();
		edgeActor->SetMapper(edgeMapper);
		edgeActor->GetProperty()->SetLineWidth(3.0);

		
		vtkSmartPointer<vtkEdgePoints> e_points =
vtkSmartPointer<vtkEdgePoints>::New();
		e_points->SetInputConnection(edges->GetOutputPort());
		e_points->SetValue(1150);
		e_points->Update();

		vtkSmartPointer<vtkActor> e_a = make_an_actor(e_points->GetOutputPort());

                vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
		renderer->AddActor(e_a);



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list