DEV Community

Cover image for CAD STL/OBJ mesh viewer with Python/tkinter GUI
Precise Simulation
Precise Simulation

Posted on • Edited on • Originally published at Medium

CAD STL/OBJ mesh viewer with Python/tkinter GUI

Mesh Viewer is an experimental and simple open source STL/OBJ CAD geometry and surface mesh viewer prototype, built with a Model View Controller (MVC) type design. It was made to explore how the next generation physics simulation GUIs & APIs can be built for the FEATool Multiphysics toolbox. The concept has also been applied to building a prototype of scientific Python App framework for a simple 3D CAD (OpenCASCADE) application.

Scientific Application Framework for Python

In the project three different visualization backends are compared and embedded within the same Python Tkinter GUI framework. Although often ignored in favor of more complex Qt or web UIs, Tkinter comes with Python and is quite suitable for rapidly building simple apps. The three 3D graphics backends are the following

Mesh Viewer screenshot

After comparing the three versions, the vispy/OpenGL backend seems to be the best choice overall with respect to performance and packaged size (~35 MB), while plotly (subjectively) looks the best but leads to large binaries due to embedding the entire Chromium web browser framework which (~70–90 MB), matplotlib is the simplest backend but suffers from slow performance for larger 3D visualizations.


The project source code is available from the Precise Simulation GitHub repository https://github.com/precise-simulation/mesh-viewer, and pre-built Windows binaries can be downloaded from the project releases https://github.com/precise-simulation/mesh-viewer/releases

Top comments (0)