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

David E DeMarle dave.demarle at kitware.com
Wed Aug 1 15:21:11 EDT 2012


After looking at the file you've sent me offline, I think it is a
rendering artifact. What you are seeing is edges on the back side
popping through.

You have very thin cells. When VTK renders edges, it can offset them
from the polygons toward the viewer to make them stand out from the
surfaces they are part of. It isn't as visible with the tet version of
that file because VTK extracts the external polygons from unstructured
grids before rendering them. In that case, the far side edges are on
the other side of the entire data set and the zbuffer culls almost all
of them.

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 11:13 AM, ALI HADIMOGULLARI
<ali.hadimogullari at netcad.com.tr> wrote:
> Hi David,
> Before I changed the order of the insertion point but it doesn't do it. continues the same error.
> Like You said, vtk or our class making more than four triangles but this situation doesn't do it for vtk type TETRA!
>
> After model creates we will create blok model. This is diffrent model and will consist of incorrect. I will look like your said.
>
> Thank you.
>
> -----Original Message-----
> From: David E DeMarle [mailto:dave.demarle at kitware.com]
> Sent: Tuesday, July 31, 2012 4:13 PM
> To: ALI HADIMOGULLARI
> Cc: vtk-developers at vtk.org
> Subject: Re: [vtk-developers] UnstructuredGrid result datas are diffrent if use VTK_TRIANGLE and VTK_TETRA
>
> 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