Page MenuHome

Fix: T75083 Documentation for math nodes
ClosedPublic

Authored by Alaska (Alaska) on Apr 7 2020, 1:51 PM.

Details

Summary

Here's a rough mock up of the documentation for math nodes I constructed.

I don't know how some operators work (Arctan2, Fraction, Sign, Smooth Minimum, Smooth Maximum).
I'm also unsure if my wording is that clear.
I would also like feedback on whether or not we should have all the value times listed at the top of the page.

Diff Detail

Repository
rBM Blender Manual

Event Timeline

Alaska (Alaska) edited the summary of this revision. (Show Details)Apr 7 2020, 1:54 PM
Alaska (Alaska) edited the summary of this revision. (Show Details)

@Alaska (Alaska) thanks for starting this. I've added the image below from the original patch which may be useful too.

Wrap: this was taken from Godot, here is a link that may be useful. It is similar to modulo but works for negative numbers too.
see: https://docs.godotengine.org/en/3.1/classes/class_@gdscript.html#class-gdscript-method-wrapf

Pingpong: this was based on the Unity function: see https://docs.unity3d.com/ScriptReference/Mathf.PingPong.html

@Aaron Carlisle (Blendify)

The math functions are used in compositor, shading and texture nodes too. I guess the same content can be reused for each of these areas.

These documents are shared between the different nodes, so these changes would automatically be copied:

.. DO NOT EDIT FILE. This is simply a stub which copies everything from the link below.
.. include:: /compositing/types/converter/math.rst
   :start-after: .. --- copy below this line ---

For arctan2 see https://en.wikipedia.org/wiki/Atan2

@Charlie Jolly (charlie) can you provide insight on Fraction, Sign, Smooth Minimum, Smooth Maximum).

@Charlie Jolly (charlie)

Wrap: this was taken from Godot, here is a link that may be useful. It is similar to modulo but works for negative numbers too.

From my testing Modulo works for negative numbers, so I won't make changes to the docs yet.
Thanks for sharing the link on Wrap, sadly I'm unable to come up with a better solution on how to re-word that part. If you have any suggestions, please share them.

As for the image, it's useful, but I feel there's a disconnect the values used (a, b) and the documentation as we refer to everything as "value". Or should we go with the assumption that the user reading the manual is well versed enough to make the connection?

Pingpong: this was based on the Unity function: see https://docs.unity3d.com/ScriptReference/Mathf.PingPong.html

Once again, thank you for sharing a link explaining what this does. Playing around with Pingpong some more and reading the unity documentation proves that I was originally wrong in my definition.

@Aaron Carlisle (Blendify)

For arctan2 see https://en.wikipedia.org/wiki/Atan2

Thank you for sharing this.

@Charlie Jolly (charlie) @Aaron Carlisle (Blendify)
I'll be updating the changes I've made in the next few minutes.

Another question. In the beginning of the documentation, I refer to the input values as "the value" where later on I use "the input value". Should I make this more consistent? Or do you believe the use of these different terms help out with understanding what is written?

Examples:

Add
The sum of the two values.
Minimum
The output is the smallest input value.

Changed 0 to 0.0 in ping-pong

Another question. In the beginning of the documentation, I refer to the input values as "the value" where later on I use "the input value". Should I make this more consistent? Or do you believe the use of these different terms help out with understanding what is written?

I do not think it makes much difference.

Updated the definition of "Sign".

Alaska (Alaska) added a comment.EditedApr 8 2020, 5:14 AM

Some of the images on this page are outdated. I will be updating them in a separate project. T75511

Small spelling error here, interger -> integer:

Wrap

The output is a value between *Min* and *Max* based on the absolute difference between the input value and the nearest interger multiple of *Max* less than the value.

Another one here, ouput -> output:

Sign

Extracts the sign of the input value. All positive numbers will output 1.0. All negative numbers will ouput -1.0. And 0.0 will output 0.0.

Round

Round the input value to the nearest integer.

Good to add "Round upward if the fraction part is 0.5", like in the tooltip.

Ping-pong
   The output value is moved between 0.0 and the *Scale* based on the input value.

This needs to be explained a bit better (I am not sure how though myself).

Corrects spelling mistakes.

Alaska (Alaska) added a comment.EditedApr 8 2020, 11:52 AM

@Wouter Stomp (wouterstomp) I've fixed the spelling mistakes you've pointed out. As for pingpong, the explanation might be clearer if we include the image from @Charlie Jolly (charlie): F7825634

I've also left rounding as is. From my understanding rounding up at 0.5 is common practice in mathematics. Will wait to hear from @Charlie Jolly (charlie) and @Aaron Carlisle (Blendify) before making that change. I'm not an official developer or manual manager, just decided to pick up this project to help everyone out.

Sorry I didn't notice earlier, but there are three more instances of "interger" instead of "integer", under floor, ceil and snap.

Fix more spelling mistakes.

Alaska (Alaska) added a comment.EditedApr 8 2020, 11:58 AM

@Wouter Stomp (wouterstomp) Fixed them. Just found out the tool I'm using to edit these has a spell checker. It just doesn't tell me when there's a spelling mistake.

This revision is now accepted and ready to land.Apr 13 2020, 9:20 PM