Circles vs BSplines depending on view scale

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Circles vs BSplines depending on view scale

Post by wandererfan »

alivetechs wrote: Sun Jun 05, 2022 9:24 pm any way I could force them to be interpreted as circles maybe? Because when they fall into said tolerance factor, I'm able to dimension them perfectly fine.
I can't think of anything that a user could do to change this. Even if you could force treating the bspline as a circle, the radius and center might not be what you expect. A bit of GIGO.
alivetechs wrote: Sun Jun 05, 2022 9:24 pm Side question: is it normal that when I try to dimension them as splines I always get a dimension of zero appearing completely off in the center of the view? (sure there is a warning telling me the diameter will be approximate, but here it simply fails in the end I think)
This is an error. If the bspline can not be coerced into being a circle, the current code continues the attempt to make a dimension instead of abandoning the attempt.
alivetechs wrote: And it's also puzzling that in the first view, all 19 small circles that are supposed to be identical, sometimes fall into the tolerance and sometimes not nope?
The circles aren't quite identical. In the picture, the black squares are the poles of the 2 bsplines. The rotation of the "circle" is probably enough to confuse the algorithm.
Attachments
notQuiteIdentical.png
notQuiteIdentical.png (16.57 KiB) Viewed 719 times
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Circles vs BSplines depending on view scale

Post by heda »

oki, good to know

i just chased down why healarcs gave bogus results...
https://github.com/FreeCAD/FreeCAD/blob ... #L135-L147

to fix it in source, and how, i leave up to someone else to do.

the exercise also revealed that the way the points are picked up, is with a high probability of introducing numerical errors.
maybe there should be code in there to check if one has got one of those annoying 1e-10 diffs on what used to be a nice round value before the new circle is created.
User avatar
Roy_043
Veteran
Posts: 8541
Joined: Thu Dec 27, 2018 12:28 pm

Re: Circles vs BSplines depending on view scale

Post by Roy_043 »

heda wrote: Mon Jun 06, 2022 3:24 pm to fix it in source, and how, i leave up to someone else to do.
AFAICT the arcFromSpline() function is not used when importing a DXF. But there is a bug in the function (thanks for finding it :mrgreen: ) so I'll try to do a PR anyway. I think I'll have to create a GH issue first. I'll report back when the PR is merged.

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.21.30922 (Git)
Build type: Release
Branch: master
Hash: 8ec1279ea8ee32a36fae683b42b5cfc5821734b5
Python 3.8.13, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: Dutch/Netherlands (nl_NL)
Attachments
Unnamed.dxf
(6.58 KiB) Downloaded 21 times
User avatar
Roy_043
Veteran
Posts: 8541
Joined: Thu Dec 27, 2018 12:28 pm

Re: Circles vs BSplines depending on view scale

Post by Roy_043 »

Post Reply