forked from Ultimaker/CuraEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraft.cpp
19 lines (17 loc) · 778 Bytes
/
raft.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/** Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License */
#include "raft.h"
#include "support.h"
void generateRaft(SliceDataStorage& storage, int distance)
{
for(unsigned int volumeIdx = 0; volumeIdx < storage.volumes.size(); volumeIdx++)
{
if (storage.volumes[volumeIdx].layers.size() < 1) continue;
SliceLayer* layer = &storage.volumes[volumeIdx].layers[0];
for(unsigned int i=0; i<layer->parts.size(); i++)
{
storage.raftOutline = storage.raftOutline.unionPolygons(layer->parts[i].outline.offset(distance));
}
}
SupportPolyGenerator supportGenerator(storage.support, 0);
storage.raftOutline = storage.raftOutline.unionPolygons(supportGenerator.polygons);
}