Dear support,
I am struggling to perform some basic operations to get the moments around an axis. My objective is to find the normal force around an axis following this sketch:
Where AB is the axis that I’ve defined using a line filter and P is the point where a vector force is stored in my dataset.
The first step is to get the AP vector which works fine using this python calculator:
# Get reference to the inputs
surf = inputs[0]
axis = inputs[1]
# Get axis vector
A = axis.Points[ 0,:]
B = axis.Points[-1,:]
AB = B-A # VTKArray - Shape(3,)
AB = AB.reshape((3, 1))
# AP vector
AP = surf.Points-A # VTKCompositeDataArray - Shape(35248, 3)
return AP
And there you have the magnitude of the AP vector which increases as you get away from A
But then I need to perform dot and cross operations between the AB and AP vectors I the following code crashes:
# Get reference to the inputs
surf = inputs[0]
axis = inputs[1]
# Get axis vector
A = axis.Points[ 0,:]
B = axis.Points[-1,:]
AB = B-A # VTKArray - Shape(3,)
AB = AB.reshape((3, 1))
# AP vector
AP = surf.Points-A # VTKCompositeDataArray - Shape(35248, 3)
return cross(AB,AP)
Is it possible to get the cross and dot product of 2 vectors which belong to different filters in a simple way? I know how to do this using the regular calculators but I am trying to do this in a python calculator to simplify a bit my pipeline
Thank you in advance for your time!