I’m struggling to do something I feel like should be doable but keep running into issues with.
The core of the problem seems to be some interplay between variables, patterns and constraints.
Here’s a video demonstrating:
I start out by sketching a rectangle, constrain its width with a variable, constrain all of its sides to be equal, and constrain the midpoint to the origin.
I test changing the variable and it works as expected.
Then I create a pattern to repeat that square 3 times, test changing the variable, and all squares change as expected.
Now, in my use case, I need to break the pattern at this point to manipulate certain aspects of the squares individually, but still expect to be able to control their size with the variable.
When I delete the pattern constraint and try to change the variable, only the original square responds.
As a workaround I try to set their reference edges equal, assuming all of the other equal constraints propagated with the pattern, but when I test changing the variable, I get a constraint error.
I tried to set all of their sides equal but I’m not even sure if I was able to at this point because it seemed like the UI wasn’t responding properly. I tried to do so in various ways but none of it solved the issue.
Yes. This is just a small part of a larger design. It is for 3D printing the housing for a keyboard and there are some a few keys that need specific placement and angles and it makes a lot more sense to place them in 2D relative to one another.
The reason why I need variables, specifically for these key switch holes is because although they are standard size, I need to account for material shrinkage when printing, so their centers need to be locked but I need to be able to control the size to test print and dial in the right setting for my print.
If you use pattern tool on the extruded model you can utilize spacing with variables.
Also you can project the extruded model face via linked sketch. Since it’s linked what you do to the extruded model via variables will change the linked sketch.
Thanks for the suggestion. I think that would have been cumbersome for this model though.
I ended up simplifying my patterns and instead of trying to break them to work with them, I realized I could just define several simple ones (columns) and shift them as needed.
There’s still something very odd about what I experienced though, but I recently came to realize that having auto constraints on can introduce constraints that I don’t actually want or need. I think that may have been at least part of what was going on here.
I’ve been having a better experience with them off.
Here is the setup, if you use Sketch to pattern you still have to extrude it, for example if you add more pattern quantity you have to manually extrude the extra sketch pattern that was generated.
If you use 1 sketch with extruded model and pattern that you get variable control (which is missing in sketch pattern not sure why, I have used other Shapr like software that has sketch pattern variables!).
With this setup you can increase pattern quantity and it will add more models.
Thanks very much for that! I am currently in a project where I was having some issues trying to use variables in a sketch pattern. I’ll extrude first and pattern the bodies instead. I do furniture design and I always struggle with how much to sketch vs. manipulate/pattern/mirror in 3d bodies.
I think you might also find this interesting, so sketch with variable constraints is not always needed to control alignment if you setup variables. If you put in between a dumb box you can use it do control the gap, you can also hide it. Now you can have unequal size keys and still control position equally. Benefit of this is not dealing with constraints errors.
Thank you for the workaround but this solution feels very unintuitive especially when there is other sketch geometry on the same plane that I would like to use the parts of the pattern as a reference for. I’m sure projections could be used to make this work but, again, it feels very unintuitive and forces one to artificially break up the design to retain flexibility.
I’ll definitely try this if I encounter the situation again though. I’ve moved on to just breaking the pattern up and working with it.