Ignore:
Timestamp:
Aug 20, 2014, 1:04:08 PM (11 years ago)
Author:
Frederik Heber <heber@…>
Children:
0710bf
Parents:
6aa6b7
git-author:
Frederik Heber <heber@…> (06/12/14 07:23:12)
git-committer:
Frederik Heber <heber@…> (08/20/14 13:04:08)
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

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