generating a sierpinski fractal with python for maya, renderman, and arnold To generate this fractal, methods were written to find the midpoint between two given points, pick one random point in a list, generate a tetrahedron, then interpolate between a seed point and a vertex and a new points until the iteration is complete. I then added a sort method for the vertices based on their y-value and moved the x-positions along a sine curve.
This project was a fun exercise on trying to understand more of the intricacies of python. I still need to research more pythonic methods to understand them better, such as the lambda temporary function that I employ a couple times but do not fully understand.
challenges functions
I wrote this function for creating a perfect tetrahedron based on a given center and side length. It is based on the amplitude of an equilateral triangle which is equal to (length*sqrt(3))/2 Passing the sierpinski vertices through this function sorts the vertices by y-value and then moves the point along x based on a sine curve (in my animated version it accepts a user defined frequency and amplitude). Passing the sierpinski vertices through this function sorts the vertices by y-value and then moves the point along x based on a sine curve (in my animated version it accepts a user defined frequency and amplitude).
full scripts utilizing these functions in the generation of the sierpinski gasket:
core sierpinski functions:
sierpinski .mel writer:
sierpinski .rib writer:
sierpinski .ass writer:
Going further, I attempted to create a renderman tool with a UI for Maya using Cutter templates ("more code" button on the right), but I could not get that to work. Perhaps that has to do with environment variables. The following code is used to create a UI using renderman and maya, generated by Cutter templates (helper scripts, and UI/RI PreShape MEL scripts)
sierpinski helper: .rman declaring params:
PreShape UI Script: PreShape RI Script:
© 2018
generalist visual fx
generating a sierpinski fractal with python for maya, renderman, and arnold To generate this fractal, methods were written to find the midpoint between two given points, pick one random point in a list, generate a tetrahedron, then interpolate between a seed point and a vertex and a new points until the iteration is complete. I then added a sort method for the vertices based on their y-value and moved the x-positions along a sine curve.
This project was a fun exercise on trying to understand more of the intricacies of python. I still need to research more pythonic methods to understand them better, such as the lambda temporary function that I employ a couple times but do not fully understand.
challenges functions
I wrote this function for creating a perfect tetrahedron based on a given center and side length. It is based on the amplitude of an equilateral triangle which is equal to (length*sqrt(3))/2 Passing the sierpinski vertices through this function sorts the vertices by y-value and then moves the point along x based on a sine curve (in my animated version it accepts a user defined frequency and amplitude). Passing the sierpinski vertices through this function sorts the vertices by y-value and then moves the point along x based on a sine curve (in my animated version it accepts a user defined frequency and amplitude).
full scripts utilizing these functions in the generation of the sierpinski gasket:
core sierpinski functions: sierpinski .mel writer:
sierpinski .rib writer: sierpinski .ass writer:
Going further, I attempted to create a renderman tool with a UI for Maya using Cutter templates ("more code" button on the right), but I could not get that to work. Perhaps that has to do with environment variables. The following code is used to create a UI using renderman and maya, generated by Cutter templates (helper scripts, and UI/RI PreShape MEL scripts)
sierpinski helper: .rman declaring params:
PreShape UI Script: PreShape RI Script:
© 2018
generalist visual fx
generating a sierpinski fractal with python for maya, renderman, and arnold To generate this fractal, methods were written to find the midpoint between two given points, pick one random point in a list, generate a tetrahedron, then interpolate between a seed point and a vertex and a new points until the iteration is complete. I then added a sort method for the vertices based on their y-value and moved the x-positions along a sine curve.
This project was a fun exercise on trying to understand more of the intricacies of python. I still need to research more pythonic methods to understand them better, such as the lambda temporary function that I employ a couple times but do not fully understand.
challenges functions
I wrote this function for creating a perfect tetrahedron based on a given center and side length. It is based on the amplitude of an equilateral triangle which is equal to (length*sqrt(3))/2 Passing the sierpinski vertices through this function sorts the vertices by y-value and then moves the point along x based on a sine curve (in my animated version it accepts a user defined frequency and amplitude). Passing the sierpinski vertices through this function sorts the vertices by y-value and then moves the point along x based on a sine curve (in my animated version it accepts a user defined frequency and amplitude).
full scripts utilizing these functions in the generation of the sierpinski gasket:
core sierpinski functions: sierpinski .rib writer:
sierpinski .mel writer: sierpinski .ass writer:
Going further, I attempted to create a renderman tool with a UI for Maya using Cutter templates ("more code" button on the right), but I could not get that to work. Perhaps that has to do with environment variables. The following code is used to create a UI using renderman and maya, generated by Cutter templates (helper scripts, and UI/RI PreShape MEL scripts)
sierpinski helper: .rman declaring params:
PreShape UI Script: PreShape RI Script: