Patterns are a great tool for creating… patterns. They come in all different shapes and sizes – linear, circular, curve, part, feature, face, sketch – each with its own use case. But how do you know which one to use and when?
Some are obvious, but the most abused pattern type is the sketch pattern. There’s a great Tech Tip here that explains all the benefits of sketch patterns, but there are also some limitations, namely adding geometry to an existing pattern and driving the instance count with variables. My general rule of thumb: If you want more flexibility and more robust models, stick to using pattern features wherever possible.
Pattern features offer three options:
Part Pattern - This option patterns an entire part in a Part Studio which is useful if you are constructing a complex part using a multi-part tooling workflow. If you’re using a part pattern to create an assembly of parts in a Part Studio, please don’t. That’s what assemblies are for. Each patterned part has a new name and none of the original part’s properties will be inherited, so your assembly BOM will be incorrect.
Feature Pattern - This option patterns individual features in the feature list. Feature patterns can be more compute intensive if each instance of the pattern needs to be regenerated in order to take topological changes into account. More on this in a moment.
Face Pattern - This is the fastest way to create patterns of geometrically identical features. It’s fast because the faces and edges that make up a feature in your model are just copied to a new location and no feature regeneration is required.
So, which one should you use? Face patterns are quick, but require a lot of user selections. Feature patterns require minimal selection, but can be slower to compute.
To make this decision easier, the feature pattern was modified to behave more like a face pattern. When you select a feature from the feature list, Onshape collects all the faces that make up that feature and performs a face pattern behind the scenes. The result is the best of both worlds – fast selection and fast compute.
For this to work, the topology of each pattern instance must be identical. If it isn’t, Onshape is not shy in letting you know. But all is not lost, simply click “Apply per instance” and the more topology-resilient feature pattern code takes over.
If that’s the case, why would you ever use a face pattern? The only reason to do so is if you only want to pattern a subset of the faces created by a feature. As mentioned earlier, every pattern type has its use case.
Anyway, I digress. This tip is not about face pattern versus feature pattern, it's about how you can make complex parts with repeating patterns even faster. Enter the part pattern.
Part patterns are great and you should try to use them wherever possible. However, there is one performance hit that part patterns suffer from and that is the number of boolean operations that take place when the "Add" option is being used.
Take this model of a tire:
It may not be too complex, but there’s a lot of repeating geometry. In the first attempt to model this, the tire profile was revolved without the tread, then a small section of the tread was created by splitting a surface multiple times. Then the Thicken feature was used to create the depth of the tread. The resultant tread was then patterned once to add extra geometry, then again to get the full tread around the tire, then boolean subtracted from the revolved tire. This works fine, but is VERY slow. Why? Because there are 14 boolean operations going on with progressively increasing complexity. Time for part regeneration: ~19 seconds!
This is clearly not acceptable, so a second model was built, this time by creating a small section of the revolved tire and creating the tread as before. This section was then patterned around to create the full tire. Much better performance at ~9s. However, there are still 28 boolean operations going on (though much simpler than the previous example).
There’s a pattern emerging here (see what I did there?). The path to faster patterns is to reduce the number of booleans. Instead of patterning the tire section shown in the above image 27 times to get the full revolved profile, creating two or more pattern features can reduce the total number of booleans and therefore increase performance.
If you pattern the above section three times, then create a second pattern with nine instances (getting the total of 27 instances as before), there are now only 12 booleans occurring and regeneration time is a paltry 5s!
Anyway, here’s the moral of the story. By reducing the number of boolean operations created by the pattern feature, you can dramatically improve the performance of your parts.
Thought I'd pass along this little nugget – the proof in the pudding can be found here.
Interested in learning more Onshape Tech Tips? You can review the most recent technical blogs here.