Ticket #4419 - Trim of ellipse creates invalid 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!
jeno
Posts: 867
Joined: Sun Jun 29, 2014 10:41 am

Ticket #4419 - Trim of ellipse creates invalid constraints

Postby jeno » Mon Aug 17, 2020 1:54 pm

We found a bug in the sketcher workbench. See post in german sub up from here
A user asked for help with a part of a ellipse as section for an revolve. After some attempts it came out, that after trimming a ellipse things went wrong.
Steps to repeat the problems:
- create a ellipse
- depending on which quadrant is trimmed away different errors show up: ellipse collapses to a vertikal or horizontal line or to a single vertex. Or the sketcher references to vertices which aren't exist anymore. Also undo creates ugly behaviour.

regards
Last edited by Kunda1 on Thu Aug 27, 2020 3:53 am, edited 1 time in total.
Reason: Added ticket number to thread title (altered title to reflect ticket subject)
jmaustpc
Posts: 10524
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Bug in sketcher WB - ellipse and trim tool

Postby jmaustpc » Mon Aug 17, 2020 2:25 pm

jeno wrote:
Mon Aug 17, 2020 1:54 pm
We found a bug in the sketcher workbench. See post in german sub up from here
It seems that they are talking about FreeCAD 0.18.4, at least the first post is, Chris at least knows better than to worry about an old bug in an old release version (so perhaps he did test 0.19), it has to be tested (like all bugs) in the latest Dev version Currently FreeCAD 0.19.

For me it did go to a straight line the first time I tried it but undo worked perfectly and I could not get it to do that again, unless I used clip on the shorter of the two construction lines axes. The longer line would halve in length and recalculate the ellipse, and clicking on any 1/4 just removed that 1/4 as expected.

Now I just got the straight line thing again but undo is still working properly. There must be a more complex set of requirements to get this straight line error at least in 0.19. I will see if I can narrow it down...

OS: Ubuntu 18.04.5 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 93bb9646c36a84efdc3be4e4ca60c7e0234a6233
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
jeno
Posts: 867
Joined: Sun Jun 29, 2014 10:41 am

Re: Bug in sketcher WB - ellipse and trim tool

Postby jeno » Mon Aug 17, 2020 3:11 pm

jmaustpc wrote:
Mon Aug 17, 2020 2:25 pm
jeno wrote:
Mon Aug 17, 2020 1:54 pm
We found a bug in the sketcher workbench. See post in german sub up from here
It seems that they are talking about FreeCAD 0.18.4, at least the first post is, Chris at least knows better than to worry about an old bug in an old release version (so perhaps he did test 0.19), it has to be tested (like all bugs) in the latest Dev version Currently FreeCAD 0.19.
For me it did go to a straight line the first time I tried it but undo worked perfectly and I could not get it to do that again, unless I used clip on the shorter of the two construction lines axes. The longer line would halve in length and recalculate the ellipse, and clicking on any 1/4 just removed that 1/4 as expected.
Now I just got the straight line thing again but undo is still working properly. There must be a more complex set of requirements to get this straight line error at least in 0.19. I will see if I can narrow it down...
Thanks for the reply. Some more info.
I'm on 0.18 as well as

Code: Select all

OS: Debian GNU/Linux bullseye/sid (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22261 (Git) AppImage
Build type: Release
Branch: master
Hash: 1c432fd6170b7904592a224194e42d3c566707a6
Python version: 3.8.5
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
PD-ellipse.png
PD ellipse created
PD-ellipse.png (61.88 KiB) Viewed 579 times
PD-ellipse_error.png
Error after trimming upper right quadrant away
PD-ellipse_error.png (64.95 KiB) Viewed 579 times
auto contstraining is on
auto removal of redundant constraints is on
avoid redundant auto-constraints is on
Unfortunately I forgot to copy the output of the console. From memory: sketch has malformed constraints.

Hope it helps
jmaustpc
Posts: 10524
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Bug in sketcher WB - ellipse and trim tool

Postby jmaustpc » Mon Aug 17, 2020 3:50 pm

For me undo works, but I think I have finally found a way to get a straight line with the following error message in report view...

Code: Select all

01:21:10  Updating geometry: Error build geometry(0): 
01:21:10  Invalid solution from DogLeg solver.
01:21:10  Updating geometry: Error build geometry(0): 
01:21:10  Invalid solution from LevenbergMarquardt solver.
I created an ellipse with "centre, major radius, point" method in the positive xy quadrant. Then I selected the auto generated major radius point (opposite the major radius that I click to create), then select the origin and coincidence constraint, then use the trim tool one the higher left quadrant (see sreenshot), which then makes a straight line with the error message above. However if I click on any other quadrant first then it seems to work, although some time I get an error message even thought it worked but not always.
Screenshot_20200818_012845.png
Screenshot_20200818_012845.png (12.03 KiB) Viewed 573 times



Daily PPA

OS: Ubuntu 18.04.5 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 93bb9646c36a84efdc3be4e4ca60c7e0234a6233
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
chrisb
Posts: 30606
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug in sketcher WB - ellipse and trim tool

Postby chrisb » Mon Aug 17, 2020 5:29 pm

I had tested with the almost latest 0.19 and as far as I know nothing has changed in sketcher since.

Jim, you use the Levenberg-Marquardt solver. As this isn't the default, could you retry with the dogleg solver? I get the message

Code: Select all

19:06:04  Updating geometry: Error build geometry(0): 
19:06:04  Invalid solution from DogLeg solver.
There was an issue with Levenberg-Marquardt not being able to solve some pretty simple sketches, but I'm not sure if it was fixed or not.

I had uploaded a file with an ellipse, just to make sure that different ways of creation don't play a role, I link it below. With that file I experience the following behaviour:

- opening the file and trimming the right lower quarter and then the left lower yields the error described above with the invalid constraints

- starting with trimming the right upper quarter yields different results, undo and trim again is usually not identical to first trim
- - it can remove the arc and create conflicting constraints
Snip macro screenshot-ffcc23.png
Snip macro screenshot-ffcc23.png (17.19 KiB) Viewed 551 times
- - it can collapse to a point
Snip macro screenshot-9c249e.png
Snip macro screenshot-9c249e.png (820 Bytes) Viewed 551 times
- - it can collapse to a line
Snip macro screenshot-3b64cf.png
Snip macro screenshot-3b64cf.png (1.21 KiB) Viewed 551 times
- - it can collapse to a rather small (correct) variant of the trimmed ellipse
Snip macro screenshot-7ee228.png
Snip macro screenshot-7ee228.png (1.31 KiB) Viewed 551 times
- - it can look correct but is in fact unsolved
Snip macro screenshot-daaa6b.png
Snip macro screenshot-daaa6b.png (20.01 KiB) Viewed 551 times
OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22246 (Git)
Build type: Release
Branch: master
Hash: abd18ff88f7682e9b1160c36bb785b14a33473ef
Python version: 3.8.5
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)

ellipseTrim.FCStd
You need at least FreeCAD 0.19.23300 to edit my current sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Posts: 30606
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug in sketcher WB - ellipse and trim tool

Postby chrisb » Mon Aug 17, 2020 5:32 pm

I may add that trimming such a quarter is non trivial, because the open ends of the arc must not be connected with coincidence constraints to the nds of the axes, they have to be point-on-objects.
You need at least FreeCAD 0.19.23300 to edit my current sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Posts: 30606
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug in sketcher WB - ellipse and trim tool

Postby chrisb » Tue Aug 18, 2020 3:37 pm

Created issue #4419.
You need at least FreeCAD 0.19.23300 to edit my current sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Kunda1
Posts: 9205
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #4419 - Trim of ellipse creates invalid constraints

Postby Kunda1 » Thu Aug 27, 2020 3:54 am

Mod edit: Renamed thread with Ticket number and summary
Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features