示例#1
0
        /// <summary>
        ///分析体获得斜度和最下R角
        /// </summary>
        /// <returns></returns>
        public AnalyzeBuilder AnalyzeBody()
        {
            Body           body    = ele.PartTag.Bodies.ToArray()[0];
            AnalyzeBuilder builder = new AnalyzeBuilder(body);

            builder.Analyze(new Vector3d(0, 0, 1));
            builder.AnalyzeFaces.Sort();
            builder.AnalyzeFaces.RemoveRange(0, 5);
            builder.AnalyzeFaces.RemoveRange(1, 5);
            return(builder);
        }
示例#2
0
        public ElectrodeCAMInfo(ElectrodeModel model)
        {
            this.Info = model.EleInfo;
            AnalyzeElectrode analyze = new AnalyzeElectrode(model);

            this.MinDim                   = analyze.GetMinDis();
            builder                       = analyze.AnalyzeBody();
            this.BaseFace                 = builder.AnalyzeFaces[1].FaceData;
            this.BaseSubfaceFace          = builder.AnalyzeFaces[0].FaceData;
            this.MinDia                   = 2 * GetBaseMinDia(BaseFace.Face);
            this.BasePlanarPlanarBoundary = new PlanarBoundary(this.BaseFace.Face);
        }
示例#3
0
        public static bool Analye(List <Body> bodys, Matrix4 workMat, string vecName)
        {
            Vector3d vec = new Vector3d();

            switch (vecName.ToUpper())
            {
            case "Z+":
                vec = (new Vector3d(-workMat.GetZAxis().X, -workMat.GetZAxis().Y, -workMat.GetZAxis().Z));
                break;

            case "X+":
                vec = (new Vector3d(-workMat.GetXAxis().X, -workMat.GetXAxis().Y, -workMat.GetXAxis().Z));
                break;

            case "X-":
                vec = (workMat.GetXAxis());
                break;

            case "Y+":
                vec = (new Vector3d(-workMat.GetYAxis().X, -workMat.GetYAxis().Y, -workMat.GetYAxis().Z));
                break;

            case "Y-":
                vec = (workMat.GetYAxis());
                break;

            default:
                break;
            }
            bool isBack = false;

            foreach (Body body in bodys)
            {
                AnalyzeBuilder builder = new AnalyzeBuilder(body);
                builder.Analyze(vec);
                builder.GetBackOff();
                if (builder.IsBackOff)
                {
                    isBack = true;
                }
            }

            return(isBack);
        }