virtualritz / nsi-docs

Documentation for Illumination Research’s Nodal Scene Interface, ɴsɪ.
https://nsi.readthedocs.io/
1 stars 0 forks source link

Decide on use of singular or plural for token naming #2

Open virtualritz opened 4 years ago

virtualritz commented 4 years ago

At the moment token naming is all over the place for grammatical number.

Some examples:

faceset node has faces (plural instead of face). What's more, this specifies an index. So it should be face.indices or face.index.

curves and particles have width (singular instead of widths). Built-in attributes like P and N are also singular (vs Ps and Ns). nvertices is plural, etc. particles also have id (singular vs ids).

mesh node has subdivision.creasevertices and subdivision.cornervertices (both plural) but subdivision.cornersharpness and subdivision.creasesharpness (singular instead of subdivision.cornersharpnessess and subdivision.creasesharpnessess).

Shouldn't these be subdivision.creasevertex.indices etc.? Or, neat and short: subdivision.crease.index, for DRY, singular.

Indexing attributes are called X.indices (plural vs X.index). A book has one index which contains references to many pages. Just as an index array for P contains one index with references to many vertices. So the name indices is dubious here at best but that seems to be a common issue in use if this term in CS.

More examples of plural use: attributes node has bounds (plural vs. bound or boundary). instances node has all attributes plural. camera node uses screens (plural vs. screen).

More examples of plural & singular on same node: outputdriver & outputlayer nodes have lightset (singular vs. lightsets) but outputdrivers (plural vs. outputdriver).

It seems that any attribute referenced by a shader later is kept singular. Maybe just a coincidence?

If there is a rationale (e.g. to increase readability of the shader), why not make all attributes singular? As a neat side effect it will also shorten some tokens.

aghiles commented 4 years ago

Agreed that we need some order in there.

aghiles commented 4 years ago

We use "s" sometimes to signifiy that you can have many connnection, this is the case for "screens" on the camera node. But yeah, all over the place.