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

**URL:** <https://discourse.vtk.org/t/transform-seems-to-not-be-applied-to-input-points-after-vtkbox-settransform-bug-code-included/8784>\
**Category:** Development\
**Tags:** python\
**Created:** [June 22, 2022, 4:31pm UTC](https://discourse.vtk.org/t/transform-seems-to-not-be-applied-to-input-points-after-vtkbox-settransform-bug-code-included/8784 "2022-06-22T16:31:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MJJ](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@MJJ](https://discourse.vtk.org/u/MJJ)\
**Post date:** [June 22, 2022, 4:31pm UTC](https://discourse.vtk.org/t/transform-seems-to-not-be-applied-to-input-points-after-vtkbox-settransform-bug-code-included/8784/1 "2022-06-22T16:31:29Z")

</div>

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:

```auto
import vtk

box_origin = [420, 69, 420.69]

T = vtk.vtkTransform()
T.Translate(box_origin)

box = vtk.vtkBox()
box.SetXMin([0,0,0])
box.SetXMax([1,1,1])
box.SetTransform(T.GetInverse()) 
# 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
print(val)

```

---

<div class="post-metadata">

**Author:** ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)\
**Post date:** [June 22, 2022, 5:13pm UTC](https://discourse.vtk.org/t/transform-seems-to-not-be-applied-to-input-points-after-vtkbox-settransform-bug-code-included/8784/2 "2022-06-22T17:13:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MJJ](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@MJJ](https://discourse.vtk.org/u/MJJ)\
**Post date:** [June 28, 2022, 5:25am UTC](https://discourse.vtk.org/t/transform-seems-to-not-be-applied-to-input-points-after-vtkbox-settransform-bug-code-included/8784/3 "2022-06-28T05:25:56Z")

</div>

Thank you!
