A lightweight VS Code extension for visualizing finite element meshes, contact surface pairs, and material assignments.
- Mesh Visualization: View VTK, STL, and OBJ mesh files directly in VS Code
- Material Assignment Viewing: Visualize material properties assigned to mesh elements
- Contact Surface Pairs: Identify and highlight contact surfaces in FEA meshes
- Multiple Format Support:
.vtp,.vtu,.vti,.stl,.objfiles
- VTK PolyData (
.vtp) - Surface meshes - VTK UnstructuredGrid (
.vtu) - Finite element meshes - VTK ImageData (
.vti) - Structured grids - STL (
.stl) - Stereolithography files - Wavefront OBJ (
.obj) - Object files
- Node.js (v18 or higher)
- npm (v9 or higher)
- VS Code (v1.85.0 or higher)
-
Clone the repository:
git clone <repository-url> cd prepro-light
-
Install dependencies:
npm install
-
Build the extension:
npm run compile
- Open the project in VS Code
- Press
F5to launch the Extension Development Host - In the new VS Code window, open a mesh file (
.vtp,.vtu,.vti,.stl, or.obj) - The mesh viewer will open automatically
- Build:
npm run compile- Compile TypeScript to JavaScript - Watch:
npm run watch- Watch for changes and recompile automatically - Lint:
npm run lint- Run ESLint on source files - Package:
npm run build- Build for production
To create a distributable .vsix package for installation:
-
Install the
vscepackaging tool (if not already installed):npm install -g @vscode/vsce
-
Build the
.vsixpackage:vsce package
This will create a file like
prepro-light-0.1.0.vsixin the project root. -
Install the
.vsixpackage:Via command line:
code --install-extension prepro-light-0.1.0.vsix
Via VS Code UI:
- Open the Extensions view (Ctrl+Shift+X / Cmd+Shift+X)
- Click the "..." menu at the top
- Select "Install from VSIX..."
- Choose your
.vsixfile
- Set breakpoints in the source code
- Press
F5to start debugging - The debugger will attach to the Extension Development Host
- Open a mesh file to trigger the extension
prepro-light/
├── src/ # Extension source code
│ ├── extension.ts # Main extension entry point
│ ├── meshEditorProvider.ts # Custom editor provider
│ ├── parsers/ # File format parsers
│ ├── utils/ # Utility functions
│ └── types/ # TypeScript type definitions
├── webview/ # Webview source code
│ ├── main.ts # Webview entry point
│ ├── ui/ # UI components
│ ├── styles/ # CSS styles
│ └── utils/ # Webview utilities
├── media/ # Icons and media assets
├── samples/ # Sample mesh files for testing
├── test/ # Test files
├── .vscode/ # VS Code configuration
├── dist/ # Compiled output (generated)
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
└── webpack.config.js # Webpack configuration
- Language: TypeScript
- Visualization: VTK.js (@kitware/vtk.js)
- Framework: VS Code Extension API
- Build Tool: Webpack
- Testing: VS Code Extension Test Runner
See PLAN.md for detailed implementation phases and task breakdown.
Current Status: Phase 1 Complete - Project setup and foundation
This is an internal development project. Please refer to the development plan for feature priorities and upcoming work.
Private - Internal Use Only
Current Version: 0.1.0 (Phase 1 - Foundation)