[vtk-developers] UnstructuredGrid result datas are diffrent if use VTK_TRIANGLE and VTK_TETRA

David E DeMarle dave.demarle at kitware.com
Tue Jul 31 09:12:55 EDT 2012


What happens if you switch the ordering of points in the first and
third triangle cells? They appear to point into the tet while the
others point out. This could cause the strange rendering.
cell.Points.AddRange(p0, p1, p2);// -> p0,p2,p1
...
cell.Points.AddRange(p0, p2, p3);// -> p0,p3,p2
If that switch doesn't work, try switching the other two triangles instead.

If it isn't the inconsistent winding, I am guessing you are making
more than four triangles
per tet somehow. To diagnose, use a vtkwriter to save a file that
ParaView 3.14.1 can open. Then use selection, the shrink filter, and
the spreadsheet view to focus in on a problematic area and see exactly
what the triangles in it are.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Tue, Jul 31, 2012 at 5:24 AM, alihadim
<ali.hadimogullari at netcad.com.tr> wrote:
> I’im sending  detail data but Sorry, I’m not sending running file.  The code
> for drawing their own class. Our classes are very basic. Use cell, add point
> and update data.
> I have already solid model of name “orjData.pnj”  sending the file. I‘m
> creating two drawing  and sending all draw files. I marked diffrent place.
> The “tetra.png” use vtk type tetra, The “triangle.png” use vtk type
> triangle.
>
>
> The first method ;
> INetcad3DUnstructuredGrid2 solid =
> (INetcad3DUnstructuredGrid2)Main.FactoryWF.SelectPrimitiveFromFramework(Main.FW,
> "Select Solid");
>                 Netcad3DUnstructuredGrid2 prTest = new
> Netcad3DUnstructuredGrid2();
>                 for (int i = 0; i < solid.GetCellCount(); i++)
>                 {
>                     INetcad3DCell cell0 = solid.GetCell(i, true);
>
>                     INetcad3DCoordinate p0 = cell0.Points[0];
>                     INetcad3DCoordinate p1 = cell0.Points[1];
>                     INetcad3DCoordinate p2 = cell0.Points[2];
>                     INetcad3DCoordinate p3 = cell0.Points[3];
>
>                     {
>                         Netcad3DCell cell = new Netcad3DCell();
>                         cell.Points.AddRange(p0, p1, p2);
>                         cell.CellType = *VTK_CELLTYPE.VTK_TRIANGLE;*
>                         prTest.AddCell(cell);
>                     }
>                     {
>                         Netcad3DCell cell = new Netcad3DCell();
>                         cell.Points.AddRange(p0, p1, p3);
>                         cell.CellType = VTK_CELLTYPE.VTK_TRIANGLE;
>                         prTest.AddCell(cell);
>                     }
>                     {
>                         Netcad3DCell cell = new Netcad3DCell();
>                         cell.Points.AddRange(p0, p2, p3);
>                         cell.CellType = VTK_CELLTYPE.VTK_TRIANGLE;
>                         prTest.AddCell(cell);
>                     }
>                     {
>                         Netcad3DCell cell = new Netcad3DCell();
>                         cell.Points.AddRange(p1, p2, p3);
>                         cell.CellType = VTK_CELLTYPE.VTK_TRIANGLE;
>                         prTest.AddCell(cell);
>                     }
>                 }
>                prTest.Update();
>
> The second method;
>
>   INetcad3DUnstructuredGrid2 solid =
> (INetcad3DUnstructuredGrid2)Main.FactoryWF.SelectPrimitiveFromFramework(Main.FW,
> "Select Solid");
>             Netcad3DUnstructuredGrid2 prTest = new
> Netcad3DUnstructuredGrid2();
>
>             for (int i = 0; i < solid.GetCellCount(); i++)
>             {
>                 INetcad3DCell cell0 = solid.GetCell(i, true);
>
>                 INetcad3DCoordinate p0 = cell0.Points[0];
>                 INetcad3DCoordinate p1 = cell0.Points[1];
>                 INetcad3DCoordinate p2 = cell0.Points[2];
>                 INetcad3DCoordinate p3 = cell0.Points[3];
>
>                 {
>                     Netcad3DCell cell = new Netcad3DCell();
>                     cell.Points.AddRange(p0, p1, p2, p3);
>                     cell.CellType = *VTK_CELLTYPE.VTK_TETRA*;
>                     prTest.AddCell(cell);
>                 }
>             }
>             prTest.Update();
>
> Thank you for all.
> http://vtk.1045678.n5.nabble.com/file/n5715020/orjData.png
> http://vtk.1045678.n5.nabble.com/file/n5715020/tetra.png
> http://vtk.1045678.n5.nabble.com/file/n5715020/triangle.png
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/UnstructuredGrid-result-datas-are-diffrent-if-use-VTK-TRIANGLE-and-VTK-TETRA-tp5714989p5715020.html
> Sent from the VTK - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>



More information about the vtk-developers mailing list