SzPreview3D
SzPreview3D is a self-contained VS Code extension for interactive finite-element
and scientific-mesh previews. Opening a supported file uses the 3D preview as
the default editor.
- VTK XML UnstructuredGrid (
.vtu): ASCII, inline binary, appended raw/base64,
and zlib-compressed arrays
- Legacy VTK (
.vtk): ASCII and classic big-endian binary unstructured grids;
polygonal surface data is also accepted
- Abaqus (
.inp): common 2D and 3D element families, including linear and
higher-order tetrahedra, hexahedra, wedges, pyramids, triangles, and quads
- XDMF (
.xdmf, .xmf): uniform unstructured grids with inline XML, external
binary, or HDF5 heavy data
The extension is TypeScript/JavaScript only. HDF5 support is bundled through
h5wasm; Python, ParaView, and a native VTK installation are not required.
Viewer features
- Automatic exterior-face extraction for volume cells
- Triangle and quadrilateral boundary rendering
- Point- and cell-associated scalar/vector/tensor fields
- Vector magnitude or individual-component coloring
- Viridis, cool-to-warm, and grayscale maps
- Surface, surface-with-edges, wireframe, and point representations
- Scalar thresholding of visible boundary faces
- Interactive X/Y/Z clipping plane
- Opacity, line/point size, camera reset, and mesh statistics
- Abaqus node and element sets exposed as 0/1 fields
For XDMF temporal or spatial collections, version 0.1 displays the first
supported uniform grid and reports that choice in the viewer.
Development
Requirements: Node.js 22+ and npm 10+.
npm install
npm run check
npm test
Press F5 in VS Code to launch an Extension Development Host. Open a .vtu,
.vtk, .inp, .xdmf, or .xmf file; SzPreview3D is registered with default
priority. Use Reopen Editor With… if another installed extension already
owns that file type.
Create an installable VSIX with:
npm run package
- Boundary extraction keeps a face only when it belongs to exactly one
supported volume element. Explicit triangle and quad surface elements are
preserved.
- Higher-order elements currently render their corner-node geometry; midside
nodes remain available to point fields but are not curved.
- XDMF
HyperSlab and Function DataItems, arbitrary polyhedra, and
multiblock composition are not yet supported.
- Very large meshes can be limited with
szPreview3d.maxMessageSizeMB.