Пример #1
0
        /// <summary>
        /// 创建面对象
        /// </summary>
        /// <param name="face"></param>
        /// <returns></returns>
        private static SWFace CreateSWFace(Face2 face)
        {
            if (face == null)
            {
                return(null);
            }

            //复制Face信息
            SWFace swFace = new SWFace();

            //ID
            swFace.ID = face.GetFaceId();
            //包围盒
            swFace.BoundingBox = CreateSWBoundingBox(face.GetBox());

            //三角面片
            //int tessTriCount = face.GetTessTriangleCount();
            swFace.TessTriangles = face.GetTessTriangles(false);
            swFace.TessNormals   = face.GetTessNorms();

            //OutPutTessTriangles(tessTriCount, arrTriangles);

            /*
             * if (arrTriangles != null) {
             *  for (int i = 0; i < tessTriCount; i += 9) {
             *      swFace.TessTriangles.Add(CreateSWTriangle(arrTriangles, i));
             *  }
             * }
             */

            //几何信息
            swFace.Surface = CreateSWSurface(face.GetSurface());

            return(swFace);
        }
Пример #2
0
        /// <summary>
        /// 创建面对象
        /// </summary>
        /// <param name="face"></param>
        /// <returns></returns>
        private static SWFace CreateSWFace(Face2 face) {
            if (face == null)
                return null;

            //复制Face信息
            SWFace swFace = new SWFace();

            //ID
            swFace.ID = face.GetFaceId();
            //包围盒
            swFace.BoundingBox = CreateSWBoundingBox(face.GetBox());

            //三角面片
            //int tessTriCount = face.GetTessTriangleCount();
            swFace.TessTriangles = face.GetTessTriangles(false);
            swFace.TessNormals = face.GetTessNorms();

            //OutPutTessTriangles(tessTriCount, arrTriangles);
            /* 
            if (arrTriangles != null) {
                for (int i = 0; i < tessTriCount; i += 9) {
                    swFace.TessTriangles.Add(CreateSWTriangle(arrTriangles, i));
                }
            }
            */
           
            //几何信息
            swFace.Surface = CreateSWSurface(face.GetSurface());

            return swFace;
        }