Deborah R. Fowler
File creation to
supplement Exercise 2 dailies
Posted on April 23 2022Update on April 24 with video links
The files available in data.zip below were created using python in Houdini. I wanted to create some test files that were similar to the Hurricane exercise (reading data to draw the turtle). The homework was:
- Download and unzip the following data files data.zip
- You are are read in the data, grab the x and y coordinates of the points (they are ordered in x,y,z order) and draw them with the turtle as demonstrated in class.
- If you have completed today's and last day's homework, continue with the hurricane exercise which is due next class.
I want to use this as an opportunity to show how easy it is to use python inside of Houdini. In Houdini you can access python in many ways, but here we use the python sop (node is geometry context).
In the python node you will see two references, one identifying the node and the other identifying the geometry (which contains the points and primitive that define 3D geo shapes). These will be useful for accessing information.
First we need geometry to write out. Click on the following links or below on the images for a full decription of the circle and the maple leaf generation. In addition, there is a discussion about generalizing it to 3D objects.
Once you have the geometry, it is simply a matter of writing out the geometry information into a file. It is very similar to what you would do in python outside of Houdini.