Absolute comparison is much worse, as it scales with the magnitude of the terms involved.DeepSOIC wrote: ↑Fri Dec 30, 2022 10:27 pmthis is an absolute comparison, relative precision is mostly irrelevant.acolomitchi wrote: ↑Fri Dec 30, 2022 7:50 pm Personally, when if comes to hypot/square, I see anything beyond double(1e-8) relative precision as questionable.
That is to say: in the unit (1.0) range, the absolute imprecision of going through square/sqrt is around 1e-8; in the magnitude of A, the absolute imprecision is going to be around A*1e-8. Like, in the order of magnitude of 1000, one cannot trust the decimal digits coming lower that 1e-5 - they may by good, but then again there will be enough cases in which they garbage.
Then altering the tolerance is a better path to follow. Like in: working with relative tolerances. But then again, neither this is a silver bullet - that's just the nature of the beast.DeepSOIC wrote: ↑Fri Dec 30, 2022 10:27 pm BTW, there are other interesting precision-related problems in freecad. For example geometric primitives are by default created with tolerance of precision::confusion, which is 1e-7 mm. This is used to test if geometry is coincident or intersecting (e.g. in boolean operations), and can cause trouble for very big things (like, space-elevator-scale models are impossible, unless you alter this tolerance; see this piece of discussion for example).
If one really needs 1e-10 absolute precision, the only way to obtain this in more cases is to perform the computations in "long double" (work with a finer granularity of the real-number axis).
Good to hear. FYI, I did run in such flipping behaviours when I was fooling around with line-2-line angle constraints. Actually, I'm not quite sure which constraint was flipping sides, there were more in the sketch than the l-2-l angle. I'll try find some time to get a repro.DeepSOIC wrote: ↑Fri Dec 30, 2022 10:27 pmX-dist and Y-dist flipping in particular were actually fixed some long time ago, by me (i think). The minus sign is automatically removed by swapping the points when the constraint is being created.acolomitchi wrote: ↑Fri Dec 30, 2022 7:50 pm (the other rant I feel growing inside me is the use of "always distances, never displacements" - like when you set your "X-dist" constraint for you geom to a positive value no matter if it's on the left or the right relative to Yaxis. Then you are living with the sword of Damocles above your head, praying a drag on a remotely related DoF won't slide the solver into the other local minimum and decide the best way to solve that constraint is by mirroring it across Y axis)