[vtkusers] Add new vertexes inside 3D structure
jaki19
nour_sn at hotmail.fr
Thu Nov 3 16:53:16 EDT 2016
the documentations are not very clear for me, I don't understand the result
where are my polys??
vtkSTLReader reader = new vtkSTLReader();
reader.SetFileName(path3d);
reader.Update();
vtkPolyData input = new vtkPolyData();
input = reader.GetOutput();
System.out.println("Before subdivision" );
System.out.println("-----------------");
System.out.print("points: "+input.GetNumberOfPoints() +
"\n");/---->points: 4500/
System.out.print("polys: "+input.GetNumberOfPolys() +
"\n");/------>polys: 6580/
System.out.println("Cells:
"+input.GetNumberOfCells());/------>Cells: 6580/
System.out.println("verts:
"+input.GetNumberOfVerts());/------>verts: 0/
System.out.println("lines:
"+input.GetNumberOfLines());/------>lines: 0/
System.out.println("Strips:
"+input.GetNumberOfStrips());------>Strips: 0
System.out.println("pieces:
"+input.GetNumberOfPieces());------>pieces: 1
vtkRandomAttributeGenerator rag =new
vtkRandomAttributeGenerator();
rag.SetInputData(input);
vtkTessellatorFilter tesla= new vtkTessellatorFilter();
tesla.SetInputConnection(rag.GetOutputPort());
tesla.MergePointsOn();
tesla.Update();
for ( int odim = 1; odim < 4; ++odim )
{
tesla.SetOutputDimension( odim );
tesla.Update();
}
tesla.MergePointsOff();
tesla.Update();
vtkPolyData subdivised = new vtkPolyData();
subdivised.ShallowCopy(tesla.GetOutput());
System.out.println("After Tessellation" );
System.out.println("-----------------");
System.out.print("points"+subdivised.GetNumberOfPoints() +
"\n"); ---->points: 19740
System.out.print("polys"+subdivised.GetNumberOfPolys() +
"\n");------>polys:0
System.out.println("Cells"+subdivised.GetNumberOfCells());------>Cells: 0
System.out.println("verts"+subdivised.GetNumberOfVerts());------>verts: 0
System.out.println("lines"+subdivised.GetNumberOfLines());------>lines: 0
System.out.println("Strips"+subdivised.GetNumberOfStrips());------>Strips: 0
System.out.println("pieces"+subdivised.GetNumberOfPieces());------>pieces: 1
--
View this message in context: http://vtk.1045678.n5.nabble.com/Add-new-vertexes-inside-3D-structure-tp5741022p5741038.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list