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

alihadim ali.hadimogullari at netcad.com.tr
Tue Jul 31 05:24:52 EDT 2012


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.



More information about the vtk-developers mailing list