I could not figure out the logic behind constraintlist returing an empty getvalues() when the geometry is invalid. However, without changing that class, I was able to avoid it by calling acceptgeometry right before validateExternalLinks. Yet the battle is only half done, since we still need a way to validate datums!DeepSOIC wrote:I remember that evil bit of code, I messed with it some long time ago. It makes it look like the sketch has no constraints if geometry types change, and eventually that state of no constraints is stored permanently, with no way back.jnxd wrote:Once the deletion is triggered, the code tries to delete constraints related to these external geometries, but due to the structure of the constraintlist object, we only get an empty list, and the code replaces the constraints with this empty list.
I searched up the commit that introduced the code, and it was some kind of an experimental measure against crashes when edge kind of external geometry changes.
I thought on how to solve it better, but unfortunately didn't come up with anything.
So the way to go should be to patch up validateExternalLinks, I think.
[bug#2682] -constraints with external geometry disapear after closing/opening the sketch
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
Re: [bug#2682] -constraints with external geometry disapear after closing/opening the sketch
Re: [bug?] -constraints with external geometry disapear after closing/opening the sketch
The test file currently seems out of date, due to the transitional nature of PDN. Nemesis, could you update it?nemesis wrote:and the test file
I patched up validateExternalLinks as DeepSOIC suggested, and that seems to have sorted the issue as far as the removal of constraints on restore is concerned. But the original issue, that nemesis mentioned, doesn't seem to even exist without the patch.
Re: [bug#2682] -constraints with external geometry disapear after closing/opening the sketch
Done in the Tracker.
with this version :
OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10519 (Git)
Build type: Release
Branch: (detached from e3d5584)
Hash: e3d55841065cc22b32eda7ff53a648698c748562
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
with this version :
OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10519 (Git)
Build type: Release
Branch: (detached from e3d5584)
Hash: e3d55841065cc22b32eda7ff53a648698c748562
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Re: [bug#2682] -constraints with external geometry disapear after closing/opening the sketch
Thanks. I presume the steps to reproduce are the same as the first post of this thread.nemesis wrote:Done in the Tracker.
with this version :
OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10519 (Git)
Build type: Release
Branch: (detached from e3d5584)
Hash: e3d55841065cc22b32eda7ff53a648698c748562
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Re: [bug#2682] -constraints with external geometry disapear after closing/opening the sketch
Absolutelyjnxd wrote: Thanks. I presume the steps to reproduce are the same as the first post of this thread.
Re: [bug#2682] -constraints with external geometry disapear after closing/opening the sketch
I opened your file and there is no external geometry even in your fcstd file. What constraints did you apply? I created the edge and applied some arbitrary constraints, and I could change the angle of the datum plane from 45 to 40 degrees without seeing any constraints removed. With my patch I was also able to save and restore all external geometries and constraints. Can you build from here, and check if you can do all these things?nemesis wrote:Absolutelyjnxd wrote: Thanks. I presume the steps to reproduce are the same as the first post of this thread.
version details:
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10539 +1 (Git)
Build type: Debug
Branch: bugsquash
Hash: 7ce31a805a84ae75a51148f6c4c421b6a351ab74
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Re: [bug#2682] -constraints with external geometry disapear after closing/opening the sketch
that's the pointjnxd wrote:I opened your file and there is no external geometry even in your fcstd file......
here is an example, but it bug whatever the constraint is with the external ref to datum plane
unfortunatly I've never succed to compile freeCAD (but my last try was some years ago... )jnxd wrote:Can you build from here, and check if you can do all these things?
Re: [bug#2682] -constraints with external geometry disapear after closing/opening the sketch
PR is merged now so you can try the daily when its released.nemesis wrote:that's the pointjnxd wrote:I opened your file and there is no external geometry even in your fcstd file......
here is an example, but it bug whatever the constraint is with the external ref to datum plane
SketcExtRef.PNG
unfortunatly I've never succed to compile freeCAD (but my last try was some years ago... )jnxd wrote:Can you build from here, and check if you can do all these things?
Re: [bug?] -constraints with external geometry disapear after closing/opening the sketch
Sorry, I have been away. Glad you figured it out.jnxd wrote:
Summoning some people to shed some light on what to doIf necessary, we could move the talks to the development thread.abdullah wrote: ...
Re: [bug?] -constraints with external geometry disapear after closing/opening the sketch
That's quite alright. And as I said the battle is only half over. There is still this problem of all the constraint deletion on failure of a single external element. If you've roamed around these streets, please input.abdullah wrote:
Sorry, I have been away. Glad you figured it out.