PCB genesis短槽加引导孔实现方法
一.何为短槽
短槽通常定义:槽长小于2倍槽宽 如:槽长1.8mm,槽宽1.0mm
二.为什么要加短槽加引孔呢
短槽孔在钻孔时孔易偏斜导致槽长偏短, 当槽长宽比越小,则受力越不均匀,在钻第2个孔时,钻头两边受力不均匀再加上是顺时针旋转,会导至第2个孔往逆时针方向偏转且变短(如下图)
短槽偏位问题如何解决呢,在我们PCB行业最佳作法是在钻槽孔之前,先在槽孔两端2个小孔(如下图).
PCB行业已有很多短槽加工方法了
具体方法请链接:PCB钻孔--超短坑槽的加工方法
三.加短槽引孔实现原理
求解思路
1.已知短槽宽1.0mm与短槽2点坐标
2.求出槽长=槽中心距0.8 + 槽宽1.0=1.8mm
3.求出引孔大小=(1.8-0.2)/2 =0.8mm
(0.2为2个引孔间距, 孔径向下取整为钻刀大小)
4.求出短槽的线拉伸距离=
(槽长1.8- 引孔大小0.8mm)-槽中心距0.8mm=0.2mm
5.求引孔坐标,在短槽2点坐标为一条线,在的基础上拉伸0.2mm即可,每边各拉0.1mm,即可得到引孔坐标(下面代码有提供线拉伸函数)
四.C#简易代码实现:
1.加短槽代码
#region 短槽加引孔 ydkdrl
List<gL> SlotList = glayer.Llist.Where(tt => ((calc2.p2p_di(tt.ps, tt.pe) + tt.width * 0.001) / (tt.width * 0.001)) < ).ToList();
if (SlotList.Count() > )
{
if (!g.Check_Layer_Exist("ydkdrl")) g.CreateLayer("ydkdrl");
g.SetAffectedLayer("ydkdrl");
for (int i = ; i < SlotList.Count; i++)
{
double HoleSize = ((int)(Math.Floor(((calc2.p2p_di(SlotList[i].ps, SlotList[i].pe) * + SlotList[i].width)) * 0.5 / )) * );
SlotList[i] = calc2.l_extend(SlotList[i], (SlotList[i].width - HoleSize) * 0.001);
addCOM.pad(SlotList[i].ps, HoleSize);
addCOM.pad(SlotList[i].pe, HoleSize);
}
g.SetAffectedLayer("");
}
#endregion
2.线拉伸函数(关键在于此函数实现)
/// <summary>
/// 线Line拉伸
/// </summary>
/// <param name="l"></param>
/// <param name="extend_val">拉伸数值</param>
/// <param name="type_">0两端拉伸 1起点拉伸 2端点拉伸</param>
/// <returns></returns>
public gL l_extend(gL l, double extend_val, byte type_ = )
{
gL tempL = l;
double angle_ = p_ang(l.ps, l.pe);
if (type_ == )
{
tempL.ps = p_val_ang(l.ps, extend_val, p_ang_invert(angle_));
}
else if (type_ == )
{
tempL.pe = p_val_ang(l.pe, extend_val, angle_);
}
else
{
extend_val = extend_val * 0.5;
tempL.ps = p_val_ang(l.ps, extend_val, p_ang_invert(angle_));
tempL.pe = p_val_ang(l.pe, extend_val, angle_);
}
return tempL;
} /// <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 * ;
//象限角 转方位角 计算所属象限 并求得方位角
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 + ;
}
else 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 + ;
}
else
{
return a_ang;
}
} /// <summary>
/// 求反方位角
/// </summary>
/// <param name="ang_direction"></param>
/// <returns></returns>
public double p_ang_invert(double ang_direction)//求反方位角
{
if (ang_direction >= )
return ang_direction - ;
else
return ang_direction + ;
}
/// <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 / );
pe.y = ps.y + val * Math.Sin(ang_direction * Math.PI / );
return pe;
}
3.点线数据结构
/// <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;
} }
/// <summary>
/// Line 数据类型
/// </summary>
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;
}
五.加短槽引孔脚本UI
六.加短槽效果
PCB genesis短槽加引导孔实现方法的更多相关文章
- PCB genesis连孔加除毛刺孔(槽孔与槽孔)实现方法(三)
一.为什么 连孔加除毛刺孔 原因是 PCB板材中含有玻璃纤维, 毛刺产生位置在于2个孔相交位置,由于此处钻刀受力不均导致纤维切削不断形成毛刺 ,为了解决这个问题:在钻完2个连孔后,在相交处再钻一个孔, ...
- PCB genesis Slot槽转钻孔(不用G85命令)实现方法
PCB钻Slot槽一般都采用G85命令钻槽孔,而采用G85命令工程CAM无法准确的知道Slot槽钻多少个孔,并不能决定钻槽孔的顺序,因为采用G85命令钻孔密度与钻槽顺序由钻机本身决定的.在这里介绍一种 ...
- PCB genesis自制孔点 Font字体实现方法
一.先看genesis原有Font字体 在PCB工程CAM加孔点字体要求时,通常我们直接用Geneis软件给我们提供了2种孔点字体canned_57与canned_67,但此字体可能不能满足各个工厂个 ...
- PCB genesis连孔加除毛刺孔(圆孔与槽孔)实现方法(二)
一.为什么 连孔加除毛刺孔 原因是 PCB板材中含有玻璃纤维, 毛刺产生位置在于2个孔相交位置,由于此处钻刀受力不均导致纤维切削不断形成毛刺 ,为了解决这个问题:在钻完2个连孔后,在相交处再钻一个孔, ...
- PCB genesis连孔加除毛刺孔(圆孔与圆孔)实现方法(一)
一.为什么 连孔加除毛刺孔 原因是 PCB板材中含有玻璃纤维, 毛刺产生位置在于2个孔相交位置,由于此处钻刀受力不均导致纤维切削不断形成毛刺 ,为了解决这个问题:在钻完2个连孔后,在相交处再钻一个孔, ...
- PCB genesis大孔加小孔(即卸力孔)实现方法
一.为什么 大孔中要加小孔(即卸力孔) 这其实跟钻刀的排屑有关了,当钻刀越大孔,排屑量也越大(当然这也得跟转速,下刀速的参数有关系),通常当钻刀越大,转速越慢,下刀速也越慢(因为要保证它的排屑通畅). ...
- PCB Genesis拼SET画工艺边 实现方法(一)
在PCB行业中,客户提供的PCB尺寸较小,为方便PCB加工,并生产提高生产效率,通常小于80X80mm需拼板处理的, 拼板要求可能来自按户指定拼板,也有可能是由工厂自行拼板,但对于CAM来说就需将PC ...
- PCB Genesis或Incam 右键导入TGZ 实现方法
使用Genesis导入TGZ方式很多 的,比如有:写个脚本框选TGZ的的方式实现TGZ导入,将TGZ拖入脚本界面实现TGZ导入, 给Engineering Toolkit窗口句柄注册拖拽事件实现TGZ ...
- PCB Genesis脚本C#使用WPF窗体实现方法
用C#写脚本做UI界面基本上都是用WinForm界面,如果想制作很漂亮动态的界面用WPF界面挺不错的选择, 这里介绍如何使用控制台程序调用WPF窗口 一.方法一 在控制台程序中,通过Main方法启动W ...
随机推荐
- java.net.MalformedURLException: no protocol: www.baidu.com
URL url = new URL("www.baidu.com");改为 URL url = new URL("http://www.baidu.com");
- JAVA基础——集合Iterator迭代器的实现
一.迭代器概述 1.什么是迭代器? 在Java中,有很多的数据容器,对于这些的操作有很多的共性.Java采用了迭代器来为各种容器提供了公共的操作接口.这样使得对容器的遍历操作与其具体的底层实现相隔离, ...
- 洛谷——P2709 小B的询问
P2709 小B的询问 莫队算法,弄两个指针乱搞即可 这应该是基础莫队了吧 $x^2$可以拆成$((x-1)+1)^2$,也就是$(x-1)^2+1^2+2\times (x-1)$,那么如果一个数字 ...
- NOIp2017——追求那些我一直追求的
谨以此祭奠我即将爆炸的NOIP2017. $Mingqi\_H\ \ 2017.09.24$ Day -47 突然发现半年来自己从来没有写对过SPFA,最近几天才发现自己的板子一直是错的...赶紧找个 ...
- linux whereis-查找二进制程序、代码等相关文件路径
推荐:更多Linux 文件查找和比较 命令关注:linux命令大全 whereis命令用来定位指令的二进制程序.源代码文件和man手册页等相关文件的路径. whereis命令只能用于程序名的搜索,而且 ...
- Linux iostat-监视系统输入输出设备和CPU的使用情况
推荐:更多linux 性能监测与优化 关注:linux命令大全 iostat命令被用于监视系统输入输出设备和CPU的使用情况.它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况.同vmsta ...
- 转来的——python webdriver自动化测试初步印象——转来的
python webdriver自动化测试初步印象 以下示例演示启动firefox,浏览google.com,搜索Cheese,等待搜索结果,然后打印出搜索结果页的标题 from selenium i ...
- Shiro-工作流程
[与Web集成] 1.Shiro 提供了与 Web 集成的支持,其通过一个ShiroFilter 入口来拦截需要安全控制的URL,然后进行相应的控制. 2.ShiroFilter 类似于如 Strut ...
- 【Codeforces 476C】Dreamoon and Sums
[链接] 我是链接,点我呀:) [题意] 让你求出所有x的和 其中 (x div b)是(x mod b)的倍数 且x mod b不等于0 且(x div b)除(x mod b)的值(假设为k),k ...
- 1154 能量项链 2006年NOIP全国联赛提高组 codevs
1154 能量项链 2006年NOIP全国联赛提高组 codevs 题目描述 Description 在Mars星球上,每个Mars人都随身佩带着一串能量项链.在项链上有N颗能量珠.能量珠是一颗有头 ...