[vtkusers] precision problem with vtkPiecewiseFunction

Benjamin King benjaminking at web.de
Fri Aug 23 06:31:57 EDT 2002


Hi,

I'm using VTK with Tcl and tried to read all points from a user provided 
vtkPiecewiseFunction. I ran into the following problem:

---
vtkPiecewiseFunction f
	f AddPoint 0 0
	f AddPoint 1.00000000000000001 0; # ridiculus, isn't it?
	f AddPoint 2.000001 0; # This happened in a real case
	f AddPoint 3.00001 0
	f AddPoint 4 0

f GetRange         (--> 0 4)

f RemovePoint 0
f GetRange         (--> 1 4, so 1.000000[...]01 was rounded)

f RemovePoint 1
f GetRange         (--> 2 4, but 2.000001 wasn't rounded, see below)

f RemovePoint 2
f GetRange         (--> 2 4, still there)

f RemovePoint 2.000001
f GetRange         (--> 3.00001 4, no rounding)
---

Is there another way to get the defining values from a 
vtkPiecewiseFunction than that? The GetDataPointer Method isn't wrapped...

Thanks,
   Ben


-- 
There are only 10 types of people in this world:
Those who understand binary, and those who don't.





More information about the vtkusers mailing list