How to clone or copy a feature

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!
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

How to clone or copy a feature

Post by run_the_race »

Refering to the image below, I am trying to model a raspberry pi screen with its 4 mounting tabs, you can see I have done 3 so far. I can't figure out how to get bottom right.

I drew the first tab top left, from there what is the expected way to add the other 3 mounting tabs?
  • I first tried to mirror the top left one with "create mirrored feature", that worked once, when I tried to mirror the two of them it failed and said one can't mirror a mirror.
  • I tried to draw all f4 mounting tabs (rectangles with holes in them) in the same sketch but got errors, and would only extrude one of them. Although if its two separate circles (like the lego block tutorial) then it can extrude 2 parts, so I don't understand the difference between when one can extrude one feature, or multiple features.
  • I tried to use "create a linear pattern feature", but I can only go in one axis, not specify the direction in 2 axis.
  • I tried to use clone but it clones the whole body not just the feature.
I struggle to see the consistency on why some things work, and some things dont. So I must be missing something here.

If one draws one mounting tab top left, how does one clone the rest of them? mounting tabs in 4 positions (note they are not mirrored in the y axis but have an offset)?
2021-04-19 21_40_52-FreeCAD 0.19.png
2021-04-19 21_40_52-FreeCAD 0.19.png (178.72 KiB) Viewed 632 times

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23756 (Git)
Build type: Release
Branch: master
Hash: 9c6e9184930a52b165a0b7274e3a45d1006bfe67
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

Re: How to clone or copy a feature

Post by run_the_race »

Figured it out eventually, theres a "Multi transform array", just to the right of the array buttons, there one can add a X and Y offset.

What I don't understand is what the length attribute is or hows its measured. Say one wants an items every 100mm, what does one enter?
100mm? 100m + 2*width? 100m - 2*width? 100m - width? 100m + width?
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: How to clone or copy a feature

Post by chrisb »

run_the_race wrote: Mon Apr 19, 2021 8:27 pm What I don't understand is what the length attribute is or hows its measured.
It is the total length from the beginning of the first to the beginning of the last instance.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

Re: How to clone or copy a feature

Post by run_the_race »

chrisb wrote: Mon Apr 19, 2021 8:38 pm
run_the_race wrote: Mon Apr 19, 2021 8:27 pm What I don't understand is what the length attribute is or hows its measured.
It is the total length from the beginning of the first to the beginning of the last instance.
In the lego block tutorial https://wiki.freecadweb.org/Manual:Mode ... uct_design it agrees with you and says
which is the total "span" we want our copies to fit in
Here https://wiki.freecadweb.org/PartDesign_LinearPattern it says its the gap between them:
Define the Length (distance) between the last copied occurrence and the original feature.
But with my experimentation its neither. If I set it to 0, the parts are exactly on top of each other, if I set it to 1mm, then the parts are offset by 1mm. If I set it to the width of the part, they are exactly side by side. If I set it to 2widths, then there is a single width gap between them. To me length is the center to center offset.

I don't understand why it doesnt all tie up.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: How to clone or copy a feature

Post by chrisb »

Please upload the file where it is not as described in my last post.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

Re: How to clone or copy a feature

Post by run_the_race »

chrisb wrote: Mon Apr 19, 2021 9:24 pm Please upload the file where it is not as described in my last post.
I attached the file as requested. Refer to screen_mount_all_4 -> linear patternxxx as shown in the pic below:
ofsets.png
ofsets.png (193.79 KiB) Viewed 579 times
Attachments
raaspberry_pi_7inch_touchscreen.FCStd
(217.14 KiB) Downloaded 24 times
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: How to clone or copy a feature

Post by chrisb »

It is exactly as I said, but after a complete recompute you have an error in Sketch005. You have probably changed the number of instances in the properties, or something else without recomputing.
You should read about the topological naming problem and have a look at this page, especially the paragraph about creating stable models.

- LinearPattern goes in X direction, Length=126,2.
- LinearPattern001 goes in Z direction, Length=65,65

And these are the distance of the instances:
SnipScreenshot-41f6a7.png
SnipScreenshot-41f6a7.png (13.37 KiB) Viewed 570 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

Re: How to clone or copy a feature

Post by run_the_race »

chrisb wrote: Mon Apr 19, 2021 10:45 pm It is exactly as I said, but after a complete recompute you have an error in Sketch005. You have probably changed the number of instances in the properties, or something else without recomputing.
You should read about the topological naming problem and have a look at this page, especially the paragraph about creating stable models.

- LinearPattern goes in X direction, Length=126,2.
- LinearPattern001 goes in Z direction, Length=65,65

And these are the distance of the instances:
SnipScreenshot-41f6a7.png
Thanks to opening my eyes to this problem I did not know existed. I right clicked on each tree item and said reocmputer, then pressed F5 and did not see any errors. I right clicked on sketch005 and steps before and after it and select "Mark to recompute", then went "Edit" -> "Refresh" but still did not see any errors. How did you see the error?
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: How to clone or copy a feature

Post by chrisb »

run_the_race wrote: Tue Apr 20, 2021 12:12 pm How did you see the error?
I marked the whole model for recompute with the right mouse button on the filename. After recompute the error is shown. Perhaps different OCC versions?

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.24720 (Git)
Build type: Release
Branch: master
Hash: 8b0c58d1b45017ad42bf0fa8f827f1cf22a398e7
Python version: 3.9.2
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.1
Locale: C/Default (C)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

Re: How to clone or copy a feature

Post by run_the_race »

chrisb wrote: Tue Apr 20, 2021 7:04 pm
run_the_race wrote: Tue Apr 20, 2021 12:12 pm How did you see the error?
I marked the whole model for recompute with the right mouse button on the filename. After recompute the error is shown. Perhaps different OCC versions?

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.24720 (Git)
Build type: Release
Branch: master
Hash: 8b0c58d1b45017ad42bf0fa8f827f1cf22a398e7
Python version: 3.9.2
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.1
Locale: C/Default (C)
Thanks for that explanation. I tried recompute on the file name and got the same result. Hmm that is weird. And thanks for all the help over the last few days! Are you like paid from the FreeCAD donnations (if not you should be since you are so active on this forum :D )
Post Reply