Esempio n. 1
0
        private Matrix4D GetVolumeMatrix(TriMesh.Face face)
        {
            Vector3D normal = this.traits.FaceNormal[face.Index];
            Plane    p      = new Plane(face.HalfEdge.ToVertex.Traits.Position, normal);
            Matrix4D m      = this.Square(p);

            double area = this.traits.FaceArea[face.Index];

            foreach (var item in TriMeshUtil.RetrieveOneRingFaceOfFace(face))
            {
                area += this.traits.FaceArea[item.Index];
            }

            m *= area * area;
            return(m);
        }