Ignore:
Timestamp:
May 25, 2016, 7:13:58 AM (9 years ago)
Author:
Frederik Heber <heber@…>
Children:
3e52312, 80c119
Parents:
06a874
git-author:
Frederik Heber <heber@…> (06/12/14 07:23:12)
git-committer:
Frederik Heber <heber@…> (05/25/16 07:13:58)
Message:

Using the idea of three points giving a triangle to find rotation axis.

  • we calculate the center of either triangle and rotate the center of the ideal point distribution to match the one from the given points.
  • next we have the triangles normals as axis, take the first matching point and rotate align it.
  • we have to deal with a lot of special cases: What if only zero, one, or two points are given ...
  • in general we assume that the triangle lies relatively flat on the sphere's surface but what if the origin is in the triangle plane or even the calculated center is at the origin ...
  • TESTS: SphericalPointDistributionUnitTest working again, regression tests FragmentMolecule-cylces and StoreSaturatedFragment working.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Exporters/SphericalPointDistribution.hpp

    r06a874 r6cf5bb  
    7676  //!> precalculated value for root of 3
    7777  static const double SQRT_3;
     78
     79  typedef std::pair<Vector, double> Rotation_t;
     80
     81  typedef std::list<unsigned int> IndexList_t;
     82  typedef std::vector<unsigned int> IndexArray_t;
     83  typedef std::vector<Vector> VectorArray_t;
     84
     85  //!> amplitude up to which deviations in checks of rotations are tolerated
     86  static const double warn_amplitude;
     87
     88private:
     89  static std::pair<double, double> calculateErrorOfMatching(
     90      const std::vector<Vector> &_old,
     91      const std::vector<Vector> &_new,
     92      const IndexList_t &_Matching);
     93
     94  static Polygon_t removeMatchingPoints(
     95      const VectorArray_t &_points,
     96      const IndexList_t &_matchingindices
     97      );
     98
     99  struct MatchingControlStructure {
     100    bool foundflag;
     101    double bestL2;
     102    IndexList_t bestmatching;
     103    VectorArray_t oldpoints;
     104    VectorArray_t newpoints;
     105  };
     106
     107  static void recurseMatchings(
     108      MatchingControlStructure &_MCS,
     109      IndexList_t &_matching,
     110      IndexList_t _indices,
     111      unsigned int _matchingsize);
     112
     113  static IndexList_t findBestMatching(
     114      const Polygon_t &_polygon,
     115      const Polygon_t &_newpolygon
     116      );
     117
     118  static Rotation_t findPlaneAligningRotation(
     119      const VectorArray_t &_referencepositions,
     120      const VectorArray_t &_currentpositions,
     121      const IndexList_t &_bestmatching
     122      );
     123
     124  static Rotation_t findPointAligningRotation(
     125      const VectorArray_t &remainingold,
     126      const VectorArray_t &remainingnew,
     127      const IndexList_t &_bestmatching);
     128
    78129};
    79130
Note: See TracChangeset for help on using the changeset viewer.