博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PCB genesis方槽加内角槽孔实现方法
阅读量:4885 次
发布时间:2019-06-11

本文共 6940 字,大约阅读时间需要 23 分钟。

 一.为什么方槽孔加内角孔

      如下图,客户来的方槽或Slot槽有内角尺寸要求,通常直接钻一个Slot槽孔内角是不能满足客户要求的,这时我们做CAM的需采用小钻刀进行处理.加内角孔或内角槽的方式进行处理了.

  二.为什么不建议直接在4个角加内角孔

      Slot槽4个角采用加内角孔的方式处理,这样会导致如下图效果,凸起.

 

 三.方槽加内角槽孔方式(里面加4条槽)

       1.常规槽宽则计算方式:

       内角槽孔宽度:(W-0.1mm)/2 

       如:2.0X5.0mm槽宽,内角要求最大r0.5mm  那么内角槽宽为(2-0.1)/2 =0.95mm

         2.特殊情况内角槽宽(不能满足内角尺寸要求):

      如:2.0X3.0mm,内角要求最大r0.4mm,如按上面常规计算内角槽宽(1-0.1)/2=0.95mm

             选用0.95mm钻刀,无法满足r0.4mm内角尺寸要求,这时需选用0.8mm钻刀

       3.特殊情况槽宽(无槽刀):

       如:1.0X3.0mm,内角要求最大r0.3mm,如按上面常规计算内角槽宽(1-0.1)/2=0.45mm

             实际没有0.45mm槽刀,那这种情况,需选0.6mm槽刀,存在短槽孔时,钻刀需减速慢钻

       此计算未考虑补偿,如真实计算需将钻孔补偿考虑进来.

四.C#简易代码实现:

1.方槽加内角槽孔代码

#region 方槽  加内角孔            gLayer glayer = g.getFEATURES($"{
"drl"}", g.STEP, g.JOB, "mm", true); foreach (var item in glayer.Llist) { List
glList = calc2.l_InnerLine(item); addCOM.line(glList); } #endregion
View Code

2.计算函数

///         /// 将线段转为内切边的4条线段        ///         ///         /// 4个SLOT槽宽  当为0时,自动计算SLOT槽宽        /// 单边预大值        /// 
public List
l_InnerLine(gL l, double SlotWidth = 0, double UpVal = 0) { List
lineList = new List
(); double width = l.width * 0.001; if (SlotWidth < 0.001) { SlotWidth = ((width + UpVal * 2) - 0.1)*0.5; SlotWidth = ((int)(Math.Floor((SlotWidth * 1000) / 50)) * 50) * 0.001; ; } double val = (width - SlotWidth)* 0.5 + UpVal ; double ang_direction = p_ang(l); double length = width + UpVal * 2 - SlotWidth; gL gL1 = p_val_angL(l.pe, val, ang_direction, length); gL1.width = SlotWidth * 1000; gL gL2 = p_val_angL(l.ps, val, p_ang_invert(ang_direction), length); gL2.width = SlotWidth * 1000; lineList.Add(gL1); lineList.Add(gL2); lineList.Add(new gL(gL1.ps, gL2.pe, gL1.width)); lineList.Add(new gL(gL1.pe, gL2.ps, gL1.width)); return lineList; } ///
/// 求方位角 /// ///
///
public double p_ang(gL l)//求方位角 { return p_ang(l.ps, l.pe); } ///
/// //求增量T 线L坐标 /// ///
///
///
///
///
public gL p_val_angL(gPoint ps, double val, double ang_direction, double length = 2) { gPoint pe = p_val_ang(ps, val, ang_direction); gL tempL; tempL.ps = p_val_ang(pe, length * 0.5, ang_direction + 90); tempL.pe = p_val_ang(pe, length * 0.5, ang_direction - 90); tempL.negative = false; tempL.attribut = ""; tempL.symbols = ""; tempL.width = 121; return tempL; } ///
/// 求反方位角 /// ///
///
public double p_ang_invert(double ang_direction)//求反方位角 { if (ang_direction >= 180) return ang_direction - 180; else return ang_direction + 180; } ///
/// 求增量坐标 /// ///
起点 ///
增量值 ///
角度 ///
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;Line数据结构

///     /// Line 数据类型    ///     public struct gL    {        public gL(double ps_x, double ps_y, double pe_x, double pe_y, double width_)        {            this.ps = new gPoint(ps_x, ps_y);            this.pe = new gPoint(pe_x, pe_y);            this.negative = false;            this.symbols = "r";            this.attribut = string.Empty;            this.width = width_;        }        public gL(gPoint ps_, gPoint pe_, double width_)        {            this.ps = ps_;            this.pe = pe_;            this.negative = false;            this.symbols = "r";            this.attribut = string.Empty;            this.width = width_;        }        public gL(gPoint ps_, gPoint pe_, string symbols_, double width_)        {            this.ps = ps_;            this.pe = pe_;            this.negative = false;            this.symbols = symbols_;            this.attribut = string.Empty;            this.width = width_;        }        public gPoint ps;        public gPoint pe;        public bool negative;//polarity-- positive  negative        public string symbols;        public string attribut;        public double width;        public static gL operator +(gL l1, gPoint move_p)        {            l1.ps += move_p;            l1.pe += move_p;            return l1;        }        public static gL operator +(gL l1, gP move_p)        {            l1.ps += move_p.p;            l1.pe += move_p.p;            return l1;        }        public static gL operator -(gL l1, gPoint move_p)        {            l1.ps -= move_p;            l1.pe -= move_p;            return l1;        }        public static gL operator -(gL l1, gP move_p)        {            l1.ps -= move_p.p;            l1.pe -= move_p.p;            return l1;        }    }    ///     /// PAD  数据类型    ///     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;        }    }    ///     /// 点  数据类型 (XY)    ///     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

五.实现效果

 

转载于:https://www.cnblogs.com/pcbren/p/9906536.html

你可能感兴趣的文章
正则表达式之字符串验证
查看>>
codeblocks如何支持_tmain?可移植代码的编码推荐
查看>>
省市联动 填坑
查看>>
canvas写的一个小时钟demo
查看>>
原来今天是冬至
查看>>
又混了一天班
查看>>
九度oj 1006
查看>>
HDU6400-2018ACM暑假多校联合训练1004-Parentheses Matrix-构造
查看>>
最短路问题专题
查看>>
《Redis复制与可扩展集群搭建》看后感
查看>>
Jquery Mobile总结
查看>>
223. Rectangle Area
查看>>
spring boot + velocity中文乱码解决方式
查看>>
ASP 32位程序运行与64位问题:ADODB.Connection 错误 '800a0ea9' 未指定提供程序,也没有指派的默认提供程序。...
查看>>
xcode-git笔记
查看>>
TCP和UDP的优缺点及区别
查看>>
MATLAB消除曲线毛刺Outlier Detection and Removal [hampel]
查看>>
【javascript学习——《javascript高级程序设计》笔记】DOM操作
查看>>
高效的SQL语句翻页代码
查看>>
XMLHTTP.readyState的五种状态
查看>>