-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distance along poly line/Spline #252
Comments
Perhaps we could just use the |
spline = pv.Spline(points, 1000)
dense_spline = pv.Spline(points, 10000)
inc_dist = (np.diff(dense_spline.points, axis=0)**2).sum(1)
dist = np.cumsum(inc_dist)
spline['distance'] = dist[::10]
# tube = spline.tube(radius=0.1)
tube = spline.tube(radius=0.1)
tube.plot(scalars='distance', smooth_shading=True) |
I just found out the poly lines/splines are actually linearly segmented. Which means any distance computed along the line would be a sum of Euclidean distances between points along the line. This is pretty easy to implement so I'll just do a cumulative summation of the distances between the nodes |
Actually, the filter |
@banesullivan maybe just an addition to this issue: Is there a way to retrieve the XYZ position of a point along this line given a distance? The point is most like not located on a vertex/note but rather located along a linear segment. I am particularly interested in that since we can display wells/boreholes including their deviation in PyVista (see image). We then know the stratigraphic boundaries in a given measured depth (along the spline) and would like to get the TVD (true vertical depth) of the point for subsequent structural modeling for instance in GemPy. So that you can combine the representations of the GemPy/Pyvista meshes with the boreholes. I am also happy to open a new issue or discussion on that :) |
Could we add a way to compute the distance along every node/point in a poly line when creating them via
pyvista.Spline
? pinging @akaszynskiNote that I added this for straight lines from
pyvista.Line
in #250:pyvista/pyvista/geometric_objects.py
Lines 262 to 267 in 4017286
However this only works for computing distances along straight lines. How would we go about computing the distances of points along a ploy line? And once we figure this out, let's add a
'Distance'
array to thepyvista.Spline
output by default.The text was updated successfully, but these errors were encountered: