PCB genesis加尾孔實現方法
阿新 • • 發佈:2018-11-29
一.為什麼增加尾孔呢
看一看下圖在panel中增加尾孔的效果;如下圖所示,主要有2點原因.
1.孔徑大小測量
假設如果不增加尾孔,要檢測孔徑大小是否符合要求,那麼QA檢測會選擇最後鑽的孔進大小進行測量, 但鑽孔路徑優化後,是不知道哪個孔是最後一個孔鑽孔,為了讓鑽孔QA清楚的知道哪個孔是尾孔,CAM製作時會將每把刀最一個孔放到統一的一個區域內排列。
2.防止漏鑽刀
如果最後一把刀尾孔漏鑽了,那麼QA一眼就看出來漏鑽刀了
說一下鑽孔工序QA檢測孔徑要求是:用針規全部測量其尾孔,並隨機測量一些板內的孔,檢查有無孔大孔小
二.增加尾孔有哪些要求
1.尾孔鑽刀大小排序
正常是尾孔的鑽刀排序和鑽孔輸出的鑽刀排序一致,每個工廠鑽刀排序不同,需結合每個工廠排刀要求而定,通常鑽孔是:
2.尾孔間距
尾孔間距要求比較寬鬆,0.5-2.0mm之間,一般取中間值就好了,但如遇到鑽刀數太多了,會導致孔整個尾孔區域的長度超長了,尾孔會與其它圖形或鑽孔重疊,這時候可以考慮鑽孔間距減少一些了.
3.尾孔位置
通常尾孔加到板角, 尾孔的方向如下圖所示
三.C#簡易程式碼實現:
1.方槽加內角槽孔程式碼
//鑽孔尺寸按小到大排序 實際鑽刀輸出鑽刀排序進行排序 var OrderSizeList = symbolsList.OrderBy(tt => tt.width).Select(tt=>tt.width *0.001 ).ToList(); gPoint StartPoint = new gPoint(300, 100); //起點 double Hole2Hole = 1;//孔邊到孔邊 double Ang_direction = 45; //方位角 List<gP> HoleList = calc2.p_2plist(OrderSizeList, StartPoint, Hole2Hole, Ang_direction); addCOM.pad(HoleList);View Code
2.計算函式
/// <summary> /// 通過已排序孔大小列表生成點鏈 /// </summary> /// <param name="OrderSizeList">已排序鑽孔</param> /// <param name="StartPoint">起始點</param> /// <param name="Hole2Hole">孔邊到孔邊</param> /// <param name="Ang_direction">方位角</param> /// <returns></returns> public List<gP> p_2plist(List<double> OrderSizeList, gPoint StartPoint, double Hole2Hole, double Ang_direction) { List<gP> HoleList = new List<gP>(); gPoint newP = StartPoint; int HoleSizeCount = OrderSizeList.Count(); double PreRadSize = 0; if (HoleSizeCount > 0) { HoleList.Add(new gP(newP, OrderSizeList[0] * 1000)); PreRadSize = OrderSizeList[0] * 0.5; } for (int i = 1; i < HoleSizeCount; i++) { var val = PreRadSize + Hole2Hole + OrderSizeList[i] * 0.5; newP = p_val_ang(newP, val, Ang_direction); HoleList.Add(new gP(newP, OrderSizeList[i] * 1000)); PreRadSize = OrderSizeList[i] * 0.5; } return HoleList; } /// <summary> /// 求增量座標 /// </summary> /// <param name="ps">起點</param> /// <param name="val">增量值</param> /// <param name="ang_direction">角度</param> /// <returns></returns> public gPoint p_val_ang(gPoint ps, double val, double ang_direction) { gPoint pe; pe.x = ps.x + val * Math.Cos(ang_direction * Math.PI / 180); pe.y = ps.y + val * Math.Sin(ang_direction * Math.PI / 180); return pe; }View Code
3.Point,PAD資料結構
/// <summary> /// PAD 資料型別 /// </summary> public struct gP { public gP(double x_val, double y_val, double width_) { this.p = new gPoint(x_val, y_val); this.negative = false; this.angle = 0; this.mirror = false; this.symbols = "r"; this.attribut = string.Empty; this.width = width_; } public gPoint p; public bool negative;//polarity-- positive negative public double angle; public bool mirror; public string symbols; public string attribut; public double width; public static gP operator +(gP p1, gP p2) { p1.p += p2.p; return p1; } public static gP operator -(gP p1, gP p2) { p1.p -= p2.p; return p1; } } /// <summary> /// 點 資料型別 (XY) /// </summary> public struct gPoint { public gPoint(gPoint p_) { this.x = p_.x; this.y = p_.y; } public gPoint(double x_val, double y_val) { this.x = x_val; this.y = y_val; } public double x; public double y; public static gPoint operator +(gPoint p1, gPoint p2) { p1.x += p2.x; p1.y += p2.y; return p1; } public static gPoint operator -(gPoint p1, gPoint p2) { p1.x -= p2.x; p1.y -= p2.y; return p1; } }View Code
四.實現效果