Skip to content

New SurfaceIntersection schema and overstepping fix

Andreas Salzburger requested to merge 613-surface-intersection into master

Closes #613 (closed)

This MR solves a few long standing issues:

  • Firstly it removes the notion of anyDirection as a navigation direction - that concept was faulty and could create problems if the navigation direction was used as a sign multiplicator with the Vector3D. anyDirection would have set the length of this vector to 0.

  • It changes the Intersection object from being just a boolean intersection to an Intersection with status. The allowed status values are missed = 0, unreachable = 0, reachable = 1, onSurface = 2. Backward solutions are marked as reachable but with negative path length indicating that those were achieved with opposite the direction.

  • It merges the ObjectIntersection<O> and the FullIntersection<O,R> into one class with an enable_if if two different template parameters are given for object_t and representation_t. It allows adds alternative Intersection solutions for surfaces/objects that can be multiply intersected.

  • It streamlines the usage of direction and momentum in the surface intersection and global to local methods: if a direction (i.e. a unit vector) is needed, it has to be provided as such the normalisation is expected to be done before method call. In that case the argument is clearly called direction.

  • Using the new intersection schema, overstepping is allowed for the steppers within an overstepping tolerance that can be (fixed or dynamically) chosen by the stepper itself. Currently a fixed value is given (s_onSurfaceTolerance for the StraightLineStepper).

  • Allowing overstepping makes the intersection corrector obsolete, hence this concept is removed entirely and the corrector_t template consistently removed from the geometry/intersection methods. Eventually this should save time since overstepping happens relatively rarely and the intersection corrector forced double intersection for all navigation steps.

  • Finally, this makes the BoundarySorter obsolete as well, it is dropped.

Edited by Andreas Salzburger

Merge request reports