예제 #1
0
        private void ConstructFaceNormal(MeshGeometry3D themesh, int faceindex)
        {
            Point3D  centroid   = Tools3D.ComputeTriangleCentroid(themesh, faceindex);
            Vector3D facenormal = Tools3D.ComputeTriangleNormal(themesh, faceindex);

            ConstructAnnotationArrow(centroid, facenormal, CONTAINERfacenormals);
        }
예제 #2
0
        private void ConstructVertexNormalsMatchingFaceNormal(MeshGeometry3D themesh, int faceindex)
        {
            Vector3D facenormal = Tools3D.ComputeTriangleNormal(themesh, faceindex);

            ConstructAnnotationArrow(themesh.Positions[themesh.TriangleIndices[faceindex * 3]], facenormal, CONTAINERfacenormals);
            ConstructAnnotationArrow(themesh.Positions[themesh.TriangleIndices[faceindex * 3 + 1]], facenormal, CONTAINERfacenormals);
            ConstructAnnotationArrow(themesh.Positions[themesh.TriangleIndices[faceindex * 3 + 2]], facenormal, CONTAINERfacenormals);
        }
예제 #3
0
        private void ConstructVertexNormalsForTwoFaceSituation(MeshGeometry3D themesh)
        {
            Vector3D facenormal0 = Tools3D.ComputeTriangleNormal(themesh, 0);
            Vector3D facenormal1 = Tools3D.ComputeTriangleNormal(themesh, 1);

            // The edge vertices (non-shared) use the face normal as-is
            ConstructAnnotationArrow(themesh.Positions[1], facenormal0, CONTAINERfacenormals);
            ConstructAnnotationArrow(themesh.Positions[3], facenormal1, CONTAINERfacenormals);

            // The shared vertices 0 and 2 use the average of the two normals.
            Vector3D normalavgd = (facenormal0 + facenormal1);

            normalavgd.Normalize();
            ConstructAnnotationArrow(themesh.Positions[0], normalavgd, CONTAINERfacenormals);
            ConstructAnnotationArrow(themesh.Positions[2], normalavgd, CONTAINERfacenormals);
        }