POV-Ray : Documentation : 2.8.3.4 User defined Functions
  POV-Ray 3.6 Documentation Online View  
2.8.3.3 Colors   2.8.3.5 Strings

2.8.3.4 User defined Functions

User-Defined Functions
USER_FUNCTION:
FLOAT_USER_FUNCTION | VECTOR_USER_FUNCTION | COLOR_USER_FUNCTION
FLOAT_USER_FUNCTION:
function { FN_FLOAT } | function (IDENT_LIST) { FN_FLOAT } | function { pattern { PATTERN [PATTERN_MODIFIERS]} }
IDENT_LIST:
IDENT_ITEM [, IDENT_LIST]
The maximum number of parameter identifiers is 56. An identifier may not be repeated in the list.
IDENT_ITEM:
x | y | z | u | v | PARAM_IDENTIFIER
PATTERN:
MAP_PATTERN | brick [BRICK_ITEM] | checker | hexagon | object { LIST_OBJECT }
VECTOR_USER_FUNCTION:
function { SPECIAL_VECTOR_FUNCTION }
SPECIAL_VECTOR_FUNCTION:
TRANSFORM | SPLINE
COLOR_USER_FUNCTION:
function { PIGMENT }
Specify a float expression in a user-defined function:
FN_FLOAT
LOGIC_AND [OR LOGIC_AND]
OR:
|
LOGIC_AND:
REL_TERM [AND REL_TERM]
AND:
&
REL_TERM:
TERM [REL_OPERATOR TERM]
REL_OPERATOR:
< | <= | = | >= | > | !=
TERM:
FACTOR [SIGN FACTOR]
SIGN:
+ | -
FACTOR:
EXPRESSION [MULT EXPRESSION]
MULT:
* | /
EXPRESSION:
FLOAT_LITERAL | FLOAT_IDENTIFIER | FN_FLOAT_FUNCTION | FLOAT_BUILT_IN_IDENT | ( FN_FLOAT ) | IDENT_ITEM | SIGN EXPRESSION | VECTOR_FUNCTION_INVOCATION.FN_DOT_ITEM | COLOR_FUNCTION_INVOCATION.FN_DOT_ITEM | FLOAT_FUNCTION_INVOCATION
FN_DOT_ITEM:
DOT_ITEM | hf
FN_FLOAT_FUNCTION:
abs (FN_FLOAT) | acos (FN_FLOAT) | acosh (FN_FLOAT) | asin (FN_FLOAT) | asinh (FN_FLOAT) | atan (FN_FLOAT) | atanh (FN_FLOAT) | atan2 (FN_FLOAT,FN_FLOAT) | ceil (FN_FLOAT) | cos (FN_FLOAT) | cosh (FN_FLOAT) | degrees (FN_FLOAT) | exp (FN_FLOAT) | floor (FN_FLOAT) | int (FN_FLOAT) | ln (FN_FLOAT) | log (FN_FLOAT) | max (FN_FLOAT,FN_FLOAT[,FN_FLOAT]...) | min (FN_FLOAT,FN_FLOAT[,FN_FLOAT]...) | mod (FN_FLOAT,FN_FLOAT) | pow (FN_FLOAT,FN_FLOAT) | prod (IDENTIFIER, FN_FLOAT, FN_FLOAT, FN_FLOAT) | radians (FN_FLOAT) | sin (FN_FLOAT) | sinh (FN_FLOAT) | sqrt (FN_FLOAT) | sum (IDENTIFIER, FN_FLOAT, FN_FLOAT, FN_FLOAT) |tan (FN_FLOAT) | tanh (FN_FLOAT) | select (FN_FLOAT,FN_FLOAT,FN_FLOAT [,FN_FLOAT])
Create an identifier for a user-defined function:
USER_FUNCTION_DECLARATION:
#declare FLOAT_FUNCTION_IDENTIFIER = FLOAT_USER_FUNCTION |
#local FLOAT_FUNCTION_IDENTIFIER = FLOAT_USER_FUNCTION |
#declare VECTOR_FUNCTION_IDENTIFIER = VECTOR_USER_FUNCTION |
#local VECTOR_FUNCTION_IDENTIFIER = VECTOR_USER_FUNCTION |
#declare COLOR_FUNCTION_IDENTIFIER = COLOR_USER_FUNCTION |
#local COLOR_FUNCTION_IDENTIFIER = COLOR_USER_FUNCTION
Reference a user-defined function:
FLOAT_FUNCTION_INVOCATION:
FLOAT_FUNCTION_IDENTIFIER (FN_PARAM_LIST)
VECTOR_FUNCTION_INVOCATION:
VECTOR_FUNCTION_IDENTIFIER (FN_PARAM_LIST)
COLOR_FUNCTION_INVOCATION:
COLOR_FUNCTION_IDENTIFIER (FN_PARAM_LIST)
FN_PARAM_LIST:
FN_PARAM_ITEM [, FN_PARAM_LIST]
FN_PARAM_ITEM:
x | y | z | u | v | FLOAT

Quick Reference Contents

2.8.3.3 Colors   2.8.3.5 Strings


Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.