Corrupt sketches

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!
Post Reply
csmith
Posts: 15
Joined: Sun Jun 15, 2014 6:05 pm

Corrupt sketches

Post by csmith »

I chaps. I keep having the following problem, and the only resolution I've found is to scrap what I've been doing and start again :(

Put simply, I have a simple sketch (attached) that complains about conflicting constraints 12, 31, 33, 45, 47, 79 constraints that I don't have. The sketch is nicely green showing that I have zero degrees of freedom despite the notice. I can't delete the constraints, because they don't exist (or rather, they are not shown.... but wait....)

When I exit sketch, the constrained sketch disappears, and I get a few white lines that reflect the very early steps of the sketch I created. The same number of lines as conflicting constraints. I cannot select these lines as the vanish on entering the sketch.

If I hold "space" whilst in the sketch, the white lines do appear on-off-on-off-on-off on repeat, so I can get to see them, but they are unelectable .

I am running Debian jessie/sid, so my OS is pretty fresh, but it's been a few weeks since I did an aptitude upgrade.

Has anyone else seen this, or can reproduce the problem with my file?

Edit. I know exactly how to reproduce the problem now. Attached are two files showing the design progression up to the point it goes bad (three steps). First I draw the containing frame, second sketch in the shapes, third join up the nodes. Now, what I am doing is selecting the two nodes to join by dragging the select box around them. They turn green and I connect them. This generates the following errors:

Not able to delete a constraint on point with the given index: 7
Not able to delete a constraint on point with the given index: 5
Not able to delete a constraint on point with the given index: 3
Not able to delete a constraint on point with the given index: 1
Not able to delete a constraint on point with the given index: 0
Not able to delete a constraint on point with the given index: -1
Not able to delete a constraint on point with the given index: 35

If I click both nodes specifically with the mouse pointer (which is sometimes a lot of trouble, particularly with a trackpad!) and connect them, then everything is fine.
Container and rough sketch shapes
Container and rough sketch shapes
step2.png (17.31 KiB) Viewed 4247 times
Nodes connected using mouse select box
Nodes connected using mouse select box
step3-sketch.png (17.23 KiB) Viewed 4247 times
Attached are the files that illustrates the problem.

OS: Debian GNU/Linux unstable (sid)
Platform: 32-bit
Version: 0.14.3637 (Git)
Branch: master
Hash: 0acb77e8def9434b2303aefacc3cfb097685ec0c
Python version: 2.7.7rc1
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0
Attachments
step3.fcstd
Connecting the nodes using mouse select box: corrupts sketch.
(5.24 KiB) Downloaded 91 times
step2.fcstd
Containing frame with shapes roughly drawn in
(5.26 KiB) Downloaded 85 times
control.fcstd
Weird hidden lines
(4.17 KiB) Downloaded 67 times
slc55
Posts: 34
Joined: Thu Feb 07, 2013 7:27 pm

Re: Corrupt sketches

Post by slc55 »

I am a relative Freecad novice so I don't normally reply to requests for help but I'm just passing this way so I'll try.

When the sketch is in editing mode, change the constraints filter to ALL. The missing constraints will appear in the drop down list and can be deleted. The sketch then appears correctly when editing mode is closed.

OS: Ubuntu 14.04 LTS
Word size: 64-bit
Version: 0.14.3681 (Git)
Branch: master
Hash: ef08a61a4dbec598101e0c1aead95a031ef53f7b
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0




Edit ....... Did you edit your post while I was replying? Something has changed!
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Corrupt sketches

Post by ulrich1a »

There seems to be a bug in the sketcher. If two nodes are selected with the selection box and one of the nodes is already connecting two lines, than at adding a coincidence constraint two coincidence constraints are added.

Whereas if both nodes are clicked, than only one coincidence constraint is added.

The sketcher has problems with multiple constraints constraining the same thing. This seems to be working the first time, but give problems at later stages in the sketching progress.
I consider the adding of multiple coincidence constraints when only selecting two nodes with the selection box a bug. The selection box seems to select three nodes and adds coincidence constraints for them. It should be checked by the sketcher, if some nodes already have a coincidence constraint, instead of adding superfluous ones.

Ulrich
csmith
Posts: 15
Joined: Sun Jun 15, 2014 6:05 pm

Re: Corrupt sketches

Post by csmith »

Okay, cool. Well, as long as we know :D

It is a bit frustrating though not being able to mouse-drag select, just need to remember to click-select!

I'll try the filter idea, it only takes one mouse-drag select to stuff up the sketch at the moment, so hopefully that will be a saviour.

Do you want this logged as a bug?
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Corrupt sketches

Post by ulrich1a »

csmith wrote:Do you want this logged as a bug?
It is always good to log problems, as they can than be solved some day.

Ulrich
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Corrupt sketches

Post by NormandC »

As I wrote in your other topic, this sketch is over-constrained. There are too many equality constraints. This certainly does not help.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Corrupt sketches

Post by abdullah »

Hi guys,

There is a possible bug fix in my github:
https://github.com/abdullahtahiriyo/Fre ... master.git

In branch:
coincident_constraint_fix

Why this happens?
Because when choosing by clicking only the point "on top" of the two that are coincident is selected (only the one closest to the camera is picked by Coin3D), they the system is requested to make the third point coincident with that one (ergo one coincident constraint is added). When the selection box is used, the three points are selected, and two different coincident constraints are requested, point1 with point3 and point2 with point3.

What I did is:
Not to allow a constraint of the same type and same elements and positions to be added, if it is of type coincident.

Why only for coincidents?

Because otherwise it will ignore the user when for example trying to add an equal distance type constraint to a line when there is already one there, without showing any information about the conflicting constraint (other than the overconstraint warning).

If you think of more cases where this happens and the user can safely be ignored (like this one), just tell me and I add them.

If someone could test it a little bit before asking for a pull request... I really have to leave the computer now...

Regards,
Abdullah
Post Reply