[vtkusers] Interpolated edges with mid-side nodes

madz madaramh at gmail.com
Thu May 24 07:07:54 EDT 2018


I have a grid made with tetrahedral cells. Each cell has 10 points (4 -
corner points and 6 - mid-side points).
I've given an example of the method used to create the grid but I can't seem
to get the cell edges to go through the mid-side points.

How can I get the edges to appear as in the black line shown in the right
image. The left one is what I have now.

Image - 

<http://vtk.1045678.n5.nabble.com/file/t340134/midside-vtk.png> 

Code-

 vtkSmartPointer<vtkPoints> points =
    vtkSmartPointer<vtkPoints>::New();
 
points->InsertNextPoint(-7.1374208222357446e-002,8.5031050836294406e-002,1.2763288004142873e-001);
 
points->InsertNextPoint(-8.0855828124495405e-002,7.4990717996207365e-002,1.1777091844875046e-001);
 
points->InsertNextPoint(-7.1736895273477944e-002,8.4576899052732968e-002,1.1760875416048089e-001);
 
points->InsertNextPoint(-7.1683111292242127e-002,7.6559876311458649e-002,1.1936078137875390e-001);

 
points->InsertNextPoint(-7.6115018173426419e-002,8.0010884416250899e-002,1.2270189924508959e-001);
 
points->InsertNextPoint(-7.6296361698986681e-002,8.0783808524470173e-002,1.1768983630461567e-001);
 
points->InsertNextPoint(-7.1555551747917695e-002,8.4803974944513694e-002,1.2262081710095481e-001);
 
points->InsertNextPoint(-7.1528659757299787e-002,8.0795463573876528e-002,1.2349683071009131e-001);
 
points->InsertNextPoint(-7.6269469708368759e-002,7.5775297153833007e-002,1.1856584991375219e-001);
 
points->InsertNextPoint(-7.1710003282860035e-002,8.0568387682095816e-002,1.1848476776961739e-001);


  //points->InsertNextPoint(0, 0, 0);
  //points->InsertNextPoint(0, 0, 0);
  //points->InsertNextPoint(0, 0, 0);
  //points->InsertNextPoint(0, 0, 0);
  //points->InsertNextPoint(0, 0, 0);
  //points->InsertNextPoint(0, 0, 0);

   vtkSmartPointer<vtkTetra> tetra =
    vtkSmartPointer<vtkTetra>::New();

  tetra->GetPointIds()->SetId(0, 0);
  tetra->GetPointIds()->SetId(1, 1);
  tetra->GetPointIds()->SetId(2, 2);
  tetra->GetPointIds()->SetId(3, 3);
  tetra->GetPointIds()->SetId(4, 4);
  tetra->GetPointIds()->SetId(5, 5);
  tetra->GetPointIds()->SetId(6, 6);
  tetra->GetPointIds()->SetId(7, 7);
  tetra->GetPointIds()->SetId(8, 8);
  tetra->GetPointIds()->SetId(9, 9);

  vtkSmartPointer<vtkCellArray> cellArray =
    vtkSmartPointer<vtkCellArray>::New();
  cellArray->InsertNextCell(tetra);


  vtkSmartPointer<vtkUnstructuredGrid> unstructuredGrid =
    vtkSmartPointer<vtkUnstructuredGrid>::New();
  unstructuredGrid->SetPoints(points);
  unstructuredGrid->SetCells(VTK_TETRA, cellArray);


Any help will be appreciated.
Thanks.




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


More information about the vtkusers mailing list