Question about Part Feature

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
triplus
Posts: 4983
Joined: Mon Dec 12, 2011 4:45 pm

Re: Question about Part Feature

Postby triplus » Wed Apr 19, 2017 1:09 am

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
Posts: 12258
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Question about Part Feature

Postby NormandC » Wed Apr 19, 2017 2:40 am

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: 61
Joined: Sun Apr 24, 2011 11:56 am

Re: Question about Part Feature

Postby kcleung » Wed Apr 19, 2017 2:52 am

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 3 times
User avatar
NormandC
Posts: 12258
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Question about Part Feature

Postby NormandC » Wed Apr 19, 2017 3:06 am

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 123 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 123 times
triplus
Posts: 4983
Joined: Mon Dec 12, 2011 4:45 pm

Re: Question about Part Feature

Postby triplus » Wed Apr 19, 2017 11:51 am

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.
DeepSOIC
Posts: 4663
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Question about Part Feature

Postby DeepSOIC » Wed Apr 19, 2017 12:18 pm

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: 61
Joined: Sun Apr 24, 2011 11:56 am

Re: Question about Part Feature

Postby kcleung » Wed Apr 19, 2017 11:24 pm

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?