Bug: sketcher angle (and other) constraints while working in meters

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
dimitar
Posts: 229
Joined: Thu Jun 13, 2019 6:10 am
Contact:

Bug: sketcher angle (and other) constraints while working in meters

Post by dimitar »

I have been having a series of issues with Angled Constraints. It has been mentioned that some issues with angles could be due to using meters whereas sketcher internally works in mm so there could be some rounding issues (related thread: https://forum.freecadweb.org/viewtopic. ... ilit=angle)

I am wondering if anyone could give some ideas of what else might be happening here?

I've filed a bug report, as to me it seems like a bug (https://www.freecadweb.org/tracker/view.php?id=4124)
0QuRSqJqFX.png
0QuRSqJqFX.png (30.85 KiB) Viewed 2015 times
GBC3cjBUXj.png
GBC3cjBUXj.png (37.19 KiB) Viewed 2015 times
FreeCAD_3n4ZeeSc1T.png
FreeCAD_3n4ZeeSc1T.png (34.65 KiB) Viewed 2015 times
FreeCAD_nfCOryjGDy.png
FreeCAD_nfCOryjGDy.png (42.65 KiB) Viewed 2015 times
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
Attachments
angled constraints issues.FCStd
(14.63 KiB) Downloaded 54 times
Last edited by dimitar on Fri Sep 13, 2019 5:06 pm, edited 2 times in total.
User avatar
dimitar
Posts: 229
Joined: Thu Jun 13, 2019 6:10 am
Contact:

Re: Sketcher Angle Constraints

Post by dimitar »

Interesting, with the example I've posted, if i go more gradually between a high and low number it works, but if i do a big jump from 60 to 10 subdivisions, the sketch throws an error.

And, at some point, after going many times between high and low numbers, it seems to always break and produce some unintended outputs.
FreeCAD_ecGbg8iF0q.png
FreeCAD_ecGbg8iF0q.png (32.11 KiB) Viewed 2009 times
User avatar
salp
Posts: 252
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

Re: Sketcher Angle Constraints

Post by salp »

The freecad file you attached is empty.
Also please post the FreeCad info.
User avatar
dimitar
Posts: 229
Joined: Thu Jun 13, 2019 6:10 am
Contact:

Re: Sketcher Angle Constraints

Post by dimitar »

salp wrote: Thu Sep 12, 2019 12:44 am The freecad file you attached is empty.
Also please post the FreeCad info.
Info posted above. Sorry, the file has the array hidden.. I've re-uploaded the file.
User avatar
dimitar
Posts: 229
Joined: Thu Jun 13, 2019 6:10 am
Contact:

Re: Sketcher Angle Constraints

Post by dimitar »

i've just experienced this behavior with a radius constraint. I suspect it must be a rounding issue due to the fact that I am working in meters. In the following example, if i change the radius from 70m to 50m, i get the following error, also, if i go down to what it gives me and then try to go back up I also get and invalid constraints with index 8.
FreeCAD_Dv3e0Ajbbs.png
FreeCAD_Dv3e0Ajbbs.png (29.24 KiB) Viewed 1947 times
FreeCAD_wjaJcbFmgB.png
FreeCAD_wjaJcbFmgB.png (20.44 KiB) Viewed 1947 times
Attachments
constraints issue.FCStd
(14.72 KiB) Downloaded 45 times
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Bug: sketcher angle (and other) constraints while working in meters

Post by kisolre »

Having the 90m constraint there makes the minimum radius 90/2=45m in order to fulfill those PointOnLine constraints at ends of arc.
User avatar
dimitar
Posts: 229
Joined: Thu Jun 13, 2019 6:10 am
Contact:

Re: Bug: sketcher angle (and other) constraints while working in meters

Post by dimitar »

kisolre wrote: Fri Sep 13, 2019 5:09 pm Having the 90m constraint there makes the minimum radius 90/2=45m in order to fulfill those PointOnLine constraints at ends of arc.
Correct. Excuse me for the bad math. However, over 45m, sometimes the radius constraint works, sometimes it doesn't
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Bug: sketcher angle (and other) constraints while working in meters

Post by vocx »

dimitar wrote: Mon Sep 16, 2019 11:00 am Correct. Excuse me for the bad math. However, over 45m, sometimes the radius constraint works, sometimes it doesn't
Using large quantities and not getting the desired results sounds a bit like these two threads
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Bug: sketcher angle (and other) constraints while working in meters

Post by paullee »

Hi, I do not have any direct answer, hope below helps.

- I remember there is hints that sketcher tends to solve the geometry interactively when user move the edges with mouse.
- With constraints like angle, datum etc., where user input figures with huge difference, the geometry may 'flip' when there could be a number of solutions be solved to a problem. And this may leads to error when this is in contradiction to other constraints.
- I experience something similar when I try to do something on sketcher with python
- I was told to try other Sketcher Solver (tick Show 'Advance solver control' in preference...and find them in sketcher task panel) e.g. LevenbergMarquadt rather than DogLeg
- Or in my python script to change the parameter in more steps...

- @Chrisb has a tutorial on sketcher https://forum.freecadweb.org/viewtopic.php?f=36&t=30104
- @Chrisb, @abdullah and probably others help a lot on sketcher, and I remember they develop sketcher features - @abdullah even helps do some low-level C++ features for me to solve a few of my python sketcher::featurepython problems
- you may ping them, unfortunately @abdullah seem not around for almost 2 months, hope he is fine

Good luck
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Bug: sketcher angle (and other) constraints while working in meters

Post by paullee »

Maybe this is something relevant to your approach

https://forum.freecadweb.org/viewtopic.php?f=24&t=39969 Use sketch for kinematic
Post Reply