public override void SetOperationData(AbstractElectrodeCAM eleCam) { Dictionary <double, Face[]> slope = new Dictionary <double, Face[]>(); if ((steep && isAll) || (!steep && isAll)) { slope = eleCam.GetAllFaces(); } else if (steep && !isAll) { slope = eleCam.GetSteepFaces(); } else if (!steep && !isAll) { slope = eleCam.GetSlopeFaces(); } slope.OrderBy(a => a.Key); for (int k = 0; k < slope.Count; k++) { if (k == 0) { this.Inter = slope.Keys.ToArray()[k]; this.SetFaces(slope[this.Inter]); this.SetCutLevel(eleCam.Analysis.BaseFace.BoxMinCorner); } else { AbstractCreateOperation oper = this.CopyOperation(99); oper.Inter = slope.Keys.ToArray()[k]; (oper as ZLevelMillingCreateOperation).SetFaces(slope[this.Inter]); (oper as ZLevelMillingCreateOperation).SetCutLevel(eleCam.Analysis.BaseFace.BoxMinCorner); } } }
/// <summary> /// 创建用户定义操作 /// </summary> /// <param name="eleCam"></param> /// <returns></returns> public List <string> CreateUserOperation(AbstractElectrodeCAM eleCam) { List <string> err = new List <string>(); UpdateProgramName(); foreach (AbstractCreateOperation ao in Oper) { if (ao is BaseFaceCreateOperation) { ao.SetOperationData(eleCam); } if (ao is BaseStationCreateOperation) { ao.SetOperationData(eleCam); } } foreach (AbstractCreateOperation ao in Oper) { try { err.AddRange(ao.CreateOperation()); } catch (Exception ex) { err.Add(ex.Message); } } return(err); }
public override void SetOperationData(AbstractElectrodeCAM eleCam) { double minDia; this.Inter = eleCam.Inter; eleCam.Analysis.GetFlatFaces(out this.Faces, out minDia); }
public override void SetOperationData(AbstractElectrodeCAM eleCam) { Dictionary <double, Face[]> slope = new Dictionary <double, Face[]>(); if (flat && isAll) { slope = eleCam.GetAllFaces(); } else if (flat) { slope = eleCam.GetSlopeFaces(); } else { slope = eleCam.GetFlatFaces(); } slope.OrderBy(a => a.Key); for (int k = 0; k < slope.Count; k++) { if (k == 0) { this.Inter = slope.Keys.ToArray()[k]; this.SetFaces(slope[this.Inter]); } else { AbstractCreateOperation oper = this.CopyOperation(99); oper.Inter = slope.Keys.ToArray()[k]; (oper as FlowCutCreateOperation).SetFaces(slope[this.Inter]); } } }
public override void SetOperationData(AbstractElectrodeCAM eleCam) { //this.Inter = eleCam.Inter; this.Inter = 0; Point3d floorPt; BoundaryModel conditions; eleCam.GetBaseStationBoundary(out conditions, out floorPt); SetBoundary(floorPt, conditions); }
public override void SetOperationData(AbstractElectrodeCAM eleCam) { this.Inter = eleCam.Inter; Line[] lines = eleCam.GetBaseFaceLine(); if (lines == null || lines.Length == 0) { } else { SetBoundary(lines); } }
public CreateElectrodeCAMBuilder(Part pt, UserModel user) { this.pt = pt; try { cam = ElectrodeCAMFactory.CreateCAM(pt, user); } catch (Exception ex) { throw ex; } }
public override void SetOperationData(AbstractElectrodeCAM eleCam) { Dictionary <double, Face[]> plane = eleCam.GetPlaneFaces(); plane.OrderBy(a => a.Key); for (int k = 0; k < plane.Count; k++) { if (k == 0) { this.Inter = plane.Keys.ToArray()[k]; this.SetBoundary(plane[this.Inter]); } else { AbstractCreateOperation oper = this.CopyOperation(99); oper.Inter = plane.Keys.ToArray()[k]; (oper as FaceMillingCreateOperation).SetBoundary(plane[this.Inter]); } } }
public override void SetOperationData(AbstractElectrodeCAM eleCam) { Dictionary <double, BoundaryModel[]> boun = eleCam.GetBaseFaceBoundary(); boun.OrderBy(a => a.Key); for (int k = 0; k < boun.Count; k++) { if (k == 0) { this.Inter = boun.Keys.ToArray()[k]; this.SetBoundary(eleCam.Analysis.BaseFace.BoxMinCorner, boun[this.Inter]); } else { AbstractCreateOperation oper = this.CopyOperation(99); oper.Inter = boun.Keys.ToArray()[k]; (oper as PlanarMillingCreateOperation).SetBoundary(eleCam.Analysis.BaseFace.BoxMinCorner, boun[this.Inter]); } } }
public static AbstractElectrodeCAM CreateCAM(Part pt, UserModel user) { AbstractElectrodeCAM cam = null; if (ParentAssmblieInfo.IsElectrode(pt)) { ElectrodeModel em = new ElectrodeModel(pt); ElectrodeGapValueInfo gap = em.Info.AllInfo.GapValue; if ((gap.ERNum[0] != 0 || gap.ERNum[1] != 0) && (gap.FineInter != 0 && gap.FineNum != 0) && (gap.CrudeInter != 0 && gap.CrudeNum == 0)) { try { cam = new ErAndEfElectrodeCAM(em, user); } catch (Exception ex) { throw ex; } } else if (((gap.FineInter != 0 && gap.FineNum != 0) && (gap.CrudeInter != 0 && gap.CrudeNum != 0)) || ((gap.FineInter != 0 && gap.FineNum != 0) && (gap.DuringInter != 0 && gap.DuringNum != 0)) || ((gap.CrudeInter != 0 && gap.CrudeNum != 0) && (gap.DuringInter != 0 && gap.DuringNum != 0))) { try { cam = new ManyInterElectrodeCAM(em, user); } catch (Exception ex) { throw ex; } } else if (((gap.FineInter != 0 && gap.FineNum != 0) && (gap.CrudeInter == 0 && gap.CrudeNum == 0) && (gap.DuringNum == 0 && gap.DuringNum == 0)) || ((gap.FineInter == 0 && gap.FineNum == 0) && (gap.CrudeInter != 0 && gap.CrudeNum != 0) && (gap.DuringNum == 0 && gap.DuringNum == 0)) || ((gap.FineInter == 0 && gap.FineNum == 0) && (gap.CrudeInter == 0 && gap.CrudeNum == 0) && (gap.DuringNum != 0 && gap.DuringNum != 0))) { try { cam = new OnlyInterElectrodeCAM(em, user); } catch (Exception ex) { throw ex; } } else { try { cam = new NonStandardElectrodeCAM(pt, user); } catch (Exception ex) { throw ex; } } } else { try { cam = new NonStandardElectrodeCAM(pt, user); } catch (Exception ex) { throw ex; } } return(cam); }
public override void SetOperationData(AbstractElectrodeCAM eleCam) { this.Inter = eleCam.Inter; }
/// <summary> /// 设置刀具路径比要数据 /// </summary> /// <param name="eleCam"></param> public abstract void SetOperationData(AbstractElectrodeCAM eleCam);