Where is the rotation pivot/axis for the Transform filter on a procedural bend?

Hi everyone,

I’m using MFiX 25.1 and building geometry in Geometry → Procedural → bend. I want to rotate the bend, but I cannot figure out what point the Transform filter rotates about (i.e., the rotation pivot/center).

In Geometry → Filters → transform, I can set Rotation (X,Y,Z) and Translation (X,Y,Z), but there is no option for a pivot point. When I change the rotation (e.g., Rotation Z = 90°), the bend appears to rotate around some point that is not obvious to me, and I can’t reliably keep a specific port/endpoint fixed while rotating.

Questions:

  1. For a Procedural bend, what is the default rotation pivot for the transform filter?

    • The bend’s local origin?

    • Something else depending on the filter chain order?

  2. Is there a way in the GUI to set a custom rotation center/pivot for the transform filter (e.g., rotate about a port center)?

  3. If the GUI doesn’t support a pivot directly, what is the recommended workflow to rotate about an arbitrary point (e.g., using multiple transforms / translate-rotate-translate)?

Caption / explanation:
“As shown in the figure, the only parameter I changed is the rotation angle about the Z axis (Rotation Z). All other parameters (translation and other rotation components) remain unchanged.”

Thanks in advance for your help, and Merry Christmas

The rotation center is at the center of mass of the geometry (here the bend). Unfortunately, this cannot be changed in the GUI. It is a good suggestion for a future release.

The vtk filter that does the rotation actually rotates about the origin (x=0, y=0, z=0), so internally we do the following to rotate about the center of mass:

  1. Get the geometry center of mass. Let’s call this (x,y,z)

  2. Translate the geometry by (-x, -y, -z) so that the center of mass is now located at (0,0,0).

  3. Rotate the geometry about (0,0,0)

  4. Translate the geometry by (x,y,z) plus any non-zero translation defined in the transform filter.

If you knew the location of the center of mass, you could adjust the transform filter translation to get a better control. However the center of mass is not displayed in the GUI and may not be easy to compute manually.

If you are up to the challenge, you can try the following:

Locate where the mfix environment is installed. On Linux, it could be something like

~/miniforge3/envs/mfix-25.1.2

Then go to the vtk_widget directory:

cd ~/miniforge3/envs/mfix-25.1.2/lib/python3.12/site-packages/mfixgui/vtk_widgets

and edit the file geometry_engine.py and add a print statement on line 1061. This will display the center of mass coordinate in the console, not the GUI.

1052             # find the center   
1053             vtkfilter.Update()  
1054             polydata = vtkfilter.GetInput()
1055             com = vtk.vtkCenterOfMass()
1056             com.SetInputData(polydata)
1057             com.SetUseScalarsAsWeights(False)
1058             com.Update()        
1059             x, y, z = com.GetCenter()
1060                   
1061             print('Center of mass = ',x,y,z)
1062                                                                                                                    
1063             # translate to center
1064             transform.Translate(-x, -y, -z)
1065                                 
1066             # scale
1067             transform.Scale(safe_float(geo['scalex']),
1068                             safe_float(geo['scaley']),
1069                             safe_float(geo['scalez']))
1070                   
1071             # rotation
1072             transform.RotateWXYZ(safe_float(geo['rotationx']), 1, 0, 0)
1073             transform.RotateWXYZ(safe_float(geo['rotationy']), 0, 1, 0)
1074             transform.RotateWXYZ(safe_float(geo['rotationz']), 0, 0, 1)
1075                   
1076             # translate
1077             transform.Translate(x + safe_float(geo['translatex']),
1078                                 y + safe_float(geo['translatey']),
1079                                 z + safe_float(geo['translatez']))
```

Save the file, launch the GUI from command line. When you apply a transform filter, the center of mass coordinates will be shown in the console. Then you can use these coordinates to adjust the location of the bend. You can also overwrite x,y,z to define the rotation center or edit line 1077-1079 to change how the geometry is translated after rotation.

I hope this helps. Merry Christmas !!

Hi Jeff,

Thank you for the clear explanation about the transform rotation center. I added the print statement to show the center of mass in the console and then adjusted my translation accordingly—this solved my issue.

Thanks again, and happy holidays!!!