Skip to content
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

Mesh not correctly plotted #66

Open
keurfonluu opened this issue Mar 7, 2022 · 4 comments
Open

Mesh not correctly plotted #66

keurfonluu opened this issue Mar 7, 2022 · 4 comments

Comments

@keurfonluu
Copy link

Description

Attached mesh is not correctly plotted with Dash VTK. No issue with ParaView or PyVista.
No problem with simpler meshes with Dash VTK.

mesh.zip

Steps/Code to Reproduce

import dash
import dash_vtk
from dash_vtk.utils import to_mesh_state
import pyvista

mesh = pyvista.read("mesh.dat")
mesh_state = to_mesh_state(mesh)

app = dash.Dash(__name__)
app.layout = dash.html.Div(
    dash_vtk.View(
        dash_vtk.GeometryRepresentation(
            dash_vtk.Mesh(state=mesh_state),
            property={"edgeVisibility": True},
        ),
        cameraPosition=[1005.0, -5000.0, -1500.0],
        cameraViewUp=[0.0, 0.0, 1.0],
    ),
    style={"width": "600px", "height": "600px"},
)

if __name__ == "__main__":
    app.run_server(debug=True)

Expected Results

expected

Actual Results

output

Versions

dash == 2.0.0
dash_vtk == 0.0.9

@jourdain
Copy link
Collaborator

jourdain commented Mar 8, 2022

Interesting, it seems that a decimation is happening. I'm wondering if the index encoding for cell connectivity is done on a too small uintXX. I guess I will need to investigate and look at you data. Thanks for sharing...

@jourdain
Copy link
Collaborator

I was able to reproduce it and made some test cases for trame. It will require some additional investigation.

So far the server is encoding connectivity using uint16 which might be the issue.

@jourdain
Copy link
Collaborator

The issue is actually related to vtkGeometryFilter vs vtkDataSetSurfaceFilter.

If you preprocess your dataset with vtkDataSetSurfaceFilter that will solve your issue. That also mean, that the vtkGeometryFilter[1, 2, 3] should be replaced by vtkDataSetSurfaceFilter inside the dash-vtk code.

@jourdain
Copy link
Collaborator

Did a PR for VTK itself. Thanks for reporting such issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants