Picking Apart Pattern Performance: Features, Faces, and Sketches
“When should you use a sketch pattern vs. a feature pattern?”
Due to the similarities between our sketch- and feature-based pattern tools, this question comes up often in training classes. I’ll say, generally, feature patterns make more sense. It’s much easier to go back and alter the properties of a feature pattern than those of a sketch pattern since the feature pattern exists in the design tree. Feature patterns also have more advanced capabilities, like using model geometry to define the stopping point of the pattern with “Up to Reference” or adjusting the spacing between specific instances using “Instances to Vary.” There is also a performance difference between these patterns, where feature patterns are typically faster to regenerate than sketch patterns. This final detail is what I aim to explore further.
I wanted to go a little beyond just a comparison of feature patterns and sketch patterns, though. Rather than patterning features or sketch geometry, you can also pattern individual faces and bodies. Body patterns tend to have specific and straight-forward applications (i.e., if you want to pattern an entire body… use a body pattern), so I ignored them for this testing, but I was definitely interested in the interchangeability between faces, features, and sketches.
Before going on, I want to clarify what I mean by “sketch pattern,” “feature pattern,” and “face pattern.” I’m referring to a sketch pattern as a pattern created by the Linear Sketch Pattern or Circular Sketch Pattern commands, both of which can be found in the Sketch tab of the CommandManager. These tools are meant to pattern entities within an active sketch.
Instead of patterning within a sketch, you can copy existing 3D geometry using one of the patterns found in the Features tab of the CommandManager. The direct analogues to the two sketch pattern types would be the Linear Pattern and the Circular Pattern. A feature pattern and a face pattern refer simply to different applications of these tools. For most of these commands, you can define the patterned geometry either as individual features or as specific faces. While feature patterns are far more common, there are situations when face patterns can be helpful, like when you are working with an imported model that doesn’t have discrete features.
To compare the different types of patterns, I started with a circular extruded cut running from the top face of a large cube to its bottom. For the feature pattern, I was just able to pattern the entire cut feature. For the face pattern, I patterned the internal cylindrical face of the cut. For the sketch pattern, I patterned the circular sketch geometry before extruding it. Each pattern was created in 5 x 5, 10 x 10, 50 x 50, and 100 x 100 linear arrays. (I also ran a few trials at 200 x 200 and quickly decided it was not a good move.) For a sense of scale, the picture below illustrates the range of these patterns.
I also wanted to see how different end conditions for the extruded cut would impact the rebuild performance. End conditions that reference other geometry in a model tend to require more calculations and take longer to generate. I wasn’t sure whether it would matter much on a simple part that only had a couple features, but I thought it was worth trying a few options anyway. For each scenario then, I applied a Blind cut with a depth of 500mm (the height of the cube), an Up to Next cut, an Up to Surface cut referencing the bottom face of the block, and a Through All cut. All four conditions would produce identical geometry, but the process of calculating the cut would be different.
Most of the patterns found in the Features tab of the CommandManager have an important option called “Geometry Pattern.” When it is disabled, SOLIDWORKS will need to calculate each instance created by the pattern just like it calculates the source feature. For example, if the original feature took 0.1 seconds to calculate and you create a pattern that adds eight more instances, the rebuild time of that pattern may be around 0.8 seconds. When Geometry Pattern is enabled, SOLIDWORKS will ignore the feature’s calculations and, instead, strictly pattern the geometry—the faces, edges, and vertices—created by that feature. That means any calculations required to solve end conditions or complicated references can be bypassed. This option is thus a great way to improve performance for large or complex patterns.
In theory, Geometry Pattern should only matter when patterning features. When patterning faces, SOLIDWORKS is inherently using the geometry already rather than any features that would need calculation. So, turning Geometry Pattern on or off shouldn’t impact the rebuild time for a face pattern. Just to verify this, I tested all the face patterns twice—once with Geometry Pattern enabled and once with it disabled—as I did for all the feature patterns.
All told, there were five different pattern types (feature with and without Geometry Pattern, face with and without Geometry Pattern, and sketch), four different pattern sizes (5 x 5, 10 x 10, 50 x 50, and 100 x 100), and four different end conditions for the extruded cut (Blind, Up to Next, Up to Surface, and Through All), yielding 80 possible scenarios.
The metric of interest was the overall part rebuild time, available through the Performance Evaluation tool. To avoid potential outliers in the rebuild times, I performed five forced rebuilds (Ctrl-Q) for each scenario, recording the total rebuild time after each, and took the median of the results.
Going into this process, I had a few theories that I wanted to evaluate:
- The sketch pattern would be the slowest. Extruding large numbers of distinct sketch entities seemed likely to tax the software far more than taking an existing cut and just recalculating it.
- Geometry Pattern would not affect face patterns, as stated earlier.
- When Geometry Pattern is used in feature patterns, the rebuild times would not change much with different end conditions. If you’re just patterning the geometry, it shouldn’t matter whether the original cut was made Through All or Blind.
- A feature pattern with Geometry Pattern would have similar performance to a face pattern. Again, face patterns should already be focusing exclusively on the geometry, which is how Geometry Pattern modifies a normal feature pattern.
- The relative performance of each pattern wouldn’t change as the pattern scales up, meaning there won’t be one pattern type that is the best option when there are only a few instances and another pattern type that’s best with larger quantities.
Let’s look at how the results compared to these predictions.
The table below shows the median rebuild times (in seconds) for all 80 situations. It’s worth noting here that rebuild performance is dependent on system components and settings, so if a colleague were to run this test they could end up with noticeably different values. Still, the data should at least provide a good representation of how each pattern type performs relative to the others.
Let’s start with the end conditions. For the feature and face patterns, the end conditions did not make much of a difference, which I didn’t expect. It may just be that the rebuild time of the initial cut feature was so insignificant that any extra calculations would barely register in the model. Since this behavior appeared with and without Geometry Pattern, it’s hard to determine whether Expectation #3 above was correct.
Interestingly, there were notable differences between the end conditions for the sketch patterns. The Up to Surface and Up to Next cuts were comparable to one another, as were the Blind and Through All cuts, with the former pair being consistently worse than the latter. The difference may not be huge—about an 18.3% change at most in the 50 x 50 pattern—but it seems to be a trend nonetheless. This could suggest that the “Up to ____” conditions require more calculations than Blind or Through All (which could make sense, since I believe the software would need to evaluate several locations along the terminating face in these two conditions rather than just checking for the maximum point—as in Through All—or simply ignoring the face geometry—as in Blind), but I can’t say for certain since this behavior only presented itself for sketch patterns.
Speaking of sketch patterns, they were, across the board, dramatically worse than feature and face patterns, which lined up with Expectation #1. In the two largest patterns, there were several occasions where the sketch pattern was 20 times slower than the next-worst pattern type. These patterns are clearly not intended for large instance counts.
Face patterns were a bit surprising. I’d suggested in Expectation #4 that a feature pattern with Geometry Pattern would have similar rebuild performance to a face pattern. This was not the case. Face patterns were similar to feature patterns at low instance counts, but they got less efficient as the pattern size went up. In the 50 x 50 grid, the face patterns were similar in rebuild time to the non-Geometry Pattern feature pattern, but with the 100 x 100 grid they had rebuild times around 80% greater. It would seem then that feature patterns with Geometry Pattern and face patterns are functionally different operations within the software, and that the way the software manages face patterns is not as suitable for large arrays. With regards to Geometry Pattern, though, it did not appear to have any impact on face patterns, as predicted in Expectation #2.
Finally, we have the feature patterns. Though the basic feature pattern was already good at keeping rebuild times low, enabling Geometry Pattern led to clear improvements for the two largest patterns.
As for the final prediction, Expectation #5, I do not believe this can be validated by these results. Face patterns were essentially interchangeable with feature patterns (and sometimes even faster) for lower instance counts but got progressively worse as the pattern size rose. Granted, the rebuild times on these smaller patterns were negligible, but it could be worth exploring this further in case there is a threshold prior to which face patterns might be the most effective option.
Along with the information in the table above, I also have a few stray observations that aren’t captured there. Something interesting happened with the feature patterns (non-Geometry Pattern) once I got into the 100 x 100 array. In all four scenarios—Blind, Up to Next, Up to Surface, and Through All—the feature pattern rebuild time got slower with each successive rebuild. For example, the Through All trials went 3.89s, 4.00s, 4.20s, 4.30s, and 4.63s—a range of 0.74 seconds, which is an increase of just about 19% from the initial value.
Since I only did five rebuilds, I’m not sure if the trend would continue infinitely (a couple times, I did a sixth rebuild and saw the time come back down), but this is a potentially concerning result. It is as if the computer has to perform additional tasks related to the previous rebuild before it can move on to the current one.
Another thing I noticed is that the rebuild time SOLIDWORKS reports is not the full loading period. On the Status Bar in the lower-right corner, SOLIDWORKS indicates how the rebuild is progressing. You’ll see which feature it’s working on with a message along the lines of “Rebuilding feature 22 of 22 – LPattern1 (Default).” Once it finishes calculating that final feature, it moves on to a couple other processes, most notably the “Generating graphics” step, during which you will still see the spinning cursor and be unable to click anything in the program. As far as I can tell, these later processes are not included in the Performance Evaluation rebuild time, and they can sometimes add substantial time to the rebuild. I tried to time this using the stopwatch on my phone for a 100 x 100 feature pattern. While the reported rebuild time was 3.92s, it took 9.52s before I could do anything!
The video below shows how much time this process can add to the rebuild. In this case, the stopwatch ends when the “Generating graphics” message disappears, but in reality it usually takes another second or so after that before the cursor regains function.
Fortunately, this aspect of the rebuild time is controlled in part by the model’s image quality. Reducing the image quality of the model can lessen the time spent waiting for the rebuild to complete. My model’s image quality was already at maybe only 15% of the way across the slider. However, dropping it all the way down to the low end still had a noticeable impact on the model. After testing again with my stopwatch, a 3.92s reported rebuild time (coincidentally the same as the previous attempt) meant 7.15s of actual waiting.
So, there’s a lot of information here that I found interesting, but now let’s get into how this can actually help you. First and foremost, I recommend using feature patterns with Geometry Pattern as often as possible. There may be times when Geometry Pattern won’t work for your design though. You may occasionally want SOLIDWORKS to calculate each instance of a pattern. Maybe you’re patterning a cut whose end profile is determined by offsetting a curvy face and you want all the instances to satisfy that offset. This would yield cuts that are not geometrically identical to the seed. A result like this can only be achieved by disabling Geometry Pattern. Additionally, there are some scenarios where Geometry Pattern just can’t be used, such as when the feature being patterned has faces that merge with geometry outside the feature. (The Help documentation provides a good illustration of this.) When that is the case, SOLIDWORKS will simply give you a warning that the pattern cannot be generated using Geometry Pattern and force you to toggle the option off. Aside from these exceptions, I think you should always have Geometry Pattern enabled to improve the performance of your models.
Where possible, avoid sketch patterns. If the sketch geometry you want to pattern is just going to be used for an extrusion or some other standard 3D feature, then you will likely be better off creating a single instance of that feature and then patterning it rather than trying to create the pattern first. That being said, the sketch pattern isn’t totally useless. There are some features that do not lend themselves well to patterning. For example, you may not be able to pattern a Split Line feature to break up multiple faces, but you can pattern sketch geometry and then split all of the faces at once. Just be wary that introducing too many of these kinds of patterns can have adverse effects on the performance of your model.
Although image quality doesn’t technically have an effect on the rebuild time of the model—at least the one you’ll see reported by Performance Evaluation—it does impact how long you’re waiting for a rebuild to finish. While Performance Evaluation will only tell you how long it takes to recalculate the features in your model, there are also some graphics-related steps that get performed during the rebuild process that can slow things down a lot. If you are noticing unexpectedly long delays in your model’s rebuild process, try reducing its image quality.
Still, the findings of this test are somewhat limited, and there would be a few things I’d like to consider if this were done again. First, multi-face features would be worth exploring. As we saw, the face and feature patterns performed similarly to one another for small pattern sizes. Each cut only had one face to pattern, so I wonder if the performance of face patterns would be significantly worse if you included more faces.
Trying this out in a more detailed model could be interesting as well. The lack of difference between the four end conditions was likely due to the simple, flat shape of the stopping face. If the bottom face were curved or on an angle, I suspect that there would be a noticeable effect on rebuild times between the end conditions.
Finally, I think more pattern sizes would help make trends clearer. The 100 x 100 pattern seems like a good upper limit (I can’t imagine many people would ever need to create 10,000 instances of anything in a model), but testing more arrays of smaller size could help clear up the differences between face and feature patterns. As noted earlier, the two patterns were very similar at lower instance counts, so I’d like to find the point at which they start to diverge.
I hope this gave you some useful information! If you’re experiencing slow performance on your pattern features and want some more specific tips, give us a call.
Computer Aided Technology