leakec / sihm

Standalone Interactive HTML Movie (SIHM): A highly-portable, interactive way to visualize your simulations.
https://leakec.github.io/sihm/
MIT License
1 stars 0 forks source link

Make YAML organization more succinct #10

Closed leakec closed 1 year ago

leakec commented 1 year ago

We are currently using FUNCTION and ARGS to explicitly say we are using a function and here are the arguments. However, as long as we are not using a FILE, it is implied that what we are using is a function. Hence, rather than having:

GEOMETRY:
  FUNCTION: my_func
    ARGS:
      - arg_1
      - arg_2

We could have

GEOMETRY: my_func
    - arg_1
    - arg_2

File specifications would look like this

GEOMETRY: FILE
    - my_file

where FILE is used as a sentinel value to denote a file rather than a function.

leakec commented 1 year ago

Actually, this may not be a good idea. For example, this would not work for specifying lights because they also have a POSITION parameter, e.g.:

LIGHTS:
    l1:
        FUNCTION: HemisphereLight
        ARGS:
            - 0xffffff
            - 0x444444
        POSITION:
            - 0
            - 20
            - 0

We need to separate out FUNCTION into its own section because it needs to be differentiated from POSITION. Although we don't have an analog for GEOMETRY at the moment, it is possible we will have one in the future. Therefore, I think it is a bad idea to implement this, at least for now.