Displaying content from .vtk file in cookiecutter template projec #514
-
Hi! I'm using the cookiecutter template to generate a POC. My goal is to render the contents of a mesh in a .vtk file that I read from a temp directory after converting it from a .msh file. The code looks like this:
where
which follows the style from the Trame tutorial. However, I cannot make the server render the contents. The template originally uses this construct to pass in the geometry to the view, but I cannot fathom how to interact with the class model for the use case at hand.
Any hints would be greatly appreciated! Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Need to replace with vtk.VtkView() as vtk_view: # vtk.js view for local rendering
self.ctrl.reset_camera = vtk_view.reset_camera # Bind method to controller
with vtk.VtkGeometryRepresentation(): # Add representation to vtk.js view
vtk.VtkAlgorithm( # Add ConeSource to representation
vtk_class="vtkConeSource", # Set attribute value with no JS eval
state=("{ resolution }",) # Set attribute value with JS eval
) by with vtk.VtkRemoteView(renderWindow) as vtk_view:
self.ctrl.update = vtk_view.update
self.ctrl.reset_camera = vtk_view.reset_camera Look at that example for reference. |
Beta Was this translation helpful? Give feedback.
-
That was embarrassingly simple 😬 Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Need to replace
by