about LineWidget?

As you said, a function similar to copyCamera should be used.

I found a method called CopyCamera, and the code is as follows:
const camera = this.renderer.getActiveCamera();
this.paintRenderer.setActiveCamera(cloneDeep(camera));
CloneDeep is a function of the lodash plugin.

I tried deleting the updateCamera method, and the handle and line of lineWidget were displayed.



But it is far away from the position of the mouse cursor, and the handle moves faster than the mouse cursor.

UpdateCamera only applies to circleWidget, ellipseWidget, and rectangleWidget.

It has been confirmed that the problem lies in updateCamera. In this case, after using functions similar to copyCamera, the next step should be to adjust the offset. I don’t know if my understanding is correct?

Thank you very much for your patience in recovering.

Do not use cloneDeep, VTK.js object instances can’t be cloned that way.
You must do:

paintCamera.setViewUp(baseCamera.getViewUp());
paintCamera.setPosition(baseCamera.getPosition());
...

Following your suggestion, I have modified the paintCamera. set() function.
Setting the offset has no effect.
After some code adjustments, the handle of LineWidget is now displayed and moveHandle is also displayed, but the straight line is missing, as shown in the following figure:
Behind

I switched to the next slice and can see the lines, but they are not clear.
1

How can I troubleshoot this issue?

Thank you for your reply!
Behind

be accomplished!
:grinning: :grinning: :grinning: :grinning:

1 Like