[vtkusers] Newbie question about vtkMeshQuality

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed Apr 27 11:53:36 EDT 2005


What is wrong with :

$ ctest -R MeshQuality -V 
 

Test project
Changing directory into 
/home/mathieu/Dashboards/MyTests/VTK-gcc/Graphics/Testing/Cxx
   1/  1 Testing MeshQuality
Test command: 
/home/mathieu/Dashboards/MyTests/VTK-gcc/bin/GraphicsCxxTests 
MeshQuality -D /home/mathieu/Dashboards/MyTests/VTKData -T 
/home/mathieu/Dashboards/MyTests/VTK-gcc/Testing/Temporary -V 
Baseline/Graphics/MeshQuality.png

Triangle quality of mesh
/home/mathieu/Dashboards/MyTests/VTKData/Data/uGridEx.vtk
  Edge Ratio:
   range: 1.41421  -  1.41421
   average: 1.41421  , standard deviation: 1.30634e-08
  Aspect Ratio:
   range: 1.39385  -  1.39385
   average: 1.39385  , standard deviation: 8.87815e-09
  Radius Ratio:
   range: 1.20711  -  1.20711
   average: 1.20711  , standard deviation: 1.83331e-09
  Frobenius Norm:
   range: 1.1547  -  1.1547
   average: 1.1547  , standard deviation: 3.4377e-09
  Minimal Angle:
   range: 45  -  45
   average: 45  , standard deviation: 2.92002e-07

Quadrilatedral quality of mesh
/home/mathieu/Dashboards/MyTests/VTKData/Data/uGridEx.vtk
  Edge Ratio:
   range: 1  -  1
   average: 1  , standard deviation: 0
  Aspect Ratio:
   range: 1  -  1
   average: 1  , standard deviation: 0
  Radius Ratio:
   range: 1  -  1
   average: 1  , standard deviation: 0
  Average Frobenius Norm:
   range: 1  -  1
   average: 1  , standard deviation: 0
  Maximal Frobenius Norm:
   range: 1  -  1
   average: 1  , standard deviation: 0
  Minimal Angle:
   range: 90  -  90
   average: 90  , standard deviation: 0

Tetrahedral quality of mesh
/home/mathieu/Dashboards/MyTests/VTKData/Data/uGridEx.vtk
  Edge Ratio:
   range: 1.41421  -  1.73205
   average: 1.57313  , standard deviation: 0.158919
  Aspect Ratio:
   range: 1.36603  -  1.70711
   average: 1.53657  , standard deviation: 0.170541
  Radius Ratio:
   range: 1.36603  -  1.39385
   average: 1.37994  , standard deviation: 0.0139107
  Frobenius Norm:
   range: 1.19055  -  1.32283
   average: 1.25669  , standard deviation: 0.0661417
  Minimal Dihedral Angle:
   range: 45  -  54.7356
   average: 49.8678  , standard deviation: 4.86781

Hexahedral quality of mesh
/home/mathieu/Dashboards/MyTests/VTKData/Data/uGridEx.vtk
  Edge Ratio:
   range: 1  -  1
   average: 1  , standard deviation: 0

-- Process completed
    Passed

The following tests passed:
         MeshQuality

100% tests passed, 0 tests failed out of 1


This is tested every night...
Mathieu

Andriy Fedorov wrote:
> Mathieu,
> 
> Are you aware that the test you pointed me to is outdated: apparently, 
> the functionality provided by vtkMeshQuality in the latest release of 
> VTK is significantly restricted.
> 
> AF
> 
> 
> Mathieu Malaterre wrote:
> 
>> Andriy,
>>
>>     Use the documentation of VTK. For example go to the doxygen of the 
>> class you wish to use:
>>
>> http://www.vtk.org/doc/nightly/html/classvtkMeshQuality.html
>>
>>     Then scroll, you'll find a 'Tests' section, which will lead you to:
>>
>> http://www.vtk.org/doc/nightly/html/c2_vtk_t_8.html#c2_vtk_t_vtkMeshQuality 
>>
>>
>>     In this case the choice is easy since there is only one test 
>> written in c++:
>>
>> http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Graphics/Testing/Cxx/MeshQuality.cxx?root=VTK&content-type=text/plain 
>>
>>
>> This gives you an example on how to use this class:
>>
>> <snip>
>>   vtkUnstructuredGridReader* mr = vtkUnstructuredGridReader::New();
>>   vtkUnstructuredGrid* ug;
>>   vtkMeshQuality* iq = vtkMeshQuality::New();
>>
>>   mr->SetFileName( fname );
>>   mr->Update();
>>
>>   ug = mr->GetOutput();    // <-- this is the line you need
>>   iq->SetInput( ug );
>> </snip>
>>
>>
>> HTH
>> Mathieu
>>
>> Andriy Fedorov wrote:
>>
>>> I know this is something very simple... I am trying to use 
>>> itkMeshQuality with a tetrahedral 3D mesh. Here's the code:
>>>
>>> #include "vtkUnstructuredGrid.h"
>>> #include "vtkUnstructuredGridReader.h"
>>> #include "vtkMeshQuality.h"
>>> #include "vtkDataSet.h"
>>> #include <iostream>
>>>
>>> int main(int argc, char **argv){
>>>  if(argc<2)
>>>    return -1;
>>>
>>>  vtkUnstructuredGridReader *vtk_mesh_reader =
>>>    vtkUnstructuredGridReader::New();
>>>  vtkMeshQuality *mesh_qual = vtkMeshQuality::New();
>>>  vtkDataObject *output_mesh;
>>>
>>>  vtk_mesh_reader->SetFileName(argv[1]);
>>>  vtk_mesh_reader->Update();
>>>  vtkDataSet *input_mesh = vtkDataSet::SafeDownCast(
>>>    vtk_mesh_reader);
>>>  mesh_qual->SetInput(input_mesh);
>>>  mesh_qual->Update();
>>>  output_mesh = mesh_qual->GetOutput();
>>>
>>>  return 0;
>>> }
>>>
>>> When I run it, I have failure here:
>>>
>>> ERROR: In 
>>> /home/fedorov/SPL/slicer2/Lib/linux-x86/VTK/Common/vtkSource.cxx, 
>>> line 384
>>> vtkMeshQuality (0x8069318): Required input 0 is not assigned. 
>>> Skipping execution.
>>>
>>> I realize it shuld be possible to figure out from the code, but I 
>>> already spent couple of hours w/o success (my VTK experience 
>>> approaches 0).  Can somebody give me a quick hint what I am missing? 
>>> Thanks a lot!
>>>
>>> Andriy Fedorov
>>> _______________________________________________
>>> This is the private VTK discussion list. Please keep messages 
>>> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>
> 
> 




More information about the vtkusers mailing list