PCB SLOT槽孔数量计算方法,同CAM350孔数一致 实现方法
最近有好几个写脚本的朋友问我,SLOT槽孔孔的如何计算的,要求孔数与CAM350孔数保持一致。
前几年通过在CAM350里面不断测试,结果是:CAM 350中SLOT槽孔,孔与孔之间最高位,凸位高度值为0.0127mm
这里将计算方法分享一下,下次有同样的问题可以看此篇文章即可得到答案了。哈。。。。

通过这个凸位值就很好的计算出SLOT槽孔数了,弧型SLOT槽的原理也是同样的。
一.SLOT槽为线段,求解SLOT槽孔数 (Mod类在后面代码中)
/// <summary>
/// 求线Line slot槽孔数 (同CAM350一致)
/// </summary>
/// <param name="l"></param>
/// <param name="tol_">凸位高度值</param>
/// <returns></returns>
public int l_2hole_count(gL l, double tol_ = 0.0127)
{
double r, center_L, hole_L;
r = l.width / * 0.5;
center_L = p2p_di(l.ps, l.pe);
hole_L = Math.Sqrt(Math.Pow(r, ) - Math.Pow(r - tol_, )) * ;
return (int)Math.Abs(Math.Floor(-center_L / hole_L)) + ;
}
/// <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));
}
二.SLOT槽为弧段,求解SLOT槽孔数 (Mod类在后面代码中)
/// <summary>
/// 求弧Arc slot槽孔数 (同CAM350一致)
/// </summary>
/// <param name="a"></param>
/// <param name="tol_">凸位高度值</param>
/// <returns></returns>
public int a_2hole_count(gA a, double tol_ = 0.0127)
{
double r, center_L, hole_L;
r = a.width / * 0.5;
center_L = a_Length(a);
hole_L = Math.Sqrt(Math.Pow(r, ) - Math.Pow(r - tol_, )) * ;
return (int)Math.Abs(Math.Floor(-center_L / hole_L)) + ;
}
/// <summary>
/// 求弧Arc长度
/// </summary>
/// <param name="a"></param>
/// <returns></returns>
public double a_Length(gA a)
{
return pi / * p2p_di(a.pc, a.ps) * a_Angle(a);
}
/// <summary>
/// 求弧Arc圆心角 //后续改进 用叉积 与3P求角度求解 验证哪个效率高
/// </summary>
/// <param name="a"></param>
/// <returns></returns>
public double a_Angle(gA a)
{
double angle_s, angle_e, angle_sum;
if (a.ccw)
{
angle_s = p_ang(a.pc, a.pe);
angle_e = p_ang(a.pc, a.ps);
}
else
{
angle_s = p_ang(a.pc, a.ps);
angle_e = p_ang(a.pc, a.pe);
}
if (angle_s == ) { angle_s = ; }
if (angle_e >= angle_s)
angle_sum = - Math.Abs(angle_s - angle_e);
else
angle_sum = Math.Abs(angle_s - angle_e);
return angle_sum;
}
三.使用的Mod类
线 mod类型
/// <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;
}
public static gL operator +(gL l1, gPP move_p)
{
l1.ps += move_p.p;
l1.pe += move_p.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, gPP move_p)
{
l1.ps -= move_p.p;
l1.pe -= move_p.p;
return l1;
}
public static gL operator -(gL l1, gP move_p)
{
l1.ps -= move_p.p;
l1.pe -= move_p.p;
return l1;
}
}
弧 mod类型
/// <summary>
/// ARC 数据类型
/// </summary>
public struct gA
{
public gA(double ps_x, double ps_y, double pc_x, double pc_y, double pe_x, double pe_y, double width_, bool ccw_)
{
this.ps = new gPoint(ps_x, ps_y);
this.pc = new gPoint(pc_x, pc_y);
this.pe = new gPoint(pe_x, pe_y);
this.negative = false;
this.ccw = ccw_;
this.symbols = "r";
this.attribut = string.Empty;
this.width = width_;
}
public gA(gPoint ps_, gPoint pc_, gPoint pe_, double width_, bool ccw_=false)
{
this.ps = ps_;
this.pc = pc_;
this.pe = pe_;
this.negative = false;
this.ccw = ccw_;
this.symbols = "r";
this.attribut = string.Empty;
this.width = width_;
}
public gPoint ps;
public gPoint pe;
public gPoint pc;
public bool negative;//polarity-- positive negative
public bool ccw; //direction-- cw ccw
public string symbols;
public string attribut;
public double width;
public static gA operator +(gA arc1, gPoint move_p)
{
arc1.ps += move_p;
arc1.pe += move_p;
arc1.pc += move_p;
return arc1;
}
public static gA operator +(gA arc1, gPP move_p)
{
arc1.ps += move_p.p;
arc1.pe += move_p.p;
arc1.pc += move_p.p;
return arc1;
}
public static gA operator +(gA arc1, gP move_p)
{
arc1.ps += move_p.p;
arc1.pe += move_p.p;
arc1.pc += move_p.p;
return arc1;
}
public static gA operator -(gA arc1, gPoint move_p)
{
arc1.ps -= move_p;
arc1.pe -= move_p;
arc1.pc -= move_p;
return arc1;
}
public static gA operator -(gA arc1, gPP move_p)
{
arc1.ps -= move_p.p;
arc1.pe -= move_p.p;
arc1.pc -= move_p.p;
return arc1;
}
public static gA operator -(gA arc1, gP move_p)
{
arc1.ps -= move_p.p;
arc1.pe -= move_p.p;
arc1.pc -= move_p.p;
return arc1;
} }
点 mod类型
/// <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;
}
}
PCB SLOT槽孔数量计算方法,同CAM350孔数一致 实现方法的更多相关文章
- PCB genesis孔符制作实现方法
一.先看genesis原始孔符 孔符的作用:用于表示孔径的大小的一种代号, 当孔径检测时,可以按分孔图中的孔符对应的孔径尺寸对孔径检测. 在实际PCB行业通常不使用原始(图形)孔符,而使用字母孔符(如 ...
- 使用size()方法输出列表中的元素数量。需要注意的是,这个方法返回的值可能不是真实的,尤其当有线程在添加数据或者移除数据时,这个方法需要遍历整个列表来计算元素数量,而遍历过的数据可能已经改变。仅当没有任何线程修改列表时,才能保证返回的结果是准确的。
使用size()方法输出列表中的元素数量.需要注意的是,这个方法返回的值可能不是真实的,尤其当有线程在添加数据或者移除数据时,这个方法需要遍历整个列表来计算元素数量,而遍历过的数据可能已经改变.仅当没 ...
- 【转帖】2011-2018年中国IPv6地址数量及国际出口带宽数走势情况[图]
2011-2018年中国IPv6地址数量及国际出口带宽数走势情况[图] http://www.chyxx.com/industry/201910/791801.html 三亿多ipv4的地址. 接近9 ...
- 作用域插槽模板迭代的次数,取决于组件内部独立slot的数量
第一种情况:内部有两个独立插槽(模板自动迭代2次) <!DOCTYPE html> <html> <head> <title> hello world ...
- [PCB设计] 2、畸形PCB板子的制作核心——AD14导入dwg格式文件的方法
本文参考园友:The Zone of up.Craftor http://www.cnblogs.com/craftor/archive/2012/06/28/2567259.html 硬件工程师在做 ...
- PCB 合拼遍历(全排序+旋转90度) 基本遍历方法
分享一下PCB合拼的组合的遍历方法,在分享之前先纠正一下 PCB拼板之多款矩形排样算法实现--学习 时间复杂度计算错误 一.PCB 合拼(全排序+旋转90度)的时间复杂度是多少? 二.合拼遍历(全 ...
- PCB MS SQL 标量函数(CLR) 实现DataTable转HTML的方法
一.准备需转为HMLT字符串的DataTable数据 在数据库中执行一段SQL返回的数据 需转换后的HTML的文本 <html ><head></head>< ...
- PCB CS架构(工程系统)实现单点登入方法
社会的不断进步发展,分工也越来越细了.而我们工作接触的范围也越来越狭小了,但这不是倒退了,而是分工之细让人们在各个方面深耕细作.PCB企业软件系统发展路线同样也如此,随着我们PCB企业发展不断壮大,软 ...
- 优化JAVA查询Mongodb数量过大,查询熟读慢的方法
前言:2018年的时候优化了一个项目,该项目从MOngodb中获取数据的时候一次去十万百万千万的数据过慢,往往每次都要二十秒,三十秒,今天提出了一个代码优化的方案 项目查从mongodb中获取数据:代 ...
随机推荐
- 【译】x86程序员手册15-5.2页转换
5.2 Page Translation 页转换 In the second phase of address transformation, the 80386 transforms a linea ...
- GNSS数据下载网站
Bernese 数据表文件下载 rinex文件下载 ftp://nfs.kasi.re.kr DCB.ION文件ftp://ftp.unibe.ch/AIUB/CODE/ 下载5.0更新文件 ftp: ...
- js弹开页面并调用方法
每次重新写一个功能的时候,都能发现以前写的并不太好,都可以改进,奇怪的是我还是我,为什么曾经的我就想不起来要这么写,比如下面两段代码 历史代码: if (infoTablePage != null) ...
- 用u盘安装黑苹果10.12.3
链接: https://pan.baidu.com/s/1eR9GgwE 密码: rubh 主机和显示器必须是数字口连接,如dvi.displayport,VGA不能进安装界面 下载苹果镜像文件10. ...
- Java类及成员
Java类及成员 类 类是对一类事物的的描述,是抽象的概念上的定义:类是创建对象的模板: public class TestClass { public static void main(String ...
- sublime text3 verilog代码编写高级操作篇
2018.10.21 好久没写博客了,这段时间一直在学习一直在沉淀,然而发现学的越多会的更少,只能快马加鞭吧! 博主从大一暑假接触FPGA,到现在快一年半了,时间恍逝.刚开始入门也是用的quartus ...
- S-HR之OSF
1):getWorkDayCount ->ArrayList data = (ArrayList) com.kingdee.shr.rpts.ctrlreport.osf.OSFExecutor ...
- Python学习【第3篇】:Python之运算符
一.运算符 计算机可以进行的运算有很多种,不只是加减乘除,它和我们人脑一样,也可以做很多运算. 种类:算术运算,比较运算,逻辑运算,赋值运算,成员运算,身份运算,位运算,今天我们先了解前四个. 算术运 ...
- hbase + phoenix 单机版安装
1. 环境: centos 6.5 jdk 1.8.0 http://www.oracle.com/te ...
- 2977,3110 二叉堆练习1,3——codevs
二叉堆练习1 题目描述 Description 已知一个二叉树,判断它是否为二叉堆(小根堆) 输入描述 Input Description 二叉树的节点数N和N个节点(按层输入) 输出描述 Outpu ...