예제 #1
0
        public bool Backward()
        {
            if (this.index == 0)
            {
                return(false);
            }
            else
            {
                index--;
                EdgeContext ctx = this.method.Logs[this.index];
                SplitVertex.Split(this.Mesh, ctx);
                TriMesh.Vertex left  = null;
                TriMesh.Vertex right = null;
                foreach (var v in this.Mesh.Vertices)
                {
                    if (v.Index == ctx.Left)
                    {
                        left = v;
                    }
                    else if (v.Index == ctx.Right)
                    {
                        right = v;
                    }
                }

                TriMesh.HalfEdge hf = left.FindHalfedgeTo(right);
                hf.Face.Traits.Normal          = TriMeshUtil.ComputeNormalFace(hf.Face);
                hf.Opposite.Face.Traits.Normal = TriMeshUtil.ComputeNormalFace(hf.Opposite.Face);
                left.Traits.Normal             = TriMeshUtil.ComputeNormalAreaWeight(left);
                right.Traits.Normal            = TriMeshUtil.ComputeNormalAreaWeight(right);
                return(true);
            }
        }