Cannot constrain arc in sketcher

Post here for help on using FreeCAD's graphical user interface (GUI).
Joel_graff
Posts: 1005
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Cannot constrain arc in sketcher

Postby Joel_graff » Fri Feb 15, 2019 1:54 pm

I'm trying to create a highway horizontal alignment using sketcher for testing and I'm running into a constraint problem that seems like Sketcher shouldn't have an issue with.

Specifically, I lay out a line constrained to north by an angle constraint, and an angle constraint. Then, I add an arc and tangentially constrain it to the end of the line. From there, I want to fully-constrain the arc. I apply a radius constraint, leaving only one degree of freedom - the far end of the arc.

In order to constrain the arc's end point, I would typically apply an angle constraint to the arc (defining it's central angle). or possibly set it's chord length (half the straight-line distance between the curve end points). This is typically how curves are defined in transportation engineering.

However, if I try to set an angle constraint to the arc, or apply a length constraint between the arc's end points, Sketcher tells me it's invalid. It seems like this is a sketcher bug...

In the image, the angle constraint should read 48 deg, 48 M, 34 S (48.8094 degrees), and the doubled chord length (the total straight-line distance between the endpoints) should be 833.54758.

EDIT: I can fix the arc endpoint using a fixed constraint that ties it to the origin...
Capture.JPG
Capture.JPG (21.83 KiB) Viewed 192 times

Code: Select all

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15340 (Git)
Build type: Release
Branch: master
Hash: 14b780c0ee9a0cd4adc2dc7abdff94ed315dd781
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Attachments
sketch_solve_error.FCStd
(46.93 KiB) Downloaded 9 times
openBrain
Posts: 522
Joined: Fri Nov 09, 2018 5:38 pm

Re: Cannot constrain arc in sketcher

Postby openBrain » Fri Feb 15, 2019 2:05 pm

I'll look at it but remember similar issues were discussed here, appearing when using big dimensions in sketches.
Do you still get the problem if you divide all dimensions by 1000 ?
openBrain
Posts: 522
Joined: Fri Nov 09, 2018 5:38 pm

Re: Cannot constrain arc in sketcher

Postby openBrain » Fri Feb 15, 2019 2:11 pm

Actually bug is not reproduced here working with SI units...

EDIT : also see that your FC version is a little bit outdated. May you try with last one ?
---
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15816 (Git)
Build type: Release
Branch: master
Hash: 7ee0e4d43909ec688299b8498b240cccf8362c47
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: French/France (fr_FR)
chrisb
Posts: 14104
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot constrain arc in sketcher

Postby chrisb » Fri Feb 15, 2019 2:20 pm

I don't have any issues with these. Opening your file I get a fully constraint sketch without errors. I can delete the distance constraint and add an angle instead, which again makes the sketch fully constrained - as expected.

OS: macOS 10.13
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15525 (Git)
Build type: Release
Branch: master
Hash: 1a7d3d9a37fe43468c8ac84590c1db53e2b2000a
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
Attachments
Bildschirmfoto 2019-02-15 um 15.17.01.png
Bildschirmfoto 2019-02-15 um 15.17.01.png (17.74 KiB) Viewed 180 times
User avatar
meme2704
Posts: 2560
Joined: Sat Apr 01, 2017 2:47 pm
Location: Vosges

Re: Cannot constrain arc in sketcher

Postby meme2704 » Fri Feb 15, 2019 4:29 pm

Ho :!: straight lines of 406miles while in my contry 406meters (yard) is à dream :lol:
Joel_graff
Posts: 1005
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Cannot constrain arc in sketcher

Postby Joel_graff » Sat Feb 16, 2019 9:42 pm

chrisb wrote:
Fri Feb 15, 2019 2:20 pm
e any issues with these. Opening your file I get a fully constraint sketch without errors. I can delete the distance constraint and add an angle instead, which again makes the sketch fully constrained - as expected.
openBrain wrote:
Fri Feb 15, 2019 2:05 pm
I'll look at it but remember similar issues were discussed here, appearing when using big dimensions in sketches.
Do you still get the problem if you divide all dimensions by 1000 ?

This is definitely related to the issue I had before. My bad for not refreshing my memory on it. Still, I can't understand why it works at the large scale for @chrisb but not for me. I tried it on my ubuntu appimage (0.18.15671) and it worked for about three elements, then started to give me the same trouble (at mile / kilometer scale). Better than my Win7 version, but still there.

However, I successfully constrained multiple curves and tangents when my scale was more 'normal' (meter / foot instead of kilometer / mile) - so yes, it's definitely the scale issue at play.
chrisb
Posts: 14104
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot constrain arc in sketcher

Postby chrisb » Sun Feb 17, 2019 1:50 am

I had tested on MacOS, perhaps that's an issue. If I take the same file and save it on the Mac i get slightly different rounding results than on Ubuntu, both being 64 bit systems.
openBrain
Posts: 522
Joined: Fri Nov 09, 2018 5:38 pm

Re: Cannot constrain arc in sketcher

Postby openBrain » Sun Feb 17, 2019 12:18 pm

AFAIK imperial units are internally converted to SI. Maybe it creates more rounding errors.
What about making available the advanced solver options from the preferences, and trying to set a more loosy set of parameters (eg. convergence) ?
Roy_043
Posts: 143
Joined: Thu Dec 27, 2018 12:28 pm

Re: Cannot constrain arc in sketcher

Postby Roy_043 » Sun Feb 17, 2019 2:59 pm

There are always rounding errors in floating point calculations. The bigger the number the greater the rounding error. So in this case it does not help that 'internally' FreeCAD works in mm. Dividing all dimensions by 1000, as already mentioned, may be the best solution.
The fact that in a FreeCAD file numbers are stored in a decimal (string) format may cause additional rounding errors.
chrisb
Posts: 14104
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot constrain arc in sketcher

Postby chrisb » Sun Feb 17, 2019 3:50 pm

openBrain wrote:
Sun Feb 17, 2019 12:18 pm
AFAIK imperial units are internally converted to SI. Maybe it creates more rounding errors.
What about making available the advanced solver options from the preferences, and trying to set a more loosy set of parameters (eg. convergence) ?
Both use the same units system and the same solver preferences.
cron