Optimizing 2D Vector CAD Spline and Polyline Rendering on Microcontrollers with LVGL Canvas

In industrial HMI terminals and embedded measurement instruments (e.g. ESP32-S3, STM32F4/F7), there is frequently a need to visualize 2D CAD cross-sections, toolpaths, or sheet metal profiles on color touch displays.

Hi @CADGuide_Tools,

While researching the LVGL documentation, I found references that could help optimize polylines and splines. I’m not sure if anyone has had the chance to create a dedicated API (for example, lv_polyline_create or lv_spline_create) that would be a great idea…

In any case, here is a strategy you could try:

  1. Use the vector graphics API.

  2. Select the appropriate path.

  3. Reuse and clear your paths.

  4. Minimize invalidated areas (this is invaluable).

  5. Enable hardware acceleration (wherever available).

More details: Draw Descriptors | LVGL Open