Old Workflow refactoring

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Old Workflow refactoring

Post by ickby »

Nice work!
Some one need to help me up with the origin display which is broken after the migration (Have sad about it before)
I currently rebase the code I created recently to your "rebase" branch and now work with this as basis. Doing this I will look into this issue
PartDesign boolean features (I suppose we don't need them anymore, right?)
I think you come to this conclusion as now Part::Booleans are possible with bodies? And a body can have a body as base? hm in general you are right, I would still like to keep them, as they fit nicely in the body workflow, and you do not need switch workbenches if you want a cut or common. Should not be that hard to make them work again.
Addictive/subtractive Loft/Sweep, they supposed to be broken, as they were from the beginning... I've tried to touch them as less as possible.
Why have they been broken? they worked fine for me and during the first test run. Maybe they have been broken by the large rebase? If so I will have a look and fix it
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: Old Workflow refactoring

Post by Fat-Zer »

ickby wrote:Why have they been broken? they worked fine for me and during the first test run. Maybe they have been broken by the large rebase? If so I will have a look and fix it
I've managed to created a loft without crashing freecad only on the third try... After that when I've looked into code I didn't liked that it doesn't reuses the TopoShape::makeLoft(). Also I've got some plans in mind on rewriting it, so it would be possible to loft a face-to-face without a sketch
About sweep, AFAIR I was confused by the mess of pipe and sweep terms, I suppose they both refers to the same feature?
ickby wrote:I think you come to this conclusion as now Part::Booleans are possible with bodies? And a body can have a body as base? hm in general you are right, I would still like to keep them, as they fit nicely in the body workflow, and you do not need switch workbenches if you want a cut or common. Should not be that hard to make them work again.
For me the same sad story as with loft: but now I couldn't create a boolean at all... may be it would be better to create wrappers around Part's booleans? Like it is with duplicate command.
triplus wrote:Body container in this example actually is some sort of fork?
Yes, I was gonna to show, how currenly existing files with forks will likely look after the migration...And that it will be possible to safly migrate such files.
Although I think that forking may increase reuse of bodies and generally is not an evil thing...
triplus wrote:But if i see correctly Cube, Common, Sketch002, Pocket and Pyramid are all outside the body containers and as i understood this shouldn't be allowed in new PartDesign WB? But indeed once you do Common between (features in) 2 body containers will you be allowed to add/remove any new features to the result? As i am not all that sure how does this sort of operation fits in the idea "Forbid to create PartDesign features outside of bodies in the new workflow"? Isn't Common exactly that? A feature outside any body container?
Pyramid is a Body... So Pocket and Sketch002 are inside it amd Common is it's BaseFeature. Cube is a base feature for both Body and Body001. Note that Common and Cube are Part features, not PartDesign...
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Old Workflow refactoring

Post by ickby »

I've managed to created a loft without crashing freecad only on the third try...
Please report the cases for which it does not work, than i can fix it. It is of course not tested overly well, but it will get ironed out.
When I've looked into code I didn't liked that it doesn't reuses the TopoShape::makeLoft().

Because makeLoft does only work with profiles, a Part design feature however needs to work with sketches which form faces with inner and outer profiles. So you can't reuse it.
Also I've got some plans in mind on rewriting it, so it would be possible to loft a face-to-face without a sketch
I have this plan too, however, the workbench should have a unified behavior, so one needs to make all sketch based features work with faces. This is IMHO a needed and welcome improvement, and it is not very hard to achive. However, it needs some work and IMHO getting the workbench into master is more important right now. Such changes can happen later.
About sweep, AFAIR I was confused by the mess of pipe and sweep terms, I suppose they both refers to the same feature?
Yes,, I may have mixed it quite often :)
For me the same sad story as with loft: but now I couldn't create a boolean at all... may be it would be better to create wrappers around Part's booleans? Like it is with duplicate command.
I will check if it works in my branch. But I would like too keep it as it nicely holds the linear part workflow compared to the part tools.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Old Workflow refactoring

Post by triplus »

Fat-Zer wrote:Pyramid is a Body... So Pocket and Sketch002 are inside it amd Common is it's BaseFeature. Cube is a base feature for both Body and Body001. Note that Common and Cube are Part features, not PartDesign...
I see. Therefore as for the "Forbid to create PartDesign features outside of bodies in the new workflow" this rule is satisfied.

But this is new (conceptual difference)?
Creation of a body with base feature (just select a part::feature when creating a body)
The possibility to mix Part and PartDesign work flow by selecting Part feature as a base feature for Body? Therefore PartDesign features outside of body containers are not possible but it is possible to mix them with Part features when creating the Part? And basically as the single Part feature can be used as base feature for more body containers effectively indeed body containers in this use case are forks. :idea:
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Old Workflow refactoring

Post by jmaustpc »

ickby wrote:However, it needs some work and IMHO getting the workbench into master is more important right now. Such changes can happen later.
Hi ickby
Can you tell me when you get to a point where you have a branch for which my testing would be helpful to you?

You guys are still using some c++11 in these branch, aren’t you? Getting that to compile on Ubuntu 12.04 would be difficult, so I was wondering what you though about that? Do we drop support for 12.04 when it still has over 1.5 years to go, or is there a work around for 12.04, or would it be better to remove the C++11 bits and not use it for another approximately 1.5 years?

I still have a Kubuntu12.04 64bit box (which I am using to write this) so I could test anything you want me to on it.

Jim

edit, with help from Thomas and Werner, I tried to get this to compile on 12.04 sometime ago without success as changing the cmake files was not enough, at that time I gave up on it as I was moving to my newer PC with 14.04 anyway.
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: Old Workflow refactoring

Post by Fat-Zer »

Just pushed several changes: an initial implementation of the workflow manager and migration command + some bug fixes.
«Forbid outside of bodies» implemented only for Sketch command so far.
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: Old Workflow refactoring

Post by Fat-Zer »

Fixed Base plane display... that was so easy after I opened a book about Invertor...
On the other hand I was barely understood that I was doing, so please review it somebody: https://github.com/Fat-Zer/FreeCAD_sf_m ... 05cd48a9b6
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Old Workflow refactoring

Post by ickby »

Hey, dont have much time, but there is also a commit in my branch which fixes it too. It does basically the same as yours, but you forgot to respect the freecad settings. you can have a look there.
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Old Workflow refactoring

Post by ickby »

ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Old Workflow refactoring

Post by ickby »

sorry for the noise :) You forgot more than respecting the freecad settings. You also need to set which object the highlight node belongs to in the "attach" method of the viewprovider:

Code: Select all

pcHighlight->objectName = pcObject->getNameInDocument();
pcHighlight->documentName = pcObject->getDocument()->getName();
pcHighlight->subElementName = "Main";
This requires that you need to store the highlight node as member. If you do so, you need to ensure its reference count is updated correctly.
Post Reply