Multibody Part: Unknown C++ exeption when saving

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!
User avatar
OakLD
Posts: 131
Joined: Fri Jan 12, 2018 7:38 pm
Location: Brno

Multibody Part: Unknown C++ exeption when saving

Post by OakLD »

Hello,

this is related to development version 0.17 and it's new topology. Perhaps I am doing something incorrectly with my attempts of multibody part. The reason for a multibody part is, that I need to process it with FEM later and it should be easier to model it in one part, do a boolean fusion and then FEM.

By trial-and-error procedure I found out, that I cannot do multiple pads from different sketches within one body, when one pad is placed along the other (so not based on the face of the other) 1mm apart and connected by welds. So I created a second body and started to sketch and pad it separately, but I get all sorts of errors, like "out of memmory", "Unknown C++ exeption" (this error shows when saving), features disappearing...
FC_01.PNG
FC_01.PNG (23.22 KiB) Viewed 1965 times
It might be happening simply due to the development state of FC 0.17, but I have a feeling, that perhaps my approach is incorrect and I am using it incorrectly. Is there a recommended procedure for multibody parts in the new topology enviroment of 0.17?

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13408 (Git)
Build type: Release
Branch: (HEAD detached at FETCH_HEAD)
Hash: 7cf0beb6c024fd0cb3739de843d7ccafc6de8035
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
Locale: Czech/CzechRepublic (cs_CZ)
Regards,

Oak
User avatar
OakLD
Posts: 131
Joined: Fri Jan 12, 2018 7:38 pm
Location: Brno

Re: Multibody Part: Unknown C++ exeption when saving

Post by OakLD »

OK, I found 1 workaround: To model the other part in a separate file and then copy&paste it into the target file. Then there are no troubles.
FC_02.PNG
FC_02.PNG (27.78 KiB) Viewed 1943 times
I am still interested in comments regarding a proper recommended procedure.
Regards,

Oak
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Multibody Part: Unknown C++ exeption when saving

Post by wmayer »

Perhaps I am doing something incorrectly with my attempts of multibody part.
Independent of whether your workflow is correct, wrong, good or bad such an error shouldn't occur. Could you give step-by-step instruction how to get into this state, please? Maybe we could fix this then before the 0.17 release.
User avatar
OakLD
Posts: 131
Joined: Fri Jan 12, 2018 7:38 pm
Location: Brno

Re: Multibody Part: Unknown C++ exeption when saving

Post by OakLD »

wmayer wrote: Thu Mar 15, 2018 12:18 pmIndependent of whether your workflow is correct, wrong, good or bad such an error shouldn't occur. Could you give step-by-step instruction how to get into this state, please? Maybe we could fix this then before the 0.17 release.
OK, I'll do that, I'll put each issue I ran into and will be able to reproduce it into a separate post. It will take me some time, maybe few days...

Here is the first one:
  • New file
  • Create Body
  • Create Sketch: XY_plane
  • Draw profile, save sketch (100x50 simplified shape)
    FC_03.PNG
    FC_03.PNG (14.33 KiB) Viewed 1905 times
  • Pad sketch L=780
  • Save TEST1.fcstd
  • Pick Body.Face4
  • Create a new sketch (of a profile in a perpendicular position to the first, 1mm apart)
    FC_04.PNG
    FC_04.PNG (83.89 KiB) Viewed 1905 times
  • Pad: Two dimensions: 100, 150mm
>> No profile is shown, even though a new feature "Pad001" apears
>> Here is the result with sketch made visible manually (to demonstrate where the "pad" should appear)
FC_05.PNG
FC_05.PNG (16.37 KiB) Viewed 1905 times
>> Turning visibility of Pad001 on/off switches the visibility of Pad the same ways as if turn on/of visibility of Pad.

Please note, that the parts are 1mm apart (at this stage). This could be a problem to "Body" container. Since there's no correct procedure to model such parts (I would know about), it may be a design limitation, or it may be a bug.
Regards,

Oak
User avatar
OakLD
Posts: 131
Joined: Fri Jan 12, 2018 7:38 pm
Location: Brno

Re: Multibody Part: Unknown C++ exeption when saving

Post by OakLD »

  • Open file ASSY U2
  • Mouse pick ASSY_U2.Body.Pad002.Face22
  • PartDesign WB: Create Sketch
    FC_06.PNG
    FC_06.PNG (12.09 KiB) Viewed 1888 times
  • Error: To create a new PartDesign object, there must be an active Body object in the document... OK
  • Model tab, double click "Body" container object.
  • Again, Mouse pick ASSY_U2.Body.Pad002.Face22
  • X (Create an edge linked to external geometry), pick ASSY_U2.Body.Pad002.Edge47
  • R (Rectangle), with one point on the inherited edge. Constrain it to 150x2mm and set 30mm from the end of adjuscent section.
  • Close (sketch)
    FC_07.PNG
    FC_07.PNG (26.42 KiB) Viewed 1888 times
  • Pad >>> Error: In order to use this feature it needs to belong to a part object in the document
FC_08.PNG
FC_08.PNG (54.21 KiB) Viewed 1888 times
I understand why it is happening, but I don't know how to avoid it - I think that thre are asome gaps in the logic of the new topology. I noticed, that you can design features without body, features within body (blue tetris icon), and bodies can be contained within Part (yellow tetris icon). But when you create a solid feature, sometimes a body object apears, sometimes not (probably depending on the commmand). And there are way more possibilities when you're copying features from one file to another, one body to another, if you create the body first manully, etc. etc.

EDIT: I tried the same procedure again on the same model and this time it created a Pad feature without the error message, but nothing shows in the model (the same issue as in previous post).

EDIT2: I didn't saved the broken Pad and closed the file. Then re-opened, clicked on the Pad again and it works now... With the same sketch.
Regards,

Oak
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Multibody Part: Unknown C++ exeption when saving

Post by sgrogan »

OakLD wrote: Thu Mar 15, 2018 1:01 pm Please note, that the parts are 1mm apart (at this stage). This could be a problem to "Body" container. Since there's no correct procedure to model such parts (I would know about), it may be a design limitation, or it may be a bug.
A Body [1] can only contain a single connected solid. When disconnected solids are created all but 1 will be randomly discarded. I think there is already an issue on the tracker to give the user a warning. I don't think Pad001 should appear in the tree.

To make multiple disconnected solids each must be created in it's own body. To create datum references between bodies the PartDesign_ShapeBinder is used.

[1] https://www.freecadweb.org/wiki/PartDesign_Workbench
"fight the good fight"
User avatar
OakLD
Posts: 131
Joined: Fri Jan 12, 2018 7:38 pm
Location: Brno

Re: Multibody Part: Unknown C++ exeption when saving

Post by OakLD »

Another multibody issue:

1) I fusioned the new body with the previous body (COLUMN001) into Fusion object
2) Now I want to draw a rectangle on one of the face and make it a boolean fragment, so I select the face and click on Create sketch command. I get an error, that the object must be contained within a Body.
3) Deselected, selected fusion again, selected face, clicked again the Create Sketch command and it works this time. Strangely enough, the new sketch is part of a new different body, the Body002. It seems, that this body has a link to the original body. Such setup cannot be succesfully meshed with the sketch. So...
FC_10.PNG
FC_10.PNG (50.56 KiB) Viewed 1840 times
4) Selected BaseFeature and Sketch004 and run PartWB->Shape Splitting Tools->Boolean Fragments.
5) A new object BooleanFragments appears, in the root (NOT within a Body002). So is this another little gap in topology?
6) But that's OK, FEM WB accepts this setup and doesn't care about missing Body container of BooleanFragments.
FC_11.PNG
FC_11.PNG (131.3 KiB) Viewed 1840 times
Regards,

Oak
User avatar
OakLD
Posts: 131
Joined: Fri Jan 12, 2018 7:38 pm
Location: Brno

Re: Multibody Part: Unknown C++ exeption when saving

Post by OakLD »

sgrogan wrote: Thu Mar 15, 2018 1:53 pm To make multiple disconnected solids each must be created in it's own body.
Fair enough. That is what I empirically discovered, so now I know it's correct. Another thing is that when trying to create multiple bodies, I get issues too.
The warning would be enough for user to understand what is happening, IMHO.
sgrogan wrote: Thu Mar 15, 2018 1:53 pmTo create datum references between bodies the PartDesign_ShapeBinder is used.

I will have a look at it, thanks :-). Some docs have changed lately, I see.
Regards,

Oak
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Multibody Part: Unknown C++ exeption when saving

Post by sgrogan »

OakLD wrote: Thu Mar 15, 2018 1:59 pm 4) Selected BaseFeature and Sketch004 and run PartWB->Shape Splitting Tools->Boolean Fragments.
When using non-PartDesign WB tools on PartDesign objects you need to operate on the Body, not the Features inside the Body.
If you look at the Std_DependencyGraph for your model I image it is a tangled mess.

There is still much to be done making non PartDesign tools work on PartDesign Bodies, so results may vary.
"fight the good fight"
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Multibody Part: Unknown C++ exeption when saving

Post by sgrogan »

OakLD wrote: Thu Mar 15, 2018 2:05 pm I will have a look at it, thanks . Some docs have changed lately, I see.
Yes, NormandC has recently totally re-written the PartDesign sections to reflect 0.17
"fight the good fight"
Post Reply