Is it possible to change the center of rotation of an object in Transform when i move it
In theory, you may do a translation by moving the center of object to the origin, do the rotation; then do a reverse-translation by moving back the object.
I am trying to do something on transform but I am also just hitting the road on this transform. I will follow this topic.
I would not recommend to try to align objects using rotation around specified point, since landmark registration is much more reliable, faster, and accurate: you just specify a few corresponding points on the objects you want to align and you are done - no manual tuning of several sliders are necessary and result is guaranteed to be optimal. There are several landmark registration modules available in Slicer, but probably the most convenient and powerful is Fiducial registration wizard module in SlicerIGT extension.
Anyway, if you still want to do rotation around centerpoint (there are valid uses cases, they are just rare) then you can use this example in the script repository: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Rotate_a_node_around_a_specified_point
The bounding box of the transform interaction widget is set to the boundaries of all the transformed nodes. Therefor you can change the boundary by adding other transformable nodes under the same transform. However, since aligning objects in 3D view by interactive translation and rotation is extremely inefficient (it is an iterative process of translations, rotations, changing view orientation) I would not recommend doing this instead doing direct positioning by placing landmarks on the object you want to align.
I am agree with but my goal is not to align but to move a tooth like orthodontisc appliance with forces and center of rotation
For this, you can use the script that I referenced above.
Hello Mr. Lasso, I tested the codes to create a new center of rotation. I do not get the desired result.
When I make the first linear transformation, my object does not turn around the new point.
Can you tell me the correct coding in my case? Here is the model that I’m studying.
Pay attention to which transform you apply to the model and which one you are adjusting with sliders (they are not same).
Also check for any error messages in the console.
If you need more specific help, share a screen capture video of what you do, or save the scene as a bundle (mrb) file and share that.
Hello Mr. Lasso, my concern persists. I join here the model in vtk format and the scene.
I want to rotate the model around himself and not about the axis of the skull base.
Thank you for your help.
Hello, thanks for the video.
I don’t know why, but I have an error message :
Traceback (most recent call last):
File “”, line 1, in
File “”, line 5, in updateFinalTransform
AttributeError: ‘vtkSlicerMarkupsModuleMRMLPython.vtkMRMLMarkupsFid’ object has no attribute ‘GetNthControlPointPositionWorld’
I am attaching the video to you.
The script is for recent Slicer Preview Releases (currently 4.11.x). Method names are slightly different in latest Slicer Stable Release (currently 4.10.2).
Perfect. Thanks a lot