tigl icon indicating copy to clipboard operation
tigl copied to clipboard

Change absolute tolerance values to relative

Open rainman110 opened this issue 5 years ago • 3 comments
trafficstars

This is a huge issue and must probably be split into multiple smaller ones.

Absolute values have the problem, the the algorithms are not invariant of model scaling and might fail.

Therefore, we should

  1. Find all places, where we use hard tolerances (search for small values, Precision::Confusion)
  2. We need a concept, of how to pass reference sizes (e.g.) of the aircraft, shapes... into the functions
  3. Finally replace absolute values by relative_tolerance * refercence_size

rainman110 avatar Oct 27 '20 22:10 rainman110

I agree! We should have a consistent definition of tolerances. We should probably also have different relative tolerances for

  • spatial values (length, area, volume)
  • radians & degrees
  • geometric parameters

We need a concept, of how to pass reference sizes (e.g.) of the aircraft, shapes... into the functions

Any idea on how we could achieve this? Some algorithms for calculating reference sizes (e.g. the arc length of a curve or a bounding box) are iterative and require a tolerance value themself. If we go about this the wrong way, we may clutter our low-level algorithms with the calculation of reference sizes. We have to make sure that performance doesn't suffer too much by this.

joergbrech avatar Oct 28 '20 07:10 joergbrech

If we go about this the wrong way, we may clutter our low-level algorithms with the calculation of reference sizes.

The low level algorithms should not have to compute the tolerances, but it should be passed into them. We need to compute absolute tolerances on the CPACS level I would say ( i think it really depends on the algorithm)

To not mix up the tolerances, it would make sense to define separate C++ types for tolerances, as e.g.

  • SpatialTolerance (Absolute and Relative)
  • ParametricTolerance
  • and whatever we need

rainman110 avatar Oct 28 '20 08:10 rainman110

We should discuss how to handle different units as well

joergbrech avatar Mar 01 '21 14:03 joergbrech