[vtkusers] vtkTransformFilter and precisions

Murat Aydın murat.aydin at netcad.com.tr
Thu Feb 4 08:32:42 EST 2010


Hi,

I noticed something. There is setDataTypeToDouble() method in vtkPoints. The reason of precision loss may be that default dataType of vtkPoints is float. How can i set default dataType of vtkUnstructured grid to double? How can i change dataType of points? Thanks.

Kind Regards,

murat
  ----- Original Message ----- 
  From: Murat Aydın 
  To: vtkusers at vtk.org 
  Sent: Wednesday, February 03, 2010 12:01 PM
  Subject: [vtkusers] vtkTransformFilter and precisions


  Hi,

  Precisions change after executing vtkTransformFilter. My code is the following:

  vtk.vtkTransform transformRotate3 = new vtk.vtkTransform();
  transformRotate3.RotateWXYZ(45.0, 1, 0, 0);
  vtk.vtkTransformFilter transformFilterRotate3 = new vtk.vtkTransformFilter();
  transformFilterRotate3.SetTransform(transformRotate3);
  transformFilterRotate3.SetInputConnection(transformFilterRotate2.GetOutputPort());

  transformFilterRotate2 is another transformFilter.

  Distance between points[0] and points[4] is 20.0 in  transformFilterRotate2.GetUnstructuredGridOutput()
  After executing  transformFilterRotate3
  distance between points[0] and points[4] is 20.032103138407294

  I am getting points by the following code:

  transformFilterRotate2.GetUnstructuredGridOutput().GetPoint(0)
  transformFilterRotate2.GetUnstructuredGridOutput().GetPoint(4)

  transformFilterRotate3.GetUnstructuredGridOutput().GetPoint(0)
  transformFilterRotate3.GetUnstructuredGridOutput().GetPoint(4)


  why the distance changed from 20.0 to 20.032103138407294? How can i prevent this?

  Kind Regards,

  murat aydin


------------------------------------------------------------------------------


  _______________________________________________
  Powered by www.kitware.com

  Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

  Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

  Follow this link to subscribe/unsubscribe:
  http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100204/ad3fb036/attachment.htm>


More information about the vtkusers mailing list