示例#1
0
        public double[] ColorVertexByMeanCurvature(TriMesh mesh, double min, double max)
        {
            double[] mean = TriMeshUtil.ComputeMeanCurvature(mesh);

            ColorVertex(mesh, mean, min, max);

            return(mean);
        }
示例#2
0
        public void SetRange(TriMesh mesh, EnumColorItem item, ref CriteriaRange criteriaRange)
        {
            double[] range = null;
            switch (item)
            {
            case EnumColorItem.DihedralAngle:
                range = TriMeshUtil.ComputeDihedralAngle(mesh);
                break;

            case EnumColorItem.Gaussian:
                range = TriMeshUtil.ComputeGaussianCurvatureIntegrated(mesh);
                break;

            case EnumColorItem.Mean:
                range = TriMeshUtil.ComputeMeanCurvature(mesh);
                break;
            }

            criteriaRange.Max = TriMeshFunction.Instance.ComputeMax(range);
            criteriaRange.Min = TriMeshFunction.Instance.ComputeMin(range);
        }
示例#3
0
        private void InitCurvatureInfoGrid()
        {
            this.dataGridViewCurvature.Rows.Clear();
            double[] curvature = TriMeshUtil.ComputeGaussianCurvature(Mesh);

            double[]             meanCurv = TriMeshUtil.ComputeMeanCurvature(Mesh);
            PrincipalCurvature[] basic    = TriMeshUtil.ComputePricipalCurvature(Mesh);

            PrincipalCurvature[] pg = TriMeshUtil.ComputePricipalCurvaturePG07(Mesh);
            CurvatureLib.Init(Mesh);
            PrincipalCurvature[] ccc = CurvatureLib.ComputeCurvature();

            for (int i = 0; i < curvature.Length; i++)
            {
                this.dataGridViewCurvature.Rows.Add(i,
                                                    curvature[i],
                                                    meanCurv[i],
                                                    ccc[i].max,
                                                    ccc[i].min,
                                                    pg[i].max,
                                                    pg[i].min);
            }
        }
示例#4
0
        public double[] ComputeFunction(TriMesh mesh)
        {
            double[] function = null;
            switch (FunctionType)
            {
            case EnumFunction.X:
                function = ComputeX(mesh);
                break;

            case EnumFunction.Y:
                function = ComputeY(mesh);
                break;

            case EnumFunction.Z:
                function = ComputeZ(mesh);
                break;

            case EnumFunction.CosX:

                function = ComputeCosX(mesh, ConfigFunction.Instance.Cos);
                break;

            case EnumFunction.CosY:

                function = ComputeCosY(mesh, ConfigFunction.Instance.Cos);
                break;

            case EnumFunction.CosZ:

                function = ComputeCosZ(mesh, ConfigFunction.Instance.Cos);
                break;

            case EnumFunction.Harmonic:

                function = ComputeHarmonic(mesh);
                break;

            case EnumFunction.SmoothedCurvature:

                function = ComputeSmoothedCurvature(mesh);
                break;

            case EnumFunction.DiffusionDistance:

                function = ComputeDistanceDiffusion(mesh, ConfigFunction.Instance.Diffustion);
                break;

            case EnumFunction.CommuteTime:

                function = ComputeDistanceCommuteTime(mesh);
                break;


            case EnumFunction.BiharmonicDistance:

                function = ComputeDistanceBiharmonic(mesh);
                break;

            case EnumFunction.ADFDistance:

                function = ComputeDistanceADF(mesh, ConfigFunction.Instance.ADF);
                break;

            case EnumFunction.Gaussian:

                function = TriMeshUtil.ComputeGaussianCurvatureIntegrated(mesh);
                break;

            case EnumFunction.MeanCurvature:

                function = TriMeshUtil.ComputeMeanCurvature(mesh);
                break;

            case EnumFunction.GaussianVertex:
                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputeGaussianCurvature();

                break;

            case EnumFunction.MeanCurvatureVertex:

                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputeMeanCurvature();
                break;

            case EnumFunction.PrincipalMaxAbs:

                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputePrincipalMaxAbs();
                break;

            case EnumFunction.PrincipalMinAbs:

                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputePrincipalMinAbs();
                break;

            case EnumFunction.PrincipalMax:

                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputePrincipalMax();
                break;

            case EnumFunction.PrincipalMin:

                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputePrincipalMin();
                break;

            case EnumFunction.EigenVector:

                function = ComputeEigenVector(mesh, ConfigFunction.Instance.EigenIndex);
                break;

            case EnumFunction.External:

                function = Function;
                break;
            }

            this.Function = function;

            return(function);
        }