A helper class mostly for normal computation. If convex hulls are computed in higher dimensions, it might be a good idea to add a specific FindNormalVectorND function.
コード例 #1
0
ファイル: Data.cs プロジェクト: jimmylarkin/River
        /// <summary>
        /// Initialize buffers and lists.
        /// </summary>
        /// <param name="config"></param>
        void InitializeData(ConvexHullComputationConfig config)
        {
            UnprocessedFaces = new FaceList();
            ConvexFaces = new IndexBuffer();

            FacePool = new ConvexFaceInternal[(Dimension + 1) * 10]; // must be initialized before object manager
            AffectedFaceFlags = new bool[(Dimension + 1) * 10];
            ObjectManager = new MIConvexHull.ObjectManager(this);

            Center = new double[Dimension];
            TraverseStack = new IndexBuffer();
            UpdateBuffer = new int[Dimension];
            UpdateIndices = new int[Dimension];
            EmptyBuffer = new IndexBuffer();
            AffectedFaceBuffer = new IndexBuffer();
            ConeFaceBuffer = new SimpleList<DeferredFace>();
            SingularVertices = new HashSet<int>();
            BeyondBuffer = new IndexBuffer();

            ConnectorTable = new ConnectorList[ConnectorTableSize];
            for (int i = 0; i < ConnectorTableSize; i++) ConnectorTable[i] = new ConnectorList();

            VertexMarks = new bool[Vertices.Length];
            InitializePositions(config);

            MathHelper = new MIConvexHull.MathHelper(Dimension, Positions);
        }