# Rotation in plane created by API : is it normal?

**URL:** <https://discourse.slicer.org/t/rotation-in-plane-created-by-api-is-it-normal/38148>\
**Category:** Feature requests\
**Created:** [September 1, 2024, 10:11am UTC](https://discourse.slicer.org/t/rotation-in-plane-created-by-api-is-it-normal/38148 "2024-09-01T10:11:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [September 1, 2024, 10:11am UTC](https://discourse.slicer.org/t/rotation-in-plane-created-by-api-is-it-normal/38148/1 "2024-09-01T10:11:03Z")

</div>

If a markups plane is created using the API, and its normal and origin are set to those of another plane interactively placed in a rotated 3D view, the plane created by API has an extra rotation.

```auto
interactivePlane = getNode("P")

# New plane on interactive plane : there is an additional rotation
apiPlane = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLMarkupsPlaneNode")
apiPlane.AddControlPointWorld(interactivePlane.GetOriginWorld())
apiPlane.SetNormalWorld(interactivePlane.GetNormalWorld())

# New plane on api plane : there is no additional rotation
apiPlane2 = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLMarkupsPlaneNode")
apiPlane2.AddControlPointWorld(apiPlane.GetOriginWorld())
apiPlane2.SetNormalWorld(apiPlane.GetNormalWorld())

```

![rotated_api_planes](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/c/fc25fcbb2c65e1e26a636508e7a02ddb43320739.png)

Is this to be expected? If so, how should it be handled in user code to cancel this rotation?

Thank you.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 1, 2024, 11:36am UTC](https://discourse.slicer.org/t/rotation-in-plane-created-by-api-is-it-normal/38148/2 "2024-09-01T11:36:58Z")

</div>

Yes, this is the expected behavior, because normal direction does not specify the orientation of a rectangle in 3D. You need to specify direction of all the axes if you care about the rotation around the normal vector.
