Exemple #1
0
        public static Trans3 GetTransformNoScale(Vector from1, Vector from2, Vector from3, Vector to1, Vector to2, Vector to3)
        {
            //HTLib.DoubleVector3 lfrom1 = new HTLib.DoubleVector3(from1);
            //HTLib.DoubleVector3 lfrom2 = new HTLib.DoubleVector3(from2);
            //HTLib.DoubleVector3 lfrom3 = new HTLib.DoubleVector3(from3);
            //HTLib.DoubleVector3 lto1   = new HTLib.DoubleVector3(to1);
            //HTLib.DoubleVector3 lto2   = new HTLib.DoubleVector3(to2);
            //HTLib.DoubleVector3 lto3   = new HTLib.DoubleVector3(to3);
            //HTLib.Trans3        ltrans = HTLib.Trans3.GetTransformNoScale(lto1, lto2, lto3, lfrom1, lfrom2, lfrom3);
            Trans3 ltrans;

            {
                Vector[] p        = new Vector[] { to1, to2, to3 };
                Vector[] x        = new Vector[] { from1, from2, from3 };
                Trans3   optTrans = ICP3.OptimalTransform(p, x);
                ltrans = optTrans;
            }

            if (HDebug.IsDebuggerAttached)
            {
                var nto1 = ltrans.DoTransform(from1); var err1 = (nto1 - to1).Dist;
                var nto2 = ltrans.DoTransform(from2); var err2 = (nto2 - to2).Dist;
                var nto3 = ltrans.DoTransform(from3); var err3 = (nto3 - to3).Dist;
                HDebug.AssertTolerance(0.00000001, err1, err2, err3);
            }
            return(ltrans);
        }
                public static Trans3 GetTrans(IList <Vector> source
                                              , IList <Vector> target
                                              )
                {
                    Trans3 trans = ICP3.OptimalTransform(source, target);

                    return(trans);
                }
                public static Trans3 GetTrans(IList <Vector> source
                                              , IList <Vector> target
                                              , IList <double> weight
                                              )
                {
                    Trans3 trans = ICP3.OptimalTransformWeighted(source, target, weight);

                    return(trans);
                }