sketcher bug?? fully constrained error

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
jmaustpc
Posts: 9556
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

sketcher bug?? fully constrained error

Postby jmaustpc » Sat Jun 16, 2012 8:43 am

Hi guys
I just found this bug in Luke's sketcher branch while testing his new work. I just checked and the bug is also in SF git/Master.

Have a look at this file, it is two lines on a circle. The way it is constrained, you can drag the "triangle" in circles around the circle, which partly works.

1) if you drag the "triangle" around the circle it goes most of the way around and then suddenly flips to the other side.... then if you keep the mouse pointer going around the circle, the triangle suddenly flips back again.
2) If you select the apex of the "triangle" and then set either one horizontal distance or one vertical distance constraint it says the sketch is fully constrained, which it is not. If you look at the screen shots attached you will see the two valid possible out comes for a vertical distance constraint. The error is the same type of thing if you set horizontal distance constraint
3) if you set lock constraint on the apex it complains of being over constrained ....which might or might not be the case.
4) this point happened the first two times I tried to set vertical distance constraint but after closing and reopening the file, I have not yet managed to get it to repeat. I will test further on this point. When the apex was one the right hand position of the two possible outcomes for vertical constraint on the apex, it inserted the correct vertical value but flipped the triangle over to the lower left hand side (the second possible outcome for that vertical constraint value)


I am wondering if this is a problem with how "length along line constraint" works? I might well be talking complete crap, but I was wondering if the horizontal and vertical distant constraint is working of the x and y value of the length along the line constraint rather than truly working on its length. If so that could explain what is going on.


Manits link
https://sourceforge.net/apps/mantisbt/f ... php?id=754

jmaustpc
Posts: 9556
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: sketcher bug?? fully constrained error

Postby jmaustpc » Sat Jun 16, 2012 8:58 am

I managed to get the error 4), or something similar to be repeatable. I not sure if this is more of a problem with the undo system, hence maybe should be on a different ticket, for now it is just a note on the existing ticket in my last post above.

1) move the apex of the triangle to point somewhere towards the lower right quadrant
2)set a vertical distance constraint on the apex
3) click "undo" on the tool bar to remove the last added vertical distance constraint
4) move the apex of the triangle to point somewhere towards the lower left quadrant
5) set a vertical distance constraint on the apex


rather than setting the then current correct default value for vertical distance constraint, ....FreeCAD will push the apex back to the position it had been in prior to the "undo", and set the what should have been a new value default vertical constraint value back to what it had previously been prior to the undo.


Jim
jmaustpc
Posts: 9556
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: sketcher bug?? fully constrained error

Postby jmaustpc » Mon Jun 18, 2012 2:22 am

Hi all
I've found another "fully constrained error".

Here is a series of three files RHS_tube_demo, tube_demo1, tube_demo2. These three files are almost the same, this bug relates to the second sketch in each (sketch001) and is the only way in which they vary.

RHS_tube_demo
In sketch001, constraint "=" number 23 says that the two horizontal construction lines are equal. However if the vertical construction line is constrained as it is then these two horizontal line must be equal, hence the "=" constraint 23 is superfluous.

FreeCAD agrees with this as demonstrated by this next file which is the same but without constraint 23, and FreeCAD still thinks its fully constrained.

RHS_tube_demo1


RHS_tube_demo2

This third file is an experiment, I started with the previous file (RHS_tube_demo1) which FreeCAD said was fully constrained, and then selected the two horizontal construction lines while still in the fully constrained state and then clicked on the "=" constraint....which should produce an "over constrained error" but does not....it just accepts the extra superfluous "=" constraint and still says the sketch is fully constrained.


version data
Kubuntu 12.04 32bit
Platform: Ubuntu 12.04 LTS (32-bit)
Version: 0.13.1162 (Git)
Branch: master
Hash: e05fcc7daf7d806c9766cfe75ca2b4880c3dccf0
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.1

RHS_tube_demo.FCStd
(8.72 KiB) Downloaded 34 times
RHS_tube_demo1.FCStd
(8.7 KiB) Downloaded 35 times
RHS_tube_demo2.FCStd
(8.7 KiB) Downloaded 29 times

Jim
jmaustpc
Posts: 9556
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: sketcher bug?? fully constrained error

Postby jmaustpc » Mon Jun 18, 2012 3:01 am

Here is another example of where there is a multiple solution with the tangent constraint.

In these two examples, the tangent can be in either direction, I have included some screen shots two illustrate this particular example. Of course in this file there are more possibilities when one considers the other tangent.

I've added a note to the mantis ticket, at the above url.
tangent_constraint_multiple_solutions_example1.FCStd
arc tangent with line, line flowing forward smoothly
(8.04 KiB) Downloaded 34 times
tangent_constraint_multiple_solutions_example2.FCStd
arc tangent with line, bent back on itself
(8.21 KiB) Downloaded 30 times
tangent_constraint_multiple_solution_example2.jpg.zip
screen shots of the two FreeCAD files, in case they render differently
(81.71 KiB) Downloaded 35 times

Still the same version data as the last post.

Jim