public void TriangulateFace(Autodesk.Revit.DB.Face vFace, Transform instTransform)
        {
            try
            {
                //setup utility class
                LuxExporter.UnitConverter Converter = new UnitConverter();

                //process face
                Mesh vMesh = vFace.Triangulate();

                //check if we have a quad mesh (4 edges to a face)
                if (vMesh.Vertices.Count == 4)
                {
                    //increase face counter
                    iNumberOfFaces++;

                    //found quad
                    Data.NumberOfVerticesinFace = 4;
                    //loop through all vertices and add
                    foreach (XYZ ii in vMesh.Vertices)
                    {
                        XYZ point = ii;
                        XYZ transformedPoint;

                        //transform geometry (only required in nested families / or elements like baluster
                        if (instTransform == null)
                        {
                            transformedPoint = point;
                        }
                        else
                        {
                            transformedPoint = instTransform.OfPoint(point);
                        }

                        //get the normal
                        XYZ NormalAtPoint;

                        IntersectionResult IntResult= vFace.Project(ii);

                        if (IntResult != null)
                        {
                            UV UVatPoint = IntResult.UVPoint;
                            NormalAtPoint = new XYZ(vFace.ComputeNormal(UVatPoint).X, vFace.ComputeNormal(UVatPoint).Y, vFace.ComputeNormal(UVatPoint).Z);
                        }
                        else
                        {
                            //this needs fixing!!!
                            NormalAtPoint = new XYZ(0, 0, 0);
                        }

                        //convert to meter
                        transformedPoint = Converter.ConvertPointCoordToMeter(transformedPoint);
                        //NormalAtPoint = Converter.ConvertPointCoordToMeter(NormalAtPoint);

                        //add to ply class
                        Data.AddVertice(transformedPoint,NormalAtPoint);

                    }

                }
                else
                {
                    // set pointer
                    Data.NumberOfVerticesinFace = 3;

                    //export all triangles in face
                    for (int i = 0; i < vMesh.NumTriangles; i++)
                    {
                        //increase face counter
                        iNumberOfFaces++;

                        MeshTriangle objTriangular = vMesh.get_Triangle(i);

                        for (int iPointsCounter = 0; iPointsCounter < 3; iPointsCounter++)
                        {
                            XYZ point = objTriangular.get_Vertex(iPointsCounter);
                            XYZ transformedPoint;
                            //transform geometry (only required in nested families / or elements like baluster
                            if (instTransform == null)
                            {
                                transformedPoint = point;
                            }
                            else
                            {
                                transformedPoint = instTransform.OfPoint(point);
                            }

                            XYZ NormalAtPoint;

                            //get the normal
                            IntersectionResult IntResult = vFace.Project(point);
                            if (IntResult!=null)
                            {
                                UV UVatPoint = IntResult.UVPoint;
                                NormalAtPoint = new XYZ(vFace.ComputeNormal(UVatPoint).X,vFace.ComputeNormal(UVatPoint).Y,vFace.ComputeNormal(UVatPoint).Z);
                            }
                            else
                            {
                                //this needs fixing
                                NormalAtPoint = new XYZ(0, 0, 0);
                            }

                            //convert to meter
                            transformedPoint = Converter.ConvertPointCoordToMeter(transformedPoint);
                            //NormalAtPoint = Converter.ConvertPointCoordToMeter(NormalAtPoint);
                            //add to ply class
                            Data.AddVertice(transformedPoint,NormalAtPoint);
                        }

                    }
                }

            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("Error in module PLY_by_material::TriangulateMesh "+ex.Message);
                throw;
            }
        }
        //function processing the meash
        public void TriangulateTopoMesh(Autodesk.Revit.DB.Mesh vMesh)
        {
            //setup utility class
            LuxExporter.UnitConverter Converter = new UnitConverter();

            // set pointer
            Data.NumberOfVerticesinFace = 3;

            //export all triangles
            for (int i = 0; i < vMesh.NumTriangles; i++)
            {
                //increase face counter
                iNumberOfFaces++;

                //create a triangle
                MeshTriangle objTriangular = vMesh.get_Triangle(i);

                //calculate normal of triangle
                LuxExporter.NormalOfTriangle NormalofT = new NormalOfTriangle();
                XYZ NormalAtPoint =  NormalofT.calcNormal(objTriangular.get_Vertex(0), objTriangular.get_Vertex(1), objTriangular.get_Vertex(2));

                for (int iPointsCounter = 0; iPointsCounter < 3; iPointsCounter++)
                {
                    XYZ point = objTriangular.get_Vertex(iPointsCounter);
                    //convert to meter
                    point = Converter.ConvertPointCoordToMeter(point);
                    //add to ply class
                    Data.AddVertice(point, NormalAtPoint);
               }
            }
        }