Question about Part Feature

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Question about Part Feature

Post by triplus »

kcleung wrote:Also, suppose if I make a CSG solid under the Part workbench, then how can I make a part out of it?

Currently I can't find anyway to do it under the Part or PartDesign workbench.
To add it to PartDesign Part feature you would i guess simply drag and drop it in it (tree view). After you can move the result (Part feature) around freely. If you would like to create PartDesign Body feature out of it. I guess you can't do that ATM. What you can do instead is install PoM and use its Module feature:

https://forum.freecadweb.org/viewtopic.php?f=22&t=20698

You can add CSG solid in a PoM Module feature. To get functionality like the Tip. And after you can add the Module to PartDesign Part feature (drag and drop in tree view) if you want that.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Question about Part Feature

Post by NormandC »

triplus wrote:If you would like to create PartDesign Body feature out of it. I guess you can't do that ATM.
Actually you can! You just select the CSG solid and click on "Create body". It will import the solid as base into a new Body.

EDIT: when I say import, it does not create a copy, the CSG solid itself is moved under the Body.
kcleung
Posts: 162
Joined: Sun Apr 24, 2011 11:56 am

Re: Question about Part Feature

Post by kcleung »

triplus wrote:
kcleung wrote:Also, suppose if I make a CSG solid under the Part workbench, then how can I make a part out of it?

Currently I can't find anyway to do it under the Part or PartDesign workbench.
To add it to PartDesign Part feature you would i guess simply drag and drop it in it (tree view). After you can move the result (Part feature) around freely. If you would like to create PartDesign Body feature out of it. I guess you can't do that ATM. What you can do instead is install PoM and use its Module feature:

https://forum.freecadweb.org/viewtopic.php?f=22&t=20698

You can add CSG solid in a PoM Module feature. To get functionality like the Tip. And after you can add the Module to PartDesign Part feature (drag and drop in tree view) if you want that.
Thanks Triplus and DeepSOIC! So the PoM Module can wrap a solid created by any workbench, and then I can drag that module into a partdesign part, am I correct?

Finally, I have just managed to drag my CSG solid created by the Part workbench into a Part in the PartDesign workbench (part1.fcstd). Have I done it correctly?
Attachments
part1.fcstd
(9.98 KiB) Downloaded 65 times
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Question about Part Feature

Post by NormandC »

kcleung wrote:Finally, I have just managed to drag my CSG solid created by the Part workbench into a Part in the PartDesign workbench (part1.fcstd). Have I done it correctly?
I think so, unfortunately there's a display bug in the Model tree when you drag & drop items on a Part, it makes a mess of duplicates:
FC017_kcleung_part1_01.png
FC017_kcleung_part1_01.png (19.39 KiB) Viewed 2439 times
You can see that "Cut" is listed twice, and the cubes are listed 3 times. :?

While we wait for a fix, the workaround is to move the CSG solid through a python command instead (thanks to DeepSOIC for the hint):

(Before entering this command in the python console, drag&drop the "Fillet" object out of the Part container)

Code: Select all

App.ActiveDocument.Part.Group = App.ActiveDocument.Part.Group + [App.ActiveDocument.Fillet]
This creates a proper tree:
FC017_kcleung_part1_02.png
FC017_kcleung_part1_02.png (10.35 KiB) Viewed 2439 times
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Question about Part Feature

Post by triplus »

kcleung wrote:Thanks Triplus and DeepSOIC! So the PoM Module can wrap a solid created by any workbench, and then I can drag that module into a partdesign part, am I correct?
Based on my understanding yes. And you can insert PoM Module in the first place. Just like you would insert a Body if you would use PartDesign features.
Have I done it correctly?
For now i try not to suggest what is correct and what not. Part of it comes down to my lack of extensive usage of PartDesign NEXT and part of it to unfinished state of PartDesign NEXT. After FreeCAD 0.17 will be released there will likely be a level of certainty involved on how exactly it will/should work. And shortcomings and things not implemented yet will likely be documented. When that happens it will be easier to give more direct answers.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Question about Part Feature

Post by DeepSOIC »

Adding Part-workbench objects to Part container with drag-drop actually works correctly. They used to be displayed in tree view normally, and now they kinda don't. This seems to be a sort of regression.
NormandC wrote:While we wait for a fix, the workaround is to move the CSG solid through a python command instead (thanks to DeepSOIC for the hint): (Before entering this command in the python console, drag&drop the "Fillet" object out of the Part container)

Code: Select all

App.ActiveDocument.Part.Group = App.ActiveDocument.Part.Group + [App.ActiveDocument.Fillet]
Using console snippet that I wrote and Normand reproduced here is not recommended, because it gives a false impression that the whole tree was added to Part. However it wasn't, which can be revealed by dependency graph, by hiding-showing Part when inner CSG objects are shown, or by moving Part.

The console snippet workaround should only be used to suck in other containers into Part, such as Bodies and other Parts.
kcleung
Posts: 162
Joined: Sun Apr 24, 2011 11:56 am

Re: Question about Part Feature

Post by kcleung »

NormandC wrote:
kcleung wrote:Finally, I have just managed to drag my CSG solid created by the Part workbench into a Part in the PartDesign workbench (part1.fcstd). Have I done it correctly?
I think so, unfortunately there's a display bug in the Model tree when you drag & drop items on a Part, it makes a mess of duplicates:

FC017_kcleung_part1_01.png
You can see that "Cut" is listed twice, and the cubes are listed 3 times. :?

While we wait for a fix, the workaround is to move the CSG solid through a python command instead (thanks to DeepSOIC for the hint):

(Before entering this command in the python console, drag&drop the "Fillet" object out of the Part container)

Code: Select all

App.ActiveDocument.Part.Group = App.ActiveDocument.Part.Group + [App.ActiveDocument.Fillet]
This creates a proper tree:
FC017_kcleung_part1_02.png
So have we filed an issue for this bug yet?
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Question about Part Feature

Post by triplus »

kcleung
Posts: 162
Joined: Sun Apr 24, 2011 11:56 am

Re: Question about Part Feature

Post by kcleung »

triplus wrote: Sat Apr 29, 2017 4:18 pm Reference:

https://forum.freecadweb.org/viewtopic.php?f=20&t=22077
I am working on DeepSOIC's ActiveContainer feature, that makes the selection interface easier to use. Could you guys try it out:

https://github.com/kcleung/FreeCAD/tree/ActiveContainer
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Question about Part Feature

Post by triplus »

Good to hear you are working on this again. I feel that much was said in the past already and the effort itself resulted in a bit of a standstill situation. Therefore best to leave it as is for now and just continue to do what you do. That is move the effort forward by doing things that make sense. And continue to be persistent with your questions and try to involve developers working on this area directly.

You seem to be successful at this for now and therefore just continue with that and good luck for now from my side. ;)
Post Reply