女人自慰AV免费观看内涵网,日韩国产剧情在线观看网址,神马电影网特片网,最新一级电影欧美,在线观看亚洲欧美日韩,黄色视频在线播放免费观看,ABO涨奶期羡澄,第一导航fulione,美女主播操b

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示

基于PCB 板的邊倒圓角實現方案解析

PCB線路板打樣 ? 來源:博客園 ? 作者:pcbren ? 2021-03-02 14:11 ? 次閱讀

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

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

一。 PCB 板邊倒圓角點分析

原 PCB 外形 如下圖圖示: 看了這個 PCB 外形, 產生有 2 個問題點。

1. 外形中哪些點需倒圓角?

2. 如何怎么倒圓角?

1. 外形中哪些點需倒圓角?

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

求凸包的算法: 我們可以借鑒算法導論中的查找凸包的算法(加以改進得到新的求凸包方法, 詳見[方法一] 與[方法二] )

2. 如何怎么倒圓角?

在下面有說明倒角方法。

二。 求凸點

方法一求凸點:[采用多輪遍歷, 一遍一遍將凹點踢除, 剩于的即是凸點]

方法一求凸點: 代碼

/// 《summary》

/// 求最大多邊形最大凸包 1 [采用多輪遍歷將凹點踢除, 剩于的即是凸點]

/// 《/summary》

/// 《param name=“gSur_Point_list”》《/param》

/// 《returns》《/returns》

public List《gSur_Point》 s_convex_polyon1(List《gSur_Point》 gSur_Point_list)

{

add addCOM = new add();

bool isOK = true;

List《gSur_Point》 PointList = new List《gSur_Point》();

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《gSur_Point》 Point2List = new List《gSur_Point》(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;

}

方法二求凸包:[采用一邊遍歷找出凸點并加入隊列, 并同時將隊列中的凸點隊列中找出凹點踢除]

方法二求凸包代碼:

/// 《summary》

/// 求最大多邊形最大凸包 2 [采用一邊遍歷找出凸點并加入隊列, 并同時將隊列中的凸點隊列中找出凹點踢除]

/// 《/summary》

/// 《param name=“gSur_Point_list”》《/param》

/// 《returns》《/returns》

public List《gSur_Point》 s_convex_polyon2(List《gSur_Point》 gSur_Point_list)

{

Stack《gSur_Point》 StackPoint = new Stack《gSur_Point》();

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();

}

方法三求凸包:[按算法導論 Graham 掃描法 各節點按方位角 + 距離 逆時針排序 依次檢查, 當不屬凸點于則彈出]

方法三求凸包代碼

/// 《summary》

/// 求最大多邊形最大凸包 5 [按算法導論 Graham 掃描法 各節點按方位角 + 距離 逆時針排序 依次檢查, 當不屬凸點于則彈出]

/// 由于把各點的排列順序重新排序了, 只支持折線節點(當存在弧節點時會出異常 !!!)

/// 《/summary》

/// 《param name=“gSur_Point_list”》《/param》

/// 《returns》《/returns》

public List《gSur_Point》 s_convex_polyon3(List《gSur_Point》 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《gSur_Point》 StackPoint = new Stack《gSur_Point》();

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();

}

公共方法與數據結構

/// 《summary》

/// Surface 坐標泛型集類 1

/// 《/summary》

public class gSur_Point

{

public gSur_Point()

{ }

public gSur_Point(double x_val, double y_val, byte type_point_)

{

this.p.x = x_val;

this.p.y = y_val;

this.type_point = type_point_;

}

public gSur_Point(gPoint p, byte type_point_)

{

this.p = p;

this.type_point = type_point_;

}

public gPoint p;

/// 《summary》

/// 0 為折點 1 為順時針 2 為逆時針

/// 《/summary》

public byte type_point { get; set; } = 0;

/// 《summary》

/// 值

/// 《/summary》

public double Value { get; set; } = 0;

/// 《summary》

/// 角度

/// 《/summary》

public double Angle { get; set; } = 0;

/// 《summary》

/// 標記

/// 《/summary》

public bool isFalg { get; set; }

}

/// 《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;

}

public static gPoint operator +(gPoint p1, double val)

{

p1.x += val;

p1.y += val;

return p1;

}

public static bool operator ==(gPoint p1, gPoint p2)

{

return (p1.x == p2.x && p1.y == p2.y);

}

public static bool operator !=(gPoint p1, gPoint p2)

{

return !(p1.x == p2.x && p1.y == p2.y);

}

}

/// 《summary》

/// 求叉積 判斷[點 P 與線 L] 位置關系[小于 0] 在右邊 [大于 0] 在左邊 [等于 0] 共線

/// 《/summary》

/// 《param name=“ps”》《/param》

/// 《param name=“pe”》《/param》

/// 《param name=“p”》《/param》

/// 《returns》[小于 0] 在右邊 [大于 0] 在左邊 [等于 0] 共線《/returns》

public double multi(gPoint ps, gPoint pe, gPoint p)

{

return ((ps.x - p.x) * (pe.y - p.y) - (pe.x - p.x) * (ps.y - p.y));

}

/// 《summary》

/// 檢測 Surface 是否逆時針

/// 《/summary》

/// 《param name=“gSur_Point_list”》《/param》

/// 《returns》《/returns》

public bool s_isCCW(List《gSur_Point》 gSur_Point_list)

{

double d = 0;

int n = gSur_Point_list.Count() - 1;

for (int i = 0; i 《n; i++)

{

if (gSur_Point_list.type_point》 0) continue;

int NextI = i + 1 + (gSur_Point_list[i + 1].type_point》 0 ? 1 : 0);

d += -0.5 * (gSur_Point_list[NextI].p.y + gSur_Point_list.p.y) * (gSur_Point_list[NextI].p.x - gSur_Point_list.p.x);

}

return d》 0;

}

/// 《summary》

/// 返回兩點之間歐氏距離

/// 《/summary》

/// 《param name=“p1”》《/param》

/// 《param name=“p2”》《/param》

/// 《returns》《/returns》

public double p2p_di(gPoint p1, gPoint p2)

{

return Math.Sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));

}

/// 《summary》

/// 求方位角

/// 《/summary》

/// 《param name=“ps”》《/param》

/// 《param name=“pe”》《/param》

/// 《returns》《/returns》

public double p_ang(gPoint ps, gPoint pe)

{

double a_ang = Math.Atan((pe.y - ps.y) / (pe.x - ps.x)) / Math.PI * 180;

// 象限角 轉方位角 計算所屬象限 并求得方位角

if (pe.x》= ps.x && pe.y》= ps.y) //↗ 第一象限

{

return a_ang;

}

else if (!(pe.x》= ps.x) && pe.y》= ps.y) // ↖ 第二象限

{

return a_ang + 180;

}

else if (!(pe.x》= ps.x) && !(pe.y》= ps.y)) //↙ 第三象限

{

return a_ang + 180;

}

else if (pe.x》= ps.x && !(pe.y》= ps.y)) // ↘ 第四象限

{

return a_ang + 360;

}

else

{

return a_ang;

}

}

View Code

三。 板邊凸點倒圓角方法

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

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

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

四。 凸點加倒圓角實現效果

編輯:hfy

聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。 舉報投訴
  • pcb
    pcb
    +關注

    關注

    4352

    文章

    23417

    瀏覽量

    406750
收藏 人收藏

    評論

    相關推薦
    熱點推薦

    PCBA設計工藝:提升生產效率與精度的關鍵

    緣的尺寸、形狀、過孔、切割方式等多方面的考慮。雖然在許多設計中,板材的內部結構可能會得到更多的關注,但工藝的設計同樣是至關重要的,因為它直接影響到整個PCB的制造、組裝、性能以及可靠性。 什么是PCBA設計工藝? PCBA設
    的頭像 發表于 04-23 09:24 ?184次閱讀

    PCB芯片加固方案

    PCB芯片加固方案PCB芯片加固工藝是確保電子設備性能和可靠性的重要環節。以下是一些常見的PCB
    的頭像 發表于 03-06 15:37 ?394次閱讀
    <b class='flag-5'>PCB</b><b class='flag-5'>板</b>芯片加固<b class='flag-5'>方案</b>

    深度解析:雙面PCB與單面PCB的制造差異

    一站式PCBA智造廠家今天為大家講講雙面PCB與單面PCB制造工藝有什么差異?雙面PCB
    的頭像 發表于 02-05 10:00 ?529次閱讀

    必看!PCB幾層設計的決定要素全解析

    一站式PCBA智造廠家今天為大家講講PCB幾層的決定因素是什么?PCB設計成幾層的決定因素。PCB作為電子產品中的關鍵組成部分,其層數設
    的頭像 發表于 12-14 11:38 ?641次閱讀

    PCB厚度對信號傳輸的影響

    PCB的厚度對其信號傳輸性能有著顯著的影響。以下是詳細分析: 1、信號傳輸速度 PCB的厚度會影響信號傳輸的速度。一般來說,較薄的PCB
    的頭像 發表于 12-06 17:24 ?909次閱讀

    了解雙面和多層pcb的優缺點

    在現代電子設備的設計和制造中,印刷電路PCB)是不可或缺的組件。PCB不僅提供了電子元件的物理支撐,還實現了電子元件之間的電氣連接或電絕緣。隨著技術的發展,
    的頭像 發表于 11-04 13:57 ?703次閱讀

    中低頻pcb與高頻pcb區別

    隨著電子技術的飛速發展,對PCB的性能要求也越來越高。在不同的應用場景中,如通信、雷達、衛星等,高頻信號的處理變得越來越重要。 中低頻PCB 中低頻
    的頭像 發表于 11-04 13:48 ?915次閱讀

    精科睿科普 pcb板材全解析

    PCB
    雨後陽光
    發布于 :2024年09月27日 10:40:40

    pcb沒有工藝怎么貼片

    PCB沒有工藝時,進行貼片加工需要特別注意以下幾點,以確保貼片過程的順利進行和最終產品的質量。 一、了解工藝的作用 工藝PCB
    的頭像 發表于 08-15 09:45 ?1620次閱讀

    PCB的電流及在電子設備中的作用

    。 一、PCB的基本概念 1.1 PCB的定義 PCB(Printed Circuit Board,印刷電路
    的頭像 發表于 08-15 09:36 ?1160次閱讀

    PCB設計與PCB的緊密關系

    一站式PCBA智造廠家今天為大家講講PCB設計與PCB有什么關系?PCB設計與PCB的關
    的頭像 發表于 08-12 10:04 ?939次閱讀

    PCB如何收費?pcb收費標準

    一站式PCBA智造廠家今天為大家講講PCB加工費是如何收取的?PCB收費方法和價格因素。PCB
    的頭像 發表于 08-07 09:24 ?2168次閱讀

    PCB多層PCB單層有什么區別

    PCB多層PCB單層在多個方面存在顯著的區別,這些區別主要體現在結構、性能、應用范圍、成本以及設計復雜性等方面。
    的頭像 發表于 08-05 16:56 ?2254次閱讀

    OTG充電芯片如何實現充電與數據傳輸并行?

    OTG充電芯片實現充電與數據傳輸并行的功能,主要依賴于其內部的設計和與USB Type-C接口標準的結合。
    的頭像 發表于 07-14 10:35 ?1215次閱讀

    海防監控圖像處理怎么選?

    我國作為一個海防大國,擁有將近1.8萬公里的海岸線,復雜、廣袤的海岸線很難進行全方位的人工巡防。但又不可輕易忽視,于是,定點的網絡實時監控覆蓋成為了人防的一大補充。通過在監控設備中加裝圖像處理
    的頭像 發表于 06-14 08:29 ?560次閱讀
    <b class='flag-5'>邊</b>海防監控圖像處理<b class='flag-5'>板</b>怎么選?