Visualization of cutting plane angle (vtkImplicitPlaneWidget2)

Hi,
I am using vtkImplicitPlaneWidget2.
I want to know the angle and coordinates of the cutting plane after mouse operation.

How can I know the angles and coordinates?
Please let me know if you know.
@dgobbi

The vtkImplicitPlaneRepresentation object owns the “plane” object. You can get this object as shown in the earlier examples:

vtkSmartPointer<vtkPlane> plane = vtkSmartPointer<vtkPlane>::New();
representation->GetPlane(plane);

The vtkPlane object has a “normal” and an “origin”:

double origin[3];
double normal[3];
plane->GetOrigin(origin);
plane->GetNormal(normal);

The “origin” is the coordinates of a point on the plane. When you use the widget to adjust the plane, it rotates around this point.

The “normal” is a vector perpendicular to the plane. You can compute the angles from this vector. The best thing is to do the math yourself, but you can also look at the function vtkMath::AngleBetweenVectors() for inspiration.

Remember that rotations are not commutative, so there are multiple ways of specifying the angles.

1 Like

Thank you for your reply.

I think once based on the explanation.

I have one more thing I want to ask, so I will create a new topic.
In that case, thank you.