示例#1
0
        /// <summary>
        ///     TODO
        /// </summary>
        /// <param name="acSol"></param>
        /// <returns></returns>
        private Matrix3d GetAbstractMatrix(Solid3d acSol)
        {
            var bestMatrix = new Matrix3d();

            using (var acBrep = acSol.GetBrep())
            {
                try
                {
                    if (acBrep.Faces.Any())
                    {
                        double largest = 0;

                        foreach (var acFace in acBrep.Faces)
                        {
                            var fArea = acFace.GetArea();

                            if (fArea.IsEqualArea(largest) || fArea < largest)
                            {
                                continue;
                            }

                            largest    = fArea;
                            bestMatrix = acFace.GetLayMatrix();
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    MailAgent.Report(e.Message);
                    return(bestMatrix);
                }
            }

            return(bestMatrix);
        }