Transform seems to not be applied to input points after vtkBox.SetTransform(). Bug? (Code included)

I have a vtkBox with a transform set.
However, the transform never seems to be applied to the input points. Here is the code so you can see for yourself:

import vtk

box_origin = [420, 69, 420.69]

T = vtk.vtkTransform()

box = vtk.vtkBox()
# implicit function should now be translated to box_origin
# input points should now be translated before evaluating the function

pt = [420, 69, 420.69]
# pt should be translated to origin, resulting in function value of 0
val = box.EvaluateFunction(pt)
# val != 0
# val ends up being as if the transform was never applied to the points.
# i.e. val = norm(pt - 1) != 0

Try using FunctionValue() and FunctionGradient() (not EvaluateFunction() and EvaluateGradient()). The former methods invoke the transform, the latter do not. (See the documentation for vtkImplicitFunction.)

1 Like

Thank you!