[BUG #4467] Malformed Constraints

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!
TedM
Posts: 142
Joined: Fri Apr 17, 2020 6:30 pm

[BUG #4467] Malformed Constraints

Post by TedM »

Edit 3: I have successfully reproduced this bug. The procedure is shown in this reply: https://forum.freecadweb.org/viewtopic. ... 98#p440598

Edit 2: It appears I was wrong when I wrote to disregard this in the first edit below.

Edit: I was seeing some other "funny" stuff happening so I closed FreeCAD and restarted it. The issue shown below has disappeared! It appears to have been some internal corruption, source unknown. This report is of little value but I decided to leave it up, just in case.

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22665 (Git)
Build type: Release
Branch: master
Hash: b0d7850406e046f3b7a8cd5da261e7d54df6bd99
Python version: 3.8.6
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
I have a sketch I've created and I'm getting the following in the report view panel:

Code: Select all

21:46:03  Sketcher constraint number 6 is malformed!
21:46:03  Sketcher constraint number 33 is malformed!
21:46:03  Sketcher constraint number 51 is malformed!
21:46:03  Sketcher constraint number 68 is malformed!
21:46:03  Sketch Sketch033 has malformed constraints!
There doesn't seem to be anything obviously wrong with the sketch and Validate Sketch shows no errors. Also, if I go, delete constraint #6 and recreate it, it then reports that constraint #5 is now malformed. (I'd previously recreated constraint #7 which was "malformed", resulting in #6 becoming "malformed".)

In any case, despite these reports, the sketch seems to function correctly.

I had previously created the sketch and then did other things with the document. I have no idea when this started happening. I just recently noticed the red message "Sketch Sketch033 has malformed constraints!" flashing on the bottom of the screen. I do not have the report view opening automatically.

Anyone have any idea what's happening? Anyone seen this before?

Thanks
malformed constraints.FCStd
(6.77 KiB) Downloaded 51 times
Last edited by TedM on Sun Oct 18, 2020 8:51 pm, edited 4 times in total.
chrisb
Veteran
Posts: 54192
Joined: Tue Mar 17, 2015 9:14 am

Re: [DISREGARD] Malformed Constraints - Help?

Post by chrisb »

I'm sad to say, but the error returns immediately if you recompute the sketch. The numbers you see in report view have an offset of 1, Constraint number 6 from the message is Constraint7 in the GUI.
Not time to look in detail now, but did you use Expressions in your Sketch?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TedM
Posts: 142
Joined: Fri Apr 17, 2020 6:30 pm

Re: [DISREGARD] Malformed Constraints - Help?

Post by TedM »

chrisb wrote: Sun Oct 18, 2020 6:58 am Not time to look in detail now, but did you use Expressions in your Sketch?
Yes. My design is parameterized using a spreadsheet. I stripped out all of the expressions and the spreadsheet to make the sample document for the post.
chrisb
Veteran
Posts: 54192
Joined: Tue Mar 17, 2015 9:14 am

Re: [DISREGARD] Malformed Constraints - Help?

Post by chrisb »

The message says among others that "constraint number 68 is malformed". According to my remark above you have to look at Constraint69 in the sketch.
It is a constraint between the center of the lower construction circle and the origin. Obviously they are not coincident. If I remove that constraint the sketch is still fully constrained, but one error message is gone!
The same with Constraint52, Constraint34, Constraint7. Remove them all and the messages have gone and the sketch is still fully constrained.

It would be very interesting to know what you have done to enter that state.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
bambuko
Veteran
Posts: 2185
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: [DISREGARD] Malformed Constraints - Help?

Post by bambuko »

TedM wrote: Sun Oct 18, 2020 4:55 am Edit: I was seeing some other "funny" stuff happening so I closed FreeCAD and restarted it. The issue shown below has disappeared!...
No, it hasn't dissapeared ;) as confirmed by chrisb and myself.

TedM wrote: Sun Oct 18, 2020 4:55 am... It appears to have been some internal corruption, source unknown...
No, it is not some corruption - it is simply "unfinished" sketch :ugeek:

TedM wrote: Sun Oct 18, 2020 4:55 am ...This report is of little value but I decided to leave it up, just in case...
Not at all, it has provided me with a good lesson.
BTW I also had problems with symmetry constraint when first started using FreeCAD :mrgreen:

TedM wrote: Sun Oct 18, 2020 4:55 am ...Anyone have any idea what's happening? ...
Yes, it is the way you have used little segments of construction lines (notice, that all "offending" constraints are at the nodes when two or more of your construction lines meet)
chrisb wrote: Sun Oct 18, 2020 6:58 am I'm sad to say, but the error returns immediately if you recompute the sketch.
...Not time to look in detail now, but did you use Expressions in your Sketch?
No, it is nothing to do with expressions (as mentioned above - get rid of all these construction lines and the problem dissapears).
I enjoyed having a go at constraing the sketch differently (see attached)

Hopefully, it helps ;)
I would edit thread title and remove DISREGARD - your question was pefectly valid
Attachments
malformed constraints-test.FCStd
(7.44 KiB) Downloaded 42 times
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
chrisb
Veteran
Posts: 54192
Joined: Tue Mar 17, 2015 9:14 am

Re: [DISREGARD] Malformed Constraints - Help?

Post by chrisb »

bambuko wrote: Sun Oct 18, 2020 9:34 am No, it is not some corruption - it is simply "unfinished" sketch :ugeek:
Not true I think, there is something corrupted. There are constraints which should show the sketch as unsolvable or at least as overconstrained.
Yes, it is the way you have used little segments of construction lines (notice, that all "offending" constraints are at the nodes when two or more of your construction lines meet)
No, it is nothing to do with expressions (as mentioned above - get rid of all these construction lines and the problem dissapears).
That's a cheap trick: It would remove the offending constraints by simply removing the geometric elements they are attached to, but it doesn't explain how this could have happened.

If you are sure that it is indeed just unfinished, then it would help if you could create such behaviour from scratch and tell us how it can happen.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
bambuko
Veteran
Posts: 2185
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: [DISREGARD] Malformed Constraints - Help?

Post by bambuko »

chrisb wrote: Sun Oct 18, 2020 12:53 pm ...If you are sure that it is indeed just unfinished, then it would help if you could create such behaviour from scratch and tell us how it can happen.
OK, challenge accepted ;)
Will be back...
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
bambuko
Veteran
Posts: 2185
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: [DISREGARD] Malformed Constraints - Help?

Post by bambuko »

Well, it was good learning exercise, trying to re-create what someone else has managed,
but it has also proved that I was talking out of my rear orifice :mrgreen:

I was unable to recreate the error.
Rather annoying, everyting I have tried ended with perfectly constrained sketch with no error messages.

I have no clue how constraints 7, 34, 52 and 69 happened to be created :oops:
Sounds like I have reached level of my incompetence :lol:
Sorry
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
TedM
Posts: 142
Joined: Fri Apr 17, 2020 6:30 pm

Re: Malformed Constraints - Help?

Post by TedM »

OK, I went back and was able to reproduce this problem very easily! It seems to be a problem with Clone in Sketcher.

To reiterate the FreeCAD version:

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22665 (Git)
Build type: Release
Branch: master
Hash: b0d7850406e046f3b7a8cd5da261e7d54df6bd99
Python version: 3.8.6
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Here is the procedure to reproduce it:
1. Start FreeCAD.
2. Open the report view panel at the bottom of the screen.
3. Create a new document.
4. Go to the Part Design WB.
5. Create a body.
6. Create a sketch on the XY plane.
7. Place a circle, not constrained in location and contrain the radius to 2.5mm.
8. Place a line with one end constrained to the center of the circle and the other end to the right. Add a horizontal constraint and a length constraint of 14mm.
9. Select both objects and then slowly double-click the center of the circle so that everything is still selected and the circle center is last selected.
10. Clone the objects and move the clone reference point onto the right end of the line so that the
constrain coincident.jpg
constrain coincident.jpg (1.06 KiB) Viewed 2600 times
symbol shows to make the cloned circle constrained to the old line and release the mouse button.
11. These errors will immediately appear in the report window:

Code: Select all

12:03:06  Sketcher constraint number 8 is malformed!
12:03:06  Sketch Sketch has malformed constraints!
12:03:06  Sketcher constraint number 8 is malformed!
12:03:06  Sketcher constraint number 8 is malformed!
12:03:06  Sketch Sketch has malformed constraints!
Here is the result of this procedure:
malformed constraints created.FCStd
(5.19 KiB) Downloaded 45 times
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: [BUG} Malformed Constraints

Post by GeneFC »

I can confirm that when following the instructions exactly I see the malformed constraints.

On the other hand if I just select the line and the circle rim (not the circle center) it works exactly as desired. The center of the circle triggers the coincident icon when it overlays the end of the line.

Not sure how it should work. My guess is that some sort of redundant constraint is created, since the center of the circle is already selected as the operation point. Repeat selection of the center is likely the cause of the problem.

Of course any such error is a bug unless it is clearly forbidden.

Gene
Post Reply