Brilliant, thank you!<br><br><div class="gmail_quote">On Tue, Apr 3, 2012 at 1:43 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Brett,<br>
<br>
The default type of vtkPoints is "float". If you need more precision,<br>
then you can change the precision to "double":<br>
<br>
vtk_points = vtk.vtkPoints()<br>
vtk_points.SetDataTypeToDouble()<br>
<br>
This is true in both C++ and Python.<br>
<span class="HOEnZb"><font color="#888888"><br>
- David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Tue, Apr 3, 2012 at 6:22 AM, Brett Tully <<a href="mailto:brett.tully@oxyntix.com">brett.tully@oxyntix.com</a>> wrote:<br>
> Dear all,<br>
><br>
> I am finding that vtkPoints.InsertNextPoint when called from python does not<br>
> return a point where I want it -- it seems to be out by ~1e-10 -- is there a<br>
> way to set the tolerance of this function or improve its location to be more<br>
> precise than 1e-10? Or is this due to python floats?<br>
><br>
> Thanks,<br>
> Brett.<br>
><br>
> I.e. the following python:<br>
><br>
> import vtk<br>
> vtk_points = vtk.vtkPoints()<br>
> e = [0.0, 0.0065, 0.0]<br>
> e_id = vtk_points.InsertNextPoint(*e)<br>
> p_e = vtk_points.GetPoint(e_id)<br>
> print p_e, e<br>
> print (e[0] - p_e[0]), (e[1] - p_e[1]), (e[2] - p_e[2])<br>
><br>
> # gives<br>
> # (0.0, 0.006500000134110451, 0.0) [0.0, 0.0065, 0.0]<br>
> # 0.0 -1.34110451043e-10 0.0<br>
</div></div></blockquote></div><br>