[fixed] Ticket #4058 - cannot set coincident constraint in 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
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: cannot set coincident constraint in sketch

Post by uwestoehr »

kisolre wrote: Tue Jul 16, 2019 11:07 am Just toggle it off and on again. This usually fixes that.
Thanks, however this is just a workaround of the bug.

I realized now that this part of the bug is in sketcher, not the DXF importer. Because the importer ignores the sketcher preferences but the sketcher has the bug that it does not indicate the correct state of autoconstraints.
I reported this part now as issue #4058.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: cannot set coincident constraint in sketch

Post by openBrain »

uwestoehr wrote: Tue Jul 16, 2019 10:44 am How do you achieve this?
  • In the import options, select "Create" -> "Simple Part shapes" and do NOT join geometry
  • You obtain a number of atomic shapes. Delete the unwanted ones to keep only the needed
  • Select all remaining (useful) shapes in the tree view and use Draft Draft2Sketch on them
  • You obtain as much sketches as there were part shapes. You can now delete the part shapes (while they are still selected).
  • Select all the sketches in the treeview and use Sketcher MergeSketches on them.
  • You obtain one merged sketch. You can now delete the atomic sketches (while they are still selected).
  • Select the complete sketch and use Sketcher ValidateSketch on it as usual
You're done. ;)
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: cannot set coincident constraint in sketch

Post by uwestoehr »

openBrain wrote: Tue Jul 16, 2019 12:24 pm In the import options, select "Create" -> "Simple Part shapes" and do NOT join geometry
Thanks. I played with your method and I think it is even faster to use "Create" -> "Sketches" and do NOT join geometry. This is what I already do for complex geometries. If I did not make a mistake the workflow is then yours with the benefit that one can omit the Draft2Sketch step.
I guess "Create" -> "Sketches" automatically invokes Draft2Sketch if possible.
User avatar
Roy_043
Veteran
Posts: 8577
Joined: Thu Dec 27, 2018 12:28 pm

Re: cannot set coincident constraint in sketch

Post by Roy_043 »

@chrisb:
Changing the Autoconstraint attribute on the View tab has no effect here. When opening the sketch the global preference is always used. In fact when closing the sketch the Autoconstraint attribute on the View tab is updated to match the global preference.

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17337 (Git)
Build type: Release
Branch: master
Hash: 0871fb49c71f1ac4029e441814332368f42bd78a
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: cannot set coincident constraint in sketch

Post by uwestoehr »

Roy_043 wrote: Tue Jul 16, 2019 3:06 pm Changing the Autoconstraint attribute on the View tab has no effect here. When opening the sketch the global preference is always used. In fact when closing the sketch the Autoconstraint attribute on the View tab is updated to match the global preference.
One has to distinguish, see issue #4058:

Case A:
- assure you have in the sketcher preferences the option "Auto constraints" enabled
- create a new sketch
- select the sketch in the tree view
- change to the View tab and set there "Autoconstraints" to "false"
- open the sketch
result: the task dialog tells you that "Auto constraints" is on while this is not the case for the sketch.
- close the sketch
result: in the View tab "Autoconstraints" is still correctly "false"

Case B:
- assure you have in the sketcher preferences the option "Auto constraints" disabled
- create a new sketch
- select the sketch in the tree view
- change to the View tab and set there "Autoconstraints" to "true"
- open the sketch
result: the task dialog tells you that "Auto constraints" is off and this is the case, so the view tab settings was ignored
- close the sketch
result: in the View tab "Autoconstraints" is now "false"
chrisb
Veteran
Posts: 54284
Joined: Tue Mar 17, 2015 9:14 am

Re: cannot set coincident constraint in sketch

Post by chrisb »

Autoconstraints in the Sketcher's Edit controls always reflects the state as set in the preferences, while the behaviour of Sketcher follows the value set in the view attributes.

This is indeed confusing, I vote for removing the attribute alltogether and leave Autoconstraints as an editing help but not as a certain sketch property.

I have seen here people who like using autoconstraints. The probably like to use them in general, not on special sketches only. And I have seen people who don't use them, because they have better control over what's happening. And again, they would probably want this on all sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Roy_043
Veteran
Posts: 8577
Joined: Thu Dec 27, 2018 12:28 pm

Re: cannot set coincident constraint in sketch

Post by Roy_043 »

@uwestoehr
Thanks for your explanation. And also thank you for your important work updating the FreeCAD documentation.

chrisb wrote: Tue Jul 16, 2019 10:38 pm the behaviour of Sketcher follows the value set in the view attributes.
Uwestoehr's case B demonstrates that this is not the case. It is indeed confusing.
chrisb
Veteran
Posts: 54284
Joined: Tue Mar 17, 2015 9:14 am

Re: cannot set coincident constraint in sketch

Post by chrisb »

That's correct, sorry! (The behaviour was different in 0.18.)
Besides discussing how it is now, what do you think about removing the attribute?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: cannot set coincident constraint in sketch

Post by kisolre »

It sometimes bugs me too when opening some file with Autoconstraint off. For me it is a preference how I like to create and edit sketches. 99% I want it activated. In the other 1% I either place entities in such a way that no constraints are added (and constraint later) ot just remove automatically added constraints. Making it a global user setting maybe with some indication of its state will be better.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #4058 - cannot set coincident constraint in sketch

Post by Kunda1 »

Added ticket issue #4058 to thread title
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
Post Reply