patterning sketch objects often fail

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

patterning sketch objects often fail

Post by uwestoehr »

I frequently run into the problem that patterning sketch fails.

Here is an example file:
pattern-bug-Sketch.FCStd
testfile
(10.3 KiB) Downloaded 31 times

I want there to pattern the second rounded rectangle, counted from the bottom. Therefore
- I select the whole rectangle
- use the patterning icon

(An issue is that I cannot manage to get an angle of exactly 90. It would be very helpful if one could e.g. press the Shift key and then get the angle in steps of e.g. 15°.)

However, the main issue is that I end up with an unusable pattern - Also when I set the angle to 90° later, the 2 clones lost the constraints. The radiuses of the edges are lost and also the info that the rectangles are fixed in X.

Here is the result I get:
pattern-bug-Sketch-result.FCStd
result
(12.58 KiB) Downloaded 31 times
Here is a screencast of what I did:
aoRzI8ZfpI.gif
aoRzI8ZfpI.gif (522.16 KiB) Viewed 2040 times
abdullah wrote: .
User avatar
Shalmeneser
Veteran
Posts: 9443
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: patterning sketch objects often fail

Post by Shalmeneser »

Sketcher_RectangularArray is an all options tool.
But usually, like in your example, you don't want 90° (or 'normal' constraint).

So, I set the first pattern at around 45° to clearly see the pattern, then suppress the angle constraint to replace it by vertical constraint somewhere.
Then sometimes, I replace parallel/normal constraints with vertical/horizontal constraints.
User avatar
Shalmeneser
Veteran
Posts: 9443
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: patterning sketch objects often fail

Post by Shalmeneser »

Don't try to get 90°. Place your pattern to clearly see the angle then modify it.
User avatar
Shalmeneser
Veteran
Posts: 9443
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: patterning sketch objects often fail

Post by Shalmeneser »

I usually don't use the between distance, but supress it and replace it with placement of the last pattern.
Attachments
Rectangular array.FCStd
(9.79 KiB) Downloaded 29 times
wmayer
Founder
Posts: 20202
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: patterning sketch objects often fail

Post by wmayer »

(An issue is that I cannot manage to get an angle of exactly 90. It would be very helpful if one could e.g. press the Shift key and then get the angle in steps of e.g. 15°.)
With the PgUp/PgDn buttons you have a step width of 10 units.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: patterning sketch objects often fail

Post by uwestoehr »

wmayer wrote: Sat Sep 25, 2021 9:43 am With the PgUp/PgDn buttons you have a step width of 10 units.
This does not work for me. Also Shifts+PgUp or Alt+PgDn does not work.

However, my main problem is that the patterning looses the constraints for the clones. The point is that patterning the lowest rectangle works while patterning the second lowest rectangle fails.
Bance
Veteran
Posts: 4163
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: patterning sketch objects often fail

Post by Bance »

The second sketch has two apparently unnecessary points ....
Snip macro screenshot-0e2a0d.png
Snip macro screenshot-0e2a0d.png (61.87 KiB) Viewed 1718 times
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: patterning sketch objects often fail

Post by abdullah »

uwestoehr wrote: Fri Sep 24, 2021 9:09 pm (An issue is that I cannot manage to get an angle of exactly 90. It would be very helpful if one could e.g. press the Shift key and then get the angle in steps of e.g. 15°.)
Ctrl, 10 degrees:
git commit c9eaa2393d339cec1985227091935051ae67a6ef
uwestoehr wrote: Fri Sep 24, 2021 9:09 pm However, the main issue is that I end up with an unusable pattern - Also when I set the angle to 90° later, the 2 clones lost the constraints. The radiuses of the edges are lost and also the info that the rectangles are fixed in X.
Only dimensionals are crosslinked between copies. In your case, you are not copying the slot that has the radius, but one that has equality constraints with an element outside the selection. The "promise" of the clone refers to selected geometry only.

The Array tool operates on the selection. This is so to avoid redundant and even conflicting constraints. This limitation requires human intervention in cases such as the one you mention (select one arc from each clone and make it equal to any constraint arc).

Such is also the case of the point on object with the construction line. This construction line is not part of the selection. However, as you are constraining by angle, if you restrict to 90 degrees, you do not need to create these (and if created will be redundant). Of course, if you prefer the point on object constraints, you will need to tweak the end result to your liking (delete the angle, make the constraints... live happily ever after).

Because the algorithm used heavily relies on this limitation, it is unlikely that the limitation is lifted.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: patterning sketch objects often fail

Post by abdullah »

Bance wrote: Sat Sep 25, 2021 3:45 pm The second sketch has two apparently unnecessary points ....

Snip macro screenshot-0e2a0d.png
Those are a feature new in 0.20. It allows to constraint a rounded rectangle based on the actual corner it would have if not rounded.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: patterning sketch objects often fail

Post by uwestoehr »

abdullah wrote: Sat Sep 25, 2021 8:19 pm Ctrl, 10 degrees:
git commit c9eaa2393d339cec1985227091935051ae67a6ef
Many thanks!
This is a very valuable addition.

Converning the array feature, it feels a bit inconsitent as it is because one can set in the options the number of rows and colums, but not also the distance between the elements. Could the dialog therefore have:
* two edits, one for the vertical, one for the horizontal distance
* an option that is by default off named "specify distance by dimension". When this is enabled, the user can enter the dimensions directly in the dialog.
* when the user uses the equal constraint option, only one edit could be filled when the new specify option is set

This would speed up the usage for many cases. Sometimes I have a reference point in the sketch and thus the current behavior is fine, but often I don't have a reference point, I only know that I need e.g. a 23 x 15 mm array. At the moment I have to create the array and then later change the dimensions to what I need. That costs some time since sometimes the initial array overlaps other elements and then it is hard to see where I must change the dimension.

abdullah wrote: Sat Sep 25, 2021 8:19 pm Only dimensionals are crosslinked between copies. In your case, you are not copying the slot that has the radius, but one that has equality constraints with an element outside the selection. The "promise" of the clone refers to selected geometry only.
But can we not change the behavior to this:
- when the Clone option is set, the selected element is created as it is and after the creation it is checked what constraints are missing
- if there are missing constraints, they will be taken from the master element

So in my example, the radius of the corners is missing in the clones. At the moment I have to manually select them and making them equal to the ones of the master. I think this action could be automatized since the option "Clone" makes clear that the users wants a real clone. So also the edge radius must then be the same as for the master.

Concerning the "Clone" option, I would like to describe it properly, but don't know all details about its limitations. Could you please write something about its limitations:
https://wiki.freecadweb.org/Sketcher_Re ... ay#Options

Or write them here that I can update the Wiki page?

abdullah wrote: Sat Sep 25, 2021 8:19 pm Such is also the case of the point on object with the construction line. This construction line is not part of the selection.
OK, I understand there cannot be done anything.
Post Reply