Exemplo n.º 1
0
        double aspect_metric(int eid)
        {
            Index3i ta, tb, ota, otb;

            MeshUtil.GetEdgeFlipTris(fillmesh, eid, out ta, out tb, out ota, out otb);
            double aspect_a  = get_tri_aspect(fillmesh, ref ta);
            double aspect_b  = get_tri_aspect(fillmesh, ref tb);
            double aspect_c  = get_tri_aspect(fillmesh, ref ota);
            double aspect_d  = get_tri_aspect(fillmesh, ref otb);
            double metric_ab = Math.Abs(aspect_a - 1.0) + Math.Abs(aspect_b - 1.0);
            double metric_cd = Math.Abs(aspect_c - 1.0) + Math.Abs(aspect_d - 1.0);

            return(metric_cd / metric_ab);
        }
Exemplo n.º 2
0
        double area_metric(int eid)
        {
            Index3i ta, tb, ota, otb;

            MeshUtil.GetEdgeFlipTris(fillmesh, eid, out ta, out tb, out ota, out otb);
            double area_a    = get_tri_area(fillmesh, ref ta);
            double area_b    = get_tri_area(fillmesh, ref tb);
            double area_c    = get_tri_area(fillmesh, ref ota);
            double area_d    = get_tri_area(fillmesh, ref otb);
            double avg_ab    = (area_a + area_b) * 0.5;
            double avg_cd    = (area_c + area_d) * 0.5;
            double metric_ab = Math.Abs(area_a - avg_ab) + Math.Abs(area_b - avg_ab);
            double metric_cd = Math.Abs(area_c - avg_cd) + Math.Abs(area_d - avg_cd);

            return(metric_cd / metric_ab);
        }