View Issue Details

IDProjectCategoryView StatusLast Update
0003974SketcherBugpublic2019-06-22 15:22
ReporteropenBrainAssigned Toabdullah 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.18 
Target VersionFixed in Version 
Summary0003974: Feature that snaps arc angles to 45° increments don't work correctly (lack of internal precision)
DescriptionWhen using the feature that snaps arc angles to 45° increments, the internal precision is not sufficient & results in weird behavior.
Steps To ReproduceDownload attached file and try to revolve the sketch around sketch Y axis. It fails with a "Revolve axis intersects the sketch" while it is unexpected.
Replacing 90° angles with perpendicular constraints fixes the issue.
Editing the 90° angles and reentering the value manually fixes the issue.
Additional InformationFrom investigations, it seems to be due to lack of decimal precision in the angle values used by the polyline tool.
Below the angle value first after creation by polyline then after manual reentering
>>> Gui.ActiveDocument.Sketch.Object.Constraints[8].Value
1.570796
>>> Gui.ActiveDocument.Sketch.Object.Constraints[8].Value
1.5707963267948966

Or same with values in degrees
>>> Gui.ActiveDocument.Sketch.Object.Constraints[8].Value*180/math.pi
89.99998127603168
>>> Gui.ActiveDocument.Sketch.Object.Constraints[8].Value*180/math.pi
90.0

This is also seeable by zooming on the small segment line that lies on the Y axis. Below a view just after creation by polyline.
https://forum.freecadweb.org/download/file.php?id=83713
---
Forum thread (FR)
---
OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
---
(OS: Windows 8.1 - Version: 0.19.16523 - Python version: 2.7.14 - Qt version: 4.8.7)
---
TagsNo tags attached.

Activities

openBrain

2019-05-15 19:12

developer  

arc_snap_bug.FCStd (6,013 bytes)

openBrain

2019-06-18 20:00

developer   ~0013258

Still reproduced with latest 0.19 release as of today.
@abdullah as you may have missed this one because in the french subforum : interested in dealing with it ? :)

abdullah

2019-06-22 13:26

manager   ~0013296

PR:
https://github.com/FreeCAD/FreeCAD/pull/2285

abdullah

2019-06-22 15:22

manager   ~0013297

Fix committed to master branch.

Related Changesets

FreeCAD: master 06358224

2019-06-22 13:19:13

abdullah


Committer: abdullahtahiriyo Details Diff
Sketcher: Polyline snap arc to 45 degrees bug fix

=================================================

fixes 0003974

Snapping to 45 degrees during arc creation (hold ctrl during an arc within a polyline), resulted in
reduced precision, because Gui::Command::doCommand %f defaults only to six decimal positions, which is
a poor representation in radians of, for example, 90 degrees.

A work-around could have been to hardcode a higher number of decimals, as in %0.Xf. However, I do not like
such magic numbers.

The solution chosen is to use an App.Quantity object using as units degrees, which leads to no loss of precision.
Affected Issues
0003974
mod - src/Mod/Sketcher/Gui/CommandCreateGeo.cpp Diff File

Issue History

Date Modified Username Field Change
2019-05-15 19:12 openBrain New Issue
2019-05-15 19:12 openBrain File Added: arc_snap_bug.FCStd
2019-06-18 20:00 openBrain Note Added: 0013258
2019-06-22 13:26 abdullah Note Added: 0013296
2019-06-22 15:22 abdullah Changeset attached => FreeCAD master 06358224
2019-06-22 15:22 abdullah Note Added: 0013297
2019-06-22 15:22 abdullah Assigned To => abdullah
2019-06-22 15:22 abdullah Status new => closed
2019-06-22 15:22 abdullah Resolution open => fixed