MCPcopy Create free account
hub / github.com/XRay3D/GERBER_X3 / createFixedSteps

Method createFixedSteps

GGEasy/gcode/gcpocketoffset.cpp:38–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void PocketCreator::createFixedSteps(const Tool& tool, const double depth, const int steps)
39{
40
41 if (m_gcp.side() == On)
42 return;
43 //PROG //PROG .3setProgMaxAndVal(0, 0);
44 m_toolDiameter = tool.getDiameter(depth) * uScale;
45 m_dOffset = m_toolDiameter / 2;
46 m_stepOver = tool.stepover() * uScale;
47
48 groupedPaths(CopperPaths);
49
50 if (m_gcp.side() == Inner) {
51 m_dOffset *= -1;
52 for (Paths paths : m_groupedPss) {
53 ClipperOffset offset(uScale);
54 offset.AddPaths(paths, jtRound, etClosedPolygon);
55 offset.Execute(paths, m_dOffset);
56 // if (App::settings().gbrCleanPolygons())
57 // CleanPolygons(paths, uScale * 0.0005);
58 Paths tmpPaths;
59 int counter = steps;
60 if (counter > 1) {
61 do {
62 tmpPaths.append(paths);
63 offset.Clear();
64 offset.AddPaths(paths, jtMiter, etClosedPolygon);
65 offset.Execute(paths, m_dOffset);
66 } while (paths.size() && --counter);
67 } else {
68 tmpPaths.append(paths);
69 }
70 m_returnPs.append(tmpPaths);
71 }
72 } else {
73 ClipperOffset offset(uScale);
74 for (Paths paths : m_groupedPss) {
75 offset.AddPaths(paths, jtRound, etClosedPolygon);
76 }
77 Paths paths;
78 offset.Execute(paths, m_dOffset);
79 // if (App::settings().gbrCleanPolygons())
80 // CleanPolygons(paths, uScale * 0.0005);
81 int counter = steps;
82 if (counter > 1) {
83 do {
84 m_returnPs.append(paths);
85 offset.Clear();
86 offset.AddPaths(paths, jtMiter, etClosedPolygon);
87 offset.Execute(paths, m_stepOver);
88 } while (paths.size() && --counter);
89 } else {
90 m_returnPs.append(paths);
91 }
92 }
93
94 if (m_returnPs.empty()) {
95 emit fileReady(nullptr);

Callers

nothing calls this directly

Calls 10

getDiameterMethod · 0.80
stepoverMethod · 0.80
sizeMethod · 0.80
setFileNameMethod · 0.80
nameEncMethod · 0.80
sideMethod · 0.45
AddPathsMethod · 0.45
ExecuteMethod · 0.45
appendMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected