drawnowvid

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 5.1, Creation date: 2021-12-06, Last change: 2025-08-19

this fnct is an auxilary fnct to automate the creation of videos

Description

If animations are created typically the drawnow function is used to update the screen. If later there is an idea to create videos from those function, it is possible to change the function by inserting Videoquickwritegcf or more easy to replace the drawnow function by drawnowvid. If there is no valid video writer, the functions is just drawnow; in case that there is an open Vieowrite by Videoquickstart, a snapshot is writen into the video.

if Videoquickwritegcf fails within this function, global Videoquick_vw is set to []

See Also: Videoquickwritetextpage , Videoquickstart , Videoquickcloseandopen , Videoquickwritegcf

Example Illustration

 missing image of drawnowvid()

Syntax

drawnowvid([])




Copyright 2021-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, drawnowvid, is designed to facilitate the creation of videos from animations in MATLAB. It is part of the SolidGeometry library and was developed by Tim Lueth. The function primarily serves as a replacement for the standard drawnow function, with added functionality for video creation.

Input Parameters

Global Variables

Function Workflow

  1. The function begins by extracting the first parameter from varargin using getfuncparams.
  2. It checks if the global variable Videoquick_vw is a valid VideoWriter object.
  3. If Videoquick_vw is valid, the function attempts to write frames to the video:
  4. If any error occurs during video writing, Videoquick_vw is set to an empty array, indicating that video writing is no longer active.
  5. If Videoquick_vw is not valid, the function simply calls drawnow to update the screen without video output.

Additional Notes

The function includes a check for isSGfigureStop, which is not detailed in the provided code. This likely serves as a condition to halt execution for debugging purposes.

The function also contains commented-out lines for setting font size and pausing execution, which are not active in the current implementation.

Algorithm explaination created using ChatGPT on 2025-08-19 07:19. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21