[bug#2682] -constraints with external geometry disapear after closing/opening the sketch

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
nemesis
Posts: 372
Joined: Tue Mar 25, 2014 11:24 pm
Location: France, Lyon

Re: [bug] -constraints with external geometry disapear after closing/opening the sketch

Post by nemesis »

yep
still there on :

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9641 (Git)
Build type: Release
Branch: (detached from d8afbe5)
Hash: d8afbe563e52281daac5fa63b12ef2e9efc61e9e
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 7.0.0


And maybe I've found another one.
I'm unable to use external geometry on datum plane if the file has not been closed once and re-opened.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [bug] -constraints with external geometry disapear after closing/opening the sketch

Post by Kunda1 »

nemesis wrote:And maybe I've found another one.
I'm unable to use external geometry on datum plane if the file has not been closed once and re-opened.
@nemesis thanks for retesting.
Please open a new ticket for this bug if you can't find a duplicate on the tracker.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
nemesis
Posts: 372
Joined: Tue Mar 25, 2014 11:24 pm
Location: France, Lyon

Re: [bug] -constraints with external geometry disapear after closing/opening the sketch

Post by nemesis »

User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [bug] -constraints with external geometry disapear after closing/opening the sketch

Post by Kunda1 »

nemesis wrote:issue #2859 done
Just for posterity this thread was initially for issue #2682
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
nemesis
Posts: 372
Joined: Tue Mar 25, 2014 11:24 pm
Location: France, Lyon

Re: [bug] -constraints with external geometry disapear after closing/opening the sketch

Post by nemesis »

still there
OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9838 (Git)
Build type: Release
Branch: (detached from 1e4b6ed)
Hash: 1e4b6ed00be8bf6931ba6b7acccf6494a5bfbbbf
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 7.0.0

and no warning message or information in the terminal
hokieengr
Posts: 62
Joined: Sat Dec 31, 2016 5:09 pm

Re: [bug] -constraints with external geometry disapear after closing/opening the sketch

Post by hokieengr »

Can anyone tell me how this is supposed to work? This was driving me nuts the other day while modeling something so I'm glad to see it's a bug and not user error.

If someone could outline the desired behavior here and any insight you may have on the nature of the problem, I'll look into fixing it.

Thank you!
Bob
User avatar
nemesis
Posts: 372
Joined: Tue Mar 25, 2014 11:24 pm
Location: France, Lyon

Re: [bug] -constraints with external geometry disapear after closing/opening the sketch

Post by nemesis »

Hi,
hokieengr wrote:If someone could outline the desired behavior here and any insight you may have on the nature of the problem, I'll look into fixing it.
I guess it should work like any other flat face. if you use a shapebinder on a flat face, you will be able to make a sketch on it.
then using other plane or other "stuff" as external reference should keep it in the sketch.
indeed it looks like nothing is saved in the sketch, if this sketch is on a datum plane.

the other bug looks like the visible datum plane is not accessible in the 3D view until you save the document and open it again, so maybe a viewprovider issue
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [bug] -constraints with external geometry disapear after closing/opening the sketch

Post by Kunda1 »

hokieengr wrote:Can anyone tell me how this is supposed to work? This was driving me nuts the other day while modeling something so I'm glad to see it's a bug and not user error.

If someone could outline the desired behavior here and any insight you may have on the nature of the problem, I'll look into fixing it.

Thank you!
Bob
see the above reply ^
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [bug?] -constraints with external geometry disapear after closing/opening the sketch

Post by jnxd »

nemesis wrote: ...it looks like they disappear when saving the file.
They do not. They are still present in the FCSTD file: open it as a zip file and read the Document.xml file.

It appears issue #2682 is two bugs bundled into one:
  • Any external geometries coming from a datum are deleted if a particular function (SketchObject::validateExternalLinks(void)) is called. This happens because the code is trying to access a certain subshape of the object, but the definition is vague for datums. For normal geometries, the subshapes are "face1", "edge1", "vertex1" etc, but for Datums they are "Plane", "Line" and "Point".
  • 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.
Summoning some people to shed some light on what to do
ickby wrote: ...
DeepSOIC wrote: ...
abdullah wrote: ...
If necessary, we could move the talks to the development thread.
My latest (or last) project: B-spline Construction Project.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: [bug#2682] -constraints with external geometry disapear after closing/opening the sketch

Post by DeepSOIC »

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 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.

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.
Post Reply