-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Distance to Wall for 2D meshes #29
Comments
Possibly also see this ParaView forum post for a Programmable Filter that may do the same thing. See some little progress in |
pyvista has compute_implicit_distance, which may work similarly to the above PV forum post. Though that assumes that it's more flexible than the pyvista documentation specifies (which currently says the PolyData input is a surface). Confirmed that |
Detailed description on |
Note that |
When @prestonTee tried to use the
This points back to this line. In order for it to calculate the signed distance, it needs to know cell normals. But to get cell normals, it needs an actual 3D cell (since VTK is implicitly always 3D). In fact, it actually filters out the vertices and edges of the input mesh (see here). Thus it can't be used with what we're trying to do. Instead, something like: d2wall = np.zeros(grid.npoints)
d2wallpnt = np.zeros(grid.npoints)
for i in range(wall.npoints):
d2wallpnt = np.linalg.norm(grid.points - wall.points[i,:], axis=1)
d2wall = np.min(d2wall, d2wallpnt, axis=1) should work fine, if being a bit more memory intensive. |
Add function to compute distance from "wall" to every point in the "grid". vtkDistancePolyDataFilter
See C++ tutorial on vtkExamples website
The text was updated successfully, but these errors were encountered: