-
Notifications
You must be signed in to change notification settings - Fork 7
/
layer.cpp
50 lines (42 loc) · 1.22 KB
/
layer.cpp
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
#include "layer.hpp"
Layer::Layer( const string& name, shared_ptr<Surface> surface, shared_ptr<RoutingMill> manufacturer, bool backside, bool mirror_absolute )
{
this->name = name;
this->mirrored = backside;
this->mirror_absolute = mirror_absolute;
this->surface = surface;
this->manufacturer = manufacturer;
}
#include <iostream>
using namespace std;
vector< shared_ptr<icoords> >
Layer::get_toolpaths()
{
return surface->get_toolpath( manufacturer, mirrored, mirror_absolute );
}
shared_ptr<RoutingMill>
Layer::get_manufacturer()
{
return manufacturer;
}
void
Layer::add_mask( shared_ptr<Layer> mask)
{
surface->add_mask( mask->surface);
}
void Layer::export_layer(ofstream* out, bool depthfirst,float safeheight, float finaldepth, float startdepth, float stepdepth,float feedrate_dive, float feedrate_lift, float feedside)
{
get_toolpaths();
surface->l.safeheight=safeheight;
surface->l.finaldepth=finaldepth;
surface->l.startdepth=startdepth;
surface->l.stepdepth=stepdepth;
surface->l.feedrate_dive=feedrate_dive;
surface->l.feedrate_lift=feedrate_lift;
surface->l.feedside=feedside;
surface->l.name=name;
if(depthfirst)
surface->l.exportgcodeDepthfirst(out);
else
surface->l.exportgcode(out);
}