示例#1
0
        private void PrepareTargetTree(PointCloudVertices pointCloudTarget)
        {
            //second object:
            //-----------
            pointCloudTargetCentered = CalculatePCA_Internal(pointCloudTarget);
            //pointCloudTargetCentered = ShiftByCenterOfMass(pointCloudTarget);

            kdtree = new KDTreeVertex();
            kdtree.BuildKDTree_Rednaxela(pointCloudTargetCentered);

            pointCloudResult       = null;
            pointCloudTargetKDTree = null;
        }
示例#2
0
        public static List <Vector3> CalculateNormals_PCA(PointCloudVertices pointCloud, int numberOfNeighbours, bool centerOfMassMethod, bool flipNormalWithOriginVector)
        {
            KDTreeVertex kv = new KDTreeVertex();

            kv.NumberOfNeighboursToSearch = numberOfNeighbours;
            kv.BuildKDTree_Rednaxela(pointCloud);
            kv.ResetVerticesLists(pointCloud);
            kv.FindNearest_NormalsCheck_Rednaxela(pointCloud, false);



            PCA            pca     = new PCA();
            List <Vector3> normals = pca.Normals(pointCloud, centerOfMassMethod, flipNormalWithOriginVector);

            return(normals);
        }