Skip to content

blocks/Icons: no record of how icons are made (see MVTB#121 for a no-LaTeX script) #709

Description

@petercorke

Note for later, prompted by a cleanup in the Machine Vision Toolbox (MVTB).

What I found in RTB

src/roboticstoolbox/blocks/Icons/ has 27 PNGs plus 250x250/ and 50x50/ subfolders, but no script and no README explaining how the icons are made, and blocks/README.md doesn't mention icons. I found no reference to bdtex2icon or an icons.sh anywhere in the repo. Several names (coriolis.png, fdyn.png, fdynx.png, ...) match icons in bdsim, which are made with bdtex2icon from LaTeX, so these were probably made the same way, but I haven't verified that.

What MVTB did

MVTB had the same gap: its icons came from an untracked icons.sh that needs bdsim, a LaTeX installation and the unpublished rvc-notation macros. The open PR petercorke/machinevision-toolbox-python#121 adds, in MVTB's blocks/Icons/:

  • make_icons.py: renders TeX math to a 250x250 black-on-transparent RGBA PNG using matplotlib mathtext (Computer Modern), so no LaTeX and no extra dependency;
  • a short README.md describing the icon convention (shared with bdsim's Icons folder);
  • a test for the script.

Findings from the prototype, including how many of bdsim's own icon expressions render and one gotcha (math_to_image output has an opaque white background), are in petercorke/bdsim#109.

Possible follow-up for RTB

  1. Add a blocks/Icons/README.md recording the convention and how each icon was made (even if just "bdtex2icon, see bdsim").
  2. If the LaTeX sources for the icons are still known, record them (an icons.sh, or a table like MVTB's ICONS) so they can be regenerated.
  3. Note for whoever tries it: in bdsim's list, the expressions that did not render under mathtext used the custom macros \dvec, \ddvec and \sbullet and array matrices; icons like coriolis and fdyn use \dvec/\ddvec, so those would need the macro definitions from rvc-notation. I haven't tried RTB's actual expressions.

Not urgent.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions