Thank you for sharing this information.
As for how to set the x-axis to arc length, it would be easy to implement this by creating your own polyline using the Programmable filter.
The following is the description of the Programmable filter in Script. Here, you need to specify vtkPolyData as Output Data Set Type of the programmable filter.
import numpy as np
input = self.GetInputDataObject(0,0)
locator = vtk.vtkCellLocator()
locator.SetDataSet(input)
locator.BuildLocator()
# Setting Constants
tol = 1e-1
z = 0.5
start_phi = 0
end_phi = 2*np.pi
num_pts = 1000
theta = np.arcsin(z)
phi = np.linspace(start_phi, end_phi, num_pts, dtype=float)
# Calculate the point coordinates of a polyline
x = np.cos(theta)*np.cos(phi)
y = np.cos(theta)*np.sin(phi)
z = np.full(num_pts, z)
# Orthogonal projection of polyline points onto the analytical model
pts = vtk.vtkPoints()
cell_id = vtk.reference(0)
closest = [0.0]*3
sub_id = vtk.reference(0)
dist = vtk.reference(0.0)
for i in range(num_pts):
locator.FindClosestPoint([x[i],y[i],z[i]], closest, cell_id, sub_id, dist)
pts.InsertNextPoint(closest)
# Recreate a polyline based on orthogonal projection points
poly_line = vtk.vtkPolyData()
poly_line.SetPoints(pts)
pt_ids = vtk.vtkIdList()
pt_ids.SetNumberOfIds(num_pts)
for i in range(num_pts):
pt_ids.SetId(i, i)
poly_line.Allocate(1)
poly_line.InsertNextCell(vtk.VTK_POLY_LINE, pt_ids)
# Interpolate the calculation results on the polyline
probe = vtk.vtkProbeFilter()
probe.SetInputData(poly_line)
probe.SetSourceData(input)
probe.SetTolerance(tol)
probe.ComputeToleranceOff()
probe.Update()
output.DeepCopy(probe.GetOutput())
output.PointData.append(phi, 'radians')
The following is the State file.
xaxis_arc.pvsm (441.1 KB)