[vtkusers] Tolerance of InsertNextPoint in python

Brett Tully brett.tully at oxyntix.com
Tue Apr 3 08:22:12 EDT 2012


Dear all,

I am finding that vtkPoints.InsertNextPoint when called from python does
not return a point where I want it -- it seems to be out by ~1e-10 -- is
there a way to set the tolerance of this function or improve its location
to be more precise than 1e-10? Or is this due to python floats?

Thanks,
Brett.

I.e. the following python:

import vtk
vtk_points = vtk.vtkPoints()
e = [0.0, 0.0065, 0.0]
e_id = vtk_points.InsertNextPoint(*e)
p_e = vtk_points.GetPoint(e_id)
print p_e, e
print (e[0] - p_e[0]), (e[1] - p_e[1]), (e[2] - p_e[2])

# gives
# (0.0, 0.006500000134110451, 0.0) [0.0, 0.0065, 0.0]
# 0.0 -1.34110451043e-10 0.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120403/229929b1/attachment.htm>


More information about the vtkusers mailing list