Deborah R. Fowler

Wrangle Node Example - User Defined Functions

Posted July 7 2018 Updated Sept 25 2020 qmultiply Updated April 3 2025 example file orient/N/up Updated April 20 2026 light/dark

Along with many built-in functions, user defined functions can be created in vex. Here is an example using the phyllotactic pattern:

vex function phyllotactic pattern

Looking closer at the code, it is similar to the previous phyllotactic pattern example, except now the code is encased in a user-defined function.

vex function phyllotactic pattern code

Going a bit further and adding elements with orientation using the orient attribute.

vex function orient attribute

vex function phyllotactic example 3 vex function phyllotactic example 4

You can also combine quaternions with qmultiply. See below:

qmultiply example

A comparison of N/up attributes vs orient (I think orient is easier to use but someone asked so...) — sample hip file

comparison of orient N up attributes