Port libvgcode/improved G-code viewer from PrusaSlicer 2.8.0 #2191

Closed
opened 2026-04-06 01:23:41 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @as-com on 9/15/2025

Description

Fixes #6813
Fixes #7782
Fixes #6367

This is a port of libvgcode, OpenGL Core Profile (libvgcode requires OpenGL 3.2+), and probably other stuff I forgot from PrusaSlicer. libvgcode is also known as "Improved G-code Viewer" which was introduced in PrusaSlicer 2.8.0. It significantly improves performance of the G-code preview and allows displaying the actual speed and volumetric flow rate.

TODO

  • Make the sliders work properly again
  • Make view type selection work
  • Fix toggling of feature type visibility
  • Expose actual speed/actual flow view types
  • Fix display of G2/G3 arcs
  • Wire up actual speed graph widgets
  • Fix painter gizmos
  • Fix crash when selecting filament view type on Windows
  • Figure out display color management (#10827)
  • Fix incorrect rendering of small area flow compensation (or any extrusions with varying flow)
  • Localization
  • Testing
  • Code cleanup, performance optimization

Removed functionality

Some functionality is not supported by libvgcode:

  • Toggling visibility of tools
  • Toggling visibility of colors in color print view
  • Support for systems with OpenGL <3.2
  • Bambu's implementation of G2/G3 arcs was replaced with PrusaSlicer's implementation

Screenshots/Recordings/Graphs

https://github.com/user-attachments/assets/c1413a82-3058-4541-b96c-3d5f7cdef174

Outdated Stuff

https://github.com/user-attachments/assets/ca172ef4-0828-4d21-8768-b08a4132c9ab

image

Tests

  • Normally sliced G-code
  • G-code viewer mode
  • Arc fitting enabled
  • Spiral Z-hops
  • Multi-extruder/multi-color
  • Vase mode
  • Skirt/brim
  • Supports
  • Support transition (whatever this is)
  • Painter gizmos
  • Measurement gizmo
  • Move/rotate/scale gizmos
  • H2D/H2S support (oh no)
  • Windows
  • macOS
  • Linux
*Originally created by @as-com on 9/15/2025* # Description Fixes #6813 Fixes #7782 Fixes #6367 This is a port of libvgcode, OpenGL Core Profile (libvgcode requires OpenGL 3.2+), and probably other stuff I forgot from PrusaSlicer. libvgcode is also known as "Improved G-code Viewer" which was introduced in [PrusaSlicer 2.8.0](https://github.com/prusa3d/PrusaSlicer/releases/tag/version_2.8.0-alpha5). It significantly improves performance of the G-code preview and allows displaying the actual speed and volumetric flow rate. ## TODO - [x] Make the sliders work properly again - [x] Make view type selection work - [x] Fix toggling of feature type visibility - [x] Expose actual speed/actual flow view types - [x] Fix display of G2/G3 arcs - [x] Wire up actual speed graph widgets - [x] Fix painter gizmos - [x] Fix crash when selecting filament view type on Windows - [ ] Figure out display color management (#10827) - [x] Fix incorrect rendering of small area flow compensation (or any extrusions with varying flow) - [ ] Localization - [ ] Testing - [ ] Code cleanup, performance optimization ## Removed functionality Some functionality is not supported by libvgcode: - Toggling visibility of tools - Toggling visibility of colors in color print view - Support for systems with OpenGL <3.2 - Bambu's implementation of G2/G3 arcs was replaced with PrusaSlicer's implementation # Screenshots/Recordings/Graphs https://github.com/user-attachments/assets/c1413a82-3058-4541-b96c-3d5f7cdef174 <details> <summary>Outdated Stuff</summary> https://github.com/user-attachments/assets/ca172ef4-0828-4d21-8768-b08a4132c9ab <img width="1611" height="1145" alt="image" src="https://github.com/user-attachments/assets/5e0d04ff-8046-4636-a08a-cdedc60303bc" /> </details> ## Tests - [x] Normally sliced G-code - [ ] G-code viewer mode - [x] Arc fitting enabled - [x] Spiral Z-hops - [x] Multi-extruder/multi-color - [x] Vase mode - [x] Skirt/brim - [x] Supports - [ ] Support transition (whatever this is) - [x] Painter gizmos - [x] Measurement gizmo - [x] Move/rotate/scale gizmos - [x] H2D/H2S support (oh no) - [ ] Windows - [x] macOS - [ ] Linux
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#2191