Exemplo n.º 1
0
        /// <summary>
        /// Calculate when two point right. The result is one triangle
        /// </summary>
        static void CalculateOneTr(BzMeshDataEditor meshDataEditor, int inV, int outA, int outB, List <BzTriangle> trianglesSliced)
        {
            //  outA\^^^^^^^^^^^^^/outB
            //       \           /
            //        \         /
            //      ---------------
            //    new2  \     /  new1
            //           \   /
            //            \ /
            //            inV

            int new1 = meshDataEditor.GetIndexFor(inV, outB);
            int new2 = meshDataEditor.GetIndexFor(inV, outA);

            if (new1 != inV & new2 != inV)
            {
                var tr = new BzTriangle(inV, new2, new1);
                trianglesSliced.Add(tr);
            }

            // save edge to chash
            if (new1 != new2)
            {
                meshDataEditor.CapEdges.Add(new IndexVector(new1, new2));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Calculate when two point right. The result is one triangle
        /// </summary>
        static void CalculateOneTr(BzMeshDataEditor meshDataEditor, int neg, int rightA, int rightB, List <BzTriangle> trianglesSliced)
        {
            //            pos
            //    rA\^^^^^^^^^^^^^/rB
            //       \           /
            //        \         /
            //      ---------------
            //    new1  \     /  new2
            //           \   /
            //            \ /
            //            neg

            int new1 = meshDataEditor.GetIndexFor(neg, rightA);
            int new2 = meshDataEditor.GetIndexFor(neg, rightB);

            var tr = new BzTriangle(neg, new1, new2);

            trianglesSliced.Add(tr);

            // save eghe to chash
            meshDataEditor.CapEdges.Add(new IndexVector(new1, new2));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Calculate when one point right. The result is two triangles
        /// </summary>
        static void CalculateTwoTr(BzMeshDataEditor meshDataEditor, int outV, int inA, int inB, List <BzTriangle> trianglesSliced)
        {
            //            outV
            //            / \
            //           /   \
            //    new2  /     \  new1
            //      ----.----------
            //        /   .     \
            //       /       .   \
            //   inB/___________._\inA

            int new1 = meshDataEditor.GetIndexFor(inA, outV);
            int new2 = meshDataEditor.GetIndexFor(inB, outV);

            if (new1 == outV | new2 == outV)
            {
                var tr = new BzTriangle(inB, outV, inA);
                trianglesSliced.Add(tr);
            }
            else
            {
                if (new1 != inA)
                {
                    var tr1 = new BzTriangle(inA, new2, new1);
                    trianglesSliced.Add(tr1);
                }
                if (new2 != inB)
                {
                    var tr2 = new BzTriangle(inB, new2, inA);
                    trianglesSliced.Add(tr2);
                }
            }

            // save edge to chash
            if (new2 != new1)
            {
                meshDataEditor.CapEdges.Add(new IndexVector(new1, new2));
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Calculate when one point right. The result is two triangles
        /// </summary>
        static void CalculateTwoTr(BzMeshDataEditor meshDataEditor, int pos, int negA, int negB, List <BzTriangle> trianglesSliced)
        {
            //            pos
            //            / \
            //           /   \
            //    new1  /     \  new2
            //      ----.----------
            //        /   .     \
            //       /       .   \
            //    iB/___________._\iA
            //           neg

            int new1 = meshDataEditor.GetIndexFor(negB, pos);
            int new2 = meshDataEditor.GetIndexFor(negA, pos);

            var tr1 = new BzTriangle(negB, new1, negA);
            var tr2 = new BzTriangle(negA, new1, new2);

            trianglesSliced.Add(tr1);
            trianglesSliced.Add(tr2);

            // save eghe to chash
            meshDataEditor.CapEdges.Add(new IndexVector(new1, new2));
        }