Issue #6613 - [Bug] Draft Snap Near is inaccurate when snapping to curves
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Issue #6613 - [Bug] Draft Snap Near is inaccurate when snapping to curves
Hi,
I'm testing the Draft Snap Near option. For this purpose I created a circle and I tried to snap a line at an arbitrary angle to it. The Snap Near symbol appeared and it seems that the snap worked:
But when I zoom in closely, I can see some inaccuracy - the line ends not exactly on the circle but somewhere before or after it:
I thought that it's just a display issue since the circle is likely shown in the form of straight line segments (like in the Sketcher). But when I select that line and dimension it, the value is slightly different than the radius of the circle (the line starts from the center of the circle, I used Snap Center to ensure that). For example, it can be 37,97 mm or 37,99 mm instead of 38 mm.
All the other snaps were disabled so it can't be a problem of e.g. Snap Grid taking precedence over Snap Near.
Is that a bug or just my misunderstanding of how it's supposed to work ?
I'm testing the Draft Snap Near option. For this purpose I created a circle and I tried to snap a line at an arbitrary angle to it. The Snap Near symbol appeared and it seems that the snap worked:
But when I zoom in closely, I can see some inaccuracy - the line ends not exactly on the circle but somewhere before or after it:
I thought that it's just a display issue since the circle is likely shown in the form of straight line segments (like in the Sketcher). But when I select that line and dimension it, the value is slightly different than the radius of the circle (the line starts from the center of the circle, I used Snap Center to ensure that). For example, it can be 37,97 mm or 37,99 mm instead of 38 mm.
All the other snaps were disabled so it can't be a problem of e.g. Snap Grid taking precedence over Snap Near.
Is that a bug or just my misunderstanding of how it's supposed to work ?
Last edited by Kunda1 on Thu Jun 02, 2022 2:39 pm, edited 1 time in total.
Reason: Added GH ticket number to thread title
Reason: Added GH ticket number to thread title
Re: Draft Snap Near accuracy
Confirmed. The near snap indeed snaps to the polygonal representation of the circle. There is even a slight 'magnetic' effect if you snap on a corner of the polygon. IMO this is a bug.
Note that in your zoomed-in image the line crosses the polygonal representation, I do not get that.
Note that in your zoomed-in image the line crosses the polygonal representation, I do not get that.
Re: Draft Snap Near accuracy
Thank you for confirming this.Roy_043 wrote: ↑Sat Mar 19, 2022 7:51 pm Confirmed. The near snap indeed snaps to the polygonal representation of the circle. There is even a slight 'magnetic' effect if you snap on a corner of the polygon. IMO this is a bug.
Note that in your zoomed-in image the line crosses the polygonal representation, I do not get that.
Could moderators move this to the Draft subforum as a potential bug report ? Or should I create a new topic there ?
Re: Draft Snap Near accuracy
Moved to Draft forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- thomas-neemann
- Veteran
- Posts: 11801
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: Draft Snap Near accuracy
confirmed. here's a workaround if you want it to be precise
https://www.youtube.com/watch?v=xvPkNq7g7a0
Re: Draft Snap Near accuracy
Another workaround (likely the easiest one) would be to draw the line longer than it should be (so that it extends outside the circle) and then use the Draft Trimex tool on it, picking the circle as an object for the intersection. The result still seems inaccurate but that's apparently just a display issue - dimensioning shows correct value in this case.thomas-neemann wrote: ↑Sat Mar 19, 2022 9:01 pm confirmed. here's a workaround if you want it to be precise
https://www.youtube.com/watch?v=xvPkNq7g7a0
Meanwhile, I created a bug report for that on GitHub: https://github.com/FreeCAD/FreeCAD/issues/6613
- thomas-neemann
- Veteran
- Posts: 11801
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: Draft Snap Near accuracy
yes, it works (very accurate for me too) but no white dot is displayed when snapping in. when i draw a second line, the white dot is shown when snapping (snap intersection)
Re: Issue #6613 - [Bug] Draft Snap Near is inaccurate when snapping to curves
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Issue #6613 - [Bug] Draft Snap Near is inaccurate when snapping to curves
This is IMHO not exactly a bug - obtaining cartesian coordinates from a point on a circle inherently depends on how much precision you give to PI, which is then always imprecise, as there is no absolute value for PI. Raising the precision value in the Draft preferences makes this imprecision smaller.
There is also the fact that on screen, curves are represented faceted (OpenGL can only represent straight lines), so you might see on screen something that is not properly intersected, while in "reality", internally, it is. Raising the Deviation value of the curved objects makes the faceting smoother.
So I think this is basically unsolvable?
There is also the fact that on screen, curves are represented faceted (OpenGL can only represent straight lines), so you might see on screen something that is not properly intersected, while in "reality", internally, it is. Raising the Deviation value of the curved objects makes the faceting smoother.
So I think this is basically unsolvable?
Re: Issue #6613 - [Bug] Draft Snap Near is inaccurate when snapping to curves
I think you have misunderstood. Currently Near snap snaps to the inaccurate representation of a circle in the 3D view. No attempt is made to project the point on the actual geometry. Doing that should be possible I think, but I do not know how hard that would be. Anyway, not something that should squeezed in for V0.20 IMO.