Skip to content

Global utility functions (or alternatively ability to import other scripts) #210

Description

@TheAssassin

Many laser scripts used by the various labs or in VisiCut's examples contain similar if not the same code all over again. For instance, drawing figures or characters inspired by a seven segment display (which I find relatively limited and will soon extend to a 14 or 16 segment one), a simple but useful focus gauge to include in other scripts, etc.

I would like to be able to define those functions once and then import the functionality into other scripts, either from a global utility script exposing functions into the global namespace or by explicitly importing script files (the latter allowing users to maintain their own scripts while also allowing them to import a global one).

There are so many advantages of such a scenario: not only will the copy-pasta between scripts end which often causes inconsistencies. When going for the import feature, one could recycle functionality from a script in another one or add different "frontends", e.g., one asking prompts, the other one using some quick defaults.

What do you think?

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