一.何为短槽

短槽通常定义:槽长小于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短槽加引导孔实现方法的更多相关文章

  1. PCB genesis连孔加除毛刺孔(槽孔与槽孔)实现方法(三)

    一.为什么 连孔加除毛刺孔 原因是 PCB板材中含有玻璃纤维, 毛刺产生位置在于2个孔相交位置,由于此处钻刀受力不均导致纤维切削不断形成毛刺 ,为了解决这个问题:在钻完2个连孔后,在相交处再钻一个孔, ...

  2. PCB genesis Slot槽转钻孔(不用G85命令)实现方法

    PCB钻Slot槽一般都采用G85命令钻槽孔,而采用G85命令工程CAM无法准确的知道Slot槽钻多少个孔,并不能决定钻槽孔的顺序,因为采用G85命令钻孔密度与钻槽顺序由钻机本身决定的.在这里介绍一种 ...

  3. PCB genesis自制孔点 Font字体实现方法

    一.先看genesis原有Font字体 在PCB工程CAM加孔点字体要求时,通常我们直接用Geneis软件给我们提供了2种孔点字体canned_57与canned_67,但此字体可能不能满足各个工厂个 ...

  4. PCB genesis连孔加除毛刺孔(圆孔与槽孔)实现方法(二)

    一.为什么 连孔加除毛刺孔 原因是 PCB板材中含有玻璃纤维, 毛刺产生位置在于2个孔相交位置,由于此处钻刀受力不均导致纤维切削不断形成毛刺 ,为了解决这个问题:在钻完2个连孔后,在相交处再钻一个孔, ...

  5. PCB genesis连孔加除毛刺孔(圆孔与圆孔)实现方法(一)

    一.为什么 连孔加除毛刺孔 原因是 PCB板材中含有玻璃纤维, 毛刺产生位置在于2个孔相交位置,由于此处钻刀受力不均导致纤维切削不断形成毛刺 ,为了解决这个问题:在钻完2个连孔后,在相交处再钻一个孔, ...

  6. PCB genesis大孔加小孔(即卸力孔)实现方法

    一.为什么 大孔中要加小孔(即卸力孔) 这其实跟钻刀的排屑有关了,当钻刀越大孔,排屑量也越大(当然这也得跟转速,下刀速的参数有关系),通常当钻刀越大,转速越慢,下刀速也越慢(因为要保证它的排屑通畅). ...

  7. PCB Genesis拼SET画工艺边 实现方法(一)

    在PCB行业中,客户提供的PCB尺寸较小,为方便PCB加工,并生产提高生产效率,通常小于80X80mm需拼板处理的, 拼板要求可能来自按户指定拼板,也有可能是由工厂自行拼板,但对于CAM来说就需将PC ...

  8. PCB Genesis或Incam 右键导入TGZ 实现方法

    使用Genesis导入TGZ方式很多 的,比如有:写个脚本框选TGZ的的方式实现TGZ导入,将TGZ拖入脚本界面实现TGZ导入, 给Engineering Toolkit窗口句柄注册拖拽事件实现TGZ ...

  9. PCB Genesis脚本C#使用WPF窗体实现方法

    用C#写脚本做UI界面基本上都是用WinForm界面,如果想制作很漂亮动态的界面用WPF界面挺不错的选择, 这里介绍如何使用控制台程序调用WPF窗口 一.方法一 在控制台程序中,通过Main方法启动W ...

随机推荐

  1. Linux之 sed用法

    sed是一个很好的文件处理工具,本身是一个管道命令,主要是以行为单位进行处理,可以将数据行进行替换.删除.新增.选取等特定工作,下面先了解一下sed的用法sed命令行格式为:         sed ...

  2. Flask保存或解压上传的文件

    import os import uuid import shutil import zipfile from flask import Flask, render_template, request ...

  3. Linux学习笔记记录(九)

  4. Win2008 Server下配置安装IIS

    最近又买了台服务器,接下来就是配置环境啦. 接下来接记录一下IIS的配置过程. 首先找到服务器管理器 打开后找到角色,点击添加角色 处理添加角色向导 勾选Web服务器(IIS) 点击添加必要功能 然后 ...

  5. python3 判断大小写

    转自http://wangwei007.blog.51cto.com/68019/1134323 # 一.pyhton字符串的大小写转换, 常用的有以下几种方法: # 1.对字符串中所有字符(仅对字母 ...

  6. vue中axios设置

    //设置默认全局baseURL axios.defaults.baseURL=process.env.BASE_API; //设置默认全局携带浏览器cookie axios.defaults.with ...

  7. js中的三种弹框分别是alert(),confirm(),prompt()

    1.alert(): ①写在<script>标签中 ②括号中的内容为字符串或者整型 ③点击确认即可关闭,无返回值 2.confirm(): ①写在<script>标签中 ②括号 ...

  8. Codeforces 989C - A Mist of Florescence

    传送门:http://codeforces.com/contest/989/problem/C 这是一个构造问题. 构造一张网格,网格中的字符为’A’.’B’.’C’.’D’,并且其连通块的个数分别为 ...

  9. WeChat-小程序-tabbar

    WeChat-小程序-tabbar https://developers.weixin.qq.com/miniprogram/dev/framework/config.html#%E5%85%A8%E ...

  10. 以位为单位存储标志-共用体-union

    一.程序的结构如下: typedef union _KEYST     {         struct         {             uint8 Key1_Flag :1;//表示第0 ...