Option 1: Design a Linear Pattern
Design a Linear Leaf
Overview
There are four main blocks of code and two optional blocks. Each block of code is called an “object,” which is also
known as a variable.
• The first four objects form one leaf, and the fifth groups everything together into one block.
• If you want to create a linear pattern across the x-axis, you can do the sixth object.
Step 1
• Move your mouse to the left side of the screen and click the area called “Modify” in purple.
• Select the Create New Object block, and drag it into the coding area in the center of the interface. You have now created
a new object, which is also called a variable. The default name is object0.
Step 2
• Change the name to leaf_base by clicking on the upside-down triangle and choosing “Rename variable.”
• Now that you have done that, you’ll find the variable in blue under the area called “Data” on the left-hand side of the
screen.
Step 3
Here you can see the first block of your code before you change all its values.
Read below for a description of every part.
• Comment: Lets you add comments to help you and others who read the
code to understand the purpose of that section
• Add Heart: Lets you add the heart shape to the workplane; click the circle to
change the color to green.
• Rotate: Lets you change the rotation of the heart to make it easier to turn
into a leaf shape
• Scale: Lets you to make the leaf taller and thinner on the y-axis and z-axis
• Move: Lets you move the leaf up so that it is flat on the workplane
• Add Cylinder: Lets you add a cylinder to fill in the gap from the heart shape
to make it look like a leaf; click the circle to change the color to green.
• Move: Lets you move the cylinder into the correct location
• Create Group: Lets you group it to make it one piece
Step 4
Now you can see all of the changes made to complete the leaf_base block of code. Read below for a description of
every part.
• Rotate: Change the axis from x to z. Change the degrees from 90 to 180.
• Scale: Change the scale for the y-axis from 1 to 1.5 and the z from 1 to .2
• Move: Change the move on the z-axis from 0 to 1mm for the heart shape.
• Add: Change the height (H) for the cylinder from 20 to 2.
• Move: Change the move from 0 to .5 for the x-axis, 0 to -11 for the y-axis, and 0 to 1 for the z-axis.
Step 5
View the image to see the
completion of the first
block of code.
Step 6
This is the second object before you change all its values. Read below
for a description of every part.
• Create New Object: Name your new object leaf_midrib.
• Comment: Add comments so that you and others who read your
code know the purpose of that section.
• Add: Add a square shape to the workplane. Click the circle to
change the color to a lighter color.
• Move: Move the midrib so that it is in the center of the leaf.
• Add: Add a roof to bring the tip of the midrib to a point. Click the
circle to change the color to a lighter color.
• Rotate: Change the rotation of the roof on a different axis twice to
form the proper shape.
• Scale: Make the midrib tip smaller on every axis to match the size
of the leaf.
• Move: Move the tip to the correct place.
• Create Group: Group it to make it one piece.
Step 7
• Add in the values as seen in the image. Remember that you need to find the copy of leaf_midrib under the category
called “Data.” It’s below the category called “Math.”
• Create two new variables, using the Create Variable block, one block at time. (It’s similar to but not the same as the
Create New Object block.)
Step 8
View the image to see the
completion of the second
block of code, also called
the second object/variable.
Step 9
This is the third object before you change all its values. Read below
for a description of how this is different from the first two objects.
There are two main differences as you need to use two new blocks
that you haven’t used before:
• One block is Add Copy of Object. You can find it under
“Modify.” Objects themselves can be found under “Data.”
• The other block is Create Variable. You can find it under “Math.”
Step 10
• Add in the values as seen in the image. Remember that you
need to find the copy of leaf_midrib under the category called
“Data.” It is below the category called “Math.”
• Create two new variables, using the “Create Variable” block, one
block at time. It works the same way as the “Create New Object”
blocks.
Step 11
Your leaf should look like
the following image so far.
Step 12
This the fourth object before you change all of the values. Read below for a description of how this is different from the
first three objects. There are two main differences, as you need to use two new blocks that you haven’t used before:
• One block is Repeat. You can find it under “Control.”
• The other block is Change. You can find it under “Math.”
Step 13
• Add in the values as seen in the image. Remember that you
need to find the copy of leaf_veins, distance, and scale under
the category called “Data.” It’s below the category called “Math.”
• For the Change blocks, click item and select the correct object.
Step 14
The four main parts are now
complete. Your design
should look like the
following image.
The last two objects are
optional.
Please continue if you’re
interested in grouping
everything into one object
and creating a copy of the
entire leaf to make another
pattern.
Step 15
For this section of blocks, you are creating an object called
entire_leaf.
• You are adding copies of all of the previous objects and deleting
the originals to combine everything into one object.
• A new block that you will use is called “Delete Object.” You can
find copies of the original objects under the category called
“Data.”
Step 16
For this last optional section of blocks, you are creating an object
called linear_leaf. It will take the whole leaf, make copies, and
move it by an additional 29mm in one direction along the x-axis
every time it makes a copy.
Step 17
Your final design should now look like the following.
Autodesk and the Autodesk logo are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders.
Autodesk reserves the right to alter product and services offerings, and specifications and pricing at any time without notice, and is not responsible for typographical or graphical errors that may appear in this document.
© 2020 Autodesk. All rights reserved.