Note: Although this is published, it is still a work-in-progress.
It’s possible to use parameters with rectangular patterns in a way that effectively combines the “spacing” and “extent” options and automatically calculate the repeat count.
An entertainment center has storage designed for VHS tapes. The tapes are stored on a shelf that has plastic spacers with slots wide enough for a single tape. We want to replace those plastic spacers with 3D printed versions that have spacing for holding DVD and Blu-ray disks. The shelf that holds the spacers is 400 mm deep. Our rail of spacers will look something like this.
The goal is to design a single section (as shown in red) and then pattern that section as many times as we need to fill our 400 mm shelf.
Using parameters for this design will make it easier to make changes to the dimensions and will allow us to easily adapt this model for other applications. By editing the parameters for things like height, width, length, spacing, etc. you can quickly scale this model to suit your needs.
Create the parameters
For this model, we’ll create and set starting values for the following user parameters:
|Height||mm||35 mm||35.00||Inside height of the divider section.|
|Width||mm||25 mm||25.00||Inside width from back wall to front edge.|
|Thickness||mm||2 mm||2.00||Back wall and base thickness.|
|Divider_Radius||mm||3.5 mm||3.50||Radius of arc at top of divider wall.|
|Spacing||mm||16 mm||16.00||Space between arcs at the top of the divider.|
|Overall_Length||mm||200 mm||200.00||The total length of all sections.|
|Pattern_Spacing||mm||Spacing + Divider_Radius * 2||23||Calculated – this is the spacing we need for the rectangular pattern tool so each section lines up with the next one.|
|Pattern_Repeat||[none] (1)||ceil(Overall_Length / Pattern_Spacing)||9||Calculated – this is how many times we need to repeat the pattern to fit our overall length. This is rounded up to the next whole section.|
|Trim_to_Fit||mm||Pattern_Spacing * Pattern_Repeat – Overall_Length + 0.001 mm (2)||7.001||Calculated – because we’re rounding up the pattern repeat, this is the amount we need to trim off our first section so the overall length is correct.|
(2) .001 is added to this value so it can never be zero. This value is used for an extrude cut and zero is invalid for that operation. Adding this small amount will be virtually undetectable in our final model and 3D print.
This tutorial won’t cover the details of this particular sketch. The basic steps will be the same for most applications.
- Create the body you want to pattern
- Create a rectangular pattern to fill the Overall_Length
- Create an offset plane that is Trim_To_Fit distance away from the start of the main body
- Extrude cut from the start of the main body to the offset plane so the Overall_Length is your desired result
Since I don’t have a printer big enough to create the entire 400 mm length, I have set the Overall_Length to 200 mm and will print 2 sections for each side of the shelf.
This creates a small problem, however. Notice that the Overall_Length (200 mm) is not evenly divisible by the Pattern_Repeat (9), creating a need for a Trim_To_Fit value of 7 mm. You can see these values in the table of parameters above.
Depending on your specific needs, there are a couple of ways to work around this problem. For this project, 400 mm is the maximum length of spacers I can use. I really don’t want any partial sections, so I will skip the steps that create the offset plane and trim cut so I don’t end up with a partial section. We don’t need to delete those steps. We can simply suppress those features on the timeline, leaving them available to use if we do need them later.
Right click the feature you want to suppress on the timeline and then choose “Suppress Features” on the context menu.
This leaves me with a part that is not trimmed to the offset plane and is 207 mm long.
My new max length is now 193 mm. After changing my Overall_Length to 193 mm, this is the result.
to be continued…