Introduction to Lattice Workbench: Polar Array - Build a Parametric “Snowflake”
One of the more advanced workbenches for manipulating objects into arrays and paths, the Lattice Workbench can be a tricky tool for the beginner. Using the workbench is quite complex due to the sheer amount of tools and features and the way you have to select sometimes three or more objects in a certain sequence before applying an action. Tools that allow you to split an array across a path, create a parametric collection etc the Lattice workbench is a powerful weapon. It even holds tools found on the draft workbench such as upgrade and downgrade but offers a parametric alternative. If you want a good example of how FreeCAD can perform parametric modeling then this tutorial which blends the tool with other workbenches will open your mind to the possibilities. As a side note the Lattice workbench is not just for circular patterns, it's for repeating patterns no matter what the shape. Whether it is blades on a turbine or slot joints around a chest of drawers it is worth investing a little time to discover its secrets. For that reason I am going to put a set of tutorials together to show you how to use the tools in this workbench in the same way as my Curves Workbench series.
Our first project will be something simple. A parametric snowflake type structure. The reason I have selected this is because every snowflake is unique so when we want to change the snowflake we will change one arm which will repeat a set number of times. But we will either add to the sketch or replace it entirely, we will even add more arms by altering the repeats. You will see everything will update, no errors, no topological naming issues. It will just work (I will include a few neat tricks included to allow us to create a solid model).
We will first start by installing the Lattice2 workbench. This can be installed from the Tools menu > Add on manager.
Once installed we can start creating our model. We are going to take this step by step working from a very basic extrude up to the snowflake to show the parametric capabilities and also to understand the workbench. It can get quite complex very quickly so let's take it slowly. Jump into the sketcher and create a very simple sketch of a line.
Close the sketch and jump over to the Lattice Workbench. You will see a large collection of tools, a large number of which have one of two icons that you will probably have not seen before. One is a paper plane, and one is an array.
The paper plane describes placement and position. Whenever a paper plane is shown on an icon or in the 3d view itself then at some point in the process it will have a copy / child of your desired object attached to it. It's important to note that the paper planes have an orientation. The back of the plane where the wings and body meet (resembling the middle of a letter 'T') is the origin of placement of the object, where the object will end up being placed. The tip of the plane is the X axis and the left wing the Y leaving the Z to run upwards.
The other buttons to look at are the ones that contain a square bracket containing an icon. This denotes an array of objects such as a compound.
For now that's return to what we are doing. We are going to create a polar array. Now there are many types available, we are going to keep it simple. Make sure nothing is selected (click on some blank space in the view) and click on the top menu > Lattice2 > Polar Array > Polar Array span / N (more on the different types in another tutorial). You should see the following.
Notice the planes, they are all placements that copies of the line will end up being added to. At this point I am going to stop referring to them as 'planes' as it will be confusing considering there are planes in geometry! I will call them gliders or just placements.
So how do we attach copies of our line to these placements? It is important to note terminology at this point. These placements (gliders) are known as an array of placements.
To attach our line first select the line, ctrl click the array and the click on the button (notice the array?):
This is the 'populate with copies'. It denotes an object and an array of placement gliders (notice the square brackets]. This can also be found on the top menu > Lattice 2 > populate with copies > populate with copies. Once selected you will see a line will have been attached to each placement.
The lines have been copied to each placement glider in the array but they are not aligned. There are two ways to align the line:
Method 1: Rotate the original sketch.
By changing the rotation of the sketch from within the placement > angle on the data tab we can change the placement of the individual lines quite easily.
Method 2: Add a placement glider.
We can add a placement glider to place the line in the correct position. Click on the line and select the Attach Placement button
Or we can select this tool from the top menu > attached placement > attached placement. We now have a glider and the following screen asking about attachment.
This is our usual attachment that we see when attaching datum planes, geometry etc. Just remember we are attaching the placement glider to the line. If we select the Z tangent to edge we can see the back of the glider align through the Z axis.
We are trying to align the X of the glider with the line (remember the x,y,z orientation diagram). We have the Z align at the moment. We just need to rotate the glider around using the attachment offset.
We are now aligned. Click OK to return to the lattice workbench. Delete the populate polar array with a sketch item from the treeview.
Now in the following order select the sketch, the new placement and then the polar array from the treeview using the ctrl key.
And now select the populate with copies (moved object) button:
also available from top menu > lattice2 > populate with copies > moved object
Now we have all the lines in place we can start extruding. Jump over to the part workbench and select the moved sketch from the treeview and hit extrude. Specify the Z axis and add some height.
Hit OK. You will see all the copies extruded. Drill into the extrude in the treeview right down into the polar array and locate the count in the data tab.
Increase the count. Notice how the model responds by simply creating more copies.
Let's change the sketch and see what happens. Double click the sketch. and change the sketch to a close geometry rather than a line. You can even delete all the geometry within and resketch.
And close the sketch.
Let's reduce the polar array count to 5
And click on the extrude and set solid to true.
We have to reattach the placement. Click on the placement from the treeview and locate the support from the data tab and click the button on the end.
Hit the clear button and select another edge of the sketch to align to.
Hit OK and then hit refresh or hit ctrl r. The extrude copies will align.
Let's increase the polar array count again.
Now let's get rid of the overlapping faces so they are one. This is very simple. In the part workbench click on the extrude and then click top menu > part > boolean > union. This will create a fusion
Click on the fusion and then locate the refine and set this to true. Click off and the refinement will be applied. We now have a snowflake structure which is a single object that can be exported.
We can modify the sketch and alter the polar array without any issues by expanding the fusion and drilling down to the sketch or polar array. Here I have increased the radius and the count and added circles to the sketch which results in holes in each of the copied elements. We can see where the workbench got its name.
And changing just the sketch once again.
We haven't even touched the tip of the iceberg. There are so many tools and I will be going deeply into these in my upcoming videos.
Thank you for the tutorial. I'm looking forward to other lattice WB tutorials. I was able to follow to the end, and got the same looking result, however my tree looks different. It caused me a little confusion when the tutorial asked me to "Drill into the extrude in the treeview right down into the polar array", because that's not where the polar array was located in my tree. My tree looked like this at the end:
ReplyDelete- Sketch
- PolarArray
- Placement
- Fusion
- Extrude
- Moved Sketch
I'm not sure if I did something wrong along the way, or if this is just due to the difference in the FCAD version in your tutorial (0.19), and the version I'm running (1.0.1).