-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPNGerber.hpp
85 lines (61 loc) · 1.88 KB
/
PNGerber.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
____ ________.___._______ .___ ____ ___ _____
\ \/ /\__ | |\ \ | | | \/ \
\ / / | |/ | \| | | / \ / \
/ \ \____ / | \ | | / Y \
/___/\ \ / ______\____|__ /___|______/\____|__ /
\_/ \/ \/ \/
Avril 2018
convertis les fichiers Gerber en Gcode
Po les fichiers issu de kicad
* PNGerber.hpp
*
* Author: xynium
*/
#ifndef PNGERBER_HPP_
#define PNGERBER_HPP_
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <math.h>
#include <vector>
using namespace std;
//user def
#define ZDWN 0 // pen low level in mm
#define ZUP 4 // pen higth level in mm
#define PTDIAM 0.5 // in mm pen diameter
#define CHVMT 0.25 // in mm recovering of 2 lines
#define MIRROR 0 // 1 si mirroir
//prog def
#define NAPPERT 60 // dimension tableau appert nombre d'appert supporté
#define DHOLETOL 0.0001 // tolerance dans la comparaison des position pour trouver si trou ou pas
typedef vector<double> Row; // One row of the matrix
typedef vector<Row> Matrix;
struct dPts {
double dXp;
double dYp;
int iC;
};
//typedef dPts tdPts;
class cHole {
private:
Matrix mdHole;
public:
int iHasDrill; // =0 si le fichier drill has been corectly read
int iMirror; // global parrameter defined
dPts dpO, dpE;
public:
cHole(void);
int ReadDrl(string filename);
double DrillAtPos(double dX, double dY);
};
int pnFormat(string s, int i);
void PlotZone(Matrix mdPts);
dPts CalcCross(dPts PtA1, dPts PtA2, dPts PtB1, dPts PtB2);
double CalcPtDist(dPts PtA1, dPts PtA2, dPts PtB1);
void PlotTheTruc(double dX, double dY, double dXR, double dYR, double dTr, string sR);
void PlotSeg(double dXa, double dYa, double dXb, double dYb, double dXR);
void GetPCBLimit(string sf,dPts *dpO,dPts *dpE);
std::string format(const char* format, ...);
#endif /* PNGERBER_HPP_ */