0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

實現(xiàn)PCB板邊倒圓角

GReq_mcu168 ? 來源:硬件攻城獅 ? 作者:硬件攻城獅 ? 2022-05-07 14:28 ? 次閱讀

當(dāng)PCB外形是直角時,通常工程制作外形(鑼帶)時,會將直角或尖角的地方倒成圓角,主要是為了防止PCB容易劃傷板他扎傷人。

所以當(dāng)客戶沒有特殊要求時,PCB外形是直角一般會默認(rèn)倒角0.5mm圓角(如下圖所示)

3db32ea6-cdce-11ec-bce3-dac502259ad0.png

一.PCB板邊倒圓角點(diǎn)分析

原PCB外形如下圖圖示:看了這個PCB外形,產(chǎn)生有2個問題點(diǎn):

1.外形中哪些點(diǎn)需倒圓角?

2.如何怎么倒圓角?

3dc63546-cdce-11ec-bce3-dac502259ad0.png

1.外形中哪些點(diǎn)需倒圓角?

看下圖: PCB外形倒圓角的點(diǎn),剛好就是我們凸包需求出的點(diǎn),接下來我們將玩轉(zhuǎn)凸包了,只要求出凸包,那么就可以實現(xiàn)PCB板邊倒圓角啦。

3dd71b9a-cdce-11ec-bce3-dac502259ad0.png

求凸包的算法我們可以借鑒算法導(dǎo)論中的查找凸包的算法(加以改進(jìn)得到新的求凸包方法,詳見【方法一】與【方法二】)

3de81756-cdce-11ec-bce3-dac502259ad0.png

2.如何倒圓角?

在下面有說明倒角方法.

二. 求凸點(diǎn)

方法一求凸點(diǎn):【采用多輪遍歷,一遍一遍將凹點(diǎn)踢除,剩于的即是凸點(diǎn)】

3df77002-cdce-11ec-bce3-dac502259ad0.gif

方法一求凸點(diǎn): 代碼

3e2aace2-cdce-11ec-bce3-dac502259ad0.jpg

        /// 
        /// 求最大多邊形最大凸包1  【采用多輪遍歷將凹點(diǎn)踢除,剩于的即是凸點(diǎn)】
        /// 
        /// 
        /// 
        public List s_convex_polyon1(List gSur_Point_list)
        {
            add addCOM = new add();
            bool isOK = true;
            List PointList = new List();
            var isCCW = s_isCCW(gSur_Point_list);
            int sum = gSur_Point_list.Count() - 1;
            int n = gSur_Point_list.Count();
            for (int i = 0; i < n; i++)
            {
                int IndexPre = (i - 1) % sum;
                if (IndexPre == -1) IndexPre = sum - 1;
                int IndexCurrent = i % sum;
                int IndexNext = (i + 1) % sum;
                if (gSur_Point_list[IndexPre].type_point > 0) continue;
                if (gSur_Point_list[IndexCurrent].type_point > 0) continue;
                var multiVal = multi(gSur_Point_list[IndexPre].p, gSur_Point_list[IndexCurrent].p, gSur_Point_list[IndexNext].p);
                if ((isCCW && multiVal > 0) || (!isCCW && multiVal < 0))
                    PointList.Add(gSur_Point_list[IndexCurrent]);
                else
                    isOK = false;
            }
            List Point2List = new List(PointList);
            while (!isOK)
            {
                isOK = true;
                PointList.Clear();
                PointList.AddRange(Point2List);
                Point2List.Clear();
                sum = PointList.Count() - 1;
                n = PointList.Count();
                for (int i = 0; i < n; i++)
                {
                    int IndexPre = (i - 1) % sum;
                    if (IndexPre == -1) IndexPre = sum - 1;
                    int IndexCurrent = i % sum;
                    int IndexNext = (i + 1) % sum;
                    var multiVal = multi(PointList[IndexPre].p, PointList[IndexCurrent].p, PointList[IndexNext].p);
                    if ((isCCW && multiVal > 0) || (!isCCW && multiVal < 0))
                        Point2List.Add(PointList[IndexCurrent]);
                    else
                        isOK = false;
                }
            }
            return Point2List;
        }

3e2aace2-cdce-11ec-bce3-dac502259ad0.jpg

方法二求凸包【采用一邊遍歷找出凸點(diǎn)并加入隊列,并同時將隊列中的凸點(diǎn)隊列中找出凹點(diǎn)踢除】

3e48bfde-cdce-11ec-bce3-dac502259ad0.gif

方法二求凸包代碼:

3e2aace2-cdce-11ec-bce3-dac502259ad0.jpg

        /// 
        /// 求最大多邊形最大凸包2  【采用一邊遍歷找出凸點(diǎn)并加入隊列,并同時將隊列中的凸點(diǎn)隊列中找出凹點(diǎn)踢除】
        /// 
        /// 
        /// 
        public List s_convex_polyon2(List gSur_Point_list)
        {
            Stack StackPoint = new Stack();
            var isCCW = s_isCCW(gSur_Point_list);
            int sum = gSur_Point_list.Count() - 1;
            int n = gSur_Point_list.Count();
            for (int i = 0; i < n; i++)
            {
                int IndexPre = (i - 1) % sum;
                if (IndexPre == -1) IndexPre = sum - 1;
                int IndexCurrent = i % sum;
                int IndexNext = (i + 1) % sum;
                if (gSur_Point_list[IndexPre].type_point > 0) continue;
                if (gSur_Point_list[IndexCurrent].type_point > 0) continue;
                var multiVal = multi(gSur_Point_list[IndexPre].p, gSur_Point_list[IndexCurrent].p, gSur_Point_list[IndexNext].p);
                if ((isCCW && multiVal > 0) || (!isCCW && multiVal < 0))
                {
                    L1:
                    if (StackPoint.Count > 1)
                    {
                        var Top1Point = StackPoint.Pop();
                        var Top2Point = StackPoint.Peek();
                        multiVal = multi(Top2Point.p, Top1Point.p, gSur_Point_list[IndexCurrent].p);
                        if ((isCCW && multiVal > 0) || (!isCCW && multiVal < 0))
                            StackPoint.Push(Top1Point);
                        else
                            goto L1;   
                    }
                    StackPoint.Push(gSur_Point_list[IndexCurrent]);
                }
            }
            return StackPoint.Reverse().ToList();
        }

3e2aace2-cdce-11ec-bce3-dac502259ad0.jpg

方法三求凸包:按算法導(dǎo)論Graham掃描法 各節(jié)點(diǎn)按方位角+距離 逆時針排序 依次檢查,當(dāng)不屬凸點(diǎn)于則彈出】

3e796c88-cdce-11ec-bce3-dac502259ad0.gif

方法三求凸包代碼

3e2aace2-cdce-11ec-bce3-dac502259ad0.jpg

        /// 
        /// 求最大多邊形最大凸包5  【按算法導(dǎo)論Graham掃描法 各節(jié)點(diǎn)按方位角+距離 逆時針排序  依次檢查,當(dāng)不屬凸點(diǎn)于則彈出】
        /// 由于把各點(diǎn)的排列順序重新排序了,只支持折線節(jié)點(diǎn)(當(dāng)存在弧節(jié)點(diǎn)時會出異常 ?。。?
        /// 
        /// 
        /// 
        public List s_convex_polyon3(List gSur_Point_list)
        {
            var LeftBottomPoint = gSur_Point_list.OrderBy(tt => tt.p.y).ThenBy(tt => tt.p.x).FirstOrDefault();
            gSur_Point_list.RemoveAt(gSur_Point_list.Count - 1);
            gSur_Point_list.ForEach(tt =>
                                        {
                                            tt.Value = p2p_di(LeftBottomPoint.p, tt.p);
                                            tt.Angle = p_ang(LeftBottomPoint.p, tt.p);
                                        }
                );
            gSur_Point_list = gSur_Point_list.OrderBy(tt => tt.Angle).ThenBy(tt => tt.Value).ToList();
            gSur_Point_list.Add(gSur_Point_list[0]);
            Stack StackPoint = new Stack();
            var isCCW = true;
            int sum = gSur_Point_list.Count() - 1;
            int n = gSur_Point_list.Count();
            for (int i = 0; i < n; i++)
            {
                int IndexPre = (i - 1) % sum;
                if (IndexPre == -1) IndexPre = sum - 1;
                int IndexCurrent = i % sum;
                int IndexNext = (i + 1) % sum;
                var multiVal = multi(gSur_Point_list[IndexPre].p, gSur_Point_list[IndexCurrent].p, gSur_Point_list[IndexNext].p);
                if (isCCW && multiVal > 0)
                {
                    L1:
                    if (StackPoint.Count > 1)
                    {
                        var Top1Point = StackPoint.Pop();
                        var Top2Point = StackPoint.Peek();
                        multiVal = multi(Top2Point.p, Top1Point.p, gSur_Point_list[IndexCurrent].p);
                        if (isCCW && multiVal > 0)
                            StackPoint.Push(Top1Point);
                        else
                            goto L1;
                    }
                    StackPoint.Push(gSur_Point_list[IndexCurrent]);
                }
            }
            return StackPoint.Reverse().ToList();
        }

3e2aace2-cdce-11ec-bce3-dac502259ad0.jpg

公共方法與數(shù)據(jù)結(jié)構(gòu)

3ec8fc30-cdce-11ec-bce3-dac502259ad0.jpg?View Code

三.板邊凸點(diǎn)倒圓角方法

方法一:也最簡單的倒角方法,我們將PCB板邊凸點(diǎn)找出來后,可以直接借助genesis倒角功能就可以實現(xiàn)了

當(dāng)然但偶爾會報錯的, 且當(dāng)N個小線段組成的尖角倒角會出錯(要實現(xiàn)完美效果只有自己寫倒角算法啦)

3ed7367e-cdce-11ec-bce3-dac502259ad0.png

方法二:自己寫倒角算法,這個算法和加內(nèi)角孔算法類似(這里只是介紹簡單的倒角)考慮特殊的需要擴(kuò)展

可以參考這篇文章:https://www.cnblogs.com/pcbren/p/9665304.html

3eec441a-cdce-11ec-bce3-dac502259ad0.png

四.凸點(diǎn)加倒圓角實現(xiàn)效果

3efbd40c-cdce-11ec-bce3-dac502259ad0.gif

——End——

審核編輯 :李倩


聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • pcb
    pcb
    +關(guān)注

    關(guān)注

    4307

    文章

    22852

    瀏覽量

    394848
  • PCB板
    +關(guān)注

    關(guān)注

    27

    文章

    1423

    瀏覽量

    51389

原文標(biāo)題:很好的實現(xiàn)PCB板邊倒圓角~

文章出處:【微信號:mcu168,微信公眾號:硬件攻城獅】歡迎添加關(guān)注!文章轉(zhuǎn)載請注明出處。

收藏 人收藏

    評論

    相關(guān)推薦

    基于PCB 板的邊倒圓角實現(xiàn)方案解析

    當(dāng) PCB 外形是直角時, 通常工程制作外形 (鑼帶) 時, 會將直角或尖角的地方倒成圓角, 主要是為了防止板邊容易劃傷板且容易扎傷人。
    的頭像 發(fā)表于 03-02 14:11 ?5318次閱讀

    pcb圓角邊設(shè)置

    `請問各位高手,protel里如何將pcb的板的四個角邊設(shè)置成圓角邊?。縛
    發(fā)表于 03-08 18:38

    DXP2004怎么設(shè)置PCB板邊

    急急急!在PCB板里我在Design 命令里重新裁剪了圖紙大小但是主管說要設(shè)置出板邊不然不知道板子大小求解
    發(fā)表于 08-09 14:11

    PCB生產(chǎn)為什么要做拼板及板邊

    1、為什么PCB生產(chǎn)時要做「拼板(panelization)」?2、PCB板邊(break-away/coupon)又是做什么用的呢?3、不是說板材使用得越少就越便宜嗎?板材使用率又是怎么一回事
    發(fā)表于 10-01 18:39

    請問AD PCB直角布線怎么批量改為圓角?

    `AD PCB 直角布線批量改為圓角,怎么批量修改呢? `
    發(fā)表于 03-19 00:25

    PCB板電鍍時板邊燒焦的原因

    `請問PCB板電鍍時板邊燒焦的原因有哪些?`
    發(fā)表于 03-16 17:13

    PCB板邊又是做什么用的呢?

    為什么PCB生產(chǎn)時要做「拼板(panelization)」作業(yè)?然后打好SMT后又要再麻煩的裁切成單板?PCB板邊(break-away/coupon)又是做什么用的呢?不是說板材使用得越少就越便宜嗎?板材使用率又是怎么一回事
    發(fā)表于 03-10 06:00

    PCB設(shè)計問題案例:板邊異常分析

    板邊異常結(jié)構(gòu)問題的原因究竟什么?通過華秋DFM最詳細(xì)的關(guān)鍵點(diǎn)進(jìn)行解剖,了解方便的板邊異常解決方法。PCB設(shè)計分析軟件(華秋DFM)官方下載地址:https://dfm.elecfans.com/?from=BBS
    發(fā)表于 05-21 18:00

    CAD制圖中倒圓角的技巧

    圓角命令是FILLET,圓角功能可使用與對象相切且指定半徑的圓弧來連接兩個對象??梢詣?chuàng)建兩種圓角,內(nèi)角點(diǎn)稱為內(nèi)圓角,外角點(diǎn)稱為外圓角??梢?/div>
    發(fā)表于 10-19 15:03 ?1.9w次閱讀
    CAD制圖中<b class='flag-5'>倒圓角</b>的技巧

    基于proe技術(shù)的倒圓角特征建模范例

    本文介紹了基于proe技術(shù)的倒圓角特征建模的范例。
    發(fā)表于 11-17 15:19 ?0次下載
    基于proe技術(shù)的<b class='flag-5'>倒圓角</b>特征建模范例

    CAD編輯器怎么使用倒圓角命令將矩形變成圓角矩形

    CAD怎么使用倒圓角命令將矩形變成圓角矩形?我們在進(jìn)行CAD繪制圖紙的時候,總會遇到很多需要進(jìn)行編輯器或者是修改的地方,那我們在CAD圖紙中要是遇到需要將圖紙上的矩形,看著實在不是很順眼,想要轉(zhuǎn)換成圓角矩形,那我們又該如何進(jìn)行操
    發(fā)表于 12-07 08:00 ?1次下載

    PCB生產(chǎn)中做拼板及板邊的作用

    1、為什么PCB生產(chǎn)時要做「拼板(panelization)」作業(yè)?然后打好SMT后又要再麻煩的裁切成單板? 2、PCB板邊(break-away/coupon)又是做什么用的呢? 3、不是說板材
    發(fā)表于 01-26 06:25 ?17次下載
    <b class='flag-5'>PCB</b>生產(chǎn)中做拼板及<b class='flag-5'>板邊</b>的作用

    如何實現(xiàn)PCB板邊倒圓角

    當(dāng)PCB外形是直角時,通常工程制作外形(鑼帶)時,會將直角或尖角的地方倒成圓角,主要是為了防止PCB容易劃傷板他扎傷人。
    發(fā)表于 11-14 11:58 ?5508次閱讀

    很好的實現(xiàn)PCB板邊倒圓角

    當(dāng)PCB外形是直角時,通常工程制作外形(鑼帶)時,會將直角或尖角的地方倒成圓角,主要是為了防止PCB容易劃傷板他扎傷人。
    發(fā)表于 01-15 15:37 ?2222次閱讀
    很好的<b class='flag-5'>實現(xiàn)</b><b class='flag-5'>PCB</b><b class='flag-5'>板邊</b><b class='flag-5'>倒圓角</b>

    pcb板邊安全距離是多少合適?

    pcb板邊安全距離是多少合適? PCB板邊安全距離是指PCB板上電路的邊緣與板的邊界之間的最小安全距離,該距離的確定對于確保電路的可靠性和防
    的頭像 發(fā)表于 01-17 16:38 ?3418次閱讀