Ejemplo n.º 1
0
        public void Fitting(Segment seg)
        {
            var m = GetMeshInfo(seg);

            if (m == null)
            {
                return;
            }
            SkeletonFitting.Fitting(m, an);
        }
Ejemplo n.º 2
0
        static void Deform(List <SegmentMeshInfo> meshes, SkeletonAnnotation an, List <ConnectPair> pairs)
        {
            if (meshes == null || meshes.Count <= 0)
            {
                return;
            }

            if (meshes.Count == 1)
            {
                SkeletonFitting.Fitting(meshes[0], an);
                return;
            }

            float delta = 0;

            for (int i = 0; i < 5; i++)
            {
                delta = AdjustScale(meshes, an, pairs);
                if (delta <= 1e-4)
                {
                    break;
                }
                foreach (var m in meshes)
                {
                    SkeletonFitting.Fitting(m, an);
                }
            }

            foreach (var m in meshes)
            {
                SkeletonFitting.Fitting(m, an);
            }

            //            AdjustRotation(meshes, an, pairs);
            AdjustPosition(meshes, an, pairs);
            ExpandSegments(meshes, an, pairs);
        }