Ejemplo n.º 1
0
        public override Dictionary <double, BoundaryModel[]> GetBaseFaceBoundary()
        {
            Dictionary <double, BoundaryModel[]> dic = new Dictionary <double, BoundaryModel[]>();
            List <BoundaryModel> boundary            = new List <BoundaryModel>();
            List <FaceData>      other = analysis.GetOtherBaseFaces();

            if (other.Count > 0)
            {
                foreach (FaceData fe in other)
                {
                    PlanarBoundary pb = new PlanarBoundary(fe);
                    BoundaryModel  model;
                    double         blank;
                    pb.GetPeripheralBoundary(out model, out blank);
                    boundary.Add(model);
                }
            }
            PlanarBoundary pby = new PlanarBoundary(analysis.BaseFace);

            boundary.AddRange(pby.GetHoleBoundary());
            if (this.IsOffsetInter)
            {
                dic.Add(0, boundary.ToArray());
            }
            else
            {
                dic.Add(tempInter, boundary.ToArray());
            }

            return(dic);
        }
        /// <summary>
        /// 获取基准框边界和地面点
        /// </summary>
        /// <returns></returns>
        public virtual void GetBaseStationBoundary(out BoundaryModel boundary, out Point3d floorPt)
        {
            double         blank;
            PlanarBoundary pl = new PlanarBoundary(analysis.BaseFace);

            pl.GetPeripheralBoundary(out boundary, out blank);
            boundary.ToolSide   = NXOpen.CAM.BoundarySet.ToolSideTypes.OutsideOrRight;
            boundary.BouudaryPt = analysis.BaseFace.BoxMinCorner;
            //  boundary.PlaneTypes = NXOpen.CAM.BoundarySet.PlaneTypes.Automatic;
            floorPt = this.analysis.BaseSubfaceFace.BoxMinCorner;
        }
        private List <BoundaryModel> GetBoundary()
        {
            List <BoundaryModel> models = new List <BoundaryModel>();

            foreach (Face face in Conditions)
            {
                PlanarBoundary pb = new PlanarBoundary(face);
                BoundaryModel  model1;
                double         blank1;
                pb.GetPeripheralBoundary(out model1, out blank1);
                if (UMathUtils.IsEqual(blank1, 0))
                {
                    models.Add(model1);
                }
            }
            return(models);
        }
        public override Dictionary <double, BoundaryModel[]> GetBaseFaceBoundary()
        {
            Dictionary <double, BoundaryModel[]> dic = new Dictionary <double, BoundaryModel[]>();

            if (this.IsOffsetInter)
            {
                List <BoundaryModel> boundary = new List <BoundaryModel>();
                List <FaceData>      other    = analysis.GetOtherBaseFaces();
                if (other.Count > 0)
                {
                    foreach (FaceData fe in other)
                    {
                        PlanarBoundary pb = new PlanarBoundary(fe);
                        BoundaryModel  model;
                        double         blank;
                        pb.GetPeripheralBoundary(out model, out blank);
                        boundary.Add(model);
                    }
                }
                PlanarBoundary pby = new PlanarBoundary(analysis.BaseFace);
                boundary.AddRange(pby.GetHoleBoundary());
                dic.Add(0, boundary.ToArray());
            }
            else
            {
                List <BoundaryModel> erBoundary = new List <BoundaryModel>();
                List <BoundaryModel> efBoundary = new List <BoundaryModel>();
                List <FaceData>      other      = analysis.GetOtherBaseFaces();
                if (other.Count > 0)
                {
                    List <FaceData> er = new List <FaceData>();
                    List <FaceData> ef = new List <FaceData>();
                    GetEFanERFace(other, out er, out ef);
                    foreach (FaceData fd in er)
                    {
                        PlanarBoundary pb = new PlanarBoundary(fd);
                        BoundaryModel  model;
                        double         blank;
                        pb.GetPeripheralBoundary(out model, out blank);
                        erBoundary.Add(model);
                    }
                    foreach (FaceData fd in ef)
                    {
                        PlanarBoundary pb = new PlanarBoundary(fd);
                        BoundaryModel  model;
                        double         blank;
                        pb.GetPeripheralBoundary(out model, out blank);
                        efBoundary.Add(model);
                    }
                }
                PlanarBoundary       pby      = new PlanarBoundary(analysis.BaseFace);
                List <BoundaryModel> boundary = pby.GetHoleBoundary();
                foreach (BoundaryModel bm in boundary)
                {
                    Edge eg = bm.Curves[0] as Edge;
                    foreach (Face fe in eg.GetFaces())
                    {
                        string er = AttributeUtils.GetAttrForString(fe, "ToolhGapValue");
                        if (er.Equals("ER", StringComparison.CurrentCultureIgnoreCase))
                        {
                            erBoundary.Add(bm);
                            break;
                        }
                        else if (er.Equals("EF", StringComparison.CurrentCultureIgnoreCase))
                        {
                            efBoundary.Add(bm);
                            break;
                        }
                    }
                }
                ElectrodeGapValueInfo gap = this.model.Info.AllInfo.GapValue;
                dic.Add(gap.CrudeInter, erBoundary.ToArray());
                dic.Add(gap.FineInter, efBoundary.ToArray());
            }

            return(dic);
        }