Exemple #1
0
        static float ABFComputeGradAlpha(ABFSystem sys, ABFFace f, ABFHalfEdge e)
        {
            ABFVertex v = e.Vertex, v1 = e.Next.Vertex, v2 = e.Next.Next.Vertex;

            float deriv = (sys.Alpha[e.AngleID] - sys.Beta[e.AngleID]) * sys.Weight[e.AngleID];

            deriv += sys.LambdaTriangle[f.AngleID];

            if (!v.PVertex.IsBorder)
            {
                deriv += sys.LambdaPlanar[v.AngleID];
            }


            if (!v1.PVertex.IsBorder)
            {
                float product = ABFComputeSinProduct(sys, v1, e.AngleID);
                deriv += sys.LambdaLength[v1.AngleID] * product;
            }

            if (!v2.PVertex.IsBorder)
            {
                float product = ABFComputeSinProduct(sys, v2, e.AngleID);
                deriv += sys.LambdaLength[v2.AngleID] * product;
            }

            return(deriv);
        }
Exemple #2
0
        void GetAngles(ABFFace f, out float a1, out float a2, out float a3)
        {
            var e1 = f.HEdge[0];
            var e2 = e1.Next;
            var e3 = e2.Next;

            var v1 = e1.Vertex;
            var v2 = e2.Vertex;
            var v3 = e3.Vertex;

            a1 = ABFVectorAngle(v3, v1, v2);
            a2 = ABFVectorAngle(v1, v2, v3);
            a3 = (float)Math.PI - a2 - a1;
        }