"I have no geometric imagination..."
I often feel this way, especially when facing complex geometry problems or writing code that deals with shapes and spaces.
Picturing complex 3D shapes in the mind is not easy, at least for me. This is a significant challenge, and it is the reason visualization is so useful.
Visualizing geometry is a key to solving such problems.
Being able to see the geometry under construction makes a substantial difference. General debugging tools such as
print are of limited help here, because they provide numbers and text but do not show the geometry that needs to be observed.
vscode-debug-visualizer is an extension for Visual Studio Code that significantly enhances the debugging experience by visualizing data structures or geometry during a
debugging session.
Unlike traditional debugging tools that rely on textual or numerical output, this visualizer transforms data into intuitive and interactive visual representations.
Visualizing geometries in debugging session
The
hediet.debug-visualizer extension must first be installed in Visual Studio Code.
The vscode-debug-visualizer module must also be installed, which can be done with pip as follows:
pip install vscodedebugvisualizer
After installing this
extension, the command
Debug Visualizer: New View opens a new visualizer view.
In this view, an expression can be entered that is evaluated and visualized while stepping through the application.
This view works the same as the watch view of VS Code, except that the resulting value is presented visually rather than textually, and only one expression can be watched at a time (although multiple windows can still be opened).
Visualizing geometries in each debugging session
In the demo above, I used the
Plotter to convert geometries into a JSON string object for visualizing 3D geometry, processed through
shapely and
trimesh.
The Plotter can be installed by cloning the repository.
git clone https://github.com/PARKCHEOLHEE-lab/debugvisualizer.git