Improvement proposal for Link in conjunction with Body

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Improvement proposal for Link in conjunction with Body

Post by openBrain »

Hi all,

I just remarked how Link behaves with Body. From my side the current behavior seems to be pretty unnatural and useless (not insulting in any way :P).
As a context, I'd like to use Link applied to Body in 2 different contexts :
  • Assembly : parts of an assembly are modeled with PartDesign one in a different file (so basically each part is a Body in its own file) and I have an assembly file where I want to link to each part
  • Sharing : when 2 parts have the same base shape, I model this latter in a file, then I want to link it to other files where specific operations are further added to the base to create each variant part
Improvement #1

First below is what happened currently if I set a Link to a Body :
LinkBody1.png
LinkBody1.png (15.11 KiB) Viewed 813 times
It creates a duplicate of the Body with its complete tree items as Links.

What I'd expect (and thus propose) is that it creates a Link only to the Body container itself, with shape being the tip of the Body. Something similar to applying Draft/Clone or Part/RefinedCopy to the Body with the advantage it works across 2 files.

Improvement #2

Currently Link objects can't be used as BaseFeature in a Body. Below is how it looks like if you try with the error message in the tooltip.
LinkBody2.png
LinkBody2.png (23.78 KiB) Viewed 813 times
I think it is really a pity and I'd like that it could be possible.

Improvement #3

It is currently possible to set a Link to an internal feature of a Body. The created is outside the Body but this is an allowed link (not out of scope). This can be great, but unfortunately ATM the shape orientation isn't kept (on the example, the Sketch is on XZ plane) :
LinkBody3.png
LinkBody3.png (20.08 KiB) Viewed 783 times
I didn't see any usage of this feature for me, but I guess it would be better if orientation is correctly linked to too.

Here we are. What are your thoughts about all this ? Do you think these are really improvements ?
Last edited by openBrain on Wed Apr 01, 2020 5:58 pm, edited 1 time in total.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Improvement proposal for Link in conjunction with Body

Post by vocx »

openBrain wrote: Wed Apr 01, 2020 1:07 pm ...
[*]Sharing : when 2 parts have the same base shape, I model this latter in a file, then I want to link it to other files where specific operations are further added to the base to create each variant part[/list]
This has already been discussed a couple of times in the forum.

The general notion is that, yes, realthunder will add more support for App Link and PartDesign Bodies in the future. The reason this hasn't happened yet is because the changes are a bit difficult to implement, so he needs to do some more testing to see what works the best.

Re: App::link of sketch in PD Body
Why Link should be available in PartDesign
Improvement #1

What I'd expect (and thus propose) is that it creates a Link only to the Body container itself, with shape being the tip of the Body...
Probably this is exactly what is occurring under the hood. I mean, how does it affect you to display all items under the Body?
Improvement #2

Currently Link objects can't be used as BaseFeature in a Body.
I think this is the same discussion as the previous two threads. It will come, realthunder just needs to do the work and be sure it won't break everything.

So far it's been discussed to link the base sketches to have a "library" of profiles that can be modified quickly. Or using partial solids inside other solids, precisely like a BaseFeature. Or Zolko's idea of using variant "Links", which is a linked object that could still be modified a little with certain parameters.

Also, just because you can't use the BaseFeature it's not a big problem as you surely can use the new PartDesign SubShapeBinder.
Improvement #3

It is currently possible to set a Link to an internal feature of a Body. The created is outside the Body but this is an allowed link (not out of scope). This can be great, but unfortunately ATM the shape orientation isn't kept (on the example, the Sketch is on XZ plane) :
It sounds like you could use PartDesign SubShapeBinder.

Also, I think you repeated the same image twice.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Improvement proposal for Link in conjunction with Body

Post by openBrain »

vocx wrote: Wed Apr 01, 2020 5:47 pm Probably this is exactly what is occurring under the hood. I mean, how does it affect you to display all items under the Body?
  1. This isn't what I expect :) And actually I don't see any added value to this.
  2. This clutters a lot the tree if eg. I just want to use this Body into an assembly
  3. If I activate the linked Body and add a sketch in it (let say I want to further operate this link), it actually adds it as a link and the "real" sketch is created in the original Body. Which again I don't think is useful in real modeling.
Also, just because you can't use the BaseFeature it's not a big problem as you surely can use the new PartDesign SubShapeBinder.
:shock: A SubShapeBinder doesn't bring any real solid material. The goal of the BaseFeature is aptly to use it as a base solid for further processing.
Also, I think you repeated the same image twice.
Right. Fixed. Makes more sense now. ;)
User avatar
adrianinsaval
Veteran
Posts: 5552
Joined: Thu Apr 05, 2018 5:15 pm

Re: Improvement proposal for Link in conjunction with Body

Post by adrianinsaval »

openBrain wrote: Wed Apr 01, 2020 6:00 pm
vocx wrote: Wed Apr 01, 2020 5:47 pm Probably this is exactly what is occurring under the hood. I mean, how does it affect you to display all items under the Body?
  1. This isn't what I expect :) And actually I don't see any added value to this.
  2. This clutters a lot the tree if eg. I just want to use this Body into an assembly
  3. If I activate the linked Body and add a sketch in it (let say I want to further operate this link), it actually adds it as a link and the "real" sketch is created in the original Body. Which again I don't think is useful in real modeling.
You could simply collapse the body so it doesn't clutter, the added value is that you can edit the linked object right there, no need to open in a separate tab, and you can see how it was constructed and every other detail. Your third point is exactly the behavior I and probably many more people expect, if you're editing the linked body its reasonable that the modifications be applied to the original file.

Now that isn't to say that a link with only the shape is not useful, that is what subshapebinders are for, and guess what: you can use them as basefeature! See attached example(download both files in same folder and open test2.FCStd). I think this is what you want.
Attachments
test2.FCStd
(12.76 KiB) Downloaded 20 times
test.FCStd
(7.36 KiB) Downloaded 20 times
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Improvement proposal for Link in conjunction with Body

Post by openBrain »

adrianinsaval wrote: Wed Apr 01, 2020 6:49 pm You could simply collapse the body so it doesn't clutter, the added value is that you can edit the linked object right there, no need to open in a separate tab, and you can see how it was constructed and every other detail. Your third point is exactly the behavior I and probably many more people expect, if you're editing the linked body its reasonable that the modifications be applied to the original file.
Why not ? Let's say have an option so that the Link can be some kind of either 'Tip' (exposed as a simple object) or 'Through' (exposed with its tree). But IMO it could also be a reasonable solution that a Body always link as a simple object and when you double-click on it, it automatically opens the source. ;)
Now that isn't to say that a link with only the shape is not useful, that is what subshapebinders are for, and guess what: you can use them as basefeature! See attached example(download both files in same folder and open test2.FCStd). I think this is what you want.
It almost work. The binder isn't correctly restored when I open the file so basically it's broken. Apart of that, this is just an horrible solution. :)
User avatar
adrianinsaval
Veteran
Posts: 5552
Joined: Thu Apr 05, 2018 5:15 pm

Re: Improvement proposal for Link in conjunction with Body

Post by adrianinsaval »

openBrain wrote: Wed Apr 01, 2020 7:04 pm Why not ? Let's say have an option so that the Link can be some kind of either 'Tip' (exposed as a simple object) or 'Through' (exposed with its tree). But IMO it could also be a reasonable solution that a Body always link as a simple object and when you double-click on it, it automatically opens the source. ;)
I wouldn't want that to be default, it is easier to edit right there and easier to reference parameters from within the body in some expression I may use. Having to open the file separately for all that would be annoying. EDIT: I'm not against having the option though, maybe there is one already and its burried in the sea of the forum unbeknownst to us.
It almost work. The binder isn't correctly restored when I open the file so basically it's broken. Apart of that, this is just an horrible solution. :)
Not broken for me, I even edited test separately and only required a recompute to update the link when I opened test2. Did you download both files in the same folder with the same names? What version of FreeCAD are you using? EDIT: also what error did you get?
Why is it horrible? Whats the benefit of showing only the body and having acces only to its shape over a subshapebinder?
User avatar
adrianinsaval
Veteran
Posts: 5552
Joined: Thu Apr 05, 2018 5:15 pm

Re: Improvement proposal for Link in conjunction with Body

Post by adrianinsaval »

openBrain wrote: Wed Apr 01, 2020 1:07 pm Improvement #2

Currently Link objects can't be used as BaseFeature in a Body. Below is how it looks like if you try with the error message in the tooltip.
LinkBody2.png
Realthunder has this implemented in his fork: https://github.com/realthunder/FreeCAD_ ... Notes-0.11
forum post: https://forum.freecadweb.org/viewtopic. ... 42#p391176
It may be merged in 0.20

Edit: basefeature doesn't support the multiple solids from a body that can be used in realthunders branch, not sure of the relevance of this but I reported it anyway: https://github.com/realthunder/FreeCAD/issues/29
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Improvement proposal for Link in conjunction with Body

Post by openBrain »

adrianinsaval wrote: Fri Apr 24, 2020 7:38 pm Realthunder has this implemented in his fork: https://github.com/realthunder/FreeCAD_ ... Notes-0.11
forum post: https://forum.freecadweb.org/viewtopic. ... 42#p391176
It may be merged in 0.20
Good to know. Thx. :+1:
Post Reply