Viewer scenes
Showing a model is kept apart from what draws it. The core turns a model and its results into a scene, plain geometry with no knowledge of xfea’s classes, and a viewer plugin draws the scene.
The pipeline
Section titled “The pipeline”flowchart LR A[Model] --> B[Scene builder] G[Results database] --> B F[Viewer settings] --> B B --> C[Scene] C --> D[Viewer plugin] D --> E[What you see]
- The scene is a container of meshes, lines, points, labels and legends (
xfea.viewers.Scene,MeshObject,LineObject,PointCloud,TextLabel,Legend). - The scene context (
SceneContext) is what a plugin is given to build from: the model, the result fields to show, and the settings. - The viewer plugin builds the scene and renders it.
xfea.viewers.Vieweris the front of whichever plugin is named.
Because the scene is neutral, the same model can be shown in a browser or in a desktop application, and a new viewer needs to know nothing about solvers.
The viewers that ship with xfea
Section titled “The viewers that ship with xfea”browser: a page served from your machine and opened in your browser.paraview: VTU files opened in ParaView’s desktop app.
Viewers shows how to use them, and Plugins the contract a new one follows.
© 2026 Francesco Ranaudo · Text and pictures CC BY 4.0 · Code Elastic License 2.0 · how to reuse them