-
Notifications
You must be signed in to change notification settings - Fork 5
Add VTK.js rendering for engineering visualization files with example MCP server #86
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: garland3 <[email protected]>
Co-authored-by: garland3 <[email protected]>
Co-authored-by: garland3 <[email protected]>
Co-authored-by: garland3 <[email protected]>
|
@copilot add an example mcp that returns files renderable by vtk. move the generation script to this folder. So make a new /backend/mcp/vtk-example mcp server |
Co-authored-by: garland3 <[email protected]>
Created the vtk-example MCP server in
The generation script was moved to The server is configured in Commit: 1758ab4 |
…le type detection
…rmat and enhance surface representation
| @@ -0,0 +1,605 @@ | |||
| import { useEffect, useRef, useState } from 'react' | |||
| import { RotateCw, ZoomIn, ZoomOut, Maximize2, Scissors, Play, Pause } from 'lucide-react' | |||
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 9 days ago
The best way to fix the problem is to remove any unused imports from the import statement on line 2. This will clarify which icons are actually used in the component, improve readability, and may have a small positive impact on the final bundle size.
Specifically:
- Examine the code in
frontend/src/components/VtkViewer.jsxand determine which (if any) ofRotateCw,ZoomIn,ZoomOut,Maximize2,Scissors,Play, andPauseare actually used.- Remove each named import that is not referenced anywhere in the file.
- Retain only those icons actively used (for e.g. in JSX as
<ZoomIn />, etc.). - If none are used, remove the import statement entirely.
- Make this change only to the import statement (lines 2–2).
No other changes, imports, or definitions are needed, and no dependencies.
-
Copy modified line R3
| @@ -1,6 +1,6 @@ | ||
| import { useEffect, useRef, useState } from 'react' | ||
| import { RotateCw, ZoomIn, ZoomOut, Maximize2, Scissors, Play, Pause } from 'lucide-react' | ||
|
|
||
|
|
||
| // Import VTK.js modules | ||
| import '@kitware/vtk.js/Rendering/Profiles/Geometry' | ||
| import vtkFullScreenRenderWindow from '@kitware/vtk.js/Rendering/Misc/FullScreenRenderWindow' |
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| import sys |
Check notice
Code scanning / CodeQL
Unused import Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 9 days ago
To fix the unused import issue, you should simply remove the line importing the sys module from scripts/generate_vtk_samples.py. This line appears at line 129 and can be deleted. No other changes are needed, as there is no use of sys anywhere else in the provided code. Only line 129 should be deleted, and care should be taken not to alter or remove any other code.
| @@ -126,7 +126,6 @@ | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| import sys | ||
| import os | ||
|
|
||
| # Create test_data directory if it doesn't exist |
🔒 Security Scan ResultsSecurity Scan SummaryScan ResultsPython SAST (Bandit)Recommendations
|
Implements 3D visualization capability for engineering and scientific file formats using VTK.js in the canvas panel, including a built-in MCP server for generating sample 3D shapes.
Changes
Core Implementation
VtkViewercomponent handles 3D rendering for 11 formats: VTK legacy, VTK XML (VTP/VTU/VTI/VTS/VTR), STL, OBJ, PLY, GLTF/GLBCanvasPanelto route detected 3D files to VTK rendereruseFiles.jsrecognizes engineering formats by extensionRendering Pipeline
VTK Example MCP Server
backend/mcp/vtk-example/for generating 3D shapes on demandgenerate_3d_shape(single shapes) andgenerate_sample_files(all samples)config/defaults/mcp.jsonand available to all usersgenerate_samples.py)Example Integration
Example Usage
Documentation & Testing
Dependencies
Added
@kitware/[email protected](no vulnerabilities)Fixes add a engineering viz canvas rendering capability #85
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.