Gerber 文件是光绘机专用的标准文件格式。现有274D、274X 两种常用格式。起源于矢量式光绘机,具有独立的码表。
gerber学习总结_-却道天凉好个秋的博客-CSDN博客
%FSLAX46Y46*%: # 表示使用的坐标格式,*表示停止符,该格式表示百分之一毫米的分辨率。
%MOMM*%: # 表示所有的尺寸和坐标值使用毫米为单位。
%ADD10C,0.001*%: # 表示定义了一个高度为0.001毫米的工具号为10的装置。
%LPD*%: # 表示定义了逻辑绘图层。
X0Y0D2*: # 表示将刀具号为2的装置移动到坐标原点 (0, 0)。
G36* # 表示绘图开始
G1X53452799Y491096213D2* # 定义绘图最大点的坐标(53452799,491096213)
X0Y491096213D1* # 定义绘图最小点的坐标(0,491096213)
X53452799Y486216094*X53452799Y491096213* #一系列图形的点,从D1点向后偏移的图形
G37* #G37指令表示绘图结束
... #一系列G36指令,用于定义绘图层中的路径
G1X0Y0D2* # 从当前位置移动到坐标原点 (0, 0)
M02* # 停止指令
关于Python-Triangle库的使用介绍 - 知乎 (zhihu.com)
from scipy.spatial import Delaunay # 算法具有局限性,无法对凹边形三角剖分
from triangle import triangulate # 可以添加约束,能实现对凹边形三角剖分,
# 但是加参数p,函数复杂度随多边形数量增大而增大,有可能会出现程序突然终止
points = each_polygon_points.astype(np.int64)
edges = []
n = len(points)
for i in range(n):
edges.append((i, (i+1) % n))
# 8.对单个多边形进行三角化
tri = triangulate({'vertices': points, 'segments': edges}, 'p') # pcq0D
data_dict_triangulated["Polygon" + str(i)] = [int(data_dict["Polygon" + str(i)][0]), tri['vertices'].shape[0], tri['triangles']]
#logging.info(f"After Triangulation, Polygon {i} / {len(each_polygon_points)} points has {len(each_polygon_points[tri.simplices])} triangles.")
# 9.画三角化后的顶点、边、三角形
ax.plot(tri['vertices'][:, 0], tri['vertices'][:, 1], '.', c='r') # 画多边形顶点
ax.plot(tri['vertices'][:, 0], tri['vertices'][:, 1], tri['triangles'], c='r') # 画多边形边界
ax.triplot(tri['vertices'][:, 0], tri['vertices'][:, 1], tri['triangles'], c='k') # 画多边形三角剖分后的三角形
报错:
python -X faulthandler triangulate.py
File "/home/devuser/anaconda3/envs/Grid_generation/lib/python3.8/site-packages/triangle/tri.py", line 73 in triangulate
File "triangulate.py", line 99 in delaunay
File "triangulate.py", line 19 in wrapper
File "triangulate.py", line 159 in
Segmentation fault (core dumped)仍然让高666?
最后猜测是当前使用的GPU集群gpu1中的GPU有问题,而不是本地的软件环境问题。最终在更换了个GPU集群后,错误消失
官网:The Computational Geometry Algorithms Library
github:https://github.com/CGAL/cgal
CGAL,Computational Geometry Algorithms Library,计算几何算法库,设计目标是以C++库的形式,提供方便,高效,可靠的几何算法。CGAL可用于各种需要几何计算的领域,如计算机图形学,科学可视化,计算机辅助设计和建模,地理信息系统,分子生物学,医学成像,机器人运动规划,网格生成,数值方法等等。
计算几何算法库(CGAL),提供计算几何相关的数据结构和算法,诸如三角剖分(2D约束三角剖分及二维和三维Delaunay三角剖分),Voronoi图(二维和三维的点,2D加权Voronoi图,分割Voronoi图等),多边形(布尔操作,偏置),多面体(布尔运算),曲线整理及其应用,网格生成(二维Delaunay网格生成和三维表面和体积网格生成等),几何处理(表面网格简化,细分和参数化等),凸壳算法(2D,3D和dD),搜索结构(近邻搜索,kd树等),插值,形状分析,拟合,距离等。
CGAL is a software project that provides easy access to efficient and reliable geometric algorithms in the form of a C++ library. CGAL is used in various areas needing geometric computation, such as geographic information systems, computer aided design, molecular biology, medical imaging, computer graphics, and robotics.
The library offers data structures and algorithms like triangulations, Voronoi diagrams, Boolean operations on polygons and polyhedra, point set processing, arrangements of curves, surface and volume mesh generation, geometry processing, alpha shapes, convex hull algorithms, shape reconstruction, AABB and KD trees...
Learn more about CGAL by browsing through the Package Overview.
Learn more about CGAL by browsing through the Package Overview.
官网:Open CASCADE Technology | Collaborative development portal
下载链接:Download - Open CASCADE Technology
Open CASCADE是一套开放源码的CAD/CAM/CAE几何模型核心,源自于法国的Matra Datavision公司。1998年Matra Datavision改变市场策略:从以销售软件为主改为提供CAD/CAM/CAE软体服务为主的获利模式,并且在1999年公布Open CASCADE的原始码,任何人都可以在该公司的网站上下载并且使用这些源码。
Matra Datavision则以此函式库为基础,为客户建立定制化的数值模拟软件。国内CAD/CAM产业所需的套装软件常常动辄数百万甚至上千万,如此高昂的软件费用对于中小企业来说非常沉重的负担。套装软件功能有些用不到,软件使用者也必须花钱购买这些用不到的功能。能够针对中小企业的需求建构一个精简化的CAD/CAM软体,并且在生产需求改变的时候才增加新的功能,将可以有效节省软件成本。
Open CASCADE的成功经验或许可以提供产业界甚至学术界一些新的思考方向。
Open CASCADE Technology (OCCT) is the only open-source full-scale 3D geometry library. Striving to be one of the best free cad software kernels, OCCT is widely used for the development of specialized programs dealing with the following engineering and mechanical domains: 3D modeling (CAD), manufacturing (CAM), numerical simulation (CAE), measurement equipment (CMM) and quality control (CAQ).
Since its publication in 1999 as an open source CAD software kernel, OCCT has been successfully used in numerous projects ranging from building and construction to aerospace and automotive.
官网:libigl
github:https://github.com/libigl/libigl
libigl is a simple C++ geometry processing library. We have a wide functionality including construction of sparse discrete differential geometry operators and finite-elements matrices such as the cotangent Laplacian and diagonalized mass matrix, simple facet and edge-based topology data structures, mesh-viewing utilities for OpenGL and GLSL, and many core functions for matrix manipulation which make Eigen feel a lot more like MATLAB.
It is a header-only library.
You do not need to compile anything to use, just include igl headers (e.g. #include) and run. Each header file contains a single function (e.g. igl/cotmatrix.h containsigl::cotmatrix()).
Most are tailored to operate on a generic triangle mesh stored in an n-by-3 matrix of vertex positions V and an m-by-3 matrix of triangle indices F.
Optionally the library may also be pre-compiled into a statically linked library, for faster compile times with your projects. This only effects compile time (run-time performance and behavior is identical). If in doubt, use the header-only default mode: (i.e. just include the headers you want to use).
We use the Eigen library heavily in our code. Our group prototypes a lot in MATLAB, and we have a useful MATLAB to libigl+Eigen conversion table.
We regularly test compiling our library on Mac OS X with clang, Linux with gcc and Windows with Visual Studio 2015 Community Edition.
官网:VTK - The Visualization Toolkit
github:https://github.com/Kitware/VTK
gitlab:VTK / VTK · GitLab
可以利用python接口做可视化
The Visualization Toolkit (VTK) is open source software for manipulating and displaying scientific data. It comes with state-of-the-art tools for 3D rendering, a suite of widgets for 3D interaction, and extensive 2D plotting capability.
VTK is part of Kitware’s collection of supported platforms for software development. The platform is used worldwide in commercial applications, as well as in research and development. For examples, please see VTK in Action.
官网:VCG
github:https://github.com/cnr-isti-vclab/vcglib/
官网:http://www.openmesh.org/
github:https://github.com/heyaaron/openmesher
OpenMesh是一种用于表示和操作多边形网格的通用且高效的数据结构。有关OpenMesh及其特性的更多信息,请查看介绍页面。
OpenMesh是一个c++库。还提供了Python绑定。在OpenMesh的基础上,我们开发了一个灵活的几何建模和处理框架OpenFlipper。